Class Plugin
- 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 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 Modifier and Type Method Description voidaddFreemarkerMacrosFile(String strMacroFileName)Adds a that file that will be autoincluded in freemarker templatesvoidaddJavascriptFile(String strJavascriptFile)Add an Javascript File to the plugin definition, not associated with a modeintcompareTo(Plugin plugin)Implementation of the Comparable interface.booleanequals(Object o)List<String>getAdminCssStyleSheets()Return the list of stylesheets that should be used in the Back OfficeList<String>getAdminJavascriptFiles()Return the list of Javascript Files that should be used in the Back OfficeList<XPageApplicationEntry>getApplications()Returns the list of XPage Applications of the pluginPluginConnectionServicegetConnectionService()Returns a Connection Service associated to the pluginContentServicegetContentService()List<ContentServiceEntry>getContentServices()Returns the list of Content services of the pluginStringgetCopyright()Returns the Copyright of the pluginList<String>getCssStyleSheets()Returns all CSS Style Sheets of the plugin with no mode associatedList<String>getCssStyleSheets(int mode)Returns all CSS Style Sheets of the plugin associated with a modeList<DaemonEntry>getDaemons()Returns The daemons list of the plugin.StringgetDbPoolName()Gets the current database connection pool associated to the pluginStringgetDescription()Returns the description of the pluginStringgetDocumentationUrl()Returns the Documentation's URL of the pluginList<String>getFreeMarkerMacrosFiles()Gets the free marker macros files.StringgetIconUrl()Returns the Icon's URL of the pluginList<InsertService>getInsertServices()Returns the list of insert services of the pluginList<String>getJavascriptFiles()Returns all Javascript File of the plugin with no mode associatedList<String>getJavascriptFiles(int mode)Returns all Javascript File of the plugin associated with a modeStringgetMaxCoreVersion()Returns the max core version compatibility for the pluginStringgetMinCoreVersion()Returns the min core version compatibility for the pluginStringgetName()Returns the name of the pluginMap<String,String>getParams()Gets plugin's parametersStringgetParamValue(String strParamName)Gets a parameter value for a given parameter nameList<PortletType>getPortletTypes()Returns the list of portlet type of the pluginStringgetProvider()Returns the Provider of the pluginStringgetProviderUrl()Returns the Provider's URL of the pluginList<Right>getRights()Returns the list of portlet type of the pluginStringgetServiceClass()Returns the main Class of the pluginintgetType()Returns the type of the pluginStringgetVersion()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(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(String strCopyright)Sets the copyrightvoidsetDescription(String strDescription)Sets the description of the pluginvoidsetDocumentationUrl(String strDocumentationUrl)Sets the url of the plugin's DocumentationvoidsetIconUrl(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(String strMaxCoreVersion)Sets the the max core version compatibility for the pluginvoidsetMinCoreVersion(String strMinCoreVersion)Sets the the min core version compatibility for the pluginvoidsetName(String strName)Sets the name of the pluginvoidsetParams(Map<String,String> mapParams)Sets parameters values with an hashtablevoidsetParamValue(String strParamName, String strParamValue)Sets a parameter value for a given parameter namevoidsetPoolName(String strPoolName)Updates a database connection pool associated to the plugin and stores itvoidsetPortletTypes(List<PortletType> listPortletTypes)Sets the list of portlet typevoidsetProvider(String strProvider)Sets the provider namevoidsetProviderUrl(String strProviderUrl)Sets the provider urlvoidsetRights(List<Right> listRights)Sets plugin rights listvoidsetServiceClass(String strPluginClass)Sets the class service of pluginvoidsetStatus(boolean bStatus)Modify the plugin statusvoidsetVersion(String strVersion)Sets the version plugin nameStringtoString()Useful for debuggingvoiduninstall()Uninstalls a PluginvoidupdatePoolName(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 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 parameterstrParamValue- The value of the parameter
-
compareTo
public int compareTo(Plugin plugin)
Implementation of the Comparable interface.- Specified by:
compareToin interfaceComparable<Plugin>- Parameters:
plugin- A plugin Object- Returns:
- 1, 0 ou -1 according the plugin name
-
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
public void addFreemarkerMacrosFile(String strMacroFileName)
Adds a that file that will be autoincluded in freemarker templates- Parameters:
strMacroFileName- the file name
-
getFreeMarkerMacrosFiles
public List<String> getFreeMarkerMacrosFiles()
Gets the free marker macros files.- Returns:
- the free marker macros files
-
toString
public String toString()
Useful for debugging
-
-