com.arsdigita.cms.lifecycle
Class PhaseDefinition

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.cms.lifecycle.PhaseDefinition

public class PhaseDefinition
extends com.arsdigita.kernel.ACSObject

Definition for a phase in a publication life lifecycle.

Version:
$Revision: #10 $ $Date: 2004/04/07 $
Author:
Jack Chung (flattop@arsdigita.com), Michael Pih (pihman@arsdigita.com), Xixi D'Moon (xdmoon@arsdigita.com)

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
protected static String DEFAULT_DELAY
           
protected static String DEFAULT_DURATION
           
protected static String DEFAULT_LISTENER
           
protected static String DESCRIPTION
           
protected static String LABEL
           
protected static String LIFECYCLE_DEFINITION
           
static String versionId
           
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
protected PhaseDefinition()
          If this constructor is used, the lifecycle definition needs to be set with the setLifecycleDefinition method.
  PhaseDefinition(BigDecimal id)
          Constructor.
  PhaseDefinition(com.arsdigita.persistence.DataObject obj)
           
  PhaseDefinition(com.arsdigita.persistence.OID oid)
          Constructor.
protected PhaseDefinition(String type)
           
 
Method Summary
 String getBaseDataObjectType()
           
 Integer getDefaultDelay()
          Get the default delay for the start of this phase definition in minutes relative to the publish date.
 Integer getDefaultDuration()
          Get the default duration for this phase definition in minutes.
 String getDefaultListener()
           
 String getDescription()
           
 String getLabel()
           
 LifecycleDefinition getLifecycleDefinition()
           
 void setDefaultDelay(Integer minutes)
          Set the default delay for the start of this phase definition in minutes relative to the publish date.
 void setDefaultDelay(Integer days, Integer hours, Integer minutes)
          Set the default delay for the start of this phase definition relative to the publish date.
 void setDefaultDuration(Integer minutes)
          Set the default duration for this phase definition.
 void setDefaultDuration(Integer days, Integer hours, Integer minutes)
          Set the default duration for this phase definition.
 void setDefaultListener(String listener)
           
 void setDescription(String description)
           
 void setLabel(String label)
           
protected  void setLifecycleDefinition(LifecycleDefinition lifecycleDefinition)
          Update the associated LifecycleDefinition.
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

LABEL

protected static final String LABEL
See Also:
Constant Field Values

DESCRIPTION

protected static final String DESCRIPTION
See Also:
Constant Field Values

DEFAULT_DELAY

protected static final String DEFAULT_DELAY
See Also:
Constant Field Values

DEFAULT_DURATION

protected static final String DEFAULT_DURATION
See Also:
Constant Field Values

DEFAULT_LISTENER

protected static final String DEFAULT_LISTENER
See Also:
Constant Field Values

LIFECYCLE_DEFINITION

protected static final String LIFECYCLE_DEFINITION
See Also:
Constant Field Values
Constructor Detail

PhaseDefinition

protected PhaseDefinition()
If this constructor is used, the lifecycle definition needs to be set with the setLifecycleDefinition method.


PhaseDefinition

public PhaseDefinition(com.arsdigita.persistence.OID oid)
                throws com.arsdigita.domain.DataObjectNotFoundException
Constructor. The contained DataObject is retrieved from the persistent storage mechanism with an OID specified by oid.

Parameters:
oid - The OID for the retrieved DataObject.

PhaseDefinition

public PhaseDefinition(BigDecimal id)
                throws com.arsdigita.domain.DataObjectNotFoundException
Constructor. The contained DataObject is retrieved from the persistent storage mechanism with an OID specified by id and PhaseDefinition.BASE_DATA_OBJECT_TYPE.

Parameters:
id - The id for the retrieved DataObject.

PhaseDefinition

public PhaseDefinition(com.arsdigita.persistence.DataObject obj)

PhaseDefinition

protected PhaseDefinition(String type)
Method Detail

getBaseDataObjectType

public String getBaseDataObjectType()
Returns:
the base PDL object type for this definition. Child classes should override this method to return the correct value

getLabel

public String getLabel()

setLabel

public void setLabel(String label)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getDefaultDelay

public Integer getDefaultDelay()
Get the default delay for the start of this phase definition in minutes relative to the publish date.

Warning:Before 5.2, the return value used to be in milliseconds, rather than minutes.


setDefaultDelay

public void setDefaultDelay(Integer minutes)
Set the default delay for the start of this phase definition in minutes relative to the publish date. A null value is the same as 0.

Warning:Before 5.2, the passed in parameter used to be in milliseconds, rather than minutes.

2002-12-06 Note: If you are running on Postgres, the value minutes must fit in an int, which limits your maximum default delay to 4081 years, give or take a few months.


setDefaultDelay

public void setDefaultDelay(Integer days,
                            Integer hours,
                            Integer minutes)
Set the default delay for the start of this phase definition relative to the publish date. A null value is the same as 0. This is a convenience wrapper around setDefaultDelay(Integer).

Parameters:
days - number of days
hours - number of hours
minutes - number of minutes

getDefaultDuration

public Integer getDefaultDuration()
Get the default duration for this phase definition in minutes. A null value is returned if this phase definition never ends.

Warning:Before 5.2, the return value used to be in milliseconds, rather than minutes.


setDefaultDuration

public void setDefaultDuration(Integer minutes)
Set the default duration for this phase definition. Pass in null if this phase definition never ends.

Warning:Before 5.2, the passed in parameter used to be in milliseconds, rather than minutes.

2002-12-06 Note: If you are running on Postgres, the value minutes must fit in an int, which limits your maximum default duration to 4081 years, give or take a few months.


setDefaultDuration

public void setDefaultDuration(Integer days,
                               Integer hours,
                               Integer minutes)
Set the default duration for this phase definition. Pass in nulls if this phase definition never ends. This is a convenience wrapper around setDefaultDuration(Integer).

Parameters:
days - number of days
hours - number of hours
minutes - number of minutes

getDefaultListener

public String getDefaultListener()

setDefaultListener

public void setDefaultListener(String listener)

getLifecycleDefinition

public LifecycleDefinition getLifecycleDefinition()

setLifecycleDefinition

protected void setLifecycleDefinition(LifecycleDefinition lifecycleDefinition)
Update the associated LifecycleDefinition. Every PhaseDefinition needs to be associated with a LifecycleDefinition. If this phase definition does not belong to any lifecycle definition, then this phase definition should be removed by calling the DomainObject.delete() method.



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