org.opencms.configuration
Class CmsConfigurationCopyResource

java.lang.Object
  extended by org.opencms.configuration.CmsConfigurationCopyResource

public class CmsConfigurationCopyResource
extends java.lang.Object

Describes a resource to copy during the creation of a new resource.

Usually used in folder types to copy some default resources to the folder, but also usable for file resources.

Since:
6.0.0
Version:
$Revision: 1.14 $
Author:
Alexander Kandzior

Field Summary
static java.lang.String COPY_AS_NEW
          Indicates "copy resources" should be copied with type CmsResource.COPY_AS_NEW.
static java.lang.String COPY_AS_PRESERVE
          Indicates "copy resources" should be copied with type CmsResource.COPY_PRESERVE_SIBLING.
static java.lang.String COPY_AS_SIBLING
          Indicates "copy resources" should be copied with type CmsResource.COPY_AS_SIBLING.
 
Constructor Summary
CmsConfigurationCopyResource(java.lang.String source, java.lang.String target, java.lang.String type)
          Creates a new copy resource info container.
 
Method Summary
 java.lang.String getSource()
          Returns the source resource.
 java.lang.String getTarget()
          Returns the target resource (may contain macros).
 CmsResource.CmsResourceCopyMode getType()
          Returns the type of the copy, for example "as new", "as sibling" etc.
 java.lang.String getTypeString()
          Returns the copy type as String.
 boolean isTargetWasNull()
          Returns true if the original target configuration was null.
 boolean isTypeWasNull()
          Returns true if the original type configuration was null.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPY_AS_NEW

public static final java.lang.String COPY_AS_NEW
Indicates "copy resources" should be copied with type CmsResource.COPY_AS_NEW.

See Also:
Constant Field Values

COPY_AS_PRESERVE

public static final java.lang.String COPY_AS_PRESERVE
Indicates "copy resources" should be copied with type CmsResource.COPY_PRESERVE_SIBLING.

See Also:
Constant Field Values

COPY_AS_SIBLING

public static final java.lang.String COPY_AS_SIBLING
Indicates "copy resources" should be copied with type CmsResource.COPY_AS_SIBLING.

See Also:
Constant Field Values
Constructor Detail

CmsConfigurationCopyResource

public CmsConfigurationCopyResource(java.lang.String source,
                                    java.lang.String target,
                                    java.lang.String type)
Creates a new copy resource info container.

If target is null, the macro A_CmsResourceType.MACRO_RESOURCE_FOLDER_PATH is used as default. If type is null, the copy type CmsResource.COPY_AS_NEW is used as default.

Parameters:
source - the source resource
target - the target resource (may contain macros)
type - the type of the copy, for example "as new", "as sibling" etc
Method Detail

getSource

public java.lang.String getSource()
Returns the source resource.

Returns:
the source resource

getTarget

public java.lang.String getTarget()
Returns the target resource (may contain macros).

Returns:
the target resource (may contain macros)

getType

public CmsResource.CmsResourceCopyMode getType()
Returns the type of the copy, for example "as new", "as sibling" etc.

Possible types are CmsResource.COPY_AS_NEW, CmsResource.COPY_AS_SIBLING and CmsResource.COPY_PRESERVE_SIBLING.

Returns:
the type of the copy, for example "as new", "as sibling" etc

getTypeString

public java.lang.String getTypeString()
Returns the copy type as String.

Returns:
the copy type as String
See Also:
getType()

isTargetWasNull

public boolean isTargetWasNull()
Returns true if the original target configuration was null.

Returns:
true if the original target configuration was null

isTypeWasNull

public boolean isTypeWasNull()
Returns true if the original type configuration was null.

Returns:
true if the original type configuration was null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()