com.arsdigita.cms
Interface ItemCopier


public interface ItemCopier

This is a supplementary class which should only be used in the copyProperty method of CustomCopy implementations. For a more detailed description, see the javadoc on CustomCopy.copyProperty(CustomCopy, Property, ItemCopier).

Note that the copyProperty method must only call copier.copy in order to correctly copy some content item inside the method body. An attempt to call any other method to copy an item may cause disastrous results.

For a correct implementation of the copyProperty method, see ContentItem.copyProperty(CustomCopy, Property, ItemCopier).

There are not, and should not be, any public implementations of this class.

Version:
$Id: //cms/dev/src/com/arsdigita/cms/ItemCopier.java#9 $
Author:
Stanislav Freidin (sfreidin@arsdigita.com)
See Also:
CustomCopy.copyProperty(CustomCopy, Property, ItemCopier)

Field Summary
static int PLAIN_COPY
          Denotes that this instance item copier is used for a regular copy operation
static int VERSION_COPY
           
 
Method Summary
 com.arsdigita.domain.DomainObject copy(CustomCopy source, CustomCopy target, com.arsdigita.domain.DomainObject object, com.arsdigita.persistence.metadata.Property prop)
          Creates a copy, by reference or by value, of the property represented in object.
 com.arsdigita.domain.DomainObject getCopy(com.arsdigita.persistence.OID oid)
          Return a copy of the object identified by the specified OID.
 int getCopyType()
          Return PLAIN_COPY if the particular instance of the item copier is used for making plain copies of the item.
 

Field Detail

PLAIN_COPY

public static final int PLAIN_COPY
Denotes that this instance item copier is used for a regular copy operation

See Also:
Constant Field Values

VERSION_COPY

public static final int VERSION_COPY
See Also:
Constant Field Values
Method Detail

copy

public com.arsdigita.domain.DomainObject copy(CustomCopy source,
                                              CustomCopy target,
                                              com.arsdigita.domain.DomainObject object,
                                              com.arsdigita.persistence.metadata.Property prop)
Creates a copy, by reference or by value, of the property represented in object. When called from within CustomCopy.copyProperty, source will be the source object passed into copyProperty, target will be this, and object will be the object which is to be copied.

Parameters:
source - the DomainObject source (original) object to which this property belongs
target - the new DomainObject copy to which the return value of this method will be attached
object - the DomainObject property being copied
prop - a Property representing object
Returns:
object if prop is not a component or a copy of object it is a component

getCopy

public com.arsdigita.domain.DomainObject getCopy(com.arsdigita.persistence.OID oid)
Return a copy of the object identified by the specified OID. The copy may not exist if the specified OID has not been copied yet; in this case, the method will return null.

This method will typically be used in the ContentItem.copyProperty(ContentItem, String, ItemCopier) method.

Parameters:
oid - the OID of the object whose copy should be retrieved
Returns:
the copy of the specified object, or null if the object has not been copied yet, or if the object is not convertible to a DomainObject.

getCopyType

public int getCopyType()
Return PLAIN_COPY if the particular instance of the item copier is used for making plain copies of the item. Return VERSION_COPY id the copier is used to create live versions for draft items.



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2352 UTC