java.lang.Object
fr.paris.lutece.portal.service.plugin.Plugin
All Implemented Interfaces:
Comparable<Plugin>
Direct Known Subclasses:
PluginDefaultImplementation

public abstract class Plugin extends Object implements Comparable<Plugin>
This class is the general plugin element
  • Field Details

  • Constructor Details

    • Plugin

      public Plugin()
  • Method Details

    • init

      public abstract void init()
      Initializes the plugin at the first load
    • getContentService

      public ContentService getContentService()
      Returns:
      the content service
    • hasPortlets

      public boolean hasPortlets()
      Returns weither or not plugin has portlet.
      Returns:
      true if the plugin contains one or more portlet
    • hasDaemons

      public boolean hasDaemons()
      Returns weither or not plugin has daemon.
      Returns:
      true if the plugin contains one or more daemon
    • getDaemons

      public List<DaemonEntry> getDaemons()
      Returns The daemons list of the plugin.
      Returns:
      The daemons list of the plugin
    • setStatus

      public void setStatus(boolean bStatus)
      Modify the plugin status
      Parameters:
      bStatus - true installed, false uninstalled
    • updatePoolName

      public void updatePoolName(String strPoolName)
      Updates a database connection pool associated to the plugin and stores it
      Parameters:
      strPoolName - the name of the pool
    • setPoolName

      public void setPoolName(String strPoolName)
      Updates a database connection pool associated to the plugin and stores it
      Parameters:
      strPoolName - The name of the pool
    • getDbPoolName

      public String getDbPoolName()
      Gets the current database connection pool associated to the plugin
      Returns:
      The name of the database for the pool checked
    • install

      public void install()
      Installs a Plugin
    • uninstall

      public void uninstall()
      Uninstalls a Plugin
    • getType

      public int getType()
      Returns the type of the plugin
      Returns:
      the plugin type as a int
    • getInsertServices

      public List<InsertService> getInsertServices()
      Returns the list of insert services of the plugin
      Returns:
      the plugin list of ContentServiceEntry
    • getContentServices

      public List<ContentServiceEntry> getContentServices()
      Returns the list of Content services of the plugin
      Returns:
      the plugin list of ContentServiceEntry
    • getApplications

      public List<XPageApplicationEntry> getApplications()
      Returns the list of XPage Applications of the plugin
      Returns:
      the plugin list of XPageApplicationEntry
    • getPortletTypes

      public List<PortletType> getPortletTypes()
      Returns the list of portlet type of the plugin
      Returns:
      the plugin list of portlet type
    • setPortletTypes

      public void setPortletTypes(List<PortletType> listPortletTypes)
      Sets the list of portlet type
      Parameters:
      listPortletTypes - The portlet type list
    • getRights

      public List<Right> getRights()
      Returns the list of portlet type of the plugin
      Returns:
      the plugin list of rights
    • setRights

      public void setRights(List<Right> listRights)
      Sets plugin rights list
      Parameters:
      listRights - The rights list
    • getName

      public String getName()
      Returns the name of the plugin
      Returns:
      the plugin name as a String
    • setName

      public void setName(String strName)
      Sets the name of the plugin
      Parameters:
      strName - The plugin name
    • getVersion

      public String getVersion()
      Returns the version of the plugin
      Returns:
      the plugin version as a String
    • setVersion

      public void setVersion(String strVersion)
      Sets the version plugin name
      Parameters:
      strVersion - The version
    • getDescription

      public String getDescription()
      Returns the description of the plugin
      Returns:
      the plugin description as a String
    • setDescription

      public void setDescription(String strDescription)
      Sets the description of the plugin
      Parameters:
      strDescription - The description
    • getProvider

      public String getProvider()
      Returns the Provider of the plugin
      Returns:
      the plugin Provider as a String
    • setProvider

      public void setProvider(String strProvider)
      Sets the provider name
      Parameters:
      strProvider - The provider name
    • getProviderUrl

      public String getProviderUrl()
      Returns the Provider's URL of the plugin
      Returns:
      the plugin Provider's URL as a String
    • setProviderUrl

      public void setProviderUrl(String strProviderUrl)
      Sets the provider url
      Parameters:
      strProviderUrl - the name of the provider
    • getIconUrl

      public String getIconUrl()
      Returns the Icon's URL of the plugin
      Returns:
      the plugin Icon's URL as a String
    • setIconUrl

      public void setIconUrl(String strIconUrl)
      Sets the url of the plugin's icon
      Parameters:
      strIconUrl - The url of icon
    • getDocumentationUrl

      public String getDocumentationUrl()
      Returns the Documentation's URL of the plugin
      Returns:
      the plugin Documentation's URL as a String
    • setDocumentationUrl

      public void setDocumentationUrl(String strDocumentationUrl)
      Sets the url of the plugin's Documentation
      Parameters:
      strDocumentationUrl - The documentation Url
    • getCopyright

      public String getCopyright()
      Returns the Copyright of the plugin
      Returns:
      the plugin Copyright as a String
    • setCopyright

      public void setCopyright(String strCopyright)
      Sets the copyright
      Parameters:
      strCopyright - The copyright
    • getServiceClass

      public String getServiceClass()
      Returns the main Class of the plugin
      Returns:
      the Class as a String
    • setServiceClass

      public void setServiceClass(String strPluginClass)
      Sets the class service of plugin
      Parameters:
      strPluginClass - The plugin class
    • isInstalled

      public boolean isInstalled()
      Returns the installation status of the plugin
      Returns:
      the installation status as an int
    • setIsInstalled

      public void setIsInstalled(boolean bIsInstalled)
      Sets the boolean which shows if the plugin is installed
      Parameters:
      bIsInstalled - The installed boolean
    • getMinCoreVersion

      public String getMinCoreVersion()
      Returns the min core version compatibility for the plugin
      Returns:
      the min core version as a String
    • setMinCoreVersion

      public void setMinCoreVersion(String strMinCoreVersion)
      Sets the the min core version compatibility for the plugin
      Parameters:
      strMinCoreVersion - The min core version
    • getMaxCoreVersion

      public String getMaxCoreVersion()
      Returns the max core version compatibility for the plugin
      Returns:
      the max core version as a String
    • setMaxCoreVersion

      public void setMaxCoreVersion(String strMaxCoreVersion)
      Sets the the max core version compatibility for the plugin
      Parameters:
      strMaxCoreVersion - The max core version
    • isDbPoolRequired

      public boolean isDbPoolRequired()
      Returns if the plugin needs a database connection pool
      Returns:
      true if the plugin needs a database connection pool, otherwise false
    • setIsDbPoolRequired

      public void setIsDbPoolRequired(boolean bDbPoolRequired)
      Sets the boolean which shows if a pool is required
      Parameters:
      bDbPoolRequired - The dbpool boolean
    • getConnectionService

      public PluginConnectionService getConnectionService()
      Returns a Connection Service associated to the plugin
      Returns:
      _connectionService The connection service
    • setConnectionService

      public void setConnectionService(PluginConnectionService connectionService)
      Sets the connection service
      Parameters:
      connectionService - The connection Service object
    • initConnectionService

      public void initConnectionService(String strPoolName)
      Initializes the plugin's ConnectionService
      Parameters:
      strPoolName - The pool name
    • getParams

      public Map<String,String> getParams()
      Gets plugin's parameters
      Returns:
      _mapParams The hastable of parameters
    • getParamValue

      public String getParamValue(String strParamName)
      Gets a parameter value for a given parameter name
      Parameters:
      strParamName - The name of the parameter
      Returns:
      null
    • setParams

      public void setParams(Map<String,String> mapParams)
      Sets parameters values with an hashtable
      Parameters:
      mapParams - The parameter map
    • setParamValue

      public void setParamValue(String strParamName, String strParamValue)
      Sets a parameter value for a given parameter name
      Parameters:
      strParamName - The name of the parameter
      strParamValue - The value of the parameter
    • compareTo

      public int compareTo(Plugin plugin)
      Implementation of the Comparable interface.
      Specified by:
      compareTo in interface Comparable<Plugin>
      Parameters:
      plugin - A plugin Object
      Returns:
      1, 0 ou -1 according the plugin name
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getCssStyleSheets

      public List<String> getCssStyleSheets()
      Returns all CSS Style Sheets of the plugin with no mode associated
      Returns:
      The list of CSS Style Sheets with no mode associated
    • getCssStyleSheets

      public List<String> getCssStyleSheets(int mode)
      Returns all CSS Style Sheets of the plugin associated with a mode
      Parameters:
      mode - the mode
      Returns:
      The list of CSS Style Sheets associated with the mode
      Since:
      5.1.0
    • getXPageTheme

      public Theme getXPageTheme(javax.servlet.http.HttpServletRequest request)
      Returns the theme the plugin use for rendering a Xpage
      Parameters:
      request - The HttpServletRequest
      Returns:
      The theme
    • addJavascriptFile

      public void addJavascriptFile(String strJavascriptFile)
      Add an Javascript File to the plugin definition, not associated with a mode
      Parameters:
      strJavascriptFile - The Javascript File path
    • getJavascriptFiles

      public List<String> getJavascriptFiles()
      Returns all Javascript File of the plugin with no mode associated
      Returns:
      The list of Javascript File with no mode associated
    • getJavascriptFiles

      public List<String> getJavascriptFiles(int mode)
      Returns all Javascript File of the plugin associated with a mode
      Parameters:
      mode - the mode
      Returns:
      The list of Javascript File with associated with the mode
      Since:
      5.1.0
    • isCssStylesheetsScopePortal

      public boolean isCssStylesheetsScopePortal()
      Give the scope of css stylesheets
      Returns:
      true if scope is portal otherwise false
    • isCssStylesheetsScopeXPage

      public boolean isCssStylesheetsScopeXPage()
      Give the scope of css stylesheets
      Returns:
      true if scope is portal otherwise false
    • isJavascriptFilesScopePortal

      public boolean isJavascriptFilesScopePortal()
      Give the scope of javascripts
      Returns:
      true if scope is portal otherwise false
    • isJavascriptFilesScopeXPage

      public boolean isJavascriptFilesScopeXPage()
      Give the scope of javascripts
      Returns:
      true if scope is portal otherwise false
    • getAdminCssStyleSheets

      public List<String> getAdminCssStyleSheets()
      Return the list of stylesheets that should be used in the Back Office
      Returns:
      the list of stylesheets that should be used in the Back Office
      Since:
      5.1
    • getAdminJavascriptFiles

      public List<String> getAdminJavascriptFiles()
      Return the list of Javascript Files that should be used in the Back Office
      Returns:
      the list of Javascript Files that should be used in the Back Office
      Since:
      5.1
    • addFreemarkerMacrosFile

      @Deprecated public void addFreemarkerMacrosFile(String strMacroFileName)
      Deprecated.
      Adds a that file that will be autoincluded in freemarker templates
      Parameters:
      strMacroFileName - the file name
    • getFreeMarkerMacrosFiles

      @Deprecated public List<String> getFreeMarkerMacrosFiles()
      Deprecated.
      Gets the free marker macros files.
      Returns:
      the free marker macros files
    • addFreemarkerAutoInclude

      public void addFreemarkerAutoInclude(String strFileName)
      Adds a file that will be autoincluded in freemarker templates
      Parameters:
      strFileName - the file name
    • getFreeMarkerAutoIncludes

      public List<String> getFreeMarkerAutoIncludes()
      Gets the freemarker auto-includes.
      Returns:
      the freemarker auto-includes
    • addFreemarkerAutoImport

      public void addFreemarkerAutoImport(String strNamespace, String strFileName)
      Adds a file that will be autoimported in freemarker templates
      Parameters:
      strNamespace - The namespace corresponding to the import file
      strFileName - the file name
    • getFreeMarkerAutoImports

      public Map<String,String> getFreeMarkerAutoImports()
      Gets the freemarker auto-imports.
      Returns:
      the freemarker auto-imports
    • toString

      public String toString()
      Useful for debugging
      Overrides:
      toString in class Object
      Returns:
      The plugin object in String format
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object