wt.projmgmt.resource
Class ProjResourceServiceFwd

java.lang.Object
  extended bywt.projmgmt.resource.ProjResourceServiceFwd
All Implemented Interfaces:
ProjResourceService, RemoteAccess, Serializable

public class ProjResourceServiceFwd
extends Object
implements RemoteAccess, ProjResourceService, Serializable

The ProjResourceService class contains the definition of remotely accessible wt.projmgmt.resource API. The access is made through the ProjResourceHelper.service variable.

Supported API: false

Extendable: false

See Also:
wt.projmgmt.execution.ProResourceHelper, Serialized Form

Field Summary
private static String CLASSNAME
           
private static String FC_RESOURCE
           
(package private) static boolean SERVER
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
ProjResourceServiceFwd()
           
 
Method Summary
 ProjectActivity addResources(ProjectActivity act, Vector resources, Vector max_units)
          Add the resources to the ProjectActivity.
 ProjectActivity changeResource(ProjectActivity projectActivity, ProjectResource old_resource, ProjectResource new_resource)
          This method replaces one ProjectResource with another ProjectResource in a ProjectActivity.
 ProjectResource changeResourceCost(ProjectResource resource, Currency use, CurrencyRate std, CurrencyRate ovt)
          Changes cost properties of the ProjectResource passed as argument.
 QueryResult createPersonResources(ProjectPlan plan, Vector assignees)
          Creates person resources for a list of WTUser passed as argument.
 void delegate(ProjectWorkItem workItem, WTPrincipal principal)
          Changes the owner of the ProjectWorkItem to user passed as argument.
 ProjectActivity getActivityHolder(Deliverable deliverable)
          Returns the ProjectActivity that holds the Deliverable passed as argument.
 QueryResult getActivityResources(ProjectActivity activity)
          Return all enabled ProjectResource associated with a given ProjectActivity.
 QueryResult getAllActivityResources(ProjectActivity activity)
          Return all enabled and disabled ProjectResource objects associated with a given ProjectActivity.
 QueryResult getAllProjectResources(ProjectPlan plan)
          Return all enabled and disabled ProjectResource associated with a given ProjectPlan passed as arguent.
 QueryResult getAllResourceAssignments(ProjectPlan plan, ResourceHolder holder, ProjectResource resource)
          Returns resource assignments (ResourceAssignmentLink) for a ProjectPlan, ResourceHolder, and ProjectResource passed as arguments.
 QueryResult getAssignees(ProjectActivity activity)
          Returns the assignees for the activity passed as argument.
 Currency getCurrentCost(ExecutionObject exec_obj, Timestamp time)
          Returns the total cost incurred in the execution of the object up to the time passed as argument.
 Currency getCurrentCost(ProjectResource resource, ProjectActivity activity, Timestamp time)
          Returns the current cost spent by a ProjectResource in a ProjectActivity up to the time passed as argument.
 Currency getCurrentResourceCost(ProjectResource resource, Timestamp time)
          Returns the cost spent so far for a given ProjectResource in the plan up to the time passed as argument.
 double getCurrentResourceUnits(ProjectResource resource, Timestamp time)
          Returns the number of resources (units) consumed so far for a given ProjectResource in the plan up to the time passed as argument.
 double getCurrentUnits(ProjectResource resource, ProjectActivity activity, Timestamp time)
          Returns the current units spent by a ProjectResource in a ProjectActivity up to the time passed as argument.
 QueryResult getDeliverables(ExecutionObject exec_obj)
          Returns all Deliverables associated to n {@link wt.projmgmt.execution.
 QueryResult getDeliverables(WTUser user)
          Returns all Deliverable objects owner by the WTUser passed as argument.
private static Manager getManager()
           
 QueryResult getMilestoneHolders(Deliverable deliverable)
          Returns a list of Milestone that hold for the Deliverable passed as argument.
 PersonResource getPersonResource(ProjectPlan plan, WTUser person)
          Returns the PersonResource for a plan given a WTUser.
 QueryResult getProjectResources(ProjectPlan plan)
          Return all enabled ProjectResource associated with a given ProjectPlan passed as argument.
 ProjectResource getResource(ProjectPlan plan, String resource_name)
          Returns a ProjectResource given the host ProjectPlan and the resource name.
 QueryResult getResourceAssignments(ProjectPlan plan, ResourceHolder holder, ProjectResource resource)
          Returns resource assignments (ResourceAssignmentLink) for a ProjectPlan, ResourceHolder, and ProjectResource passed as arguments.
 Currency getTotalCost(ExecutionObject exec_obj)
          Returns the total cost incurred in the execution of the object passed as argument.
 Currency getTotalCost(ProjectResource resource, ProjectActivity activity)
          Returns the total cost to be spent by a ProjectResource in a ProjectActivity.
 Currency getTotalResourceCost(ProjectResource resource)
          Returns the total cost for a given ProjectResource in the ProjectPlan that contains the resource This method may return a non-zero value only for CostResource objects.
 double getTotalResourceUnits(ProjectResource resource)
          Returns the total resources (or units) to be spent for a given ProjectResource.
 double getTotalUnits(ProjectResource resource, ProjectActivity activity)
          Returns the total units to be spent by a ProjectResource.
 QueryResult getUserDeliverables(WTUser user, ProjectPlan plan, ProjectState state)
          Returns all Deliverable that belong to a given WTUser.
 QueryResult getUserDeliverables(WTUser user, ProjectPlan plan, ProjectState state, Integer queryLimit, String orderByStr)
          Returns all Deliverable that belong to a given WTUser.
 ProjectActivity removeResources(ProjectActivity act, Vector resources)
          Removes the resource assignments (ResourceAssignmentLink) that correspond to the ProjectActivity.and ProjectResources passed as arguments.
 void replaceUser(WTContainer container, WTUser replacedUser, WTUser newUser)
          Replaces the replaced user with the new user for resource objects.
 void setMilestones(Deliverable deliverable, Vector milestones)
          Adds the Deliverable to each be contained in each Milestone passed as argument as a list.
 ProjectActivity setResources(ProjectActivity act, Vector resources, Vector max_units)
          Sets initial ProjectResources for a ProjectActivity, given the resources and associated maximum units.
 Deliverable setTarget(Deliverable deliverable, Persistable target, boolean latest)
          Sets the target of a Deliverable as the Persistable passed as argument.
 ProjectActivity updateResources(ProjectActivity act, Vector resources, Vector max_units)
          Updates project resources for an activity, given the resources and associated maximum units.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER

static final boolean SERVER

FC_RESOURCE

private static final String FC_RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Constructor Detail

ProjResourceServiceFwd

public ProjResourceServiceFwd()
Method Detail

getManager

private static Manager getManager()
                           throws WTException
Returns:
Manager
Throws:
WTException

addResources

public ProjectActivity addResources(ProjectActivity act,
                                    Vector resources,
                                    Vector max_units)
                             throws WTException
Add the resources to the ProjectActivity. The resources and their corresponding maximum units are given as two lists (Vector) of ProjectResource and Integer, respectively. If the resource assignment already exists and if the current maximum units resources is the same as the maximum units resources passed as argument nothing happens. Otherwise the maximum units that differ are updated.

Supported API: false

Specified by:
addResources in interface ProjResourceService
Parameters:
act -
resources -
max_units -
Returns:
ProjectActivity
Throws:
WTException

changeResource

public ProjectActivity changeResource(ProjectActivity projectActivity,
                                      ProjectResource old_resource,
                                      ProjectResource new_resource)
                               throws WTException
This method replaces one ProjectResource with another ProjectResource in a ProjectActivity.

Supported API: false

Specified by:
changeResource in interface ProjResourceService
Parameters:
projectActivity -
old_resource -
new_resource -
Returns:
ProjectActivity
Throws:
WTException

changeResourceCost

public ProjectResource changeResourceCost(ProjectResource resource,
                                          Currency use,
                                          CurrencyRate std,
                                          CurrencyRate ovt)
                                   throws WTException
Changes cost properties of the ProjectResource passed as argument. For PersonResource objects the method propagates changes as they affect work cost.

Supported API: false

Specified by:
changeResourceCost in interface ProjResourceService
Parameters:
resource -
use -
std -
ovt -
Returns:
ProjectResource
Throws:
WTException

createPersonResources

public QueryResult createPersonResources(ProjectPlan plan,
                                         Vector assignees)
                                  throws WTException
Creates person resources for a list of WTUser passed as argument. Returns the list of PersonResource just created. A resource is created for a specific user only if it doesn't exist already.

Supported API: false

Specified by:
createPersonResources in interface ProjResourceService
Parameters:
plan -
assignees -
Returns:
QueryResult
Throws:
WTException

delegate

public void delegate(ProjectWorkItem workItem,
                     WTPrincipal principal)
              throws WTException
Changes the owner of the ProjectWorkItem to user passed as argument. Updates the resource assignment and calls the workflow method of the same name in the work service.

Supported API: false

Specified by:
delegate in interface ProjResourceService
Parameters:
workItem -
principal -
Throws:
WTException

getActivityHolder

public ProjectActivity getActivityHolder(Deliverable deliverable)
                                  throws WTException
Returns the ProjectActivity that holds the Deliverable passed as argument. Returns 'null' if deliverable is not held by any activity.

Supported API: false

Specified by:
getActivityHolder in interface ProjResourceService
Parameters:
deliverable -
Returns:
ProjectActivity
Throws:
WTException

getActivityResources

public QueryResult getActivityResources(ProjectActivity activity)
                                 throws WTException
Return all enabled ProjectResource associated with a given ProjectActivity.

Supported API: false

Specified by:
getActivityResources in interface ProjResourceService
Parameters:
activity -
Returns:
QueryResult
Throws:
WTException

getAllActivityResources

public QueryResult getAllActivityResources(ProjectActivity activity)
                                    throws WTException
Return all enabled and disabled ProjectResource objects associated with a given ProjectActivity.

Supported API: false

Specified by:
getAllActivityResources in interface ProjResourceService
Parameters:
activity -
Returns:
QueryResult
Throws:
WTException

getAllProjectResources

public QueryResult getAllProjectResources(ProjectPlan plan)
                                   throws WTException
Return all enabled and disabled ProjectResource associated with a given ProjectPlan passed as arguent.

Supported API: false

Specified by:
getAllProjectResources in interface ProjResourceService
Parameters:
plan -
Returns:
QueryResult
Throws:
WTException

getAllResourceAssignments

public QueryResult getAllResourceAssignments(ProjectPlan plan,
                                             ResourceHolder holder,
                                             ProjectResource resource)
                                      throws WTException
Returns resource assignments (ResourceAssignmentLink) for a ProjectPlan, ResourceHolder, and ProjectResource passed as arguments. If the resource holder is not null, only resource assignments for the holder are returned. Similarly, if the resource is not null, only assignments for the given resource are returned. If the resource is null, assignments for both enabled and disabled resources are returned.

Supported API: false

Specified by:
getAllResourceAssignments in interface ProjResourceService
Parameters:
plan -
holder -
resource -
Returns:
QueryResult
Throws:
WTException

getAssignees

public QueryResult getAssignees(ProjectActivity activity)
                         throws WTException
Returns the assignees for the activity passed as argument. If the activity is running, returns the actual workitem owners, otherwise returns the principal assignees from the activity template.

Supported API: false

Specified by:
getAssignees in interface ProjResourceService
Parameters:
activity -
Returns:
QueryResult
Throws:
WTException

getCurrentCost

public Currency getCurrentCost(ExecutionObject exec_obj,
                               Timestamp time)
                        throws WTException
Returns the total cost incurred in the execution of the object up to the time passed as argument. Implemented only for ProjectActivity, SummaryActivity, ProjectProxy and ProjectPlan.

Supported API: false

Specified by:
getCurrentCost in interface ProjResourceService
Parameters:
exec_obj -
time -
Returns:
Currency
Throws:
WTException

getCurrentCost

public Currency getCurrentCost(ProjectResource resource,
                               ProjectActivity activity,
                               Timestamp time)
                        throws WTException
Returns the current cost spent by a ProjectResource in a ProjectActivity up to the time passed as argument.

Supported API: false

Specified by:
getCurrentCost in interface ProjResourceService
Parameters:
resource -
activity -
time -
Returns:
Currency
Throws:
WTException

getCurrentResourceCost

public Currency getCurrentResourceCost(ProjectResource resource,
                                       Timestamp time)
                                throws WTException
Returns the cost spent so far for a given ProjectResource in the plan up to the time passed as argument. This method may return a non-zero value only for CostResource objects. For non-cost resources this method returns 0.0.

The current cost for a single activity is the cost per use plus a cost that depends on the type of the resource, as follows.



Supported API: false

Specified by:
getCurrentResourceCost in interface ProjResourceService
Parameters:
resource -
time -
Returns:
Currency
Throws:
WTException

getCurrentResourceUnits

public double getCurrentResourceUnits(ProjectResource resource,
                                      Timestamp time)
                               throws WTException
Returns the number of resources (units) consumed so far for a given ProjectResource in the plan up to the time passed as argument.

Supported API: false

Specified by:
getCurrentResourceUnits in interface ProjResourceService
Parameters:
resource -
time -
Returns:
double
Throws:
WTException

getCurrentUnits

public double getCurrentUnits(ProjectResource resource,
                              ProjectActivity activity,
                              Timestamp time)
                       throws WTException
Returns the current units spent by a ProjectResource in a ProjectActivity up to the time passed as argument.

Supported API: false

Specified by:
getCurrentUnits in interface ProjResourceService
Parameters:
resource -
activity -
time -
Returns:
double
Throws:
WTException

getDeliverables

public QueryResult getDeliverables(ExecutionObject exec_obj)
                            throws WTException
Returns all Deliverables associated to n ExecutionObject . If the execution object is a deliverable holder (milestone or project activity) it navigates the deliverable holding association. If it is a project plan, it returns all deliverables in the plan. If it is a summary activity, it returns all deliverables held by objects contained in the summary. Otherwise an empty list is returned. Only enabled deliverables are returned.

Supported API: false

Specified by:
getDeliverables in interface ProjResourceService
Parameters:
exec_obj -
Returns:
QueryResult
Throws:
WTException
See Also:
wt.projmgmtexecution.Milestone, wt.projmgmtexecution.ProjectActivity, wt.projmgmtexecution.ProjectPlan, wt.projmgmtexecution.ProjectProxy, wt.projmgmtexecution.SummaryActivity, Deliverable, DeliverableHolder

getDeliverables

public QueryResult getDeliverables(WTUser user)
                            throws WTException
Returns all Deliverable objects owner by the WTUser passed as argument. Only deliverables belonging to running projects are returned. The user passed as argument can not be 'null'

Supported API: false

Specified by:
getDeliverables in interface ProjResourceService
Parameters:
user -
Returns:
QueryResult
Throws:
WTException

getMilestoneHolders

public QueryResult getMilestoneHolders(Deliverable deliverable)
                                throws WTException
Returns a list of Milestone that hold for the Deliverable passed as argument.

Supported API: false

Specified by:
getMilestoneHolders in interface ProjResourceService
Parameters:
deliverable -
Returns:
QueryResult
Throws:
WTException

getPersonResource

public PersonResource getPersonResource(ProjectPlan plan,
                                        WTUser person)
                                 throws WTException
Returns the PersonResource for a plan given a WTUser.

Supported API: false

Specified by:
getPersonResource in interface ProjResourceService
Parameters:
plan -
person -
Returns:
PersonResource
Throws:
WTException

getProjectResources

public QueryResult getProjectResources(ProjectPlan plan)
                                throws WTException
Return all enabled ProjectResource associated with a given ProjectPlan passed as argument.

Supported API: false

Specified by:
getProjectResources in interface ProjResourceService
Parameters:
plan -
Returns:
QueryResult
Throws:
WTException

getResource

public ProjectResource getResource(ProjectPlan plan,
                                   String resource_name)
                            throws WTException
Returns a ProjectResource given the host ProjectPlan and the resource name. Returns 'null' if this resource can't be found.

Supported API: false

Specified by:
getResource in interface ProjResourceService
Parameters:
plan -
resource_name -
Returns:
ProjectResource
Throws:
WTException

getResourceAssignments

public QueryResult getResourceAssignments(ProjectPlan plan,
                                          ResourceHolder holder,
                                          ProjectResource resource)
                                   throws WTException
Returns resource assignments (ResourceAssignmentLink) for a ProjectPlan, ResourceHolder, and ProjectResource passed as arguments. If the resource holder is not null, only resource assignments for the holder are returned. Similarly, if the resource is not null, only assignments for the given resource are returned. If the resource is null, assignments for only enabled are returned.

Supported API: false

Specified by:
getResourceAssignments in interface ProjResourceService
Parameters:
plan -
holder -
resource -
Returns:
QueryResult
Throws:
WTException

getTotalCost

public Currency getTotalCost(ExecutionObject exec_obj)
                      throws WTException
Returns the total cost incurred in the execution of the object passed as argument. Implemented only for ProjectActivity, SummaryActivity, ProjectProxy and ProjectPlan.

Supported API: false

Specified by:
getTotalCost in interface ProjResourceService
Parameters:
exec_obj -
Returns:
Currency
Throws:
WTException

getTotalCost

public Currency getTotalCost(ProjectResource resource,
                             ProjectActivity activity)
                      throws WTException
Returns the total cost to be spent by a ProjectResource in a ProjectActivity.

Supported API: false

Specified by:
getTotalCost in interface ProjResourceService
Parameters:
resource -
activity -
Returns:
Currency
Throws:
WTException

getTotalResourceCost

public Currency getTotalResourceCost(ProjectResource resource)
                              throws WTException
Returns the total cost for a given ProjectResource in the ProjectPlan that contains the resource This method may return a non-zero value only for CostResource objects. For non-cost resources this method returns 0.0.

The total cost for a single activity is the cost per use plus a cost that depends on the type of the resource, as follows.



Supported API: false

Specified by:
getTotalResourceCost in interface ProjResourceService
Parameters:
resource -
Returns:
Currency
Throws:
WTException

getTotalResourceUnits

public double getTotalResourceUnits(ProjectResource resource)
                             throws WTException
Returns the total resources (or units) to be spent for a given ProjectResource.

The total units depends on the type of the resource, as follows. It is a sum of the units for each activity in the plan.



Supported API: false

Specified by:
getTotalResourceUnits in interface ProjResourceService
Parameters:
resource -
Returns:
double
Throws:
WTException

getTotalUnits

public double getTotalUnits(ProjectResource resource,
                            ProjectActivity activity)
                     throws WTException
Returns the total units to be spent by a ProjectResource. in a ProjectActivity.

Supported API: false

Specified by:
getTotalUnits in interface ProjResourceService
Parameters:
resource -
activity -
Returns:
double
Throws:
WTException

getUserDeliverables

public QueryResult getUserDeliverables(WTUser user,
                                       ProjectPlan plan,
                                       ProjectState state)
                                throws WTException
Returns all Deliverable that belong to a given WTUser. If the plan passed as argument is 'null', deliverables from all ProjectPlan objects are returned. Only plans in the state (ProjectState) passed as argument are considered. If the state is null, however, all states are considered.

The deliverables are returned ordered by their deadlines (sooner first) and then by their names.

Supported API: false

Specified by:
getUserDeliverables in interface ProjResourceService
Parameters:
user -
plan -
state -
Returns:
QueryResult
Throws:
WTException

removeResources

public ProjectActivity removeResources(ProjectActivity act,
                                       Vector resources)
                                throws WTException
Removes the resource assignments (ResourceAssignmentLink) that correspond to the ProjectActivity.and ProjectResources passed as arguments. This method doesn't remove the resources from the plan just their assignments in the activity.

Supported API: false

Specified by:
removeResources in interface ProjResourceService
Parameters:
act -
resources -
Returns:
ProjectActivity
Throws:
WTException

replaceUser

public void replaceUser(WTContainer container,
                        WTUser replacedUser,
                        WTUser newUser)
                 throws WTException
Replaces the replaced user with the new user for resource objects.

Supported API: false

Specified by:
replaceUser in interface ProjResourceService
Parameters:
container -
replacedUser -
newUser -
Throws:
WTException

setMilestones

public void setMilestones(Deliverable deliverable,
                          Vector milestones)
                   throws WTException
Adds the Deliverable to each be contained in each Milestone passed as argument as a list. Removes the deliverable from all milestones not in the list.

Supported API: false

Specified by:
setMilestones in interface ProjResourceService
Parameters:
deliverable -
milestones -
Throws:
WTException

setResources

public ProjectActivity setResources(ProjectActivity act,
                                    Vector resources,
                                    Vector max_units)
                             throws WTException
Sets initial ProjectResources for a ProjectActivity, given the resources and associated maximum units. Assumes no resources has been set for the activity. To update resources use ProjResourceService.updateResources(wt.projmgmt.execution.ProjectActivity, java.util.Vector, java.util.Vector)

Supported API: false

Specified by:
setResources in interface ProjResourceService
Parameters:
act -
resources -
max_units -
Returns:
ProjectActivity
Throws:
WTException

setTarget

public Deliverable setTarget(Deliverable deliverable,
                             Persistable target,
                             boolean latest)
                      throws WTException
Sets the target of a Deliverable as the Persistable passed as argument. In case of iterated object targets, the association between a deliverable is established between the deliverable and the master if latest is 'true' or with the iteration itself if not.

Supported API: false

Specified by:
setTarget in interface ProjResourceService
Parameters:
deliverable -
target -
latest -
Returns:
Deliverable
Throws:
WTException

updateResources

public ProjectActivity updateResources(ProjectActivity act,
                                       Vector resources,
                                       Vector max_units)
                                throws WTException
Updates project resources for an activity, given the resources and associated maximum units. If the resource assignment already exists and if the total resources is the same as the total resources passed as argument nothing happens. Otherwise the resource total is changed. If an existing resource is not in the list then its assignment is removed.

Supported API: false

Specified by:
updateResources in interface ProjResourceService
Parameters:
act -
resources -
max_units -
Returns:
ProjectActivity
Throws:
WTException

getUserDeliverables

public QueryResult getUserDeliverables(WTUser user,
                                       ProjectPlan plan,
                                       ProjectState state,
                                       Integer queryLimit,
                                       String orderByStr)
                                throws WTException
Returns all Deliverable that belong to a given WTUser. If the plan passed as argument is 'null', deliverables from all ProjectPlan objects are returned. Only plans in the state (ProjectState) passed as argument are considered. If the state is null, however, all states are considered.

The deliverables are returned ordered by their deadlines (sooner first) and then by their names.

Supported API: false

Specified by:
getUserDeliverables in interface ProjResourceService
Parameters:
user -
plan -
state -
queryLimit -
orderByStr -
Returns:
QueryResult
Throws:
WTException