Package ru.bgcrm.plugin

# 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`

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final String`
  `PATH_CSS`
  `protected static final String`
  `PATH_JS`
  `protected static final String`
  `PATH_JSP_ADMIN_PLUGIN`
  `protected static final String`
  `PATH_JSP_OPEN_PLUGIN`
  `protected static final String`
  `PATH_JSP_USER_PLUGIN`
  `protected static final String`
  `PATH_LIB`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Plugin(String id)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Map<String,List<String>>`
  `endpoints()`
  Plugin endpoints
  `Set<String>`
  `getActionPackages()`
  Packages for searching annotated actions.
  `Cleaner`
  `getCleaner()`
  DB cleaner.
  `Set<String>`
  `getDependencies()`
  Dependencies plugin IDs.
  `final List<String>`
  `getEndpoints(String key)`
  Endpoints for connecting the plugin in JSP templates.
  `String`
  `getId()`
  Plugin's ID.
  `Localization`
  `getLocalization()`
  `Localizer`
  `getLocalizer()`
  `Class<? extends MessageTypeEmail>`
  `getMessageTypeClass(String name)`
  Message type class, supported by the plugin.
  `Set<String>`
  `getObjectTypes()`
  Plugin's entities.
  `String`
  `getResourcePath(String name)`
  Gets path of a file, placed int the plugin's package.
  `Set<Table>`
  `getTables()`
  Used DB tables.
  `String`
  `getTitle()`
  Human readable plugin title.
  `final String`
  `getTitleWithPrefix()`
  Prefix 'Plugin ' plus `getTitle()`.
  `Document`
  `getXml(String name, Document defaultValue)`
  XML document from the plugin's package.
  `void`
  `init(Connection con)`
  Initialization during server's start.
  `boolean`
  `isEnabled(ConfigMap config, String defaultValue)`
  If the plugin enabled.
  `boolean`
  `isSystem()`
  System plugins are always loaded, enabled and not show in the list.
  `protected Map<String,List<String>>`
  `loadEndpoints()`
  Deprecated.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### PATH_JS

    protected static final String PATH_JS
    See Also:
      - Constant Field Values

  - ### PATH_LIB

    protected static final String PATH_LIB
    See Also:
      - Constant Field Values

  - ### PATH_CSS

    protected static final String PATH_CSS
    See Also:
      - Constant Field Values

  - ### PATH_JSP_ADMIN_PLUGIN

    protected static final String PATH_JSP_ADMIN_PLUGIN
    See Also:
      - Constant Field Values

  - ### PATH_JSP_USER_PLUGIN

    protected static final String PATH_JSP_USER_PLUGIN
    See Also:
      - Constant Field Values

  - ### PATH_JSP_OPEN_PLUGIN

    protected static final String PATH_JSP_OPEN_PLUGIN
    See Also:
      - Constant Field Values

- ## 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:

  - ### getXml

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

  - ### endpoints

    protected Map<String,List<String>> endpoints()
    Plugin endpoints
    Returns:

  - ### loadEndpoints

    @Deprecated protected Map<String,List<String>> loadEndpoints()
    Deprecated.
    Outdated version of `endpoints()` method, should no more be inherited in plugins.

  - ### 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: