org.opencms.file.types
Class A_CmsResourceTypeLinkParseable

java.lang.Object
  extended by org.opencms.file.types.A_CmsResourceType
      extended by org.opencms.file.types.A_CmsResourceTypeLinkParseable
All Implemented Interfaces:
I_CmsConfigurationParameterHandler, I_CmsResourceType, I_CmsLinkParseable
Direct Known Subclasses:
CmsResourceTypeJsp, CmsResourceTypeXmlContent, CmsResourceTypeXmlPage

public abstract class A_CmsResourceTypeLinkParseable
extends A_CmsResourceType
implements I_CmsLinkParseable

Base implementation for resource types implementing the I_CmsLinkParseable interface.

Since:
6.5.0
Version:
$Revision: 1.1.2.9 $
Author:
Michael Moossen

Field Summary
 
Fields inherited from class org.opencms.file.types.A_CmsResourceType
m_addititionalModuleResourceType, m_className, m_copyResources, m_defaultProperties, m_frozen, m_mappings, m_typeId, m_typeName, MACRO_RESOURCE_FOLDER_PATH, MACRO_RESOURCE_NAME, MACRO_RESOURCE_PARENT_PATH, MACRO_RESOURCE_ROOT_PATH, MACRO_RESOURCE_SITE_PATH
 
Fields inherited from interface org.opencms.file.types.I_CmsResourceType
ADD_MAPPING_METHOD, ADD_RESOURCE_TYPE_METHOD, CONFIGURATION_PROPERTY_CREATE, CONFIGURATION_RESOURCE_TYPE_ID, CONFIGURATION_RESOURCE_TYPE_NAME, PROPERTY_ON_RESOURCE, PROPERTY_ON_STRUCTURE
 
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
 
Constructor Summary
A_CmsResourceTypeLinkParseable()
          Default constructor.
 
Method Summary
 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 properties)
          Creates a new resource of the given resource type with the provided content and properties.
 CmsResource createSibling(CmsObject cms, CmsSecurityManager securityManager, CmsResource source, java.lang.String destination, java.util.List properties)
          Creates a new sibling of the source resource.
 boolean isDirectEditable()
          Returns true if this resource type is direct editable.
 void moveResource(CmsObject cms, CmsSecurityManager securityManager, CmsResource resource, java.lang.String destination)
          Moves a resource to the given destination.
 
Methods inherited from class org.opencms.file.types.A_CmsResourceType
addConfigurationParameter, addCopyResource, addDefaultProperty, addMappingType, changeLock, chflags, chtype, copyResourceToProject, createRelations, deleteResource, getCachePropertyDefault, getClassName, getConfiguration, getConfiguredCopyResources, getConfiguredDefaultProperties, getConfiguredMappings, getLoaderId, getMacroResolver, getResourceType, getTypeId, getTypeName, importResource, initConfiguration, initConfiguration, initConfiguration, initialize, isAdditionalModuleResourceType, isFolder, lockResource, processCopyResources, processDefaultProperties, removeResourceFromProject, replaceResource, restoreResource, restoreResourceBackup, setAdditionalModuleResourceType, setDateExpired, setDateLastModified, setDateReleased, toString, undelete, undoChanges, unlockResource, updateRelationForUndo, writeFile, writePropertyObject, writePropertyObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opencms.relations.I_CmsLinkParseable
parseLinks
 

Constructor Detail

A_CmsResourceTypeLinkParseable

public A_CmsResourceTypeLinkParseable()
Default constructor.

Method Detail

copyResource

public void copyResource(CmsObject cms,
                         CmsSecurityManager securityManager,
                         CmsResource source,
                         java.lang.String destination,
                         CmsResource.CmsResourceCopyMode siblingMode)
                  throws CmsException
Description copied from interface: I_CmsResourceType
Copies a resource.

You 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:

Specified by:
copyResource in interface I_CmsResourceType
Overrides:
copyResource in class A_CmsResourceType
Parameters:
cms - the initialized CmsObject
securityManager - the initialized OpenCms security manager
source - the resource to copy
destination - the name of the copy destination with complete path
siblingMode - indicates how to handle siblings during copy
Throws:
CmsException - if something goes wrong
See Also:
I_CmsResourceType.copyResource(org.opencms.file.CmsObject, CmsSecurityManager, CmsResource, java.lang.String, CmsResource.CmsResourceCopyMode)

createResource

public CmsResource createResource(CmsObject cms,
                                  CmsSecurityManager securityManager,
                                  java.lang.String resourcename,
                                  byte[] content,
                                  java.util.List properties)
                           throws CmsException
Description copied from interface: I_CmsResourceType
Creates a new resource of the given resource type with the provided content and properties.

Specified by:
createResource in interface I_CmsResourceType
Overrides:
createResource in class A_CmsResourceType
Parameters:
cms - the initialized CmsObject
securityManager - the initialized OpenCms security manager
resourcename - the name of the resource to create (full path)
content - the content for the new resource
properties - the properties for the new resource
Returns:
the created resource
Throws:
CmsException - if something goes wrong
See Also:
I_CmsResourceType.createResource(org.opencms.file.CmsObject, CmsSecurityManager, java.lang.String, byte[], List)

createSibling

public CmsResource createSibling(CmsObject cms,
                                 CmsSecurityManager securityManager,
                                 CmsResource source,
                                 java.lang.String destination,
                                 java.util.List properties)
                          throws CmsException
Description copied from interface: I_CmsResourceType
Creates a new sibling of the source resource.

Specified by:
createSibling in interface I_CmsResourceType
Overrides:
createSibling in class A_CmsResourceType
Parameters:
cms - the current cms context
securityManager - the initialized OpenCms security manager
source - the resource to create a sibling for
destination - the name of the sibling to create with complete path
properties - the individual properties for the new sibling
Returns:
the new created sibling
Throws:
CmsException - if something goes wrong
See Also:
I_CmsResourceType.createSibling(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, CmsResource, java.lang.String, java.util.List)

isDirectEditable

public boolean isDirectEditable()
Description copied from interface: I_CmsResourceType
Returns true if this resource type is direct editable.

Specified by:
isDirectEditable in interface I_CmsResourceType
Overrides:
isDirectEditable in class A_CmsResourceType
Returns:
true if this resource type is direct editable
See Also:
I_CmsResourceType.isDirectEditable()

moveResource

public void moveResource(CmsObject cms,
                         CmsSecurityManager securityManager,
                         CmsResource resource,
                         java.lang.String destination)
                  throws CmsException,
                         CmsIllegalArgumentException
Description copied from interface: I_CmsResourceType
Moves a resource to the given destination.

A 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.

Specified by:
moveResource in interface I_CmsResourceType
Overrides:
moveResource in class A_CmsResourceType
Parameters:
cms - the current cms context
securityManager - the initialized OpenCms security manager
resource - the resource to move
destination - the destination resource name
Throws:
CmsException - if something goes wrong
CmsIllegalArgumentException - if the source argument is null or of length 0
See Also:
I_CmsResourceType.moveResource(org.opencms.file.CmsObject, org.opencms.db.CmsSecurityManager, org.opencms.file.CmsResource, java.lang.String)