Class Plugin

java.lang.Object
ru.bgcrm.plugin.Plugin
Direct Known Subclasses:
Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin, Plugin

public abstract class Plugin extends Object
Parent class for all the plugins.
  • Field Details

  • Constructor Details

    • Plugin

      protected Plugin(String id)
  • Method Details

    • getId

      public String getId()
      Plugin's ID.
      Returns:
    • getTitle

      public String getTitle()
      Human readable plugin title.
      Returns:
    • getTitleWithPrefix

      public final String getTitleWithPrefix()
      Prefix 'Plugin ' plus getTitle().
      Returns:
    • isSystem

      public boolean isSystem()
      System plugins are always loaded, enabled and not show in the list.
      Returns:
    • getDocument

      public Document getDocument()
      Plugin's XML document from 'plugin.xml'.
      Returns:
      parsed document object from or empty document if there is no such file.
    • getXml

      public Document getXml(String name, Document defaultValue)
      XML document from the plugin's package.
      Parameters:
      name -
      defaultValue -
      Returns:
    • loadEndpoints

      protected Map<String,List<String>> loadEndpoints()
      Default implementation, loads endpoints from the XML document. Deprecated way, for backward compatibility only.
      Returns:
    • getResourcePath

      public String getResourcePath(String name)
      Gets path of a file, placed int the plugin's package.
      Parameters:
      name - name of the file.
      Returns:
    • getActionPackages

      public Set<String> getActionPackages()
      Packages for searching annotated actions.
      Returns:
    • getDependencies

      public Set<String> getDependencies()
      Dependencies plugin IDs.
      Returns:
    • getEndpoints

      public final List<String> getEndpoints(String key)
      Endpoints for connecting the plugin in JSP templates.
      Returns:
    • getMessageTypeClass

      public Class<? extends MessageTypeEmail> getMessageTypeClass(String name)
      Message type class, supported by the plugin.
      Parameters:
      name - name of the type, must start from the plugin ID.
      Returns:
    • init

      public void init(Connection con) throws Exception
      Initialization during server's start.
      Parameters:
      con -
      Throws:
      Exception
    • isEnabled

      public boolean isEnabled(ConfigMap config, String defaultValue)
      If the plugin enabled.
      Parameters:
      config - configuration, where the plugin can be explicitly enabled.
      defaultValue - default value if not explicitly enabled: '1' - enabled, 'lic' - if presented in license.
      Returns:
      true or false.
    • getLocalization

      public Localization getLocalization()
      Returns:
      the plugin's localization from l10n.xml if exists, or null
    • getLocalizer

      public Localizer getLocalizer()
      Returns:
      the plugin's only localization for Localization.getLang() language.
    • getTables

      public Set<Table> getTables()
      Used DB tables.
      Returns:
    • getObjectTypes

      public Set<String> getObjectTypes()
      Plugin's entities.
      Returns:
    • getCleaner

      public Cleaner getCleaner()
      DB cleaner.
      Returns: