public class Plugin
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Plugin.LabelComparator
Comparator class used to compare Plugins' labels
|
static class |
Plugin.PluginComparator
Comparator class used to compare Plugins:
Check dependencies of each other
Check dependencies size
Check plugin order
Check plugin name
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
appserver |
protected java.lang.String |
author |
static java.lang.String |
CHANGELOG |
protected static Channel |
channel |
protected org.jdom.Document |
config |
protected org.jdom.Document |
configToSave |
static java.lang.String |
CONFIGURATION |
static java.lang.String |
DEFAULT_ICON |
static java.lang.String |
DEFAULT_PREVIEW |
static java.lang.String |
DEFAULT_PROPERTIES_EDITOR |
protected java.util.HashSet<Plugin> |
dependencies |
protected java.util.Map<java.lang.String,java.lang.String> |
descriptionMap |
static java.lang.String |
DOCUMENTATION |
static java.lang.String |
ICON |
protected boolean |
isDeployed |
protected boolean |
isInitialized |
protected boolean |
isLoaded |
protected boolean |
isRestart |
protected boolean |
isStopped |
protected boolean |
isWarned |
static java.lang.String |
JAVADOC |
protected java.lang.String |
jcms |
static org.apache.log4j.Logger |
jcmsLogger |
protected boolean |
jsync |
protected java.util.Map<java.lang.String,java.lang.String> |
labelMap |
protected java.lang.String |
license |
static java.lang.String |
LICENSE |
protected org.apache.log4j.Logger |
logger |
protected java.lang.String |
name |
protected int |
order |
protected JProperties |
pluginProp |
static java.lang.String |
PREVIEW |
static java.lang.String |
PROPERTIES_EDITOR |
static java.lang.String |
REVISION |
static java.lang.String |
SIGNATURE |
protected java.lang.String |
url |
protected java.lang.String |
version |
static java.lang.String |
XML_COMPONENTS |
static java.lang.String |
XML_DEPENDENCIES |
static java.lang.String |
XML_DEPENDENCY |
static java.lang.String |
XML_HIBERNATE |
static java.lang.String |
XML_OPENAPI |
static java.lang.String |
XML_OPENAPI_RESOURCE |
static java.lang.String |
XML_PRIVATE |
static java.lang.String |
XML_PUBLIC |
static java.lang.String |
XML_TYPE |
static java.lang.String |
XML_TYPES |
static java.lang.String |
XML_WEBAPP |
Constructor and Description |
---|
Plugin() |
Plugin(java.lang.String label)
Create a Plugin from a given Camelized Label
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkAppServer()
Check if the plugin work with the current application server
|
protected boolean |
checkJCMSVersion()
Check if the plugin work with the current JCMS version
|
java.util.Set<SignatureDiffEntry> |
diff()
Diff the base plugin signature and a live plugin signature.
|
protected void |
fillElementPath(java.util.Collection<java.lang.String> paths,
java.util.List<org.jdom.Element> elmList,
java.lang.String prefix,
java.lang.String tagName,
boolean deep,
java.lang.String matchAttribute,
java.lang.String matchValue) |
protected void |
fillJavaSet(org.jdom.Element itJava,
java.util.Set<java.lang.String> pathSet,
boolean sources) |
protected void |
fillPluginComponentPath(java.util.Map<java.lang.String,java.lang.String> itemMap,
java.lang.String tagName,
boolean sources) |
java.util.Set<Plugin> |
getAllDependenciesSet()
Returns all plugins used by this plugin recursively.
|
java.util.Set<java.lang.String> |
getAllPathSet(boolean sources,
boolean generated)
Returns a Set of relative path to all Plugins files
|
java.lang.String[] |
getAppServer() |
java.lang.String |
getAuthor() |
java.lang.String |
getBuild(java.util.Locale userLocale) |
java.lang.String |
getChangeLog() |
java.lang.String |
getConfiguration() |
java.util.Set<Plugin> |
getDependenceSet() |
java.lang.String |
getDescription(java.lang.String lang) |
protected java.util.Map<java.lang.String,java.lang.String> |
getDescriptionMap() |
java.lang.String |
getDocumentation() |
java.util.TreeMap<java.lang.String,java.lang.String> |
getEditableProperties()
Return a TreeMap that contains all plugin properties having an I18N value.
|
java.util.Set<java.lang.String> |
getHibernateMappingsPath()
Returns a Set of path to plugin's Hibernate mappings (hbm).
|
java.lang.String |
getIcon() |
protected java.util.Collection<java.lang.String> |
getIncludeCollection(java.lang.String tag)
Returns a Collection of JSP Relatives path to include for the given anchor.
|
java.lang.String |
getJarPath()
Returns the relative path to the packaged plugin jar sources
|
java.util.Set<java.lang.String> |
getJarsPath()
Returns a Set of path to plugin's jars.
|
java.lang.String |
getJavadocHtmlLink() |
java.util.Set<java.lang.String> |
getJavaPath(boolean sources)
Returns a Set of path to plugin's java files.
|
java.lang.String |
getJCMSVersion() |
boolean |
getJSync() |
java.lang.String |
getLabel(java.lang.String lang) |
protected java.util.Map<java.lang.String,java.lang.String> |
getLabelMap() |
java.lang.String |
getLicense() |
org.apache.log4j.Logger |
getLogger()
Returns the logger of the current Plugin.
|
java.lang.String |
getName() |
java.util.Map<java.lang.String,java.lang.String> |
getOpenAPIResourcePath(boolean sources)
Returns a Map from path of plugin's OpenAPI resources files to their
uritemplate.
|
int |
getOrder() |
java.lang.String |
getPackageName() |
java.lang.String |
getPackagePath() |
java.util.Set<java.io.File> |
getPackageSet()
Returns a Set of File representing all package version for this plugin.
|
java.util.Map<java.lang.String,java.lang.String> |
getPluginComponentPath(boolean sources)
Returns a Map from path of plugin's components files to their nature
("storelistener", "dblistener", ...).
|
protected <T extends PluginComponent> |
getPluginComponents(java.lang.Class<T> clazz)
Convenient method to retrieve a usage of elements from the plugin
configuration and create PluginComponents from attribute class
Skip unresolvable types with a warning.
|
protected <T extends PluginComponent> |
getPluginComponents(java.lang.Class<T> clazz,
java.lang.String tagName)
Convenient method to retrieve a usage of elements from the plugin
configuration and create PluginComponents from attribute class
Skip unresolvable types with a warning.
|
java.lang.String |
getPreview() |
java.util.Set<java.lang.String> |
getPrivatesPath()
Returns a Set of path to plugin's private files.
|
java.lang.String |
getPropertiesEditor() |
protected java.lang.String |
getPublicPath(java.lang.String pluginRelativePath,
java.lang.String defaultPath) |
java.util.Set<java.lang.String> |
getPublicsPath()
Returns a Set of path to plugin's public files.
|
Signature |
getSignature()
Returns a Signature of plugin's files
|
java.lang.String |
getSignaturePath() |
java.lang.String |
getStatus(java.lang.String userLang) |
java.lang.String |
getStatusIcons(java.lang.String userLang) |
java.util.Set<java.lang.String> |
getTemplatesPath()
Returns a Set of path to plugin's type's templates.
|
java.lang.String |
getTextLicense() |
java.util.Set<java.lang.String> |
getTypeDirectoriesPathSet()
Returns a Set of new plugin's types directory path
|
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
getTypesPath(boolean sources,
boolean generated)
Returns a Map of Type Mame / Relative path to declared plugin's type files
Type XML
Type Template XML
Declared custom java Files
Declared JSP
Declared Resources (preview, images, ...)
|
java.util.List<TypeTemplateEntry> |
getTypeTemplateEntries()
Returns templates for given types declared in plugin configuration.
|
java.lang.String |
getUrl() |
java.lang.String |
getVersion() |
java.util.Set<java.lang.String> |
getWebappsPath()
Returns a Set of path to plugin's webapps files.
|
java.util.Set<java.lang.String> |
getWorkflowsPath()
Returns a Set of path to plugin's workflow.
|
void |
init()
Called by PluginManager during initialization after all plugins
dependencies initialized.
|
void |
initDependencies(boolean checkStatus)
Called by PluginManager during initialization after all plugins loads.
|
boolean |
isDeployed() |
boolean |
isInitialized() |
boolean |
isLoaded() |
boolean |
isMainPlugin()
Returns true if this plugin is the main plugin.
|
boolean |
isStopped() |
boolean |
isWarned() |
void |
load(org.jdom.Document config,
boolean isDeployed)
Called by PluginManager during initialization to setup main variable from
config file.
|
protected void |
loadLanguageProperties(LangProperties properties,
java.util.List<java.lang.String> langList)
Load language properties into channel properties.
|
protected void |
loadProperties(LangProperties properties)
Load plugin properties into channel properties.
|
boolean |
mustRestart() |
boolean |
performPackage(boolean sources)
Performs a package of the plugin's files.
|
protected void |
registerAlarmListener()
Register AlarmListener into the Channel declared in plugin configuration.
|
protected void |
registerAlertChannel()
Register AlertChannel declared in plugin configuration.
|
protected void |
registerAuthenticationHandler()
Register Authentication handler into the Channel declared in plugin
configuration.
|
protected void |
registerChannelListener()
Register ChannelListener into the Channel declared in plugin configuration.
|
protected void |
registerCleanFilter()
Register CleanFilter into the Channel declared in plugin configuration.
|
protected void |
registerDataController()
Register DataControllers into the Channel declared in plugin configuration.
|
protected void |
registerDBListener()
Register DBListener into the Channel declared in plugin configuration.
|
protected void |
registerHibernateMapping()
Register the Hibernate mapping files
|
protected void |
registerOpenApiResources()
Register RestResource into the Channel declared in plugin configuration.
|
protected void |
registerPolicyFilter()
Register PolicyFilter into the Channel declared in plugin configuration.
|
protected void |
registerQueryFilter()
Register QueryFilter into the Channel declared in plugin configuration.
|
protected void |
registerStoreListener(boolean beforeStoreLoad)
Register StoreListeners into the Channel declared in plugin configuration.
|
protected void |
registerTemplates()
Register templates for given types declared in plugin configuration.
|
void |
resetConfigToSave()
Clones XML document that represents plugin configuration.
|
void |
saveConfig() |
void |
setInitialized(boolean initialized) |
void |
setRestart(boolean restart) |
void |
setStopped() |
void |
setup()
Called by PluginManager during initialization after all plugins
dependencies initialized.
|
void |
setWarned(boolean warn) |
boolean |
sign(boolean force)
Create a Signature of plugin's files and store it in plugin private
directory.
|
java.lang.String |
toString() |
void |
updateAppServer(java.lang.String[] field) |
void |
updateAuthor(java.lang.String field) |
void |
updateDescription(java.util.Map<java.lang.String,java.lang.String> descriptionMap) |
void |
updateInitialized(boolean field) |
void |
updateJarSet(java.util.Set<java.lang.String> jarSet) |
void |
updateJCMSVersion(java.lang.String field) |
void |
updateJSync(boolean field) |
void |
updateLabel(java.util.Map<java.lang.String,java.lang.String> labelMap) |
void |
updateLicense(java.lang.String field) |
void |
updateOrder(int field) |
void |
updatePrivateSet(java.util.Set<java.lang.String> privateSet) |
void |
updatePublicSet(java.util.Set<java.lang.String> publicSet) |
void |
updateTypeMap(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map) |
void |
updateUrl(java.lang.String field) |
void |
updateVersion(java.lang.String field) |
void |
updateWebappSet(java.util.Set<java.lang.String> webappSet) |
void |
updateWorkflowSet(java.util.Set<java.lang.String> workflowSet) |
public static org.apache.log4j.Logger jcmsLogger
protected static Channel channel
public static final java.lang.String REVISION
public static final java.lang.String SIGNATURE
public static final java.lang.String CHANGELOG
public static final java.lang.String DOCUMENTATION
public static final java.lang.String JAVADOC
public static final java.lang.String LICENSE
public static final java.lang.String PREVIEW
public static final java.lang.String ICON
public static final java.lang.String CONFIGURATION
public static final java.lang.String PROPERTIES_EDITOR
public static final java.lang.String DEFAULT_PROPERTIES_EDITOR
public static final java.lang.String DEFAULT_PREVIEW
public static final java.lang.String DEFAULT_ICON
public static final java.lang.String XML_PRIVATE
public static final java.lang.String XML_PUBLIC
public static final java.lang.String XML_WEBAPP
public static final java.lang.String XML_TYPES
public static final java.lang.String XML_TYPE
public static final java.lang.String XML_DEPENDENCIES
public static final java.lang.String XML_DEPENDENCY
public static final java.lang.String XML_COMPONENTS
public static final java.lang.String XML_HIBERNATE
public static final java.lang.String XML_OPENAPI
public static final java.lang.String XML_OPENAPI_RESOURCE
protected org.jdom.Document config
protected org.jdom.Document configToSave
protected org.apache.log4j.Logger logger
protected boolean isDeployed
protected boolean isLoaded
protected boolean isInitialized
protected boolean isStopped
protected boolean isWarned
protected boolean isRestart
protected java.lang.String name
protected java.lang.String version
protected java.lang.String jcms
protected int order
protected java.util.HashSet<Plugin> dependencies
protected boolean jsync
protected java.lang.String[] appserver
protected java.lang.String url
protected java.lang.String author
protected java.lang.String license
protected java.util.Map<java.lang.String,java.lang.String> labelMap
protected java.util.Map<java.lang.String,java.lang.String> descriptionMap
protected JProperties pluginProp
public Plugin()
public Plugin(java.lang.String label)
label
- the plugin labelpublic void load(org.jdom.Document config, boolean isDeployed)
config
- JDOM Document of config plugin fileisDeployed
- true if the plugin has been deployedpublic java.lang.String getJarPath()
public boolean performPackage(boolean sources)
sources
- boolean true to include java source files in the packagepublic java.util.Set<java.io.File> getPackageSet()
public void initDependencies(boolean checkStatus)
checkStatus
- true to check if depending plugin are availablepublic java.util.Set<Plugin> getAllDependenciesSet()
public void init()
public void setup()
protected boolean checkAppServer()
protected boolean checkJCMSVersion()
public boolean sign(boolean force)
force
- generate signature even if file existspublic java.util.Set<SignatureDiffEntry> diff()
public Signature getSignature()
public java.util.List<TypeTemplateEntry> getTypeTemplateEntries()
protected void registerTemplates()
protected java.util.Collection<java.lang.String> getIncludeCollection(java.lang.String tag)
tag
- the anchor to useprotected void registerStoreListener(boolean beforeStoreLoad)
beforeStoreLoad
- boolean true before loading storeprotected void registerDBListener()
protected void registerDataController()
protected void registerAlarmListener()
protected void registerAlertChannel()
protected void registerChannelListener()
getPluginComponents(Class)
protected void registerQueryFilter()
getPluginComponents(Class)
protected void registerCleanFilter()
getPluginComponents(Class)
protected void registerPolicyFilter()
getPluginComponents(Class)
protected void registerAuthenticationHandler()
getPluginComponents(Class)
protected <T extends PluginComponent> java.util.List<T> getPluginComponents(java.lang.Class<T> clazz)
T
- A PluginComponent typeclazz
- the PluginComponent classprotected <T extends PluginComponent> java.util.List<T> getPluginComponents(java.lang.Class<T> clazz, java.lang.String tagName)
T
- A PluginComponent typeclazz
- the PluginComponent classtagName
- the name of the tag used in plugin.xmlprotected void registerHibernateMapping()
protected void registerOpenApiResources()
protected void loadProperties(LangProperties properties)
properties
- the channel propertiesprotected void loadLanguageProperties(LangProperties properties, java.util.List<java.lang.String> langList)
properties
- the channel propertieslangList
- the lang list of JCMSpublic java.util.TreeMap<java.lang.String,java.lang.String> getEditableProperties()
public java.util.Set<java.lang.String> getAllPathSet(boolean sources, boolean generated)
sources
- include java sources in the pathgenerated
- include generated filespublic java.util.Set<java.lang.String> getTypeDirectoriesPathSet()
public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getTypesPath(boolean sources, boolean generated)
sources
- include java sources in the pathgenerated
- include generated contentpublic java.util.Set<java.lang.String> getWorkflowsPath()
public java.util.Set<java.lang.String> getJarsPath()
public java.util.Set<java.lang.String> getJavaPath(boolean sources)
sources
- boolean true to include java filespublic java.util.Set<java.lang.String> getHibernateMappingsPath()
public java.util.Set<java.lang.String> getTemplatesPath()
public java.util.Set<java.lang.String> getPublicsPath()
public java.util.Set<java.lang.String> getPrivatesPath()
public java.util.Set<java.lang.String> getWebappsPath()
public java.util.Map<java.lang.String,java.lang.String> getPluginComponentPath(boolean sources)
sources
- boolean true to include java filespublic java.util.Map<java.lang.String,java.lang.String> getOpenAPIResourcePath(boolean sources)
sources
- boolean true to include java filesprotected void fillElementPath(java.util.Collection<java.lang.String> paths, java.util.List<org.jdom.Element> elmList, java.lang.String prefix, java.lang.String tagName, boolean deep, java.lang.String matchAttribute, java.lang.String matchValue)
protected void fillJavaSet(org.jdom.Element itJava, java.util.Set<java.lang.String> pathSet, boolean sources)
protected void fillPluginComponentPath(java.util.Map<java.lang.String,java.lang.String> itemMap, java.lang.String tagName, boolean sources)
public void resetConfigToSave()
public void saveConfig()
public void updateLabel(java.util.Map<java.lang.String,java.lang.String> labelMap)
public void updateDescription(java.util.Map<java.lang.String,java.lang.String> descriptionMap)
public void updateInitialized(boolean field)
public void updateVersion(java.lang.String field)
public void updateJCMSVersion(java.lang.String field)
public void updateOrder(int field)
public void updateUrl(java.lang.String field)
public void updateAuthor(java.lang.String field)
public void updateLicense(java.lang.String field)
public void updateJSync(boolean field)
public void updateAppServer(java.lang.String[] field)
public void updateWorkflowSet(java.util.Set<java.lang.String> workflowSet)
public void updateJarSet(java.util.Set<java.lang.String> jarSet)
public void updatePrivateSet(java.util.Set<java.lang.String> privateSet)
public void updatePublicSet(java.util.Set<java.lang.String> publicSet)
public void updateWebappSet(java.util.Set<java.lang.String> webappSet)
public void updateTypeMap(java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
public org.apache.log4j.Logger getLogger()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isDeployed()
public boolean isStopped()
public boolean isLoaded()
public boolean isInitialized()
public void setInitialized(boolean initialized)
public void setStopped()
public void setRestart(boolean restart)
public boolean mustRestart()
public boolean isWarned()
public void setWarned(boolean warn)
public java.lang.String getName()
public java.lang.String getVersion()
public java.lang.String getBuild(java.util.Locale userLocale)
public java.lang.String getJCMSVersion()
public int getOrder()
public boolean getJSync()
public java.lang.String[] getAppServer()
public java.lang.String getUrl()
public java.lang.String getAuthor()
public java.lang.String getLicense()
public java.lang.String getLabel(java.lang.String lang)
public java.lang.String getDescription(java.lang.String lang)
public java.util.Set<Plugin> getDependenceSet()
protected java.util.Map<java.lang.String,java.lang.String> getLabelMap()
protected java.util.Map<java.lang.String,java.lang.String> getDescriptionMap()
public java.lang.String getPackageName()
public java.lang.String getPackagePath()
public java.lang.String getStatus(java.lang.String userLang)
public java.lang.String getStatusIcons(java.lang.String userLang)
public java.lang.String getPropertiesEditor()
public java.lang.String getPreview()
public java.lang.String getIcon()
public java.lang.String getChangeLog()
public java.lang.String getTextLicense()
public java.lang.String getDocumentation()
public java.lang.String getJavadocHtmlLink()
public java.lang.String getConfiguration()
public java.lang.String getSignaturePath()
protected java.lang.String getPublicPath(java.lang.String pluginRelativePath, java.lang.String defaultPath)
public boolean isMainPlugin()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.