|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.module.CmsModuleXmlHandler
public class CmsModuleXmlHandler
Adds the XML handler rules for import and export of a single module.
| Field Summary | |
|---|---|
static String |
A_NAME
The "name" attribute. |
static String |
A_VERSION
The "version" attribute. |
static String |
N_AUTHOREMAIL
The node name for the authoremail node. |
static String |
N_AUTHORNAME
The node name for the authorname node. |
static String |
N_CLASS
The node name for the class node. |
static String |
N_DATECREATED
The node name for the datecreated node. |
static String |
N_DATEINSTALLED
The node name for the date installed node. |
static String |
N_DEPENDENCIES
The node name for the dependencies node. |
static String |
N_DEPENDENCY
The node name for the dependency node. |
static String |
N_DESCRIPTION
The node name for the description node. |
static String |
N_GROUP
The node name for the group node. |
static String |
N_MODULE
The node name for a module. |
static String |
N_NAME
The node name for the name node. |
static String |
N_NICENAME
The node name for the nicename node. |
static String |
N_PARAM
The "param" node name for generic parameters. |
static String |
N_PARAMETERS
The node name for the parameters node. |
static String |
N_RESOURCES
The node name for the resources node. |
static String |
N_USERINSTALLED
The node name for the user installed node. |
static String |
N_VERSION
The node name for the version node. |
| Constructor Summary | |
|---|---|
CmsModuleXmlHandler()
Public constructor, will be called by digester during import. |
|
| Method Summary | |
|---|---|
void |
addDependency(String name,
String version)
Adds a module dependency to the current module. |
void |
addExplorerTypeSetting(CmsExplorerTypeSettings settings)
Adds an explorer type setting object to the list of type settings. |
void |
addExportPoint(String uri,
String destination)
Adds an export point to the module configuration. |
void |
addParameter(String key,
String value)
Adds a module parameter to the module configuration. |
void |
addResource(String resource)
Adds a resource to the list module resources. |
void |
addResourceType(I_CmsResourceType resourceType)
Adds a new resource type to the internal list of loaded resource types. |
static void |
addXmlDigesterRules(org.apache.commons.digester.Digester digester)
Adds the XML digester rules for a single module. |
void |
createdModule(String name,
String niceName,
String group,
String actionClass,
String description,
String version,
String authorName,
String authorEmail,
String dateCreated,
String userInstalled,
String dateInstalled)
Created a new module from the provided parameters. |
static Element |
generateXml(CmsModule module)
Generates a detached XML element for a module. |
CmsModule |
getModule()
Returns the generated module. |
static String |
makeValidJavaClassName(String className)
Generates a (hopefully) valid Java class name from an invalid class name. |
void |
setOldModule()
Sets the current imported module to an old (5.0.x) style module. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String A_NAME
public static final String A_VERSION
public static final String N_AUTHOREMAIL
public static final String N_AUTHORNAME
public static final String N_CLASS
public static final String N_DATECREATED
public static final String N_DATEINSTALLED
public static final String N_DEPENDENCIES
public static final String N_DEPENDENCY
public static final String N_DESCRIPTION
public static final String N_GROUP
public static final String N_MODULE
public static final String N_NAME
public static final String N_NICENAME
public static final String N_PARAM
public static final String N_PARAMETERS
public static final String N_RESOURCES
public static final String N_USERINSTALLED
public static final String N_VERSION
| Constructor Detail |
|---|
public CmsModuleXmlHandler()
| Method Detail |
|---|
public static void addXmlDigesterRules(org.apache.commons.digester.Digester digester)
digester - the digester to add the rules topublic static Element generateXml(CmsModule module)
module - the module to generate the XML element for
public static String makeValidJavaClassName(String className)
All invalid characters are replaced by an underscore "_". This is for example used to make sure old (5.0) modules can still be imported, by converting the name to a valid class name.
className - the class name to make valid
public void addDependency(String name,
String version)
name - the module name of the dependencyversion - the module version of the dependencypublic void addExplorerTypeSetting(CmsExplorerTypeSettings settings)
Adds the type setting as well to a map with the resource type name as key.
settings - the explorer type settings
public void addExportPoint(String uri,
String destination)
uri - the export point uridestination - the export point destination
public void addParameter(String key,
String value)
key - the parameter keyvalue - the parameter valuepublic void addResource(String resource)
resource - a resources uri in the OpenCms VFSpublic void addResourceType(I_CmsResourceType resourceType)
resourceType - the resource type to addI_CmsResourceType.ADD_RESOURCE_TYPE_METHOD
public void createdModule(String name,
String niceName,
String group,
String actionClass,
String description,
String version,
String authorName,
String authorEmail,
String dateCreated,
String userInstalled,
String dateInstalled)
name - the name of this module, usually looks like a java package nameniceName - the "nice" display name of this modulegroup - the group of the moduleactionClass - the (optional) module action class namedescription - the description of this moduleversion - the version of this moduleauthorName - the name of the author of this moduleauthorEmail - the email of the module authordateCreated - the date this module was created by the authoruserInstalled - the name of the user who uploaded this moduledateInstalled - the date this module was uploadedpublic CmsModule getModule()
public void setOldModule()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||