wt.projmgmt.msproject.mppobject
Class MPPResource

java.lang.Object
  extended bywt.projmgmt.msproject.mppobject.MPPObject
      extended bywt.projmgmt.msproject.mppobject.MPPResource
All Implemented Interfaces:
Comparable

public class MPPResource
extends MPPObject

An object that represents data from a Microsoft Project Plan Resource.


Field Summary
static String NAME_ELEMENT
          The XML element that contains this object's name.
 
Fields inherited from class wt.projmgmt.msproject.mppobject.MPPObject
 
Constructor Summary
MPPResource()
           
 
Method Summary
private  PersonResource addToTeam(PersonResource resource)
          Add the person that is linked to the specified PersonResource to the project plan's team.
private  MaterialResource createMaterialResource()
          Create a MaterialResource that corresponds to this resource.
protected  Persistable createPersistable()
          Create a new Persistable that is of the correct type for this object.
private  TimeResource createTimeResource()
          Create a TimeResource that corresponds to this resource.
protected  String getGenericName()
          Return a generic name fo the this object.
protected  String getNameElement()
          Return the name of the XML element that should be used to obtain the value of this object's name.
 ProjectResource getProjectResource()
          Get the persistable ProjectResource that this object corresponds to.
 boolean isMaterial()
          Return true if this resource is a material resource.
protected  boolean isValidPersistable(Persistable p)
          Make sure that the specified Persistable is of the right type for this object.
 boolean isWork()
          Return true if this resource is a work resource.
private  MaterialResource refreshMaterialResource()
          Find a MaterialResource that corresponds to this resource.
protected  Persistable refreshPersistable()
          Retrieve the Persistable that corresponds to this object from the database.
private  TimeResource refreshTimeResource()
          Find a TimeResource that corresponds to this resource.
protected  CostResource updateCostResource(CostResource costRes)
          Update the values that are specific to wt.projmgmt.execution.CostResources.
protected  Persistable updatePersistable(Persistable p)
          Update the specified Persistable with the data in this object.
protected  ProjectResource updateProjectResource(ProjectResource projRes)
          Update the values that are specific to wt.projmgmt.execution.ProjectResources.
protected  TimeResource updateTimeResource(TimeResource timeRes)
          Update the values that are specific to wt.projmgmt.execution.TimeResources.
 
Methods inherited from class wt.projmgmt.msproject.mppobject.MPPObject
compareTo, containsKey, entrySet, get, getCurrentDate, getID, getImportInfo, getName, getObjectIdentifier, getPersistable, getPersistableClass, getPersistableID, getPlan, getProjectPlan, getUID, isContainer, keySet, print, printImpl, printMsg, printNoUpdate, printNoUpdate, printRollUp, printUpdate, printUpdate, put, savePersistable, setID, setPersistable, setPlan, toString, updatePersistableCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME_ELEMENT

public static final String NAME_ELEMENT
The XML element that contains this object's name.

See Also:
Constant Field Values
Constructor Detail

MPPResource

public MPPResource()
Method Detail

getGenericName

protected final String getGenericName()
Description copied from class: MPPObject
Return a generic name fo the this object. The object's ID is appended to the result of this method to form the object's name when it doesn't have a name.

Specified by:
getGenericName in class MPPObject

getNameElement

protected final String getNameElement()
Description copied from class: MPPObject
Return the name of the XML element that should be used to obtain the value of this object's name.

Specified by:
getNameElement in class MPPObject

isWork

public final boolean isWork()
Return true if this resource is a work resource.


refreshTimeResource

private final TimeResource refreshTimeResource()
                                        throws WTException
Find a TimeResource that corresponds to this resource.

Throws:
WTException

createTimeResource

private final TimeResource createTimeResource()
                                       throws WTException
Create a TimeResource that corresponds to this resource. The new resource is persisted.

NOTE: the current implementation of this methods always creates a PersonResource.

Throws:
WTException

isMaterial

public final boolean isMaterial()
Return true if this resource is a material resource.


refreshMaterialResource

private final MaterialResource refreshMaterialResource()
                                                throws WTException
Find a MaterialResource that corresponds to this resource.

Throws:
WTException

createMaterialResource

private final MaterialResource createMaterialResource()
                                               throws WTException
Create a MaterialResource that corresponds to this resource. The new resource is persisted.

Throws:
WTException

getProjectResource

public final ProjectResource getProjectResource()
                                         throws WTException
Get the persistable ProjectResource that this object corresponds to.

Throws:
WTException
See Also:
wt.projmgmt.msproject.mppobject.MPPThing#getPersistable

refreshPersistable

protected final Persistable refreshPersistable()
                                        throws WTException
Description copied from class: MPPObject
Retrieve the Persistable that corresponds to this object from the database. Return null if no such persistable exists.

Overrides:
refreshPersistable in class MPPObject
Throws:
WTException

createPersistable

protected final Persistable createPersistable()
                                       throws WTException
Description copied from class: MPPObject
Create a new Persistable that is of the correct type for this object.

Specified by:
createPersistable in class MPPObject
Throws:
WTException

updatePersistable

protected Persistable updatePersistable(Persistable p)
                                 throws WTException
Description copied from class: MPPObject
Update the specified Persistable with the data in this object.

Specified by:
updatePersistable in class MPPObject
Throws:
WTException

isValidPersistable

protected boolean isValidPersistable(Persistable p)
                              throws WTException
Description copied from class: MPPObject
Make sure that the specified 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.

Overrides:
isValidPersistable in class MPPObject
Throws:
WTException

addToTeam

private final PersonResource addToTeam(PersonResource resource)
                                throws WTException
Add the person that is linked to the specified PersonResource to the project plan's team.

Throws:
WTException

updateProjectResource

protected final ProjectResource updateProjectResource(ProjectResource projRes)
Update the values that are specific to wt.projmgmt.execution.ProjectResources. These include the following values:


updateCostResource

protected final CostResource updateCostResource(CostResource costRes)
Update the values that are specific to wt.projmgmt.execution.CostResources. These include the following values:


updateTimeResource

protected final TimeResource updateTimeResource(TimeResource timeRes)
Update the values that are specific to wt.projmgmt.execution.TimeResources. These include the following values: