1. Modules

    Article: AN0001581Updated: 20.07.2018

    Modules enable to extend ObjectGears system functionality with new functions. You can create as many modules as you want and their deployment is very easy.

    Implementation

    Modules are implemented as DLL library in .NET jazyce (C#, VB.NET...). The library must inherit from class ModuleInterfaceBase from library Com.ObjectGears.Common.dll.

    The class provides several methods and functions for communication between ObjectGears system and module.

    Deployment

    In order to deploy just copy the dll file of the module into folder Modules of the web application. Copy it also to folder Modules of the windows service. This is necessary if you want to use it from workflow, jobs or asynchronous rules.

    After copying restart the web application in order the new module would be read.If the module was already loaded, copying will fail. In such a case the system should be stopped, new module copied and application started again.

    The same rules apply also for windows service. Before copying a new module, stop the service first, copy and start the service again.

    If the module contains more files or you want to use several versions of the same module, place it into a dedicated subfolder in the folder Modules.

    After loading the module it is not immediately available in the system. It is only loaded but you have to assign it a unique code in the page Module list. You will call it with this code from scripts. After setting up/changing module code restart the web application and windows service.

    Module properties

    All the configured modules are displayed in the list of modules on page Administration / Integration / Modules. It is possible to display module properties by means of the first icon or display all the error records in ErrorLogu. By means of icon Registration you can get overview of all the functions, properties and object methods that the module returns in function GetScriptObject()

    There is  module version, its vendor, name and decription displayed for module properties.

    Property Code is important. You have to set it up manually after loading. The code is used for calling the module from scripts. If you do not set the code, module cannot be used.

    Sending SMS

    Module can sent SMS to telephone operator. If the odul supports this functionality, then ObjectGears system will support it when sending a notification to a distribution group with defined telephone numbers or when sending SMS by means of scripts.

    Calling in scripts

    When calling in scripts we use object OG.Module:

    OG.Module[code]

    When calling module according to the input code is found, then there is function GetScriptObject() called on a module class (inheriting from ModuleInterfaceBase). The function returns object that can be used by you as you want. The object has functions and methods that the author made available. You can find these functions and methods in the page under the icon Registration in the list of modules.

    Webpart in modules

    You can define custom webparts in a module, which can be immediatelly (after entering module code) used in pages. In case that the module is not loaded later on by the system, webparts from the module are hidden. If you handle such a module by means of scripts an exception is generated.

×