Base solution for your next web application
Open Closed

How to allow extension of application through Plugins #10468


User avatar
1
gep13 created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version?
    • 9.3
  • What is your product type (Angular or MVC)?
    • MVC
  • What is product framework type (.net framework or .net core)?
    • .NET Core

If issue related with ABP Framework

  • What is ABP Framework version?
    • N/A

If issue is about UI

  • Which theme are you using?
    • N/A
  • What are the theme settings?
    • N/A

I have read the following article:

https://aspnetboilerplate.com/Pages/Documents/Plugin?searchKey=plugins

Which shows a very clean way of extending an application through the use of Plugins, however, the example seems to be limited to "backend" functionality, i.e. to provide the ability to do "work" on the application, in this case to provide a background worker to clear out the database.

Is it also possible to allow the extension of the UI for the application via a Plugin? If so, are there any examples of doing this?

We would like to be able to provide the core application to people, and then to allow the inclusion of a number of plugins. These plugins would contain additional UI (web pages) and application functionality.

Is this possilble?

If not possible out of the box, would there be any reason that we couldn't extend using something like ASP.NET Application Parts:

https://docs.microsoft.com/en-us/aspnet/core/mvc/advanced/app-parts?view=aspnetcore-5.0

Do you know of any examples of using an Application Part to extend an ASP.NET Zero project?

Thanks in advance! Gary


11 Answer(s)
  • User Avatar
    1
    ismcagdas created
    Support Team

    Hi @gep13

    Yes, it is possible to have UI specific code in your Plugin modules but unfortunately we don't have an example about it. You can mark resources like JS, CSS and CSHTML files as embedded resourses in your Plugin modules. You can also use Application Parts which is also supported.

  • User Avatar
    0
    gep13 created

    @ismcagdas thanks for getting back to me about this, I really appreicate it!

    Do you have any plans to create a sample application that shows how this can be achieved? What I would like to achieve is to have a Plugin created, that once installed, brings with it, navigation menu items (to add to the main navigation menu), permissions, Views, etc, for a new section of the website.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @gep13

    We can work on creating such a sample, but I think it will take approximately 1 month to complete this document or article. I will add this to our plan for the following month.

  • User Avatar
    0
    gep13 created

    @ismcagdas that is great news!

    I would be more than happy to take any rough drafts or notes related to the article for a spin to test things out, and to provide feedback.

    Would you have any rough tips/guidance on top of what you have already mentioned that I might be able to start with?

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @gep13

    Sorry for my late reply. This feature was added long time ago, https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1812. It seems like it is not documented and I couldn't remember how to use it. However, I will try to prepare a document during the week.

  • User Avatar
    0
    gep13 created

    @ismcagdas no need to apologise! This does sound like exactly what am I looking for. Looking forward to checking out the documentation for this, and taking it for a spin!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks, I will inform you here once it is ready.

  • User Avatar
    0
    gep13 created

    @ismcagdas I just wanted to touch base to see how this was progressing. Is this something that you have been able to work on?

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @gep13

    Sorry, I couldn't have time yet althoug promised to work on this a month ago. However, I just found that we already have a document about this case. You can check it and I think it will help you to proceed on what you need https://aspnetboilerplate.com/Pages/Documents/Embedded-Resource-Files

  • User Avatar
    0
    gep13 created

    Hello,

    Thank you for providing this link, this looks like it will be really helpful!

    I have tried to go through what is described, and I "think" I have done everything, but when I try to access the new route that I have defined, I get the following error message:

    An unhandled exception occurred while processing the request.
    ComponentNotFoundException: No component for supporting the service EmbeddedPlugin.Controllers.ApprovalController was found
    Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, bool ignoreParentContext)
    

    Is there something else that needs to be done here? Is there a complete sample available that shows an embedded plugin?

    This is the structure that I am trying to follow:

    Do you have any advice on how an Embedded Plugin would add itself into the navigation structure for the overall application? In addition, what would be the correct way for an Embedded Plugin to bring its own permissions and settings, to allow configuration of the different parts of the plugin, in the same way that you can control settings and permissions for the main application.

    Thanks again for all your help so far, it has been really helpful!

  • User Avatar
    0
    ismcagdas created
    Support Team