Global plugins

From GruppoZenit
Jump to: navigation, search

In this section, the user can add to the Global part of Z-CMS the plugins imported in the General part of Z-CMS. Plugin import is not allowed here.


Once a plugin is added to Global, it is possible to enable or disable it according to user’s needs by going to the plugin page of the Global menu.


In order to add a plugin to Global part select the following path from the Global dashboard page Plugins 2.png --> Sites plugins 1.png and the page opens the lightbox below, where the user can select the desired Plugin from the ones available from the General part.

Sites plugins 2.png

There, the user chooses the plugin and clicks Content Model 3.png to add it to the list of Global Plugins.


Once the Plugin is added into the Global part, the user can enable and disable it according to his will. Adding plugins will save all information into the table ZCMS_PLUGIN shown below. At the addition, the plugin is set as disabled by default.

Sites plugins 3.png


Contents

Enabling a plugin

Once plugins are added to Global, the user can enable them. Enabling a plugin means installing it into the Z-CMS Global part.


At the enabling, the program will validate at first the name of all jar files in Z-CMS lib folder (WEB-INF/lib) and then in corresponding plugin folder. Then it will compare plugin jars with Z-CMS System jars and will identify new jars. It will also compare previous versions of plugin and Z-CMS jars to identify updated jars as it is shown in the picture below where the program tells what jars are new, updated or unchanged.

Sites plugins 4.png

It keeps information regarding all new jars and updated jars in a property file named "install_jar.properties" located inside corresponding plugin folder.


If there is any new jar or updated jar, it will request for restarting the context in confirmation box. By confirming the restart in the box shown in picture below, the program will read information from "install_jar.properties" file inside plugin folder, will copy all new jars in plugin into the Z-CMS lib folder and will copy all updated jars into Z-CMS lib folder by deleting existing jars with lower version.

Sites plugins 5.png

After completing operations on jars, the program will read "install.properties" file for selecting keys "menu.name" and "menu.url". Then, it will create the menu voice with the enabled plugin name in the left side menu (see picture below) and change the value of the field IS_ENABLE in the plugin table from “0” to “1”. Plugin is finally enabled.

Global plugins 1.png

Note: if error occurs on deleting jars from WEB-INF/lib, it will not throw exception, but it will keep information about such jars path into a property file name "execute.properties" in folder ZPlugin located in Z-CMS context. This property file will read on next context restart and delete jars on that time.


Disabling a plugin

The user can decide to disable an active plugin. Disabling a plugin means uninstalling it from the Global part. It does not delete the plugin, but only disable it from use and, in case, it allows a quick enabling without the need of adding it again.


On disabling, the program reads property file named "install_jar.properties" inside the corresponding plugin folder. Then it checks inside the property file for any new jar copied to Z-CMS lib. If any of such jars is present, it will request for restart context in a confirmation box.


By confirming, the program will read information from "install_jar.properties" file inside the plugin folder and will delete all new jars that copied at the time of enabling this plugin. After completing jar operation, it will delete the corresponding plugin menu from the left side of Global part menu.


Finally, the program will update the WEB_PLUGIN table by changing value to IS_ENABLE field from “1” to “0”. The plugin is then disabled.


The user can also decide to remove a plugin from Global. However, such plugin remains inside Z-CMS in the General section.


In order to remove a plugin, it must be previously disabled. On removing, the program will delete all information about plugin from table WEB_PLUGIN. It will not delete any file related to the plugin.


If the user wants to remove the plugin from Z-CMS should go to the General section.


Plugins structure: install and execute jar properties

The property file created when we try to enable a plugin from list contains the information about all jars. Such file is located inside each plugin as follows: ZCMS/ZPlugin/pluginName/install_jar.properties.

Sites plugins 6.png

There are three categories:

  • New: it contains new jar’s path related to plugin. This information is used only for disabling the plugin. On disable it will delete from the Z-CMS lib path (WEB-INF/lib).
  • Delete: it contains path of jar related to Z-CMS lib in contexts which need to delete or enable the plugin. If the plugin folder contains jars of higher version with Z-CMS lib folder, then path of jar related to Z-CMS lib will add to key "delete".
Example: on enabling this plugin, we need to delete Mail-1.0.jar from Z-CMS lib path and to copy new jar Mail-2.0 into Z-CMS lib path.
Plugin Jar Z-CMS System Jar
Mail-2.0.jar Mail-1.0.jar
  • Copy: it contains path of all jars that need to copy from plugin folder into Z-CMS folder. On enabling it done this copy operation.
Sites plugins 7.png

Jar located in Z-CMS lib path can’t delete on running state of server. So on enabling the plugin, if any delete operation failed, that specific path will save into a property file with name "delete" that is located as follows inside each plugin: ZCMS/ZPlugin/execute.properties.

Delete: it will contain path related to Z-CMS lib path that failed to delete on enabling/disabling any plugin. This information will be used on next context restart by implementing it in ContextListener.java.


See also

Personal tools
Namespaces

Variants
Actions
Toolbox