Class Plugin
- java.lang.Object
-
- fr.paris.lutece.portal.service.plugin.Plugin
-
- All Implemented Interfaces:
java.lang.Comparable<Plugin>
- Direct Known Subclasses:
PluginDefaultImplementation
public abstract class Plugin extends java.lang.Object implements java.lang.Comparable<Plugin>
This class is the general plugin element
-
-
Field Summary
Fields Modifier and Type Field Description static intPLUGIN_TYPE_APPLICATIONstatic intPLUGIN_TYPE_CONTENTSERVICEstatic intPLUGIN_TYPE_DAEMONstatic intPLUGIN_TYPE_FEATUREstatic intPLUGIN_TYPE_INSERTSERVICEstatic intPLUGIN_TYPE_PORTLET
-
Constructor Summary
Constructors Constructor Description Plugin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFreemarkerAutoImport(java.lang.String strNamespace, java.lang.String strFileName)Adds a file that will be autoimported in freemarker templatesvoidaddFreemarkerAutoInclude(java.lang.String strFileName)Adds a file that will be autoincluded in freemarker templatesvoidaddFreemarkerMacrosFile(java.lang.String strMacroFileName)Deprecated.voidaddJavascriptFile(java.lang.String strJavascriptFile)Add an Javascript File to the plugin definition, not associated with a modeintcompareTo(Plugin plugin)Implementation of the Comparable interface.booleanequals(java.lang.Object o)java.util.List<java.lang.String>getAdminCssStyleSheets()Return the list of stylesheets that should be used in the Back Officejava.util.List<java.lang.String>getAdminJavascriptFiles()Return the list of Javascript Files that should be used in the Back Officejava.util.List<XPageApplicationEntry>getApplications()Returns the list of XPage Applications of the pluginPluginConnectionServicegetConnectionService()Returns a Connection Service associated to the pluginContentServicegetContentService()java.util.List<ContentServiceEntry>getContentServices()Returns the list of Content services of the pluginjava.lang.StringgetCopyright()Returns the Copyright of the pluginjava.util.List<java.lang.String>getCssStyleSheets()Returns all CSS Style Sheets of the plugin with no mode associatedjava.util.List<java.lang.String>getCssStyleSheets(int mode)Returns all CSS Style Sheets of the plugin associated with a modejava.util.List<DaemonEntry>getDaemons()Returns The daemons list of the plugin.java.lang.StringgetDbPoolName()Gets the current database connection pool associated to the pluginjava.lang.StringgetDescription()Returns the description of the pluginjava.lang.StringgetDocumentationUrl()Returns the Documentation's URL of the pluginjava.util.Map<java.lang.String,java.lang.String>getFreeMarkerAutoImports()Gets the freemarker auto-imports.java.util.List<java.lang.String>getFreeMarkerAutoIncludes()Gets the freemarker auto-includes.java.util.List<java.lang.String>getFreeMarkerMacrosFiles()Deprecated.java.lang.StringgetIconUrl()Returns the Icon's URL of the pluginjava.util.List<InsertService>getInsertServices()Returns the list of insert services of the pluginjava.util.List<java.lang.String>getJavascriptFiles()Returns all Javascript File of the plugin with no mode associatedjava.util.List<java.lang.String>getJavascriptFiles(int mode)Returns all Javascript File of the plugin associated with a modejava.lang.StringgetMaxCoreVersion()Returns the max core version compatibility for the pluginjava.lang.StringgetMinCoreVersion()Returns the min core version compatibility for the pluginjava.lang.StringgetName()Returns the name of the pluginjava.util.Map<java.lang.String,java.lang.String>getParams()Gets plugin's parametersjava.lang.StringgetParamValue(java.lang.String strParamName)Gets a parameter value for a given parameter namejava.util.List<PortletType>getPortletTypes()Returns the list of portlet type of the pluginjava.lang.StringgetProvider()Returns the Provider of the pluginjava.lang.StringgetProviderUrl()Returns the Provider's URL of the pluginjava.util.List<Right>getRights()Returns the list of portlet type of the pluginjava.lang.StringgetServiceClass()Returns the main Class of the pluginintgetType()Returns the type of the pluginjava.lang.StringgetVersion()Returns the version of the pluginThemegetXPageTheme(javax.servlet.http.HttpServletRequest request)Returns the theme the plugin use for rendering a XpagebooleanhasDaemons()Returns weither or not plugin has daemon.inthashCode()booleanhasPortlets()Returns weither or not plugin has portlet.abstract voidinit()Initializes the plugin at the first loadvoidinitConnectionService(java.lang.String strPoolName)Initializes the plugin's ConnectionServicevoidinstall()Installs a PluginbooleanisCssStylesheetsScopePortal()Give the scope of css stylesheetsbooleanisCssStylesheetsScopeXPage()Give the scope of css stylesheetsbooleanisDbPoolRequired()Returns if the plugin needs a database connection poolbooleanisInstalled()Returns the installation status of the pluginbooleanisJavascriptFilesScopePortal()Give the scope of javascriptsbooleanisJavascriptFilesScopeXPage()Give the scope of javascriptsvoidsetConnectionService(PluginConnectionService connectionService)Sets the connection servicevoidsetCopyright(java.lang.String strCopyright)Sets the copyrightvoidsetDescription(java.lang.String strDescription)Sets the description of the pluginvoidsetDocumentationUrl(java.lang.String strDocumentationUrl)Sets the url of the plugin's DocumentationvoidsetIconUrl(java.lang.String strIconUrl)Sets the url of the plugin's iconvoidsetIsDbPoolRequired(boolean bDbPoolRequired)Sets the boolean which shows if a pool is requiredvoidsetIsInstalled(boolean bIsInstalled)Sets the boolean which shows if the plugin is installedvoidsetMaxCoreVersion(java.lang.String strMaxCoreVersion)Sets the the max core version compatibility for the pluginvoidsetMinCoreVersion(java.lang.String strMinCoreVersion)Sets the the min core version compatibility for the pluginvoidsetName(java.lang.String strName)Sets the name of the pluginvoidsetParams(java.util.Map<java.lang.String,java.lang.String> mapParams)Sets parameters values with an hashtablevoidsetParamValue(java.lang.String strParamName, java.lang.String strParamValue)Sets a parameter value for a given parameter namevoidsetPoolName(java.lang.String strPoolName)Updates a database connection pool associated to the plugin and stores itvoidsetPortletTypes(java.util.List<PortletType> listPortletTypes)Sets the list of portlet typevoidsetProvider(java.lang.String strProvider)Sets the provider namevoidsetProviderUrl(java.lang.String strProviderUrl)Sets the provider urlvoidsetRights(java.util.List<Right> listRights)Sets plugin rights listvoidsetServiceClass(java.lang.String strPluginClass)Sets the class service of pluginvoidsetStatus(boolean bStatus)Modify the plugin statusvoidsetVersion(java.lang.String strVersion)Sets the version plugin namejava.lang.StringtoString()Useful for debuggingvoiduninstall()Uninstalls a PluginvoidupdatePoolName(java.lang.String strPoolName)Updates a database connection pool associated to the plugin and stores it
-
-
-
Field Detail
-
PLUGIN_TYPE_FEATURE
public static final int PLUGIN_TYPE_FEATURE
- See Also:
- Constant Field Values
-
PLUGIN_TYPE_PORTLET
public static final int PLUGIN_TYPE_PORTLET
- See Also:
- Constant Field Values
-
PLUGIN_TYPE_APPLICATION
public static final int PLUGIN_TYPE_APPLICATION
- See Also:
- Constant Field Values
-
PLUGIN_TYPE_INSERTSERVICE
public static final int PLUGIN_TYPE_INSERTSERVICE
- See Also:
- Constant Field Values
-
PLUGIN_TYPE_CONTENTSERVICE
public static final int PLUGIN_TYPE_CONTENTSERVICE
- See Also:
- Constant Field Values
-
PLUGIN_TYPE_DAEMON
public static final int PLUGIN_TYPE_DAEMON
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 java.util.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(java.lang.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(java.lang.String strPoolName)
Updates a database connection pool associated to the plugin and stores it- Parameters:
strPoolName- The name of the pool
-
getDbPoolName
public java.lang.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 java.util.List<InsertService> getInsertServices()
Returns the list of insert services of the plugin- Returns:
- the plugin list of ContentServiceEntry
-
getContentServices
public java.util.List<ContentServiceEntry> getContentServices()
Returns the list of Content services of the plugin- Returns:
- the plugin list of ContentServiceEntry
-
getApplications
public java.util.List<XPageApplicationEntry> getApplications()
Returns the list of XPage Applications of the plugin- Returns:
- the plugin list of XPageApplicationEntry
-
getPortletTypes
public java.util.List<PortletType> getPortletTypes()
Returns the list of portlet type of the plugin- Returns:
- the plugin list of portlet type
-
setPortletTypes
public void setPortletTypes(java.util.List<PortletType> listPortletTypes)
Sets the list of portlet type- Parameters:
listPortletTypes- The portlet type list
-
getRights
public java.util.List<Right> getRights()
Returns the list of portlet type of the plugin- Returns:
- the plugin list of rights
-
setRights
public void setRights(java.util.List<Right> listRights)
Sets plugin rights list- Parameters:
listRights- The rights list
-
getName
public java.lang.String getName()
Returns the name of the plugin- Returns:
- the plugin name as a String
-
setName
public void setName(java.lang.String strName)
Sets the name of the plugin- Parameters:
strName- The plugin name
-
getVersion
public java.lang.String getVersion()
Returns the version of the plugin- Returns:
- the plugin version as a String
-
setVersion
public void setVersion(java.lang.String strVersion)
Sets the version plugin name- Parameters:
strVersion- The version
-
getDescription
public java.lang.String getDescription()
Returns the description of the plugin- Returns:
- the plugin description as a String
-
setDescription
public void setDescription(java.lang.String strDescription)
Sets the description of the plugin- Parameters:
strDescription- The description
-
getProvider
public java.lang.String getProvider()
Returns the Provider of the plugin- Returns:
- the plugin Provider as a String
-
setProvider
public void setProvider(java.lang.String strProvider)
Sets the provider name- Parameters:
strProvider- The provider name
-
getProviderUrl
public java.lang.String getProviderUrl()
Returns the Provider's URL of the plugin- Returns:
- the plugin Provider's URL as a String
-
setProviderUrl
public void setProviderUrl(java.lang.String strProviderUrl)
Sets the provider url- Parameters:
strProviderUrl- the name of the provider
-
getIconUrl
public java.lang.String getIconUrl()
Returns the Icon's URL of the plugin- Returns:
- the plugin Icon's URL as a String
-
setIconUrl
public void setIconUrl(java.lang.String strIconUrl)
Sets the url of the plugin's icon- Parameters:
strIconUrl- The url of icon
-
getDocumentationUrl
public java.lang.String getDocumentationUrl()
Returns the Documentation's URL of the plugin- Returns:
- the plugin Documentation's URL as a String
-
setDocumentationUrl
public void setDocumentationUrl(java.lang.String strDocumentationUrl)
Sets the url of the plugin's Documentation- Parameters:
strDocumentationUrl- The documentation Url
-
getCopyright
public java.lang.String getCopyright()
Returns the Copyright of the plugin- Returns:
- the plugin Copyright as a String
-
setCopyright
public void setCopyright(java.lang.String strCopyright)
Sets the copyright- Parameters:
strCopyright- The copyright
-
getServiceClass
public java.lang.String getServiceClass()
Returns the main Class of the plugin- Returns:
- the Class as a String
-
setServiceClass
public void setServiceClass(java.lang.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 java.lang.String getMinCoreVersion()
Returns the min core version compatibility for the plugin- Returns:
- the min core version as a String
-
setMinCoreVersion
public void setMinCoreVersion(java.lang.String strMinCoreVersion)
Sets the the min core version compatibility for the plugin- Parameters:
strMinCoreVersion- The min core version
-
getMaxCoreVersion
public java.lang.String getMaxCoreVersion()
Returns the max core version compatibility for the plugin- Returns:
- the max core version as a String
-
setMaxCoreVersion
public void setMaxCoreVersion(java.lang.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(java.lang.String strPoolName)
Initializes the plugin's ConnectionService- Parameters:
strPoolName- The pool name
-
getParams
public java.util.Map<java.lang.String,java.lang.String> getParams()
Gets plugin's parameters- Returns:
- _mapParams The hastable of parameters
-
getParamValue
public java.lang.String getParamValue(java.lang.String strParamName)
Gets a parameter value for a given parameter name- Parameters:
strParamName- The name of the parameter- Returns:
- null
-
setParams
public void setParams(java.util.Map<java.lang.String,java.lang.String> mapParams)
Sets parameters values with an hashtable- Parameters:
mapParams- The parameter map
-
setParamValue
public void setParamValue(java.lang.String strParamName, java.lang.String strParamValue)Sets a parameter value for a given parameter name- Parameters:
strParamName- The name of the parameterstrParamValue- The value of the parameter
-
compareTo
public int compareTo(Plugin plugin)
Implementation of the Comparable interface.- Specified by:
compareToin interfacejava.lang.Comparable<Plugin>- Parameters:
plugin- A plugin Object- Returns:
- 1, 0 ou -1 according the plugin name
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
getCssStyleSheets
public java.util.List<java.lang.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 java.util.List<java.lang.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(java.lang.String strJavascriptFile)
Add an Javascript File to the plugin definition, not associated with a mode- Parameters:
strJavascriptFile- The Javascript File path
-
getJavascriptFiles
public java.util.List<java.lang.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 java.util.List<java.lang.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 java.util.List<java.lang.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 java.util.List<java.lang.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(java.lang.String strMacroFileName)
Deprecated.Adds a that file that will be autoincluded in freemarker templates- Parameters:
strMacroFileName- the file name
-
getFreeMarkerMacrosFiles
@Deprecated public java.util.List<java.lang.String> getFreeMarkerMacrosFiles()
Deprecated.Gets the free marker macros files.- Returns:
- the free marker macros files
-
addFreemarkerAutoInclude
public void addFreemarkerAutoInclude(java.lang.String strFileName)
Adds a file that will be autoincluded in freemarker templates- Parameters:
strFileName- the file name
-
getFreeMarkerAutoIncludes
public java.util.List<java.lang.String> getFreeMarkerAutoIncludes()
Gets the freemarker auto-includes.- Returns:
- the freemarker auto-includes
-
addFreemarkerAutoImport
public void addFreemarkerAutoImport(java.lang.String strNamespace, java.lang.String strFileName)Adds a file that will be autoimported in freemarker templates- Parameters:
strNamespace- The namespace corresponding to the import filestrFileName- the file name
-
getFreeMarkerAutoImports
public java.util.Map<java.lang.String,java.lang.String> getFreeMarkerAutoImports()
Gets the freemarker auto-imports.- Returns:
- the freemarker auto-imports
-
toString
public java.lang.String toString()
Useful for debugging- Overrides:
toStringin classjava.lang.Object- Returns:
- The plugin object in String format
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-