wt.project
Class StandardProjectService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.project.StandardProjectService
All Implemented Interfaces:
Manager, NetFactor, ProjectService, ProjectServiceSvr, Serializable

public class StandardProjectService
extends StandardManager
implements ProjectServiceSvr, ProjectService, Serializable

Standard implementation of the project service interfaces.

Use the newStandardProjectService static factory method(s), not the StandardProjectService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static Object IGNORE_DELETE_KEY
           
private static String RESOURCE
           
private static String SERVICE_NAME
           
private static boolean VERBOSE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardProjectService()
           
 
Method Summary
 Role[] allRoles()
          Deprecated. in R4.0. Use the appropriate call on the EnumeratedType object to get these values.
private  void applyResolution(Role role, Enumeration principals, RoleHolder roleHolder)
           
 Project copyProject(Project aProject, String copyName, String folderLocation, boolean persist)
          Produces a copy of the Project object with the name passed as argument.
 ProjectReference createTeamInstance(Persistable object)
          Deprecated. in R6.0
protected  void dispatchVetoableEvent(String eventType, ProjectManaged object)
          Dispatches a ProjectServiceEvent that includes the event type and target (i.e., ProjectManaged object).
 ProjectManaged doReproject(ProjectManaged object, ProjectReference projRef)
          Associate the object with a new project

Supported API: false
private  Vector findProjectsByDomain(AdministrativeDomain aDomain)
          find methods *
 Vector getCandidateProjects()
          Answer a vector of project references that the project managed object can be assigned to

Supported API: false
 Vector getCandidateProjects(AdminDomainRef domainRef)
          Answer a vector of project references that the project managed object can be assigned to

Supported API: false
 Vector getCandidateProjects(String domain)
          Answer a vector of project references from the specified domain that the project managed object can be assigned to

Supported API: false
 String getConceptualClassname()
          Deprecated.  
private static Cabinet getContainingCabinet(CabinetBased foldered)
           
 Vector getEnabledProjectNames()
          Return an unsorted Vector of Project names as Strings.
private  String getIdentity(ProjectManaged p)
           
private  Object getIgnoreDelete()
           
 Vector getMembers(Project aProject)
          Answer a vector of WTPrincipalReference of all members of a project

Supported API: false
 Project getProject(AdministrativeDomain adminDomain, String projectName)
          Given the AdministrativeDomain and name of a project, find the Project object.
 Project getProject(ProjectManaged object)
          Given a ProjectManaged object, answer the assigned project

Supported API: false
 Project getProject(String projectIdentity)
          Given the name or the identity of a project, find the Project object.
 Vector getProjectNames()
          Retrieve an unsorted Vector of Project names as strings.
 Vector getProjects()
          Answer a vector of project references for all projects, including the disabled ones

Supported API: false
private  String getStringOfProjectIdentities(QueryResult qr)
           
 Vector getTeamInstances()
          Deprecated. in R6.0
private  boolean isCheckedOut(ProjectManaged object)
           
private  boolean isWorkingCopy(ProjectManaged object)
           
static StandardProjectService newStandardProjectService()
          Default factory for the class.
protected  void performStartupProcess()
          Overrides the startup process specific to the project service to provide custom startup for event subscription.
protected  void processLatestIterationChange(ProjectManaged original, ProjectManaged replacement)
          Maintain the cookie information upon checkin, etc
private  Vector projectQRtoProjectRefVector(QueryResult aResultSet)
           
 void registerEvents(ManagerService manager)
          Overrides the registration of all applicable lifecycle service events with the service manager.
 ProjectManaged reproject(ProjectManaged object, ProjectReference projRef)
          Associate a project managed object with a new project.
 WTPrincipalReference resolveActorRole(ActorRole actorRole, Persistable object)
          Given an actorRole and an object, resolve the actor role to a principal

Supported API: false
private  Enumeration resolveByActorRole(Role roleToResolve, ActorRoleHolder actorRoleHolder, Persistable object)
           
private  Enumeration resolveByAllPrincipals(Role roleToResolve, ActorRoleHolder actorRoleHolder, Persistable object)
           
private  Enumeration resolveByPrincipal(Role roleToResolve, RoleHolder roleHolder)
           
private  Enumeration resolveByRole(Role roleToResolve, IndirectRoleHolder indirectRoleHolder, ActorRoleHolder actorRoleHolder, Persistable object)
           
private  Enumeration resolveRole(Role role, IndirectRoleHolder indirectRoleHolder, ActorRoleHolder actorRoleHolder, Persistable object)
          role resolution methods *
 WTRoleHolder resolveRoles(IndirectRoleHolder indirectRoleHolder, ActorRoleHolder actorRoleHolder, RoleHolder resultsRoleHolder, Persistable object)
          Given an indirect role holder and a role holder, resolve the roles to just enabled principals.
 void setIgnoreDelete(Object obj)
          

Supported API: false
private  ProjectManaged setProject(ProjectManaged object, Project aProject)
           
private  ProjectManaged setProject(ProjectManaged object, ProjectReference projRef)
           
 ProjectManaged setProject(ProjectManaged object, String projectName, String domain)
          Deprecated. at 6.0 (Use the ProjectHelper.setProject(myObject, ProjectHelper.service.getProject(AdministrativeDomainHelper.manager.getDomain(adminDomainName), projectName)) instead
private  void validateIsLatestIteration(ProjectManaged object, String action)
           
private  void validateProject(ProjectManaged object)
           
 ProjectManaged validateReproject(ProjectManaged object, ProjectReference projRef)
          Perform pre-reproject validations

Supported API: false
 Vector whereUsed(ProjectReference project)
          Answer a Vector of ProjectManaged objects Note: Any services that persist a ProjectReferenceare individually responsible for making sure the Project doesn't disappear on them.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

IGNORE_DELETE_KEY

private static final Object IGNORE_DELETE_KEY

VERBOSE

private static final boolean VERBOSE

SERVICE_NAME

private static final String SERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

StandardProjectService

public StandardProjectService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Overrides the startup process specific to the project service to provide custom startup for event subscription. During subscription an anonymous inner class adapter is created per subscription to handle each specific event of interest.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerEvents

public void registerEvents(ManagerService manager)
Overrides the registration of all applicable lifecycle service events with the service manager.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
manager - the ManagerService object used to override the registration of applicable events with the service manager

dispatchVetoableEvent

protected void dispatchVetoableEvent(String eventType,
                                     ProjectManaged object)
                              throws WTException,
                                     WTPropertyVetoException
Dispatches a ProjectServiceEvent that includes the event type and target (i.e., ProjectManaged object).

Supported API: false

Parameters:
eventType - The name of the PersistentManagerEvent type.
object - The target of the persistable operation.
Throws:
WTException
WTPropertyVetoException

newStandardProjectService

public static StandardProjectService newStandardProjectService()
                                                        throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardProjectService
Throws:
WTException

resolveRoles

public WTRoleHolder resolveRoles(IndirectRoleHolder indirectRoleHolder,
                                 ActorRoleHolder actorRoleHolder,
                                 RoleHolder resultsRoleHolder,
                                 Persistable object)
                          throws ProjectException,
                                 WTException
Given an indirect role holder and a role holder, resolve the roles to just enabled principals.

Supported API: false

Specified by:
resolveRoles in interface ProjectServiceSvr
Parameters:
indirectRoleHolder - the IndirectRoleHolder that contains roles/actorRoles to be resolved
actorRoleHolder - the ActorRoleHolder that contains rolePrincipalMaps and roleActorRoleMaps. This is typically the Project object.
resultsRoleHolder - the RoleHolder that will be populated with RolePrincipal mappings. In the case of LifeCycle, this will be a Phase object.
object - the object that is used to lookup a principal for the ActorRole
Returns:
WTRoleHolder
Throws:
ProjectException
WTException

resolveActorRole

public WTPrincipalReference resolveActorRole(ActorRole actorRole,
                                             Persistable object)
                                      throws ProjectException,
                                             WTException
Given an actorRole and an object, resolve the actor role to a principal

Supported API: false

Specified by:
resolveActorRole in interface ProjectServiceSvr
Parameters:
actorRole - the ActorRole to be resolved
object - the object that is used to lookup a principal for the ActorRole
Returns:
WTPrincipalReference
Throws:
ProjectException
WTException

doReproject

public ProjectManaged doReproject(ProjectManaged object,
                                  ProjectReference projRef)
                           throws WTException,
                                  ProjectException
Associate the object with a new project

Supported API: false

Specified by:
doReproject in interface ProjectServiceSvr
Parameters:
object - the ProjectManaged object to be re-projected
projRef -
Returns:
ProjectManaged
Throws:
WTException
ProjectException

validateReproject

public ProjectManaged validateReproject(ProjectManaged object,
                                        ProjectReference projRef)
                                 throws WTException,
                                        ProjectException
Perform pre-reproject validations

Supported API: false

Specified by:
validateReproject in interface ProjectServiceSvr
Parameters:
object - the ProjectManaged object that should be re-projected
projRef -
Returns:
ProjectManaged
Throws:
WTException
ProjectException

getCandidateProjects

public Vector getCandidateProjects(String domain)
                            throws WTException,
                                   ProjectException
Answer a vector of project references from the specified domain that the project managed object can be assigned to

Supported API: false

Specified by:
getCandidateProjects in interface ProjectService
Parameters:
domain - the name of the domain used as search criteria in the retrieval of candidate projects
Returns:
Vector
Throws:
WTException
ProjectException

getCandidateProjects

public Vector getCandidateProjects()
                            throws WTException,
                                   ProjectException
Answer a vector of project references that the project managed object can be assigned to

Supported API: false

Specified by:
getCandidateProjects in interface ProjectService
Returns:
Vector
Throws:
WTException
ProjectException

getCandidateProjects

public Vector getCandidateProjects(AdminDomainRef domainRef)
                            throws WTException,
                                   ProjectException
Answer a vector of project references that the project managed object can be assigned to

Supported API: false

Specified by:
getCandidateProjects in interface ProjectService
Parameters:
domainRef - the AdminDomainRef object used as search criteria in the retrieval of candidate projects
Returns:
Vector
Throws:
WTException
ProjectException

allRoles

public Role[] allRoles()
                throws WTException
Deprecated. in R4.0. Use the appropriate call on the EnumeratedType object to get these values.

Answer an array of Role objects

Supported API: false

Specified by:
allRoles in interface ProjectService
Returns:
Role[]
Throws:
WTException

getProject

public Project getProject(ProjectManaged object)
                   throws WTException,
                          ProjectException
Given a ProjectManaged object, answer the assigned project

Supported API: false

Specified by:
getProject in interface ProjectService
Parameters:
object - the ProjectManaged object
Returns:
Project
Throws:
WTException
ProjectException

getProject

public Project getProject(AdministrativeDomain adminDomain,
                          String projectName)
                   throws WTException,
                          ProjectException
Given the AdministrativeDomain and name of a project, find the Project object.

Supported API: false

Specified by:
getProject in interface ProjectService
Parameters:
adminDomain - the AdministrativeDomain of the project
projectName - the name of the project
Returns:
Project
Throws:
WTException
ProjectException

getProject

public Project getProject(String projectIdentity)
                   throws WTException,
                          ProjectException
Given the name or the identity of a project, find the Project object. If the identity of the object is passed in and the project exists, it should always be returned. If the name of the project is passed in and there is only one in the system by that name, it will be returned. If the name of the project is passed in, but there are multiples in the system (in different cabinets) by that name, an exception will be thrown.

Supported API: false

Specified by:
getProject in interface ProjectService
Parameters:
projectIdentity - a String that contains the identity of the project
Returns:
Project
Throws:
WTException
ProjectException

setProject

public ProjectManaged setProject(ProjectManaged object,
                                 String projectName,
                                 String domain)
                          throws WTException,
                                 ProjectException,
                                 WTPropertyVetoException
Deprecated. at 6.0 (Use the ProjectHelper.setProject(myObject, ProjectHelper.service.getProject(AdministrativeDomainHelper.manager.getDomain(adminDomainName), projectName)) instead

Set the project of the ProjectManaged object

Supported API: false

Specified by:
setProject in interface ProjectService
Parameters:
object - the ProjectManaged object whose project should be set
projectName - a String that contains the name of the project to set on the ProjectManaged object.
domain - a String that contain the AdministrativeDomain of the project that should be set
Returns:
ProjectManaged
Throws:
WTException
ProjectException
WTPropertyVetoException

reproject

public ProjectManaged reproject(ProjectManaged object,
                                ProjectReference projRef)
                         throws WTException,
                                ProjectException
Associate a project managed object with a new project.

Supported API: false

Specified by:
reproject in interface ProjectService
Parameters:
object - the ProjectManaged object that should be associated with a new project.
projRef - a reference to a Project, a ProjectReference of the projec tthat the object should be reassigned to
Returns:
ProjectManaged
Throws:
WTException
ProjectException

setIgnoreDelete

public void setIgnoreDelete(Object obj)
                     throws WTException


Supported API: false

Specified by:
setIgnoreDelete in interface ProjectService
Parameters:
obj -
Throws:
WTException

getMembers

public Vector getMembers(Project aProject)
                  throws WTException
Answer a vector of WTPrincipalReference of all members of a project

Supported API: false

Specified by:
getMembers in interface ProjectService
Parameters:
aProject -
Returns:
Vector
Throws:
WTException

copyProject

public Project copyProject(Project aProject,
                           String copyName,
                           String folderLocation,
                           boolean persist)
                    throws WTException
Produces a copy of the Project object with the name passed as argument. If the name argument is "null", the name of the copied Project is prefixed with 'copy of'. If the folder location is not specified, the object will be created in the orginal Project's folder location. If the persist parameter is set to True, the object will be persisted before it is returned. Note: The 'Copy Of' prefix is pulled from a Resource Bundle for localization purposes.

Supported API: false

Specified by:
copyProject in interface ProjectService
Parameters:
aProject -
copyName -
folderLocation -
persist -
Returns:
Project
Throws:
WTException

getProjects

public Vector getProjects()
                   throws WTException,
                          ProjectException
Answer a vector of project references for all projects, including the disabled ones

Supported API: false

Specified by:
getProjects in interface ProjectService
Returns:
Vector
Throws:
WTException
ProjectException

whereUsed

public Vector whereUsed(ProjectReference project)
                 throws WTException,
                        ProjectException
Answer a Vector of ProjectManaged objects Note: Any services that persist a ProjectReferenceare individually responsible for making sure the Project doesn't disappear on them. For example, see the Workflow Engine and Workflow Definer service. These services listen for the pre_delete of a Project object and perform their own 'whereUsed' lookup. If the Project object that is about to be deleted is used by that service, that service vetoes the exception.

Supported API: false

Specified by:
whereUsed in interface ProjectService
Parameters:
project - A ProjectReference representing the Project object of interest
Returns:
Vector
Throws:
WTException
ProjectException

createTeamInstance

public ProjectReference createTeamInstance(Persistable object)
                                    throws WTException
Deprecated. in R6.0

Creates a team instance based on the selected project. Links the object to the team.

Supported API: false

Specified by:
createTeamInstance in interface ProjectService
Parameters:
object - The object that needs a Team Instance
Returns:
ProjectReference
Throws:
WTException

getTeamInstances

public Vector getTeamInstances()
                        throws WTException,
                               ProjectException
Deprecated. in R6.0

Answer a vector of project references for all team instances, including the disabled ones

Supported API: false

Specified by:
getTeamInstances in interface ProjectService
Returns:
Vector
Throws:
WTException
ProjectException

getProjectNames

public Vector getProjectNames()
                       throws WTException
Retrieve an unsorted Vector of Project names as strings. The list includes all Projects including those which are no longer enabled.

Supported API: false

Specified by:
getProjectNames in interface ProjectService
Returns:
Vector
Throws:
WTException

getEnabledProjectNames

public Vector getEnabledProjectNames()
                              throws WTException
Return an unsorted Vector of Project names as Strings. The list of names comprises only enabled Projects

Supported API: false

Specified by:
getEnabledProjectNames in interface ProjectService
Returns:
Vector
Throws:
WTException

getStringOfProjectIdentities

private String getStringOfProjectIdentities(QueryResult qr)
                                     throws WTException,
                                            ProjectException
Throws:
WTException
ProjectException

processLatestIterationChange

protected void processLatestIterationChange(ProjectManaged original,
                                            ProjectManaged replacement)
                                     throws WTException
Maintain the cookie information upon checkin, etc

Throws:
WTException

findProjectsByDomain

private Vector findProjectsByDomain(AdministrativeDomain aDomain)
                             throws ProjectException
find methods *

Throws:
ProjectException

projectQRtoProjectRefVector

private Vector projectQRtoProjectRefVector(QueryResult aResultSet)
                                    throws WTException
Throws:
WTException

getContainingCabinet

private static Cabinet getContainingCabinet(CabinetBased foldered)
                                     throws WTException
Throws:
WTException

resolveRole

private Enumeration resolveRole(Role role,
                                IndirectRoleHolder indirectRoleHolder,
                                ActorRoleHolder actorRoleHolder,
                                Persistable object)
                         throws ProjectException,
                                WTException
role resolution methods *

Throws:
ProjectException
WTException

resolveByAllPrincipals

private Enumeration resolveByAllPrincipals(Role roleToResolve,
                                           ActorRoleHolder actorRoleHolder,
                                           Persistable object)
                                    throws WTException
Throws:
WTException

resolveByActorRole

private Enumeration resolveByActorRole(Role roleToResolve,
                                       ActorRoleHolder actorRoleHolder,
                                       Persistable object)
                                throws WTException
Throws:
WTException

resolveByPrincipal

private Enumeration resolveByPrincipal(Role roleToResolve,
                                       RoleHolder roleHolder)
                                throws WTException
Throws:
WTException

resolveByRole

private Enumeration resolveByRole(Role roleToResolve,
                                  IndirectRoleHolder indirectRoleHolder,
                                  ActorRoleHolder actorRoleHolder,
                                  Persistable object)
                           throws WTException
Throws:
WTException

applyResolution

private void applyResolution(Role role,
                             Enumeration principals,
                             RoleHolder roleHolder)
                      throws WTException
Throws:
WTException

isWorkingCopy

private boolean isWorkingCopy(ProjectManaged object)
                       throws WTException
Throws:
WTException

isCheckedOut

private boolean isCheckedOut(ProjectManaged object)
                      throws WTException
Throws:
WTException

validateIsLatestIteration

private void validateIsLatestIteration(ProjectManaged object,
                                       String action)
                                throws WTException
Throws:
WTException

validateProject

private void validateProject(ProjectManaged object)
                      throws WTException
Throws:
WTException

setProject

private ProjectManaged setProject(ProjectManaged object,
                                  Project aProject)
                           throws WTException
Throws:
WTException

setProject

private ProjectManaged setProject(ProjectManaged object,
                                  ProjectReference projRef)
                           throws WTException
Throws:
WTException

getIdentity

private String getIdentity(ProjectManaged p)

getIgnoreDelete

private Object getIgnoreDelete()