...
Antony’s modulesystem allows you to write a registry which will be loaded by the antony client and/or antonyHub. The registry is needed to let you hook into our software.
This documentation is valid for antony versions 2.22.82 and above!
Info |
---|
To integrate into the client you need to provide an assembly with is accessibly from .net Framework 462 (which the desktop client uses). To provide UIs in special you have to provide them via .Net462. We are sorry for this, but we’ll look forward to provide .net core >= 3.1 for this some day. |
From a top level perspective we need create a registry to embed our classes into the di-container, antony provides. To do so we need to write a custom registry for it. To do so, we need to register as a module developer and define our module.
We provide an example project here: https://bitbucket.org/diegroupware/antony.demo.trainee.desktop/src/master/?search_id=ceb40d4f-44b2-41a7-b340-c7ae4c46727a
Tl;Dr;
Add the nuget package https://www.nuget.org/packages/antony.Groupware.ExtensionInterfaces/ and https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0-preview.3.23174.8 (Version 3.1.32) to your project.
Be sure your project is on NET Framework 462
Write a RegistryClass, decorate your assembly with
AntonyModuleAttribute
and add your ModuleKeyCode Block [assembly: AntonyModule(typeof(MyClassRegistry), ModuleKey = "de.die_groupware.mymodule")]
Decorate your method within you RegistryClass with the
AntonyServiceRegistryAttribute
,Code Block [AntonyServiceRegistry()] public void Register(IServiceCollection services)
Add the file-link for your uri to the registry under.
Computer\HKEY_CURRENT_USER\SOFTWARE\SCOM\antony\modules\AntonyGroupware\<moduleKey>\Path = ““
or
Computer\HKEY_CURRENT_USER\SOFTWARE\SCOM\antony\modules\AntonyHubClient\<moduleKey>\Path = ““
ExtensionInterfaces
Antony provides custom interfaces which are used to detect and load your registry. This interfaces comes within an easy to handle nuget package. This package doent doesnt have any other dependencies but .netstandard 2.0. Therefore you should be able to use this in nearly every project. You find this Project on http://nuget.org : https://www.nuget.org/packages/antony.Groupware.ExtensionInterfaces/
...
To register you need to specify the assembly attribute AntonyModule
to your assembly. Within this attribute you need to point to a class, containing the Register
Callregistry. Every module need to have an own Id, you need to specify. It is not used directly, but will in the future. Please provide the same Guid for all registries your module belongs to.
At the end you might specify a RegistryGroup
. This Group is used for the licence system. In this example we’ll define “Zoom” as a group. This registry will only be loaded, if you have a valid module-licence with this group defined. You can get these licences from our shop. If you cant to create a package for the customer please contact the support.
The Register
call registry need to be part of a module for licencing. Every module needs to be licencened - even if its free. To identify your module you need to provide a ModuleKey
.
Info |
---|
At the moment you cannot register a module by yourself. Please let us know, if you want to write a module by mailing us at info(at).die-groupware.de |
The Register
method needs to be annotated with the AntonyServiceRegistry
attribute to be loaded. You can optional define an application you want to be loaded in. You are loaded in every application on defaultThe signature of this method is provided in the snipped below. In this method you can provide your types at the ExtensionPoints you want to integrate to.finally register within antony’s DI-Container.
We use AutoFac as the DI-Container (https://autofac.org)
Code Block | ||||
---|---|---|---|---|
| ||||
[assembly: AntonyModule(typeof(ZoomModuleAntonyRegistry), "edef747c-e370-40d8-89c4-2f032a6b3314", RegistryGroupModuleKey = "Zoomde.die_groupware.zoom")] namespace antony.Groupware.AddinX.Zoom { public class ZoomModuleAntonyRegistry { [AntonyServiceRegistry()] public void Register(IServiceCollection services) { // ... } } } |
Register Path
Conclusion
...
Let antony search
After we defined the registry we also need to tell antony where to find your assembly. We’ll do this by using the windows registry. You need to add a value into the following key
HKEY_CURRENT_USER\SOFTWARE\SCOM\antony\modules\<application>\<your_module_key>\
You need to replace the values within the bracets with appropriate values as shown within the screenshot below. The application might be
AntonyGroupware: To integrate within Antonys Administator or Groupware-Client
AntonyHubClient: To integrate within the antonyHub to add configuraton dialogs for a custom service.
...
You need to provide the path to the file of your assembly. antony checks all available modules at startup, compares with the available licences and calls your registry. Congratulations, you are in
Specific Implementation for specific versions
The ExtensionInterfaces
will change over time, as we add or extends the possibility to integrate into antony. Therefore we might add more interfaces for theses extension points. You as an module developer can use these interfaces to extend your module too. As you update the ExtensionInterfaces
you are able to do so.
As we described in Modules and dependent assemblies we the assemblies of antony itself are preferred to load, including the ExtensionInterfaces.
Therefore you will get a TypeNotFoundException
, if you try to load your band new module within an old antony installation. To get around this, we provide the possibility to declare a minimal version of antony your registry runs on.
So if you create a new version with new interfaces of your module you need to create a new registry
defining the version you want to add. In this case the old registry works as usual, and the new registry registered the new interfaces and implementations within the DI-container.
Conclusion
It is quite simple to provide a module which is loaded by antony. You only need to specify a registry and let antony know where to search for it. You should be able to use the classes within nearly every project.
So open up a VisualStudio, Create your favorite IDE, create a Project and go for it. You can do it right now.🇳 🅾 🇼