Extending
In introduction to extensibility in DynamicWeb 10.
Extending DynamicWeb is a powerful way to add or change how the application behaves. DynamicWeb provides many ways to customize the platform. They can be organized into two general categories
- UI extensibility
- System (or Functionality) extensibility
This section will cover the different concepts, and walk you through how to create and install a custom add-in.
UI extensibility
In this kind of extensibility you have the handles to create your own Screens for the administration of DynamicWeb. You can read more about this here
Functionality extensibility
Functionality customizations are useful when events happen in the system, or at specific point during processing of user interactions, and it's desired to have some custom handling of these events or have a related action performed. This kind of extensibility is used when you want to add some additional functionality to DynamicWeb without the need for creating some new UI.
Here are a few examples of the kinds of functionality extensibility points.
- Notification Subscribers
- Allow for handling of events/notifications
- Providers and Configurable Add-Ins
- Allow for the addition of new integrations, e.g., payment processors or shipping services
- ViewModels
- Allow extending the view models used in frontend rendering
Developing a custom add-in
DynamicWeb is a .NET application. In order to develop custom extensions, or add-ins, you need a working .NET capable development environment. No matter which type of extensibility you want to make, you will need to create a custom dll. Read more here about how to get your development environment setup.
Following the guide to get a DynamicWeb 10 installed locally will create a C# project for running the application. It is recommended to create a separate project for customizations. Whether a new project is created or the host project is used, this is a small Hello World
example of a notification subscriber that writes to the console when the application starts up.
//TODO: Add example here
Now run the application and notice the message appearing in the console.
After you have implemented the custom functionality, you are ready to create the custom add-in by building the project.
If everything builds you should have either a .dll
or a .nupkg
file, which contains your changes.
Now we need to get this functionality into DynamicWeb.
Installing add-ins
To install an add-in, you can use the Appstore.
You can also use local files, .dll or .nupkg, built and packaged locally or fetched manually through sites like NuGet or shared in other ways. Any file with the extension .dll
or .nupkg
located in the folder Files/System/Addins/Local
will be picked up as add-ins available to install. These add-ins can be installed through Settings > System > Developer > Addins > Local
.
It is also possible to use the DynamicWeb CLIs dw install
command. It works in the same way by uploading the file to the Local
folder and performing the installation.
Custom Add-ins
DynamicWeb 10 introduced a new paradigm for loading customizations compared with previous versions of DynamicWeb. Custom add-ins should no longer be added to the /bin
folder, rather they should be reside in the Files archive. DynamicWeb will load all the .dll
files located in /Files/System/Addins/Installed
.
Warning
While DynamicWeb will load custom add-ins located in the /bin
folder, it is not recommended to use this method.
Customizations added the /bin
folder cannot be managed by in the Administration, and they could possibly be removed or overwritten when a new version of the applications is deployed.
When any new add-in is installed into the solution, it will placed in a folder named by <Add-in Name>.<Add-in Version>
. Consider an add-in called DynamicwebExtensions with version 2.0.3, it will be placed in a folder called DynamicwebExtensions.2.0.3
under /Files/System/AddIns/Installed/
, full path: /Files/System/AddIns/Installed/DynamicwebExtensions.2.0.3
.