wt.enterprise
Class CopyRules

java.lang.Object
  extended bywt.enterprise.CopyRules
All Implemented Interfaces:
Externalizable, Serializable

public final class CopyRules
extends Object
implements Externalizable

Used for internal configuring of the copy of WTPart and WTDocument.

Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
private  class CopyRules.CopyRule
           
private  class CopyRules.CopyRuleSet
           
 
Field Summary
private static String CLASSNAME
           
private static String CONTENT
           
private static String COPYRULES
           
static long EXTERNALIZATION_VERSION_UID
           
private static String MADEFROM
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RELATIONSHIP
           
private static String RESOURCE
           
private static String RULEDELIM
           
private  Hashtable rules
           
(package private) static long serialVersionUID
           
private static boolean VERBOSE
           
 
Constructor Summary
CopyRules()
          No arg constructor.
CopyRules(boolean readProperties)
          Create rules.
 
Method Summary
 void addContentRule(Class cls, boolean value)
          Add a rule to some copy rules about whether to copy content or not.
 void addMadeFromRule(Class cls, boolean value)
          Add a rule to some copy rules about whether to the MadeFromLink or not.
 void addRelationship(Class cls, Class value, String role)
          Add a relationship rule to some copy rules.
 boolean getContent(Class cls)
          Get whether a copy should copy the content for the object.
 boolean getMadeFrom(Class cls)
          Get whether a copy should create a MadeFromLink.
 boolean getRelationship(Class cls, Class relationship, String role)
          Get whether a relationship should be copied for this object or not.
 Vector getRelationshipRoles(Class cls, Class relationship)
          Get the roles that are to be copied for this relationship.
 Vector getRelationships(Class cls)
          Get a list of the relationships that the copy should copy for the object.
private  CopyRules.CopyRuleSet getRules(Class cls)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(CopyRules thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

rules

private Hashtable rules

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

MADEFROM

private static final String MADEFROM
See Also:
Constant Field Values

CONTENT

private static final String CONTENT
See Also:
Constant Field Values

RELATIONSHIP

private static final String RELATIONSHIP
See Also:
Constant Field Values

COPYRULES

private static final String COPYRULES
See Also:
Constant Field Values

RULEDELIM

private static String RULEDELIM

VERBOSE

private static boolean VERBOSE
Constructor Detail

CopyRules

public CopyRules()
          throws WTException
No arg constructor. Uses the properties to populate the rules.

Supported API: false

Throws:
WTException

CopyRules

public CopyRules(boolean readProperties)
          throws WTException
Create rules. Use the readProperties flag to determine if the rules should be read from the properties file or left empty.

Supported API: false

Parameters:
readProperties - Whether to initialize the rules to the rules in the properties file or leave them empty. true = read from properties and false = leave them empty.
Throws:
WTException
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(CopyRules thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getMadeFrom

public boolean getMadeFrom(Class cls)
                    throws WTException
Get whether a copy should create a MadeFromLink.

Supported API: false

Parameters:
cls - Object that is to be copied.
Returns:
boolean
Throws:
WTException

getContent

public boolean getContent(Class cls)
                   throws WTException
Get whether a copy should copy the content for the object.

Supported API: false

Parameters:
cls - Object that is to be copied.
Returns:
boolean
Throws:
WTException

getRelationships

public Vector getRelationships(Class cls)
                        throws WTException
Get a list of the relationships that the copy should copy for the object.

Supported API: false

Parameters:
cls - Object that is to be copied.
Returns:
Vector
Throws:
WTException

getRelationship

public boolean getRelationship(Class cls,
                               Class relationship,
                               String role)
                        throws WTException
Get whether a relationship should be copied for this object or not.

Supported API: false

Parameters:
cls - Object that is to be copied.
relationship - Relationship to test whether it should be copied.
role - The role the original wants to copy to the copy.
Returns:
boolean
Throws:
WTException

addMadeFromRule

public void addMadeFromRule(Class cls,
                            boolean value)
                     throws WTException
Add a rule to some copy rules about whether to the MadeFromLink or not.

Supported API: false

Parameters:
cls -
value -
Throws:
WTException

addContentRule

public void addContentRule(Class cls,
                           boolean value)
                    throws WTException
Add a rule to some copy rules about whether to copy content or not.

Supported API: false

Parameters:
cls -
value -
Throws:
WTException

addRelationship

public void addRelationship(Class cls,
                            Class value,
                            String role)
                     throws WTException
Add a relationship rule to some copy rules.

Supported API: false

Parameters:
cls - Class of the object to be copied.
value - Class of the relationship to be copied.
role - The role the original wants to copy to the copy.
Throws:
WTException

getRelationshipRoles

public Vector getRelationshipRoles(Class cls,
                                   Class relationship)
                            throws WTException
Get the roles that are to be copied for this relationship.

Supported API: false

Parameters:
cls - Object that is to be copied.
relationship -
Returns:
Vector
Throws:
WTException

getRules

private CopyRules.CopyRuleSet getRules(Class cls)
                                throws WTException
Throws:
WTException