wt.clients.lifecycle.administrator
Class CPhaseTemplate

java.lang.Object
  extended bywt.clients.util.PersistableItem
      extended bywt.clients.project.CRoleHolder
          extended bywt.clients.lifecycle.administrator.CIndirectRoleHolder
              extended bywt.clients.lifecycle.administrator.CPhaseTemplate
All Implemented Interfaces:
Cloneable

public class CPhaseTemplate
extends CIndirectRoleHolder
implements Cloneable

A client wrapper to handle phase templates.


Nested Class Summary
static class CPhaseTemplate.Server
          Inner class that acts a lightweight service which executes methods on the server to reduce unnecessary client to server traffic and data transfer.
 
Field Summary
private  Hashtable allSelectors
           
private  Hashtable allStates
           
private  CAccessList cAccessList
           
private  CCriteriaList cCriteriaList
           
private  CLifeCycleTemplate cLifeCycleTemplate
           
private  CPhaseSuccessionList cPhaseSuccessionList
           
(package private) static String DEFAULT_GATE_WFPROCESS
           
(package private) static String DEFAULT_PHASE_WFPROCESS
           
private  PhaseTemplate phaseTemplate
           
static String SERVER_CLASS
           
(package private)  RoleBatchContainer successorContainer
           
(package private) static String UNSPECIFIED_WFPROCESS
           
private  boolean verbose
           
 
Fields inherited from class wt.clients.project.CRoleHolder
roleHolder
 
Fields inherited from class wt.clients.util.PersistableItem
 
Constructor Summary
protected CPhaseTemplate()
          Create a new client phase template.
protected CPhaseTemplate(CLifeCycleTemplate clife_cycle_entry)
          Create a new client phase template given a client life cycle template.
protected CPhaseTemplate(CLifeCycleTemplate clife_cycle_entry, PhaseTemplate phase)
          Creates a new client phase template given a client life cycle template and a phase template.
 
Method Summary
 void addRole(String roleName)
          Adds a role to this phase.
 void deleteRole(String role_name)
          Deletes a role from this phase.
protected  CPhaseTemplate duplicate()
          Returns a duplicates of this CPhaseTemplate.
protected  CPhaseTemplate duplicate(CLifeCycleTemplate clifecycle_template)
          Returns a duplicates of this CPhaseTemplate.
private  Hashtable getAllSelectorsHashtable()
           
private  Hashtable getAllStatesHashtable()
           
protected  CAccessList getCAccessList()
          Returns the access list for this phase.
protected  CCriteriaList getCCriteriaList()
          Returns the criteria list for this phase.
protected  CLifeCycleTemplate getCLifeCycleTemplate()
          Returns the client life cycle template this phase template lives in.
protected  CPhaseSuccessionList getCPhaseSuccessionList()
          Returns the phase succession list for this phase.
protected  String getGateWfProcess()
           
protected  ObjectReference getGateWfProcessReference()
           
protected  BatchContainer getMainBatchContainer()
          Returns the BatchContainer of this CPhaseTemplate.
protected  PhaseTemplate getPhaseTemplate()
          Returns the phase template represented by this client phase template.
protected  String getPhaseWfProcess()
           
protected  ObjectReference getPhaseWfProcessReference()
           
 String getSeriesSelector()
           
 SeriesRangeSelector getSeriesSelector(String selector_name)
           
protected  String getState()
          Returns the state of this phase.
 State getState(String state_name)
           
protected  RoleBatchContainer getSuccessorContainer()
          Returns the RoleBatchContainer for the successor link.
protected  PhaseTemplate getSuccessorPhaseTemplate()
          Returns the success phase template to this phase template.
private  WfProcessTemplateMasterReference getWfTemplateMasterRef(String string)
           
protected  boolean isFinalPhase()
          Returns true if this is the final phase in the lifecycle.
protected  void refresh(PhaseTemplate phase_template)
          Refreshes this CPhaseTemplate to it's database state.
(package private)  void remove()
           
 void save()
          Saves this client phase template.
protected  void setCAccessList(CAccessList caccess_list)
          Sets the access list for this phase.
protected  void setCCriteriaList(CCriteriaList ccriteria_list)
          Sets the criteria list for this phase.
protected  void setCPhaseSuccessionList(CPhaseSuccessionList cphase_succession_list)
          Sets the phase succession list for this phase.
protected  void setGateWfProcess(String name, ObjectReference reference)
           
protected  void setGateWorkflowIdRef(ObjectReference processRef)
           
protected  void setPhaseWfProcess(String name, ObjectReference reference)
           
protected  void setPhaseWorkflowIdRef(ObjectReference processRef)
           
protected  void setSeriesSelector(String seriesSelector)
          Sets the SeriesSelector of this phase.
protected  void setState(String state)
          Sets the state of this phase.
protected  void setSuccessor(CPhaseTemplate phase)
          Sets the successor of this CPhaseTemplate.
 String toString()
          Returns a string representation of this phase, it's state.
 
Methods inherited from class wt.clients.lifecycle.administrator.CIndirectRoleHolder
addRoleTarget, deleteRoleTarget, getRoleList, getRoleTargets
 
Methods inherited from class wt.clients.project.CRoleHolder
addPrincipal, containsRole, deletePrincipal, getPrincipals, getRoleHolder, getRoles
 
Methods inherited from class wt.clients.util.PersistableItem
isCreated, isModified, refresh, setCreated, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PHASE_WFPROCESS

static String DEFAULT_PHASE_WFPROCESS

DEFAULT_GATE_WFPROCESS

static String DEFAULT_GATE_WFPROCESS

UNSPECIFIED_WFPROCESS

static String UNSPECIFIED_WFPROCESS

verbose

private boolean verbose

allStates

private Hashtable allStates

allSelectors

private Hashtable allSelectors

SERVER_CLASS

public static final String SERVER_CLASS

cAccessList

private CAccessList cAccessList

cLifeCycleTemplate

private CLifeCycleTemplate cLifeCycleTemplate

cCriteriaList

private CCriteriaList cCriteriaList

cPhaseSuccessionList

private CPhaseSuccessionList cPhaseSuccessionList

phaseTemplate

private PhaseTemplate phaseTemplate

successorContainer

RoleBatchContainer successorContainer
Constructor Detail

CPhaseTemplate

protected CPhaseTemplate()
Create a new client phase template.


CPhaseTemplate

protected CPhaseTemplate(CLifeCycleTemplate clife_cycle_entry)
                  throws WTPropertyVetoException,
                         WTException
Create a new client phase template given a client life cycle template.

Parameters:
clife_cycle_entry - the client life cycle template that the new client phase template is part of
Throws:
WTPropertyVetoException - if the CPhaseTemplate cannot be named
WTException - if the CPhaseTemplate cannot be created

CPhaseTemplate

protected CPhaseTemplate(CLifeCycleTemplate clife_cycle_entry,
                         PhaseTemplate phase)
                  throws WTPropertyVetoException
Creates a new client phase template given a client life cycle template and a phase template.

Parameters:
clife_cycle_entry - the client life cycle template the new client phase template will live in
phase - the phase template represented by the new CPhaseTemplate
Throws:
WTPropertyVetoException - if the CPhaseTemplate cannot be named
Method Detail

getMainBatchContainer

protected BatchContainer getMainBatchContainer()
Returns the BatchContainer of this CPhaseTemplate.


setSuccessor

protected void setSuccessor(CPhaseTemplate phase)
                     throws WTPropertyVetoException,
                            WTException
Sets the successor of this CPhaseTemplate. If successor is set to null, this CPhaseTemplate is the last template in the Life Cycle Template.

Parameters:
phase - the successor phase
Throws:
WTPropertyVetoException - if the Gate cannot be set
WTException - if the successor cannot be set

getSuccessorPhaseTemplate

protected PhaseTemplate getSuccessorPhaseTemplate()
                                           throws WTException
Returns the success phase template to this phase template.

Throws:
WTException - if the successor cannot be returned

getPhaseTemplate

protected PhaseTemplate getPhaseTemplate()
Returns the phase template represented by this client phase template.


getCLifeCycleTemplate

protected CLifeCycleTemplate getCLifeCycleTemplate()
Returns the client life cycle template this phase template lives in.


getSuccessorContainer

protected RoleBatchContainer getSuccessorContainer()
                                            throws WTException
Returns the RoleBatchContainer for the successor link.

Throws:
WTException - if the successor container cannot be returned

save

public void save()
          throws WTException
Saves this client phase template.

Overrides:
save in class PersistableItem
Throws:
WTException - if the template cannot be saved

refresh

protected void refresh(PhaseTemplate phase_template)
                throws WTException
Refreshes this CPhaseTemplate to it's database state.

Throws:
WTException - if the object cannot be refreshed

duplicate

protected CPhaseTemplate duplicate()
                            throws WTException
Returns a duplicates of this CPhaseTemplate.

Throws:
WTException - if the template cannot be duplicated

duplicate

protected CPhaseTemplate duplicate(CLifeCycleTemplate clifecycle_template)
                            throws WTException
Returns a duplicates of this CPhaseTemplate. The duplicated phase will live in the specified client life cycle template.

Parameters:
clifecycle_template - the life cycle template the duplicated phase template will live in
Throws:
WTException - if the template cannot be duplicated

remove

void remove()
      throws WTException,
             WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

addRole

public void addRole(String roleName)
             throws WTException,
                    PropertyVetoException
Adds a role to this phase.

Throws:
WTException - if the role cannot be added
PropertyVetoException - if the role cannot be found

deleteRole

public void deleteRole(String role_name)
                throws WTException
Deletes a role from this phase.

Overrides:
deleteRole in class CRoleHolder
Parameters:
role_name - the specified role.
Throws:
WTException - if the role cannot be deleted

getCAccessList

protected CAccessList getCAccessList()
                              throws WTException
Returns the access list for this phase.

Throws:
WTException - if the access list cannot be returned

setCAccessList

protected void setCAccessList(CAccessList caccess_list)
Sets the access list for this phase.

Parameters:
caccess_list - the access list

getCCriteriaList

protected CCriteriaList getCCriteriaList()
Returns the criteria list for this phase.


setCCriteriaList

protected void setCCriteriaList(CCriteriaList ccriteria_list)
Sets the criteria list for this phase.

Parameters:
ccriteria_list - the criteria list

getCPhaseSuccessionList

protected CPhaseSuccessionList getCPhaseSuccessionList()
                                                throws WTException,
                                                       WTPropertyVetoException
Returns the phase succession list for this phase.

Throws:
WTException
WTPropertyVetoException

setCPhaseSuccessionList

protected void setCPhaseSuccessionList(CPhaseSuccessionList cphase_succession_list)
Sets the phase succession list for this phase.

Parameters:
cphase_succession_list - the criteria list

getState

protected String getState()
Returns the state of this phase.


setState

protected void setState(String state)
                 throws WTPropertyVetoException,
                        WTException
Sets the state of this phase.

Parameters:
state - the state of this phase
Throws:
WTPropertyVetoException - if the specifed state is not legal
WTException - if the state cannot be set on this phase

getState

public State getState(String state_name)
               throws WTException
Throws:
WTException

setSeriesSelector

protected void setSeriesSelector(String seriesSelector)
                          throws WTPropertyVetoException,
                                 WTException
Sets the SeriesSelector of this phase.

Parameters:
seriesSelector - the seriesSelector of this phase
Throws:
WTPropertyVetoException - if the specifed seriesSelector is not legal
WTException - if the seriesSelector cannot be set on this phase

getSeriesSelector

public SeriesRangeSelector getSeriesSelector(String selector_name)
                                      throws WTException
Throws:
WTException

getSeriesSelector

public String getSeriesSelector()
                         throws WTException
Throws:
WTException

getAllStatesHashtable

private Hashtable getAllStatesHashtable()
                                 throws WTException
Throws:
WTException

getAllSelectorsHashtable

private Hashtable getAllSelectorsHashtable()
                                    throws WTException
Throws:
WTException

isFinalPhase

protected boolean isFinalPhase()
Returns true if this is the final phase in the lifecycle.


toString

public String toString()
Returns a string representation of this phase, it's state.


getGateWfProcess

protected String getGateWfProcess()

getPhaseWfProcess

protected String getPhaseWfProcess()

setPhaseWfProcess

protected void setPhaseWfProcess(String name,
                                 ObjectReference reference)
                          throws WTPropertyVetoException
Throws:
WTPropertyVetoException

setGateWfProcess

protected void setGateWfProcess(String name,
                                ObjectReference reference)
                         throws WTPropertyVetoException
Throws:
WTPropertyVetoException

setPhaseWorkflowIdRef

protected void setPhaseWorkflowIdRef(ObjectReference processRef)
                              throws WTPropertyVetoException
Throws:
WTPropertyVetoException

setGateWorkflowIdRef

protected void setGateWorkflowIdRef(ObjectReference processRef)
                             throws WTPropertyVetoException
Throws:
WTPropertyVetoException

getPhaseWfProcessReference

protected ObjectReference getPhaseWfProcessReference()

getGateWfProcessReference

protected ObjectReference getGateWfProcessReference()

getWfTemplateMasterRef

private WfProcessTemplateMasterReference getWfTemplateMasterRef(String string)
                                                         throws WTException
Throws:
WTException