com.arsdigita.cms.lifecycle
Class LifecycleDefinition

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

public class LifecycleDefinition
extends com.arsdigita.kernel.ACSObject

Definition for a publication lifecycle. Associated with each cycle definition is a set of phase definition. Each phase definition can only be associated with one cycle definition. To remove the a phase definition from this cycle definition, call the delete() method on that particular phase definition

Version:
$Revision: #13 $ $Date: 2004/04/07 $
Author:
Jack Chung (flattop@arsdigita.com), Michael Pih (pihman@arsdigita.com)

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
protected static String DEFAULT_LISTENER
           
protected static String DESCRIPTION
           
protected static String LABEL
           
protected static String PHASE_DEFINITIONS
           
static String versionId
           
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
  LifecycleDefinition()
          Default constructor.
  LifecycleDefinition(BigDecimal id)
          Constructor.
  LifecycleDefinition(com.arsdigita.persistence.DataObject obj)
           
  LifecycleDefinition(com.arsdigita.persistence.OID oid)
          Constructor.
protected LifecycleDefinition(String type)
           
 
Method Summary
 PhaseDefinition addPhaseDefinition()
          Add a phase definition to this lifecycle definition.
 PhaseDefinition addPhaseDefinition(String label, String description, Integer delay, Integer duration, String defaultListener)
          Add a phase definition to this lifecycle definition.
 Lifecycle createFullLifecycle(Date startDate, String listenerClassName)
          Creates and returns a cycle using this lifecycle definition; then, populates the lifecycle with phases and saves it.
 Lifecycle createFullLifecycle(String listenerClassName)
          Creates and returns a cycle using this lifecycle definition; then, populates the lifecycle with phases and saves it.
 Lifecycle createLifecycle()
          Creates and returns a cycle using this lifecycle definition.
 String getBaseDataObjectType()
           
 String getDefaultListener()
           
 String getDescription()
           
 String getLabel()
           
 PhaseDefinitionCollection getPhaseDefinitions()
          Get the phase definitions for this lifecycle definition.
 void setDefaultListener(String listener)
           
 void setDescription(String description)
           
 void setLabel(String label)
           
 
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_LISTENER

protected static final String DEFAULT_LISTENER
See Also:
Constant Field Values

PHASE_DEFINITIONS

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

LifecycleDefinition

public LifecycleDefinition()
Default constructor. This creates a new life cycle definition.


LifecycleDefinition

public LifecycleDefinition(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.

LifecycleDefinition

public LifecycleDefinition(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 LifecycleDefinition.BASE_DATA_OBJECT_TYPE.

Parameters:
id - The id for the retrieved DataObject.

LifecycleDefinition

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

LifecycleDefinition

protected LifecycleDefinition(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)

getDefaultListener

public String getDefaultListener()

setDefaultListener

public void setDefaultListener(String listener)

addPhaseDefinition

public PhaseDefinition addPhaseDefinition()
Add a phase definition to this lifecycle definition. To save this phase definition, you need to call save() method on the returned PhaseDefinition.


addPhaseDefinition

public PhaseDefinition addPhaseDefinition(String label,
                                          String description,
                                          Integer delay,
                                          Integer duration,
                                          String defaultListener)
Add a phase definition to this lifecycle definition. To save this phase definition, you need to call save() method on the returned PhaseDefinition.

Parameters:
label - Name of this phase definition
description - Decription of this phase definition, Pass in null if there is no description
delay - Default delay for the start of this phase definition in minutes relative to the publish date. Pass in null or 0 is this phase definition begins at the publish date.
duration - Duration of this phase definition in minutes. Pass null if this phase definition never ends.
defaultListener - Default Listener class of this phase definition.

getPhaseDefinitions

public PhaseDefinitionCollection getPhaseDefinitions()
Get the phase definitions for this lifecycle definition. To remove the phase definition from this lifecycle definition, you need to explicitly call the delete() method on that particular phase definition.


createLifecycle

public Lifecycle createLifecycle()
Creates and returns a cycle using this lifecycle definition. To save this lifecycle, you need to call save() method on the returned Lifecycle.


createFullLifecycle

public Lifecycle createFullLifecycle(Date startDate,
                                     String listenerClassName)
Creates and returns a cycle using this lifecycle definition; then, populates the lifecycle with phases and saves it.

Parameters:
startDate - the date when the lifecycle should start, or null if the cycle should start immediately
listenerClassName - the classname of the listener for the new lifecycle

createFullLifecycle

public Lifecycle createFullLifecycle(String listenerClassName)
Creates and returns a cycle using this lifecycle definition; then, populates the lifecycle with phases and saves it.

Parameters:
listenerClassName - the classname of the listener for the new lifecycle


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