fr.paris.lutece.portal.service.plugin
Class Plugin

java.lang.Object
  extended by 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
static int PLUGIN_TYPE_APPLICATION
           
static int PLUGIN_TYPE_CONTENTSERVICE
           
static int PLUGIN_TYPE_DAEMON
           
static int PLUGIN_TYPE_FEATURE
           
static int PLUGIN_TYPE_INSERTSERVICE
           
static int PLUGIN_TYPE_PORTLET
           
 
Constructor Summary
Plugin()
           
 
Method Summary
 void addJavascriptFile(java.lang.String strJavascriptFile)
          Add an Javascript File to the plugin definition
 int compareTo(Plugin plugin)
          Implementation of the Comparable interface.
 java.util.List<XPageApplicationEntry> getApplications()
          Returns the list of XPage Applications of the plugin
 PluginConnectionService getConnectionService()
          Returns a Connection Service associated to the plugin
 ContentService getContentService()
           
 java.util.List<ContentServiceEntry> getContentServices()
          Returns the list of Content services of the plugin
 java.lang.String getCopyright()
          Returns the Copyright of the plugin
 java.util.List<java.lang.String> getCssStyleSheets()
          Returns all CSS Style Sheets of the plugin
 java.util.List<DaemonEntry> getDaemons()
          Returns The daemons list of the plugin.
 java.lang.String getDbPoolName()
          Gets the current database connection pool associated to the plugin
 java.lang.String getDescription()
          Returns the description of the plugin
 java.lang.String getDocumentationUrl()
          Returns the Documentation's URL of the plugin
 java.lang.String getIconUrl()
          Returns the Icon's URL of the plugin
 java.util.List<InsertService> getInsertServices()
          Returns the list of insert services of the plugin
 java.util.List<java.lang.String> getJavascriptFiles()
          Returns all Javascript File of the plugin
 java.lang.String getMaxCoreVersion()
          Returns the max core version compatibility for the plugin
 java.lang.String getMinCoreVersion()
          Returns the min core version compatibility for the plugin
 java.lang.String getName()
          Returns the name of the plugin
 java.util.Map<java.lang.String,java.lang.String> getParams()
          Gets plugin's parameters
 java.lang.String getParamValue(java.lang.String strParamName)
          Gets a parameter value for a given parameter name
 java.util.List<PortletType> getPortletTypes()
          Returns the list of portlet type of the plugin
 java.lang.String getProvider()
          Returns the Provider of the plugin
 java.lang.String getProviderUrl()
          Returns the Provider's URL of the plugin
 java.util.List<Right> getRights()
          Returns the list of portlet type of the plugin
 java.lang.String getServiceClass()
          Returns the main Class of the plugin
 int getType()
          Returns the type of the plugin
 java.lang.String getVersion()
          Returns the version of the plugin
 Theme getXPageTheme(javax.servlet.http.HttpServletRequest request)
          Returns the theme the plugin use for rendering a Xpage
 boolean hasDaemons()
          Returns weither or not plugin has daemon.
 boolean hasPortlets()
          Returns weither or not plugin has portlet.
abstract  void init()
          Initializes the plugin at the first load
 void initConnectionService(java.lang.String strPoolName)
          Initializes the plugin's ConnectionService
 void install()
          Installs a Plugin
 boolean isCssStylesheetsScopePortal()
          Give the scope of css stylesheets
 boolean isCssStylesheetsScopeXPage()
          Give the scope of css stylesheets
 boolean isDbPoolRequired()
          Returns if the plugin needs a database connection pool
 boolean isInstalled()
          Returns the installation status of the plugin
 boolean isJavascriptFilesScopePortal()
          Give the scope of javascripts
 boolean isJavascriptFilesScopeXPage()
          Give the scope of javascripts
protected  void registerAdminDashboardComponents()
          Register Admin Dashboard Components
protected  void registerContentServices()
          Register Content Services
protected  void registerDaemons()
          Register Daemons
protected  void registerDashboardComponents()
          Register Dashboard Components
protected  void registerFilters()
          Register Filters
protected  void registerInsertServices()
          Register Insert Services
protected  void registerPageIncludes()
          Register Page Includes
protected  void registerPortlets()
          Creates a new portlet in the portlets type set
protected  void registerRBACResourceTypes()
          Register RBAC Resource Types
protected  void registerRights()
          Creates a new right in the rights set
protected  void registerSearchIndexers()
          Register Search Indexers
protected  void registerXPageApplications()
          Register XPage applications
 void setConnectionService(PluginConnectionService connectionService)
          Sets the connection service
 void setCopyright(java.lang.String strCopyright)
          Sets the copyright
 void setDescription(java.lang.String strDescription)
          Sets the description of the plugin
 void setDocumentationUrl(java.lang.String strDocumentationUrl)
          Sets the url of the plugin's Documentation
 void setIconUrl(java.lang.String strIconUrl)
          Sets the url of the plugin's icon
 void setIsDbPoolRequired(boolean bDbPoolRequired)
          Sets the boolean which shows if a pool is required
 void setIsInstalled(boolean bIsInstalled)
          Sets the boolean which shows if the plugin is installed
 void setMaxCoreVersion(java.lang.String strMaxCoreVersion)
          Sets the the max core version compatibility for the plugin
 void setMinCoreVersion(java.lang.String strMinCoreVersion)
          Sets the the min core version compatibility for the plugin
 void setName(java.lang.String strName)
          Sets the name of the plugin
 void setParams(java.util.Map<java.lang.String,java.lang.String> mapParams)
          Sets parameters values with an hashtable
 void setParamValue(java.lang.String strParamName, java.lang.String strParamValue)
          Sets a parameter value for a given parameter name
 void setPoolName(java.lang.String strPoolName)
          Updates a database connection pool associated to the plugin and stores it
 void setPortletTypes(java.util.List<PortletType> listPortletTypes)
          Sets the list of portlet type
 void setProvider(java.lang.String strProvider)
          Sets the provider name
 void setProviderUrl(java.lang.String strProviderUrl)
          Sets the provider url
 void setRights(java.util.List<Right> listRights)
          Sets plugin rights list
 void setServiceClass(java.lang.String strPluginClass)
          Sets the class service of plugin
 void setStatus(boolean bStatus)
          Modify the plugin status
 void setVersion(java.lang.String strVersion)
          Sets the version plugin name
 java.lang.String toString()
          Useful for debugging
 void uninstall()
          Uninstalls a Plugin
protected  void unregisterPortlets()
          Remove a portlet from the portlets type set.
protected  void unregisterRights()
          Remove a right from the rights set.
protected  void update()
          Updates the plg file
 void updatePoolName(java.lang.String strPoolName)
          Updates a database connection pool associated to the plugin and stores it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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
Constructor Detail

Plugin

public Plugin()
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

update

protected void update()
Updates the plg file


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

registerRights

protected void registerRights()
Creates a new right in the rights set


unregisterRights

protected void unregisterRights()
Remove a right from the rights set.


registerPortlets

protected void registerPortlets()
Creates a new portlet in the portlets type set


unregisterPortlets

protected void unregisterPortlets()
Remove a portlet from the portlets type set.


registerXPageApplications

protected void registerXPageApplications()
                                  throws LuteceInitException
Register XPage applications

Throws:
LuteceInitException - If an error occurs

registerFilters

protected void registerFilters()
                        throws LuteceInitException
Register Filters

Throws:
LuteceInitException - If an error occurs

registerContentServices

protected void registerContentServices()
                                throws LuteceInitException
Register Content Services

Throws:
LuteceInitException - If an error occurs

registerInsertServices

protected void registerInsertServices()
                               throws LuteceInitException
Register Insert Services

Throws:
LuteceInitException - If an error occurs

registerSearchIndexers

protected void registerSearchIndexers()
                               throws LuteceInitException
Register Search Indexers

Throws:
LuteceInitException - If an error occurs

registerPageIncludes

protected void registerPageIncludes()
                             throws LuteceInitException
Register Page Includes

Throws:
LuteceInitException - If an error occured

registerDashboardComponents

protected void registerDashboardComponents()
                                    throws LuteceInitException
Register Dashboard Components

Throws:
LuteceInitException - If an error occured

registerAdminDashboardComponents

protected void registerAdminDashboardComponents()
                                         throws LuteceInitException
Register Admin Dashboard Components

Throws:
LuteceInitException - If an error occured

registerRBACResourceTypes

protected void registerRBACResourceTypes()
                                  throws LuteceInitException
Register RBAC Resource Types

Throws:
LuteceInitException - If an error occurs

registerDaemons

protected void registerDaemons()
                        throws LuteceInitException
Register Daemons

Throws:
LuteceInitException - If an error occurs

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 parameter
strParamValue - The value of the parameter

compareTo

public int compareTo(Plugin plugin)
Implementation of the Comparable interface.

Specified by:
compareTo in interface java.lang.Comparable<Plugin>
Parameters:
plugin - A plugin Object
Returns:
1, 0 ou -1 according the plugin name

getCssStyleSheets

public java.util.List<java.lang.String> getCssStyleSheets()
Returns all CSS Style Sheets of the plugin

Returns:
The list of CSS Style Sheets

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

Parameters:
strJavascriptFile - The Javascript File path

getJavascriptFiles

public java.util.List<java.lang.String> getJavascriptFiles()
Returns all Javascript File of the plugin

Returns:
The list of Javascript File

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

toString

public java.lang.String toString()
Useful for debugging

Overrides:
toString in class java.lang.Object
Returns:
The plugin object in String format


Copyright © 2011 Mairie de Paris. All Rights Reserved.