|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.xml.CmsXmlContentTypeManager
public class CmsXmlContentTypeManager
Manager class for registered OpenCms XML content types and content collectors.
Constructor Summary | |
---|---|
CmsXmlContentTypeManager()
Creates a new content type manager. |
Method Summary | |
---|---|
I_CmsXmlSchemaType |
addContentType(java.lang.Class<?> clazz)
Adds a XML content schema type class to the registered XML content types. |
void |
addSchemaType(java.lang.String className,
java.lang.String defaultWidget)
Adds a new XML content type schema class and XML widget to the manager by class names. |
void |
addWidget(java.lang.String className,
java.lang.String aliasName,
java.lang.String defaultConfiguration)
Adds a XML content editor widget class, making this widget available for the XML content editor. |
static CmsXmlContentTypeManager |
createTypeManagerForTestCases()
Returns a statically initialized instance of an XML content type manager (for test cases only). |
I_CmsXmlContentHandler |
getContentHandler(java.lang.String className,
java.lang.String schemaLocation)
Returns the XML content handler instance class for the specified class name. |
I_CmsXmlSchemaType |
getContentType(org.dom4j.Element typeElement,
java.util.Set<CmsXmlContentDefinition> nestedDefinitions)
Generates an initialized instance of a XML content type definition from the given XML schema element. |
I_CmsXmlSchemaType |
getContentType(java.lang.String typeName)
Returns the content type registered with the given name, or null . |
java.util.List<I_CmsXmlSchemaType> |
getRegisteredSchemaTypes()
Returns an alphabetically sorted list of all configured XML content schema types. |
java.lang.String |
getRegisteredWidgetAlias(java.lang.String className)
Returns the alias for the given Widget class name, may be null if no alias is defined for
the class. |
java.util.List<java.lang.String> |
getRegisteredWidgetNames()
Returns an alphabetically sorted list of the class names of all configured XML widgets. |
I_CmsWidget |
getWidget(java.lang.String name)
Returns an initialized widget class by it's class name or by it's alias. |
I_CmsWidget |
getWidgetDefault(java.lang.String typeName)
Returns the editor widget for the specified XML content type. |
java.lang.String |
getWidgetDefaultConfiguration(I_CmsWidget widget)
Returns the default widget configuration set in opencms-vfs.xml or null if nothing is found. |
java.lang.String |
getWidgetDefaultConfiguration(java.lang.String name)
Returns the default widget configuration set in opencms-vfs.xml or null if nothing is found. |
void |
initialize(CmsObject cms)
Initializes XML content types managed in this XML content type manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CmsXmlContentTypeManager()
Method Detail |
---|
public static CmsXmlContentTypeManager createTypeManagerForTestCases()
public I_CmsXmlSchemaType addContentType(java.lang.Class<?> clazz) throws CmsXmlException
clazz
- the XML content schema type class to add
CmsXmlException
- in case the class is not an instance of I_CmsXmlSchemaType
public void addSchemaType(java.lang.String className, java.lang.String defaultWidget)
className
- class name of the XML content schema type class to adddefaultWidget
- class name of the default XML widget class for the added XML content typepublic void addWidget(java.lang.String className, java.lang.String aliasName, java.lang.String defaultConfiguration)
className
- the widget class to addaliasName
- the (optional) alias name to use for the widget classdefaultConfiguration
- the default configuration of the widgetpublic I_CmsXmlContentHandler getContentHandler(java.lang.String className, java.lang.String schemaLocation) throws CmsXmlException
Only one instance of an XML content handler class per content definition name will be generated, and that instance will be cached and re-used for all operations.
className
- the name of the XML content handler to returnschemaLocation
- the schema location of the XML content definition that handler belongs to
CmsXmlException
- if something goes wrongpublic I_CmsXmlSchemaType getContentType(org.dom4j.Element typeElement, java.util.Set<CmsXmlContentDefinition> nestedDefinitions) throws CmsXmlException
typeElement
- the element to generate the XML content type definition fromnestedDefinitions
- the nested (included) XML content sub-definitions
CmsXmlException
- in case the element does not describe a valid XML content type definitionpublic I_CmsXmlSchemaType getContentType(java.lang.String typeName)
null
.
typeName
- the name to look up the content type for
null
public java.util.List<I_CmsXmlSchemaType> getRegisteredSchemaTypes()
public java.lang.String getRegisteredWidgetAlias(java.lang.String className)
null
if no alias is defined for
the class.
className
- the name of the widget
null
if no alias is defined for
the classpublic java.util.List<java.lang.String> getRegisteredWidgetNames()
public I_CmsWidget getWidget(java.lang.String name)
name
- the class name or alias name to get the widget for
public I_CmsWidget getWidgetDefault(java.lang.String typeName)
typeName
- the name of the XML content type to get the widget for
public java.lang.String getWidgetDefaultConfiguration(I_CmsWidget widget)
opencms-vfs.xml
or null
if nothing is found.
widget
- the widget instance to get the default configuration for
public java.lang.String getWidgetDefaultConfiguration(java.lang.String name)
opencms-vfs.xml
or null
if nothing is found.
name
- the class name or alias name to get the default configuration for
public void initialize(CmsObject cms) throws CmsRoleViolationException
cms
- an initialized OpenCms user context with "Administrator" role permissions
CmsRoleViolationException
- in case the provided OpenCms user context doea not have "Administrator" role permissions
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |