|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.msproject.mppobject.MPPObject
wt.projmgmt.msproject.mppobject.MPPExecutionObject
wt.projmgmt.msproject.mppobject.MPPPlan
An object that represents data from a Microsoft Project
Plan
project. A project has tasks, resources and
assignments.
Field Summary | |
private Collection |
assignments
|
private ProjectCategory |
category
|
private Timestamp |
currentDate
|
private int |
idOffset
|
private ImportInfo |
importInfo
|
private Timestamp |
now
|
private ProjectPlan |
projectPlan
|
private static String |
RESOURCE
|
private Map |
resources
|
private List |
sortedTasks
|
private Map |
tasks
|
Fields inherited from class wt.projmgmt.msproject.mppobject.MPPExecutionObject |
|
Fields inherited from class wt.projmgmt.msproject.mppobject.MPPObject |
|
Constructor Summary | |
MPPPlan()
|
Method Summary | |
WTUser |
addAdministrator(WTUser user)
If this project plan belongs to a ContainerTeamManaged ,
add the WTUser to the container's administrator role. |
void |
addAssignment(MPPAssignment assignment)
Add a new resource assignment to this plan. |
WTUser |
addMember(WTUser user)
If this project plan belongs to a ContainerTeamManaged ,
add the WTUser to the container's team. |
private WTUser |
addMember(WTUser user,
Role role)
If this project plan belongs to a ContainerTeamManaged ,
add the WTUser to the container's team. |
private int |
computeIdOffset()
Compute the offset to be applied to a task's ID number. |
protected Persistable |
createPersistable()
Create a new Persistable that is of the correct
type for this object. |
private ExecutionObject |
fixRollup(WfContainer c,
boolean nested)
Adjusts the rollups of the plan MSP doesn't know about deliverables so this is called after importing to fix the rollups to coincide with project link. |
Collection |
getAssignments()
Return the resource assignments for this plan. |
ProjectCategory |
getCategory()
Get the category for this execution object that is specified in the XML . |
WfContainer |
getContainer()
Get the persistable WfContainer that
this plan object corresponds to. |
Timestamp |
getCurrentDate()
Get the current date for this object's plan. |
protected String |
getGenericName()
Return a generic name fo the this object. |
int |
getIdOffset()
Return the offset that should be applied to a task's ID number when it is updated. |
ImportInfo |
getImportInfo()
Return the ImportInfo that
should be used when persisting this object. |
WTUser |
getManager()
Get the manager of this project plan that is specified in the XML . |
protected String |
getNameElement()
Return the name of the XML element that should
be used to obtain the value of this object's name. |
MPPPlan |
getPlan()
Get the plan that this object belongs to. |
ProjectPlan |
getProjectPlan()
Get the ProjectPlan that
contains this object. |
MPPResource |
getResource(long uid)
Get the resource with the specified UID . |
Map |
getResources()
Get the set of resources in this project. |
List |
getSortedTasks()
Get the set of tasks in this project. |
MPPTask |
getTask(long uid)
Get the task with the specified UID . |
Map |
getTasks()
Get the set of tasks in this project. |
private WTRoleHolder2 |
getTeam()
If this project plan belongs to a ContainerTeamManaged ,
return that container's team. |
private WTContainer |
getWTContainer()
Get the WTContainer that this project plan belongs
to. |
boolean |
isContainer()
Return true if this object is a container for other
project plan nodes. |
protected boolean |
isOwnable()
Return true if the ownership of this object should
be assigned to the owner specified in the XML . |
boolean |
isRollUpCost()
Return true if the total cost and actual cost of this task are rolled-up. |
boolean |
isRollUpFinishDate()
Return true if the estimated finish date of this task is rolled-up. |
boolean |
isRollUpPercentComplete()
Return true if the percent complete of this task is rolled-up. |
boolean |
isRollUpWork()
Return true if the total work and actual work of this task are rolled-up. |
boolean |
isStartAtEndOfDay()
Returns true if the the object should start at
the end of the working day instead of at the beginning. |
boolean |
isStartComputed()
Return true if the planned start date of this task is computed. |
protected boolean |
isValidPersistable(Persistable p)
Make sure that the specified Persistable is
of the right type for this object. |
private void |
makeRoomForChildren(int childCount)
Move all the nodes below the point where tasks are being inserted down to make room for the new tasks. |
private void |
saveAssignments()
Update and save each of the assignments in this project plan. |
private void |
saveResources()
Update and save each of the resources in this project plan. |
private void |
saveTasks()
Update and save each of the tasks in this project plan. |
private static void |
saveWithFeedback(Collection objects)
Save the objects in the collection and report feedback to the client. |
void |
setContainer(WfContainer c)
Set the persistable WfContainer that
this plan object corresponds to. |
void |
setImportInfo(ImportInfo info)
Set the ImportInfo that
should be used when persisting this object. |
void |
setPlan(MPPPlan plan)
Set the plan that this object belongs to. |
void |
setProjectPlan(ProjectPlan projectPlan)
Set the ProjectPlan that
corresponds to the project plan of this plan's persistable. |
void |
setResources(Map resources)
Set the set of resources in this project. |
void |
setTasks(Map tasks)
Set the set of tasks in this project. |
private static void |
sortTasksAndRemoveIdGaps(List tasks)
Sort the list of tasks and assign IDs to the tasks such that there are no gaps in the ID sequence. |
protected ExecutionObject |
updateName(ExecutionObject exObj)
Don't update the name of the WfContainer
being imported into. |
Persistable |
updatePersistable(Persistable p)
Update values on the ExecutionObject based on the data in this
MPPExecutionObject . |
protected ProjectPlan |
updateProjectPlan(ProjectPlan plan)
Update the values that are specific to this ProjectPlan . |
protected WfExecutionObject |
updateTimeToStart(WfExecutionObject exObj)
If the ProjectLink planned start date is being preserved then don't update timeToStart or isStartComputed . |
protected WfExecutionObject |
validatePlannedStart(WfExecutionObject wfExObj)
Validate the imported planned start date. |
Methods inherited from class wt.projmgmt.msproject.mppobject.MPPObject |
compareTo, containsKey, entrySet, get, getID, getName, getObjectIdentifier, getPersistable, getPersistableClass, getPersistableID, getUID, keySet, print, printImpl, printMsg, printNoUpdate, printNoUpdate, printRollUp, printUpdate, printUpdate, put, refreshPersistable, savePersistable, setID, setPersistable, toString, updatePersistableCache |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private final Timestamp now
private Timestamp currentDate
private int idOffset
private ProjectPlan projectPlan
private ImportInfo importInfo
private ProjectCategory category
private Map tasks
private List sortedTasks
private Map resources
private final Collection assignments
Constructor Detail |
public MPPPlan()
Method Detail |
protected final String getGenericName()
MPPObject
getGenericName
in class MPPObject
protected final String getNameElement()
MPPObject
XML
element that should
be used to obtain the value of this object's name.
getNameElement
in class MPPObject
public final MPPPlan getPlan()
MPPObject
getPlan
in class MPPObject
public final void setPlan(MPPPlan plan)
MPPObject
setPlan
in class MPPObject
public final boolean isContainer()
MPPObject
true
if this object is a container for other
project plan nodes. Plans, summary activities and subprojects are
considered to be containers.
isContainer
in class MPPObject
public Timestamp getCurrentDate()
MPPObject
getCurrentDate
in class MPPObject
public final boolean isStartComputed()
false
if
getImportInfo().isImportStartDate()
returns
true
. Otherwise, it returns
super.isStartComputed()
.
isStartComputed
in class MPPExecutionObject
public final boolean isStartAtEndOfDay()
MPPExecutionObject
true
if the the object should start at
the end of the working day instead of at the beginning.
isStartAtEndOfDay
in class MPPExecutionObject
public final boolean isRollUpFinishDate()
MPPExecutionObject
isRollUpFinishDate
in class MPPExecutionObject
public final boolean isRollUpPercentComplete()
MPPExecutionObject
isRollUpPercentComplete
in class MPPExecutionObject
public final boolean isRollUpWork()
MPPExecutionObject
isRollUpWork
in class MPPExecutionObject
public final boolean isRollUpCost()
MPPExecutionObject
isRollUpCost
in class MPPExecutionObject
public final int getIdOffset()
ProjectPlan
.
In order to prevent the offset from being computed before the
children of the import target have been deleted, this method
throws an exception until updatePersistable(wt.fc.Persistable)
is
called.
private final int computeIdOffset() throws WTException
updatePersistable(wt.fc.Persistable)
.
WTException
public final ProjectPlan getProjectPlan()
MPPObject
ProjectPlan
that
contains this object.
getProjectPlan
in class MPPObject
public final void setProjectPlan(ProjectPlan projectPlan)
ProjectPlan
that
corresponds to the project plan of this plan's persistable.
This persistable may or may not be the same persistable that
is returned by the
MPPObject.getPersistable()
method.
This plan provides the container in which
ProjectNode
s and
ProjectResource
s are created.
This method must be use to set the project plan before
MPPObject.savePersistable()
is called on this object.
projectPlan
- the project plan thatpublic ImportInfo getImportInfo()
MPPObject
ImportInfo
that
should be used when persisting this object.
getImportInfo
in class MPPObject
public void setImportInfo(ImportInfo info)
ImportInfo
that
should be used when persisting this object.
public final ProjectCategory getCategory()
MPPExecutionObject
XML
.
getCategory
in class MPPExecutionObject
protected final boolean isOwnable()
MPPExecutionObject
true
if the ownership of this object should
be assigned to the owner specified in the XML
.
isOwnable
in class MPPExecutionObject
public final WTUser getManager() throws WTException
XML
.
WTException
protected Persistable createPersistable() throws WTException
MPPObject
Persistable
that is of the correct
type for this object.
createPersistable
in class MPPObject
WTException
public Persistable updatePersistable(Persistable p) throws WTException, WTPropertyVetoException
MPPExecutionObject
ExecutionObject
based on the data in this
MPPExecutionObject
.
Subclass should call super.updatePersistable
if they override
this method so that the ExecutionObject
and
WfExecutionObject
attributes are updated.
updatePersistable
in class MPPExecutionObject
WTException
WTPropertyVetoException
protected final WfExecutionObject validatePlannedStart(WfExecutionObject wfExObj) throws WTException
WTException
protected final ProjectPlan updateProjectPlan(ProjectPlan plan) throws WTException, WTPropertyVetoException
ProjectPlan
. These include the
following values:
WTException
WTPropertyVetoException
protected final WfExecutionObject updateTimeToStart(WfExecutionObject exObj)
timeToStart
or isStartComputed
.
updateTimeToStart
in class MPPExecutionObject
exObj
- the object to updateprotected ExecutionObject updateName(ExecutionObject exObj) throws WTException
WfContainer
being imported into.
updateName
in class MPPExecutionObject
WTException
private final void saveResources() throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
private final void saveTasks() throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
private final void makeRoomForChildren(int childCount) throws WTException
WTException
private final void saveAssignments() throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
protected boolean isValidPersistable(Persistable p) throws WTException
MPPObject
Persistable
is
of the right type for this object. Return false
if null
is passed to the method.
This class's implementation of this method ensures that the
perisitable is in the right ProjectPlan
. Subclasses
that override this method should be sure to make a call to
super
so that this code is executed.
isValidPersistable
in class MPPExecutionObject
WTException
public final WfContainer getContainer() throws WTException
WfContainer
that
this plan object corresponds to.
WTException
wt.projmgmt.msproject.mppobject.MPPThing#getPersistable
public final void setContainer(WfContainer c)
WfContainer
that
this plan object corresponds to.
c
- the persistable container that this plan maps towt.projmgmt.msproject.mppobject.MPPThing#setPersistable
public MPPTask getTask(long uid)
UID
. This
UID
is from the XML
file (this
IDs is not the Windchill ObjectIdentifier ID).
Returns null
if no such task exists.
uid
- the task UIDpublic Map getTasks()
Map
are the UID
s for the
tasks from the XML
file (these IDs are not
the Windchill ObjectIdentifier IDs).
public void setTasks(Map tasks)
Map
are the UID
s for the
tasks from the XML
file (these IDs are not
the Windchill ObjectIdentifier IDs).
The sorted tasks collection is also initialized.
tasks
- the tasks for the project
RuntimeException
- if the tasks have already been setpublic final List getSortedTasks()
ID
s.
public MPPResource getResource(long uid)
UID
. This
UID
is from the XML
file (this
IDs is not necessarily the Windchill ObjectIdentifier ID).
Returns null
if no such resource exists.
uid
- the resource UIDpublic Map getResources()
Map
are the UID
s for the
resources from the XML
file (these IDs are not
necessarily the Windchill ObjectIdentifier IDs).
public void setResources(Map resources)
Map
are the UID
s for the
resources from the XML
file (these IDs are not
necessarily the Windchill ObjectIdentifier IDs).
resources
- the resources for the project
RuntimeException
- if the resources have already been setpublic Collection getAssignments()
public void addAssignment(MPPAssignment assignment)
assignment
- the resource assignmentprivate final WTContainer getWTContainer()
WTContainer
that this project plan belongs
to.
private final WTRoleHolder2 getTeam()
ContainerTeamManaged
,
return that container's team. Otherwise, return null
.
public final WTUser addMember(WTUser user) throws WTException
ContainerTeamManaged
,
add the WTUser
to the container's team.
WTException
private final WTUser addMember(WTUser user, Role role) throws WTException
ContainerTeamManaged
,
add the WTUser
to the container's team.
WTException
public final WTUser addAdministrator(WTUser user) throws WTException
ContainerTeamManaged
,
add the WTUser
to the container's administrator role.
WTException
private static final void sortTasksAndRemoveIdGaps(List tasks)
tasks
- the tasksprivate static final void saveWithFeedback(Collection objects) throws WTException, WTPropertyVetoException
objects
- the objects to be saved
WTException
WTPropertyVetoException
private ExecutionObject fixRollup(WfContainer c, boolean nested) throws WTException
c
- starting pointnested
- whether or not to traverse into summaries or not.
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |