| 
 | ||||||
| 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 java.lang.String | A_NAMEThe "name" attribute. | 
| static java.lang.String | A_VERSIONThe "version" attribute. | 
| static java.lang.String | N_AUTHOREMAILThe node name for the authoremail node. | 
| static java.lang.String | N_AUTHORNAMEThe node name for the authorname node. | 
| static java.lang.String | N_CLASSThe node name for the class node. | 
| static java.lang.String | N_DATECREATEDThe node name for the datecreated node. | 
| static java.lang.String | N_DATEINSTALLEDThe node name for the date installed node. | 
| static java.lang.String | N_DEPENDENCIESThe node name for the dependencies node. | 
| static java.lang.String | N_DEPENDENCYThe node name for the dependency node. | 
| static java.lang.String | N_DESCRIPTIONThe node name for the description node. | 
| static java.lang.String | N_GROUPThe node name for the group node. | 
| static java.lang.String | N_MODULEThe node name for a module. | 
| static java.lang.String | N_NAMEThe node name for the name node. | 
| static java.lang.String | N_NICENAMEThe node name for the nicename node. | 
| static java.lang.String | N_PARAMThe "param" node name for generic parameters. | 
| static java.lang.String | N_PARAMETERSThe node name for the parameters node. | 
| static java.lang.String | N_RESOURCESThe node name for the resources node. | 
| static java.lang.String | N_USERINSTALLEDThe node name for the user installed node. | 
| static java.lang.String | N_VERSIONThe node name for the version node. | 
| Constructor Summary | |
|---|---|
| CmsModuleXmlHandler()Public constructor, will be called by digester during import. | |
| Method Summary | |
|---|---|
|  void | addDependency(java.lang.String name,
              java.lang.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(java.lang.String uri,
               java.lang.String destination)Adds an export point to the module configuration. | 
|  void | addParameter(java.lang.String key,
             java.lang.String value)Adds a module parameter to the module configuration. | 
|  void | addResource(java.lang.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(java.lang.String name,
              java.lang.String niceName,
              java.lang.String group,
              java.lang.String actionClass,
              java.lang.String description,
              java.lang.String version,
              java.lang.String authorName,
              java.lang.String authorEmail,
              java.lang.String dateCreated,
              java.lang.String userInstalled,
              java.lang.String dateInstalled)Created a new module from the provided parameters. | 
| static org.dom4j.Element | generateXml(CmsModule module)Generates a detached XML element for a module. | 
|  CmsModule | getModule()Returns the generated module. | 
| static java.lang.String | makeValidJavaClassName(java.lang.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 java.lang.String A_NAME
public static final java.lang.String A_VERSION
public static final java.lang.String N_AUTHOREMAIL
public static final java.lang.String N_AUTHORNAME
public static final java.lang.String N_CLASS
public static final java.lang.String N_DATECREATED
public static final java.lang.String N_DATEINSTALLED
public static final java.lang.String N_DEPENDENCIES
public static final java.lang.String N_DEPENDENCY
public static final java.lang.String N_DESCRIPTION
public static final java.lang.String N_GROUP
public static final java.lang.String N_MODULE
public static final java.lang.String N_NAME
public static final java.lang.String N_NICENAME
public static final java.lang.String N_PARAM
public static final java.lang.String N_PARAMETERS
public static final java.lang.String N_RESOURCES
public static final java.lang.String N_USERINSTALLED
public static final java.lang.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 org.dom4j.Element generateXml(CmsModule module)
module - the module to generate the XML element for
public static java.lang.String makeValidJavaClassName(java.lang.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(java.lang.String name,
                          java.lang.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(java.lang.String uri,
                           java.lang.String destination)
uri - the export point uridestination - the export point destination
public void addParameter(java.lang.String key,
                         java.lang.String value)
key - the parameter keyvalue - the parameter valuepublic void addResource(java.lang.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(java.lang.String name,
                          java.lang.String niceName,
                          java.lang.String group,
                          java.lang.String actionClass,
                          java.lang.String description,
                          java.lang.String version,
                          java.lang.String authorName,
                          java.lang.String authorEmail,
                          java.lang.String dateCreated,
                          java.lang.String userInstalled,
                          java.lang.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 | |||||