|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.plugin.Plugin
public class Plugin
Main root class representing a Plugin.
Nested Class Summary | |
---|---|
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 |
Constructor Summary | |
---|---|
Plugin()
|
|
Plugin(String label)
Create a Plugin from a given Camelized Label |
Method Summary | ||
---|---|---|
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 |
|
Set<SignatureDiffEntry> |
diff()
Diff the base plugin signature and a live plugin signature. |
|
protected void |
fillElementPath(Collection<String> paths,
List<org.jdom.Element> elmList,
String prefix,
String tagName,
boolean deep,
String matchAttribute,
String matchValue)
|
|
protected void |
fillJavaSet(org.jdom.Element itJava,
Set<String> pathSet,
boolean sources)
|
|
protected void |
fillPluginComponentPath(Map<String,String> itemMap,
String tagName,
boolean sources)
|
|
Set<Plugin> |
getAllDependenciesSet()
Returns all plugins used by this plugin recursively. |
|
Set<String> |
getAllPathSet(boolean sources,
boolean generated)
Returns a Set of relative path to all Plugins files |
|
String[] |
getAppServer()
|
|
String |
getAuthor()
|
|
String |
getBuild(Locale userLocale)
|
|
String |
getChangeLog()
|
|
String |
getConfiguration()
|
|
Set<Plugin> |
getDependenceSet()
|
|
String |
getDescription(String lang)
|
|
protected Map<String,String> |
getDescriptionMap()
|
|
String |
getDocumentation()
|
|
TreeMap<String,String> |
getEditableProperties()
Return a TreeMap that contains all plugin properties having an I18N value. |
|
Set<String> |
getHibernateMappingsPath()
Returns a Set of path to plugin's Hibernate mappings (hbm). |
|
String |
getIcon()
|
|
protected Collection<String> |
getIncludeCollection(String tag)
Return a Collection of JSP Relatives path to include for the given anchor. |
|
String |
getJarPath()
Returns the relative path to the packaged plugin jar sources |
|
Set<String> |
getJarsPath()
Returns a Set of path to plugin's jars. |
|
Set<String> |
getJavaPath(boolean sources)
Returns a Set of path to plugin's java files. |
|
String |
getJCMSVersion()
|
|
boolean |
getJSync()
|
|
String |
getLabel(String lang)
|
|
protected Map<String,String> |
getLabelMap()
|
|
String |
getLicense()
|
|
org.apache.log4j.Logger |
getLogger()
Returns the logger of the current Plugin. |
|
String |
getName()
|
|
Map<String,String> |
getOpenAPIResourcePath(boolean sources)
Returns a Map from path of plugin's OpenAPI resources files to their uritemplate. |
|
int |
getOrder()
|
|
String |
getPackageName()
|
|
String |
getPackagePath()
|
|
Set<File> |
getPackageSet()
Returns a Set of File representing all package version for this plugin. |
|
Map<String,String> |
getPluginComponentPath(boolean sources)
Returns a Map from path of plugin's components files to their nature ("storelistener", "dblistener", ...). |
|
protected
|
getPluginComponents(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
|
getPluginComponents(Class<T> clazz,
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. |
|
String |
getPreview()
|
|
Set<String> |
getPrivatesPath()
Returns a Set of path to plugin's private files. |
|
String |
getPropertiesEditor()
|
|
protected String |
getPublicPath(String pluginRelativePath,
String defaultPath)
|
|
Set<String> |
getPublicsPath()
Returns a Set of path to plugin's public files. |
|
Signature |
getSignature()
Returns a Signature of plugin's files |
|
String |
getSignaturePath()
|
|
String |
getStatus(String userLang)
|
|
String |
getStatusIcons(String userLang)
|
|
Set<String> |
getTemplatesPath()
Returns a Set of path to plugin's type's templates. |
|
String |
getTextLicense()
|
|
Set<String> |
getTypeDirectoriesPathSet()
Returns a Set of new plugin's types directory path |
|
Map<String,Set<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, ...) |
|
List<TypeTemplateEntry> |
getTypeTemplateEntries()
Returns templates for given types declared in plugin configuration. |
|
String |
getUrl()
|
|
String |
getVersion()
|
|
Set<String> |
getWebappsPath()
Returns a Set of path to plugin's webapps files. |
|
Set<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 |
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,
List<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 |
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. |
|
String |
toString()
|
|
void |
updateAppServer(String[] field)
|
|
void |
updateAuthor(String field)
|
|
void |
updateDescription(Map<String,String> descriptionMap)
|
|
void |
updateInitialized(boolean field)
|
|
void |
updateJarSet(Set<String> jarSet)
|
|
void |
updateJCMSVersion(String field)
|
|
void |
updateJSync(boolean field)
|
|
void |
updateLabel(Map<String,String> labelMap)
|
|
void |
updateLicense(String field)
|
|
void |
updateOrder(int field)
|
|
void |
updatePrivateSet(Set<String> privateSet)
|
|
void |
updatePublicSet(Set<String> publicSet)
|
|
void |
updateTypeMap(Map<String,Set<String>> map)
|
|
void |
updateUrl(String field)
|
|
void |
updateVersion(String field)
|
|
void |
updateWebappSet(Set<String> webappSet)
|
|
void |
updateWorkflowSet(Set<String> workflowSet)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static org.apache.log4j.Logger jcmsLogger
protected static Channel channel
public static final String REVISION
public static final String SIGNATURE
public static final String CHANGELOG
public static final String DOCUMENTATION
public static final String LICENSE
public static final String PREVIEW
public static final String ICON
public static final String CONFIGURATION
public static final String PROPERTIES_EDITOR
public static final String DEFAULT_PROPERTIES_EDITOR
public static final String DEFAULT_PREVIEW
public static final String DEFAULT_ICON
public static final String XML_PRIVATE
public static final String XML_PUBLIC
public static final String XML_WEBAPP
public static final String XML_TYPES
public static final String XML_TYPE
public static final String XML_DEPENDENCIES
public static final String XML_DEPENDENCY
public static final String XML_COMPONENTS
public static final String XML_HIBERNATE
public static final String XML_OPENAPI
public static final 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 String name
protected String version
protected String jcms
protected int order
protected HashSet<Plugin> dependencies
protected boolean jsync
protected String[] appserver
protected String url
protected String author
protected String license
protected Map<String,String> labelMap
protected Map<String,String> descriptionMap
protected JProperties pluginProp
Constructor Detail |
---|
public Plugin()
public Plugin(String label)
label
- the plugin labelMethod Detail |
---|
public void load(org.jdom.Document config, boolean isDeployed)
config
- JDOM Document of config plugin fileisDeployed
- true if the plugin has been deployedpublic String getJarPath()
public boolean performPackage(boolean sources)
sources
- boolean true to include java source files in the package
public Set<File> getPackageSet()
public void initDependencies(boolean checkStatus)
checkStatus
- true to check if depending plugin are availablepublic 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 exists
public Set<SignatureDiffEntry> diff()
public Signature getSignature()
public List<TypeTemplateEntry> getTypeTemplateEntries()
protected void registerTemplates()
protected Collection<String> getIncludeCollection(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 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> List<T> getPluginComponents(Class<T> clazz)
clazz
- the PluginComponent class
protected <T extends PluginComponent> List<T> getPluginComponents(Class<T> clazz, String tagName)
clazz
- the PluginComponent classtagName
- the name of the tag used in plugin.xml
protected void registerHibernateMapping()
protected void registerOpenApiResources()
protected void loadProperties(LangProperties properties)
properties
- the channel propertiesprotected void loadLanguageProperties(LangProperties properties, List<String> langList)
properties
- the channel propertieslangList
- the lang list of JCMSpublic TreeMap<String,String> getEditableProperties()
public Set<String> getAllPathSet(boolean sources, boolean generated)
sources
- include java sources in the pathgenerated
- include generated files
public Set<String> getTypeDirectoriesPathSet()
public Map<String,Set<String>> getTypesPath(boolean sources, boolean generated)
sources
- include java sources in the pathgenerated
- include generated content
public Set<String> getWorkflowsPath()
public Set<String> getJarsPath()
public Set<String> getJavaPath(boolean sources)
sources
- boolean true to include java files
public Set<String> getHibernateMappingsPath()
public Set<String> getTemplatesPath()
public Set<String> getPublicsPath()
public Set<String> getPrivatesPath()
public Set<String> getWebappsPath()
public Map<String,String> getPluginComponentPath(boolean sources)
sources
- boolean true to include java files
public Map<String,String> getOpenAPIResourcePath(boolean sources)
sources
- boolean true to include java files
protected void fillElementPath(Collection<String> paths, List<org.jdom.Element> elmList, String prefix, String tagName, boolean deep, String matchAttribute, String matchValue)
protected void fillJavaSet(org.jdom.Element itJava, Set<String> pathSet, boolean sources)
protected void fillPluginComponentPath(Map<String,String> itemMap, String tagName, boolean sources)
public void resetConfigToSave()
public void saveConfig()
public void updateLabel(Map<String,String> labelMap)
public void updateDescription(Map<String,String> descriptionMap)
public void updateInitialized(boolean field)
public void updateVersion(String field)
public void updateJCMSVersion(String field)
public void updateOrder(int field)
public void updateUrl(String field)
public void updateAuthor(String field)
public void updateLicense(String field)
public void updateJSync(boolean field)
public void updateAppServer(String[] field)
public void updateWorkflowSet(Set<String> workflowSet)
public void updateJarSet(Set<String> jarSet)
public void updatePrivateSet(Set<String> privateSet)
public void updatePublicSet(Set<String> publicSet)
public void updateWebappSet(Set<String> webappSet)
public void updateTypeMap(Map<String,Set<String>> map)
public org.apache.log4j.Logger getLogger()
public String toString()
toString
in class 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 String getName()
public String getVersion()
public String getBuild(Locale userLocale)
public String getJCMSVersion()
public int getOrder()
public boolean getJSync()
public String[] getAppServer()
public String getUrl()
public String getAuthor()
public String getLicense()
public String getLabel(String lang)
public String getDescription(String lang)
public Set<Plugin> getDependenceSet()
protected Map<String,String> getLabelMap()
protected Map<String,String> getDescriptionMap()
public String getPackageName()
public String getPackagePath()
public String getStatus(String userLang)
public String getStatusIcons(String userLang)
public String getPropertiesEditor()
public String getPreview()
public String getIcon()
public String getChangeLog()
public String getTextLicense()
public String getDocumentation()
public String getConfiguration()
public String getSignaturePath()
protected String getPublicPath(String pluginRelativePath, String defaultPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |