com.ptc.netmarkets.nmixb
Class ProjectPlanStructCopyHelper

java.lang.Object
  extended bywt.inf.template.containercopy.AbstractContainerCopyHandler
      extended bycom.ptc.netmarkets.nmixb.ProjectPlanStructCopyHelper
All Implemented Interfaces:
ContainerCopyHandler, Serializable

public class ProjectPlanStructCopyHelper
extends AbstractContainerCopyHandler
implements Serializable

This takes care of changes to the Project Plan ProjectPlan Attribute changes. Milestones Resources Activities Deliverables

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static int[] DEF_INDICES
           
private static Object[] DEF_PARAMS
           
private static Class ENUM_TYPE_CLASS
           
private static Class OBJ_REF_CLASS
           
private static String RESOURCE
           
private  ProjectPlan sourcePlan
           
private  Project2 sourceProject
           
private  ProjectPlan targetPlan
           
private  Project2 targetProject
           
private static boolean VERBOSE
           
(package private)  ProjectCopyWorklist workList
           
private static Class WT_OBJECT_CLASS
           
 
Fields inherited from class wt.inf.template.containercopy.AbstractContainerCopyHandler
 
Constructor Summary
ProjectPlanStructCopyHelper()
           
 
Method Summary
private  ProjectActivity copyActivity(ProjectActivity source_activity)
           
protected  void copyAddedObjects()
          Most of the time this is the only method that needs to be over-ridden.
private  void copyAssignments(ProjectActivity target, ProjectActivity sourceActivity)
           
private  ProjectResource copyBaseResourceInfo(ProjectResource target, ProjectResource src)
          initializes category, name and description
 void copyContainmentLinks()
           
 void copyContainmentLinks(WfContainer source_container, WfContainer target_container)
           
private  CostResource copyCostResourceInfo(CostResource target, CostResource src)
           
private  Deliverable copyDeliverable(Deliverable source_deli)
           
 void copyDeliverableLinks()
           
 void copyDeliverables()
           
private  void copyExecutionInfo(ExecutionObject source_obj, ExecutionObject target_obj)
           
 ObjectToObjectLink copyLink(ObjectToObjectLink link)
           
private  Milestone copyMilestone(Milestone source_stone)
           
private  void copyOwnership(Ownable obj, Ownable sourceObj)
           
 void copyPlan()
           
 void copyPrecedenceLinks()
           
 void copyPrecedenceLinks(WfContainerTemplate source_container, WfContainerTemplate target_container)
           
private  void copyProjectNodeInfo(ProjectNode source_node, ProjectNode target_node)
           
 void copyProjectNodes()
           
private  ProjectResource copyProjectResource(ProjectResource source_resource)
           
private  ProjectProxy copyProxy(ProjectProxy source_proxy)
           
 void copyResourceAssignmentLinks()
           
 void copyResources()
           
private  SummaryActivity copySummary(SummaryActivity source_summ)
           
private  TimeResource copyTimeResourceInfo(TimeResource target, TimeResource src)
           
private  void copyWfAttributes(WfExecutionObject source_obj, WfExecutionObject target_obj)
           
private  WfConnector getConnector(WfContainer container, WfConnectorType type)
           
private  WfConnectorTemplate getEndConnectorTemplate(WfContainerTemplate container_template)
           
private  String getIdString(Object obj)
           
private  ObjectIdentifier getOid(Object obj)
           
private  WfContainerTemplate getParentTemplate(WfTemplateObject template)
           
 QueryResult getPrecedenceLinks(WfContainerTemplate container_template)
           
private  ProjectPlan getProjectPlan(Project2 proj)
           
 Persistable getTargetObject(Persistable source)
           
 ObjectIdentifier getTargetOid(Persistable source)
           
 QueryResult getWfNodes(WfContainer container)
           
protected  void initialize()
          This method provides an opportunity to do any initializion beyond setting the three target member variables that is performed in at the start of the method.
 void postPostCopyFeedback()
          Posts post copy feedback.
 void postPreCopyFeedback()
          Posts pre-copy user feedback.
 void printPostCopyVerbose()
          Prints verbose post-copy statements.
 void printPreCopyVerbose()
          Prints verbose pre-copy statements.
protected  void pruneObjects()
          This is not necessary for every type of object, but there are times when it is most efficient to prune objects that are present in the target container, but are absent in the source container.
protected  void rememberSourceContainerObjects()
          Depending on the template being employed it may be necessary to to remember what was in the source container in order to do pruning.
private  void saveContainerMap(WfContainer source, WfContainer target)
           
private  void saveNodeMap(ProjectNode source, ProjectNode target)
           
private  void saveOidMap(Persistable source, Persistable target)
           
private  String showAttributes(ProjectPlan plan)
           
 
Methods inherited from class wt.inf.template.containercopy.AbstractContainerCopyHandler
copyObjects, getCopier, getSourceContainer, getTargetContainer, getWorklist, postFeedback, rememberTargetContainerObjects, setCopier, setSourceContainer, setTargetContainer, setWorklist
 
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

workList

ProjectCopyWorklist workList

sourceProject

private Project2 sourceProject

targetProject

private Project2 targetProject

sourcePlan

private ProjectPlan sourcePlan

targetPlan

private ProjectPlan targetPlan

ENUM_TYPE_CLASS

private static final Class ENUM_TYPE_CLASS

OBJ_REF_CLASS

private static final Class OBJ_REF_CLASS

WT_OBJECT_CLASS

private static final Class WT_OBJECT_CLASS

DEF_INDICES

private static final int[] DEF_INDICES

DEF_PARAMS

private static final Object[] DEF_PARAMS

VERBOSE

private static final boolean VERBOSE
Constructor Detail

ProjectPlanStructCopyHelper

public ProjectPlanStructCopyHelper()
Method Detail

initialize

protected void initialize()
                   throws WTException
This method provides an opportunity to do any initializion beyond setting the three target member variables that is performed in at the start of the method.

Supported API: false

Overrides:
initialize in class AbstractContainerCopyHandler
Throws:
WTException

printPreCopyVerbose

public void printPreCopyVerbose()
                         throws WTException
Prints verbose pre-copy statements. Handler implementor is responsible for deciding what to use for this value. The handlers residing in wt.inf.template use the property wt.inf.template.verboseCopy

Supported API: false

Specified by:
printPreCopyVerbose in interface ContainerCopyHandler
Overrides:
printPreCopyVerbose in class AbstractContainerCopyHandler
Throws:
WTException

postPreCopyFeedback

public void postPreCopyFeedback()
                         throws WTException
Posts pre-copy user feedback.

Supported API: false

Specified by:
postPreCopyFeedback in interface ContainerCopyHandler
Overrides:
postPreCopyFeedback in class AbstractContainerCopyHandler
Throws:
WTException

rememberSourceContainerObjects

protected void rememberSourceContainerObjects()
                                       throws WTException
Depending on the template being employed it may be necessary to to remember what was in the source container in order to do pruning. This method is the hook that enables that to happen.

Supported API: false

Overrides:
rememberSourceContainerObjects in class AbstractContainerCopyHandler
Throws:
WTException

pruneObjects

protected void pruneObjects()
                     throws WTException
This is not necessary for every type of object, but there are times when it is most efficient to prune objects that are present in the target container, but are absent in the source container.

Supported API: false

Throws:
WTException

copyAddedObjects

protected void copyAddedObjects()
                         throws WTException
Most of the time this is the only method that needs to be over-ridden.

Supported API: false

Overrides:
copyAddedObjects in class AbstractContainerCopyHandler
Throws:
WTException

postPostCopyFeedback

public void postPostCopyFeedback()
                          throws WTException
Posts post copy feedback. (Copy of foo succeeded).

Supported API: false

Specified by:
postPostCopyFeedback in interface ContainerCopyHandler
Overrides:
postPostCopyFeedback in class AbstractContainerCopyHandler
Throws:
WTException

printPostCopyVerbose

public void printPostCopyVerbose()
                          throws WTException
Prints verbose post-copy statements. Handler implementor is responsible for deciding what to use for this value. The handlers residing in wt.inf.template use the property wt.inf.template.verboseCopy

Supported API: false

Specified by:
printPostCopyVerbose in interface ContainerCopyHandler
Overrides:
printPostCopyVerbose in class AbstractContainerCopyHandler
Throws:
WTException

copyProxy

private ProjectProxy copyProxy(ProjectProxy source_proxy)
                        throws WTException
Throws:
WTException

copySummary

private SummaryActivity copySummary(SummaryActivity source_summ)
                             throws WTException
Throws:
WTException

copyActivity

private ProjectActivity copyActivity(ProjectActivity source_activity)
                              throws WTException
Throws:
WTException

copyProjectResource

private ProjectResource copyProjectResource(ProjectResource source_resource)
                                     throws WTException,
                                            WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

copyTimeResourceInfo

private TimeResource copyTimeResourceInfo(TimeResource target,
                                          TimeResource src)
                                   throws WTException,
                                          WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

copyCostResourceInfo

private CostResource copyCostResourceInfo(CostResource target,
                                          CostResource src)
                                   throws WTException,
                                          WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

copyBaseResourceInfo

private ProjectResource copyBaseResourceInfo(ProjectResource target,
                                             ProjectResource src)
                                      throws WTException,
                                             WTPropertyVetoException
initializes category, name and description

Throws:
WTException
WTPropertyVetoException

copyAssignments

private void copyAssignments(ProjectActivity target,
                             ProjectActivity sourceActivity)
                      throws WTException
Throws:
WTException

copyMilestone

private Milestone copyMilestone(Milestone source_stone)
                         throws WTException
Throws:
WTException

copyOwnership

private void copyOwnership(Ownable obj,
                           Ownable sourceObj)
                    throws WTException
Throws:
WTException

copyDeliverable

private Deliverable copyDeliverable(Deliverable source_deli)
                             throws WTException
Throws:
WTException

copyProjectNodeInfo

private void copyProjectNodeInfo(ProjectNode source_node,
                                 ProjectNode target_node)
                          throws WTException
Throws:
WTException

copyWfAttributes

private void copyWfAttributes(WfExecutionObject source_obj,
                              WfExecutionObject target_obj)
                       throws WTException
Throws:
WTException

copyExecutionInfo

private void copyExecutionInfo(ExecutionObject source_obj,
                               ExecutionObject target_obj)
                        throws WTException
Throws:
WTException

getParentTemplate

private WfContainerTemplate getParentTemplate(WfTemplateObject template)
                                       throws WTException
Throws:
WTException

getProjectPlan

private ProjectPlan getProjectPlan(Project2 proj)
                            throws WTException
Throws:
WTException

saveContainerMap

private void saveContainerMap(WfContainer source,
                              WfContainer target)
                       throws WTException
Throws:
WTException

getConnector

private WfConnector getConnector(WfContainer container,
                                 WfConnectorType type)
                          throws WTException
Throws:
WTException

getEndConnectorTemplate

private WfConnectorTemplate getEndConnectorTemplate(WfContainerTemplate container_template)
                                             throws WTException
Throws:
WTException

saveNodeMap

private void saveNodeMap(ProjectNode source,
                         ProjectNode target)
                  throws WTException
Throws:
WTException

saveOidMap

private void saveOidMap(Persistable source,
                        Persistable target)
                 throws WTException
Throws:
WTException

copyResources

public void copyResources()
                   throws WTException
Throws:
WTException

copyProjectNodes

public void copyProjectNodes()
                      throws WTException
Throws:
WTException

copyDeliverables

public void copyDeliverables()
                      throws WTException
Throws:
WTException

copyPrecedenceLinks

public void copyPrecedenceLinks(WfContainerTemplate source_container,
                                WfContainerTemplate target_container)
                         throws WTException
Throws:
WTException

copyPrecedenceLinks

public void copyPrecedenceLinks()
                         throws WTException
Throws:
WTException

copyResourceAssignmentLinks

public void copyResourceAssignmentLinks()
                                 throws WTException
Throws:
WTException

copyLink

public ObjectToObjectLink copyLink(ObjectToObjectLink link)
                            throws WTException
Throws:
WTException

getPrecedenceLinks

public QueryResult getPrecedenceLinks(WfContainerTemplate container_template)
                               throws WTException
Throws:
WTException

copyDeliverableLinks

public void copyDeliverableLinks()
                          throws WTException
Throws:
WTException

copyContainmentLinks

public void copyContainmentLinks()
                          throws WTException
Throws:
WTException

getTargetOid

public ObjectIdentifier getTargetOid(Persistable source)
                              throws WTException
Throws:
WTException

getTargetObject

public Persistable getTargetObject(Persistable source)
                            throws WTException
Throws:
WTException

copyContainmentLinks

public void copyContainmentLinks(WfContainer source_container,
                                 WfContainer target_container)
                          throws WTException
Throws:
WTException

getWfNodes

public QueryResult getWfNodes(WfContainer container)
                       throws WTException
Throws:
WTException

copyPlan

public void copyPlan()
              throws WTException
Throws:
WTException

showAttributes

private String showAttributes(ProjectPlan plan)
                       throws WTException
Throws:
WTException

getIdString

private String getIdString(Object obj)

getOid

private ObjectIdentifier getOid(Object obj)