public abstract class A_CmsResourceTypeFolderBase extends A_CmsResourceType
I_CmsResourceType.FormatterCONFIGURATION_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 |
|---|
A_CmsResourceTypeFolderBase()
Default constructor, used to initialize member variables.
|
| Modifier and Type | Method and Description |
|---|---|
void |
chtype(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource filename,
int newType)
Changes the resource type of a resource.
|
void |
copyResource(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource source,
java.lang.String destination,
CmsResource.CmsResourceCopyMode siblingMode)
Copies a resource.
|
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.
|
int |
getLoaderId()
Returns the loader type id of this resource type.
|
boolean |
isFolder()
Returns
true if this resource type is a folder. |
void |
moveResource(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
java.lang.String destination)
Moves a resource to the given destination.
|
void |
replaceResource(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
int type,
byte[] content,
java.util.List<CmsProperty> properties)
Replaces the content, type and properties of a resource.
|
void |
setDateExpired(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
long dateLastModified,
boolean recursive)
Changes the "expire" date of a resource.
|
void |
setDateLastModified(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
long dateLastModified,
boolean recursive)
Changes the "last modified" date of a resource.
|
void |
setDateReleased(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
long dateLastModified,
boolean recursive)
Changes the "release" date of a resource.
|
void |
undelete(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
boolean recursive)
Undeletes a resource.
|
void |
undoChanges(CmsObject cms,
CmsSecurityManager securityManager,
CmsResource resource,
CmsResource.CmsResourceUndoMode mode)
Undos all changes in the resource by restoring the version from the
online project to the current offline project.
|
addConfigurationParameter, addCopyResource, addDefaultProperty, addMappingType, changeLock, chflags, chtype, copyResourceToProject, createRelations, createSibling, deleteResource, equals, getAdjustLinksFolder, getCachePropertyDefault, getClassName, getConfiguration, getConfiguredCopyResources, getConfiguredDefaultProperties, getConfiguredMappings, getFormattersForResource, getGalleryPreviewProvider, getGalleryTypes, getMacroResolver, getModuleName, getResourceType, getTypeId, getTypeName, hashCode, importResource, initConfiguration, initConfiguration, initialize, isAdditionalModuleResourceType, isDirectEditable, isIdentical, lockResource, processCopyResources, processDefaultProperties, removeResourceFromProject, replaceResource, restoreResource, setAdditionalModuleResourceType, setAdjustLinksFolder, setModuleName, toString, unlockResource, updateRelationForUndo, writeFile, writePropertyObject, writePropertyObjectspublic A_CmsResourceTypeFolderBase()
public void chtype(CmsObject cms, CmsSecurityManager securityManager, CmsResource filename, int newType) throws CmsException, CmsDataNotImplementedException
I_CmsResourceTypeOpenCms handles resources according to the resource type, not the file suffix. This is e.g. why a JSP in OpenCms can have the suffix ".html" instead of ".jsp" only. Changing the resource type makes sense e.g. if you want to make a plain text file a JSP resource, or a binary file an image, etc.
chtype in interface I_CmsResourceTypechtype in class A_CmsResourceTypecms - the initialized CmsObjectsecurityManager - the initialized OpenCms security managerfilename - the resource to change the type fornewType - the new resource type for this resourceCmsException - if something goes wrongCmsDataNotImplementedExceptionI_CmsResourceType.chtype(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, int)public void copyResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource source, java.lang.String destination, CmsResource.CmsResourceCopyMode siblingMode) throws CmsIllegalArgumentException, CmsException
I_CmsResourceTypeYou must ensure that the destination path is an absolute, valid and existing VFS path. Relative paths from the source are currently not supported.
The copied resource will always be locked to the current user after the copy operation.
In case the target resource already exists, it is overwritten with the source resource.
The siblingMode parameter controls how to handle siblings
during the copy operation.
Possible values for this parameter are:
copyResource in interface I_CmsResourceTypecopyResource in class A_CmsResourceTypecms - the initialized CmsObjectsecurityManager - the initialized OpenCms security managersource - the resource to copydestination - the name of the copy destination with complete pathsiblingMode - indicates how to handle siblings during copyCmsIllegalArgumentException - if the destination argument is null or of length 0CmsException - if something goes wrongI_CmsResourceType.copyResource(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, java.lang.String, CmsResource.CmsResourceCopyMode)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, CmsSecurityManager, java.lang.String, byte[], List)public int getLoaderId()
I_CmsResourceTypegetLoaderId in interface I_CmsResourceTypegetLoaderId in class A_CmsResourceTypeI_CmsResourceType.getLoaderId()public boolean isFolder()
I_CmsResourceTypetrue if this resource type is a folder.isFolder in interface I_CmsResourceTypeisFolder in class A_CmsResourceTypetrue if this resource type is a folderA_CmsResourceType.isFolder()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 0I_CmsResourceType.moveResource(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, org.opencms.file.CmsResource, java.lang.String)public void replaceResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, int type, byte[] content, java.util.List<CmsProperty> properties) throws CmsException, CmsDataNotImplementedException
I_CmsResourceTypereplaceResource in interface I_CmsResourceTypereplaceResource in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the name of the resource to replacetype - the new type of the resourcecontent - the new content of the resourceproperties - the new properties of the resourceCmsException - if something goes wrongCmsDataNotImplementedExceptionI_CmsResourceType.replaceResource(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, int, byte[], List)public void setDateExpired(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, long dateLastModified, boolean recursive) throws CmsException
I_CmsResourceTypesetDateExpired in interface I_CmsResourceTypesetDateExpired in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the resource to touchdateLastModified - the new expire date of the changed resourcerecursive - if this operation is to be applied recursively to all resources in a folderCmsException - if something goes wrongI_CmsResourceType.setDateExpired(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, long, boolean)public void setDateLastModified(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, long dateLastModified, boolean recursive) throws CmsException
I_CmsResourceTypesetDateLastModified in interface I_CmsResourceTypesetDateLastModified in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the resource to touchdateLastModified - timestamp the new timestamp of the changed resourcerecursive - if this operation is to be applied recursively to all resources in a folderCmsException - if something goes wrongI_CmsResourceType.setDateLastModified(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, long, boolean)public void setDateReleased(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, long dateLastModified, boolean recursive) throws CmsException
I_CmsResourceTypesetDateReleased in interface I_CmsResourceTypesetDateReleased in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the resource to touchdateLastModified - the new release date of the changed resourcerecursive - if this operation is to be applied recursively to all resources in a folderCmsException - if something goes wrongI_CmsResourceType.setDateReleased(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, long, boolean)public void undelete(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, boolean recursive) throws CmsException
I_CmsResourceTypeOnly resources that have already been published once can be undeleted, if a "new" resource is deleted it can not be undeleted.
undelete in interface I_CmsResourceTypeundelete in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the resource to undeleterecursive - if this operation is to be applied recursively to all resources in a folderCmsException - if something goes wrongA_CmsResourceType.undelete(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, org.opencms.file.CmsResource, boolean)public void undoChanges(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, CmsResource.CmsResourceUndoMode mode) throws CmsException
I_CmsResourceTypeundoChanges in interface I_CmsResourceTypeundoChanges in class A_CmsResourceTypecms - the current cms contextsecurityManager - the initialized OpenCms security managerresource - the resource to undo the changes formode - the undo mode, one of the CmsResource.CmsResourceUndoMode#UNDO_XXX constantsCmsException - if something goes wrongI_CmsResourceType.undoChanges(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, CmsResource.CmsResourceUndoMode)