public class CmsResourceTypeXmlContent extends A_CmsResourceTypeLinkParseable
I_CmsResourceType.Formatter| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONFIGURATION_SCHEMA
Configuration key for the (optional) schema.
|
static java.lang.String |
DIALOG_CHOOSEMODEL
The name for the choose model file form action.
|
CONFIGURATION_GALLERY_JAVASCRIPT_PATH, CONFIGURATION_GALLERY_PREVIEW_PROVIDER, CONFIGURATION_GALLERY_TYPE_NAMES, CONFIGURATION_INTERNAL, DEFAULT_GALLERY_PREVIEW_PROVIDER, m_addititionalModuleResourceType, m_className, m_configuration, m_copyResources, m_defaultProperties, m_frozen, m_galleryPreviewProvider, m_mappings, m_moduleName, m_typeId, m_typeName, MACRO_RESOURCE_FOLDER_PATH, MACRO_RESOURCE_FOLDER_PATH_TOUCH, MACRO_RESOURCE_NAME, MACRO_RESOURCE_PARENT_PATH, MACRO_RESOURCE_ROOT_PATH, MACRO_RESOURCE_SITE_PATHADD_MAPPING_METHOD, ADD_RESOURCE_TYPE_METHOD, CONFIGURATION_PROPERTY_CREATE, CONFIGURATION_RESOURCE_TYPE_ID, CONFIGURATION_RESOURCE_TYPE_NAME, PROPERTY_ON_RESOURCE, PROPERTY_ON_STRUCTUREADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD| Constructor and Description |
|---|
CmsResourceTypeXmlContent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigurationParameter(java.lang.String paramName,
java.lang.String paramValue)
Adds a configuration parameter to this parameter configurable class instance.
|
CmsResource |
createResource(CmsObject cms,
CmsSecurityManager securityManager,
java.lang.String resourcename,
byte[] content,
java.util.List<CmsProperty> properties)
Creates a new resource of the given resource type
with the provided content and properties.
|
void |
deleteResource(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
CmsResource.CmsResourceDeleteMode siblingMode)
Deletes a resource given its name.
|
java.lang.String |
getCachePropertyDefault()
Returns the default for the
cache property setting of this resource type. |
CmsParameterConfiguration |
getConfiguration()
Returns the parameters of this configurable class instance,
or
null if the class does not need any parameters. |
I_CmsEditHandler |
getEditHandler(CmsObject cms)
Returns the edit handler if configured.
|
CmsFormatterConfiguration |
getFormattersForResource(CmsObject cms,
CmsResource resource)
Returns the formatter configuration for the given resource.
|
java.lang.String |
getGalleryPreviewProvider()
Returns the gallery preview provider class name.
|
int |
getLoaderId()
Returns the loader type id of this resource type.
|
protected java.util.Locale |
getLocaleForNewContent(CmsObject cms,
CmsSecurityManager securityManager,
java.lang.String resourcename,
java.util.List<CmsProperty> properties)
Gets the locale which should be used for creating an empty content.
|
static java.util.List<CmsResource> |
getModelFiles(CmsObject cms,
java.lang.String currentFolder,
java.lang.String newResourceTypeName)
Returns the possible model files for the new resource.
|
java.lang.String |
getSchema()
Returns the configured xsd schema uri.
|
protected CmsLink |
getXsdLink(CmsObject cms,
CmsXmlContent xmlContent)
Creates a new link object for the schema definition.
|
void |
initialize(CmsObject cms)
Initializes this resource type.
|
static boolean |
isXmlContent(CmsResource resource)
Returns
true in case the given resource is an XML content. |
void |
moveResource(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
java.lang.String destination)
Moves a resource to the given destination.
|
java.util.List<CmsLink> |
parseLinks(CmsObject cms,
CmsFile file)
Returns a list of all links from the specified file.
|
CmsFile |
writeFile(CmsObject cms,
CmsSecurityManager securityManager,
CmsFile resource)
Writes a resource, including it's content.
|
isDirectEditableaddCopyResource, addDefaultProperty, addMappingType, changeLock, chflags, chtype, chtype, copyResource, copyResourceToProject, createRelations, createSibling, equals, getAdjustLinksFolder, getClassName, getConfiguredCopyResources, getConfiguredDefaultProperties, getConfiguredMappings, getGalleryTypes, getMacroResolver, getModuleName, getResourceType, getTypeId, getTypeName, hashCode, importResource, initConfiguration, initConfiguration, isAdditionalModuleResourceType, isFolder, isIdentical, lockResource, processCopyResources, processDefaultProperties, removeResourceFromProject, replaceResource, replaceResource, restoreResource, setAdditionalModuleResourceType, setAdjustLinksFolder, setDateExpired, setDateLastModified, setDateReleased, setModuleName, toString, undelete, undoChanges, unlockResource, updateRelationForUndo, writePropertyObject, writePropertyObjectspublic static final java.lang.String CONFIGURATION_SCHEMA
public static final java.lang.String DIALOG_CHOOSEMODEL
public CmsResourceTypeXmlContent()
public static java.util.List<CmsResource> getModelFiles(CmsObject cms, java.lang.String currentFolder, java.lang.String newResourceTypeName)
cms - the current users context to work withcurrentFolder - the foldernewResourceTypeName - the resource type name for the new resource to createpublic static boolean isXmlContent(CmsResource resource)
true in case the given resource is an XML content.resource - the resource to checktrue in case the given resource is an XML contentpublic void addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
I_CmsConfigurationParameterHandleraddConfigurationParameter in interface I_CmsConfigurationParameterHandleraddConfigurationParameter in class A_CmsResourceTypeparamName - the name of the parameterparamValue - the value for the parameterA_CmsResourceType.addConfigurationParameter(java.lang.String, java.lang.String)public CmsResource createResource(CmsObject cms, CmsSecurityManager securityManager, java.lang.String resourcename, byte[] content, java.util.List<CmsProperty> properties) throws CmsException
I_CmsResourceTypecreateResource in interface I_CmsResourceTypecreateResource in class A_CmsResourceTypecms - the initialized CmsObjectsecurityManager - the initialized OpenCms security managerresourcename - the name of the resource to create (full path)content - the content for the new resourceproperties - the properties for the new resourceCmsException - if something goes wrongI_CmsResourceType.createResource(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, java.lang.String, byte[], java.util.List)public void deleteResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, CmsResource.CmsResourceDeleteMode siblingMode) throws CmsException
I_CmsResourceType
The siblingMode parameter controls how to handle siblings
during the delete operation.
Possible values for this parameter are:
deleteResource in interface I_CmsResourceTypedeleteResource in class A_CmsResourceTypecms - the initialized CmsObjectsecurityManager - the initialized OpenCms security managerresource - the resource to deletesiblingMode - indicates how to handle siblings of the deleted resourceCmsException - if something goes wrongA_CmsResourceType.deleteResource(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, org.opencms.file.CmsResource, org.opencms.file.CmsResource.CmsResourceDeleteMode)public java.lang.String getCachePropertyDefault()
I_CmsResourceTypecache property setting of this resource type.
The cache property is used by the Flex cache implementation
to build the cache key that controls the caching behaviour of a resource.
If null is returnd, this is the same as turning the cache
off by default for this resource type.
getCachePropertyDefault in interface I_CmsResourceTypegetCachePropertyDefault in class A_CmsResourceTypecache property setting of this resource typeI_CmsResourceType.getCachePropertyDefault()public CmsParameterConfiguration getConfiguration()
I_CmsConfigurationParameterHandlernull if the class does not need any parameters.getConfiguration in interface I_CmsConfigurationParameterHandlergetConfiguration in class A_CmsResourceTypenull if the class does not need any parametersA_CmsResourceType.getConfiguration()public I_CmsEditHandler getEditHandler(CmsObject cms)
cms - the cms contextpublic CmsFormatterConfiguration getFormattersForResource(CmsObject cms, CmsResource resource)
I_CmsResourceTypegetFormattersForResource in interface I_CmsResourceTypegetFormattersForResource in class A_CmsResourceTypecms - the current cms contextresource - the resource to get the formatter configuration forA_CmsResourceType.getFormattersForResource(org.opencms.file.CmsObject, org.opencms.file.CmsResource)public java.lang.String getGalleryPreviewProvider()
I_CmsResourceTypegetGalleryPreviewProvider in interface I_CmsResourceTypegetGalleryPreviewProvider in class A_CmsResourceTypeA_CmsResourceType.getGalleryPreviewProvider()public int getLoaderId()
I_CmsResourceTypegetLoaderId in interface I_CmsResourceTypegetLoaderId in class A_CmsResourceTypeI_CmsResourceType.getLoaderId()public java.lang.String getSchema()
null if not setpublic void initialize(CmsObject cms)
I_CmsResourceTypeThis method will be called once during the OpenCms initialization processs. The VFS will already be available at the time the method is called.
initialize in interface I_CmsResourceTypeinitialize in class A_CmsResourceTypecms - a OpenCms context initialized with "Admin" permissionsA_CmsResourceType.initialize(org.opencms.file.CmsObject)public void moveResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, java.lang.String destination) throws CmsException, CmsIllegalArgumentException
I_CmsResourceTypeA move operation in OpenCms is always a copy (as sibling) followed by a delete, this is a result of the online/offline structure of the OpenCms VFS. This way you can see the deleted files/folders in the offline project, and you will be unable to undelete them.
moveResource in interface I_CmsResourceTypemoveResource in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the resource to movedestination - the destination resource nameCmsException - if something goes wrongCmsIllegalArgumentException - if the source argument is null or of length 0A_CmsResourceType.moveResource(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, org.opencms.file.CmsResource, java.lang.String)public java.util.List<CmsLink> parseLinks(CmsObject cms, CmsFile file)
I_CmsLinkParseable
Implementations of this method must return an empty list, or better
Collections.EMPTY_LIST, if no link is found at all.
Implementations of this method should return the list of links including internal (OpenCms VFS) and external links (http, https, mailto, ftp, etc.).
cms - the current user's contextfile - the file to be parsedCmsLink objects with the URIs of all linked resourcesI_CmsLinkParseable.parseLinks(org.opencms.file.CmsObject, org.opencms.file.CmsFile)public CmsFile writeFile(CmsObject cms, CmsSecurityManager securityManager, CmsFile resource) throws CmsException
I_CmsResourceType
Applies only to resources of type
that have a binary content attached.CmsFile
writeFile in interface I_CmsResourceTypewriteFile in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the resource to apply this operation toCmsException - if something goes wrongI_CmsResourceType.writeFile(org.opencms.file.CmsObject, CmsSecurityManager, CmsFile)protected java.util.Locale getLocaleForNewContent(CmsObject cms, CmsSecurityManager securityManager, java.lang.String resourcename, java.util.List<CmsProperty> properties)
cms - the current CMS contextsecurityManager - the security managerresourcename - the name of the resource to createproperties - the properties for the resource to createprotected CmsLink getXsdLink(CmsObject cms, CmsXmlContent xmlContent)
cms - the current CMS contextxmlContent - the xml content to crete the link for