com.starteam
Class Project

java.lang.Object
  extended by com.starteam.TypedResource
      extended by com.starteam.LiveObject
          extended by com.starteam.Project
All Implemented Interfaces:
ISecurable, ISecurableContainer, java.lang.Cloneable

public final class Project
extends LiveObject
implements ISecurable, ISecurableContainer

Represents a StarTeam project which is essentially just a collection of Views.


Nested Class Summary
static class Project.Methodology
          Defines the development methodology property of the Project.
static class Project.Status
          Defines the status of a Project This property is new to 12.0+ servers
static class Project.Type
          The Type of the Project
static class Project.WebCacheProject
          Project accessor for cached SDK projects contained objects are obtained from the artifact cache
 
Nested classes/interfaces inherited from class com.starteam.LiveObject
LiveObject.WebCacheLiveObject
 
Nested classes/interfaces inherited from class com.starteam.TypedResource
TypedResource.BranchState
 
Constructor Summary
Project(Server server, java.lang.String name, java.lang.String rootDirectory, Folder folderTree)
          Constructs a new project.
 
Method Summary
 void addProjectListener(ProjectListener listener)
          Adds a listener for Project events.
 void addViewListener(ViewListener listener)
          Adds a listener for View events.
 Project copy()
          Creates a copy of this Project object, with project properties fully populated.
 void discard()
          Discards all of the cached properties for this project.
 void discardViews()
          Discards the list of cached views.
 boolean equals(java.lang.Object another)
          Returns true if the specified Object identifies the same exact Project.
 View findView(int viewID)
          Finds a view in the project's view collection.
 View findView(java.lang.String name)
          Finds a view in the project's view collection.
 View[] getAccessibleViews()
          Gets the set of Views accessible from this Project.
 EnumeratedValue[] getActiveProcessItemStates(Item.Type typ)
          Returns the set of legal active states for the specified (stock or custom) type
 EnumeratedValue[] getAllowedStates(EnumeratedProperty prprty)
          Return the subset of enumerated values that are visible for the specified Enumerated property in the context of this project.
 java.lang.String getAlternateEditorPath(Item.Type typ)
          returns the alternate editor path for the specified item type
 java.lang.Boolean getCreateCheckinChangePackage()
          Returns true if checkin change packages should be created by the SDK in the absence of a process item Returns NULL if this project does not override the server configuration option This property was first introduced in the 12.0 release
 User getCreatedBy()
          Returns the User object that created the project.
 DateTime getCreatedTime()
          Returns the time at which the project was created.
 TypeCollection getDefaultItemTypes()
          Gets the default item types that will be shared upon creation of a variant view.
 View getDefaultView()
          Gets the default View for this Project.
 java.lang.String getDescription()
          Returns the description of this project.
 Server.EncryptionAlgorithm getEncryptionAlgorithm()
          Returns the encryption algorithm
 boolean getExpandKeywords()
          Returns true if keywords are expanded when files are checked out.
 Filter[] getFilters(Type typ)
          returns the set of filters associated with this project
 java.lang.String getGUID()
          Returns GUID
 int getID()
          Returns the unique integer identifier for this project.
 java.lang.String getKeywordExpansionFileExtensions()
          Returns the list of file extensions upon which to perform keyword expansion.
 boolean getMarkUnlockedWorkingFilesReadOnly()
          Determines if unlocked working files should be marked read only
 Project.Methodology getMethodology()
          Returns the development methodology used for this project (Supported methodologies include Agile, Kanban, Waterfall, Migration).
 java.lang.String getName()
          Returns the name of this project.
 ISecurableContainer getParentContainer()
          A Project has no parent container.
 int getPresentationID()
          Returns the unique integer identifier for this project.
 Item.Type[] getProcessItemTypes()
          Returns the set of (stock or custom) Item Types that may be used as process items For 11.0 servers only the three stock types ChangeRequest, Requirement and Task are supported, in the context of their stock status properties.
 Project.Type.PropertyCollection getProperties()
          Returns the PropertyCollection for the Project type
 Query[] getQueries(Type typ)
          returns the set of queries associated with this project
 ACE[] getRights()
          Returns the Access Control List for this project.
 ACE[] getRights(Type type)
          Returns the Access Control List for items of the specified type for this project.
 Server getServer()
          Returns the server to which this project belongs.
 Project.Status getStatus()
          Returns the status (Active, Parked, etc.) of this Project.
 Task.Status[] getStatus(Story.Status sts)
          Return the subset of Task Status values that match the specified Story Status for this project.
 EnumeratedValue[] getUDAGroupings(Requirement.RequirementType typ)
          Return the subset of Requirement UDA Grouping values that match the specified Requirement Type for this project.
 java.lang.Object getValue(Property property)
          Return the value for the specified property.
 View[] getViews()
          Ensures that this project's view list has been retrieved and cached locally.
 PropertyCollection getVisibleProperties(EnumeratedValue value)
          Return the subset of properties that are visible in the context of the specified Enumerated Value
 int hashCode()
          Returns a hash code for this project.
 boolean hasPermissions(PermissionCollection permissions)
          Returns true if desired permissions are granted for this project
 boolean hasPermissions(PermissionCollection permissions, Type type)
          Returns true if desired permissions are granted for items of the specified type for this project
 boolean hasSavedStatus(Story.Status sts)
          Returns true if an explicit Story Status mapped to a Task Status (or set) has been saved for this project Note that if a status mapping is not saved to the server, the getStatus() api returns a default mapping
 boolean isActiveProcessItemStateEnabled(EnumeratedValue value)
          Determines whether or not a given status value of a given type, is one that can be used for an active process item of that type.
 boolean isDeleted()
          Determines whether or not this project has been deleted from the server.
 boolean isEqualTo(Project project)
          Compares the properties of two Projects.
 boolean isForceCheckinReasonRequired()
          Returns true if a comment must be included with file check in operations.
 boolean isMailUsed()
          Return true if email is used in this project.
 boolean isProcessItemRequired()
          Determines whether or not process items are required for this project.
 boolean isProcessItemTypeEnabled(Item.Type type)
          Determines whether or not process items of the given type are supported for this project.
 boolean isRefreshRequired()
          Returns true if a refresh() operation might have resulted in project properties being updated; returns false if and only if it is known that the project properties had not been changed since the last refresh.
 boolean isRefreshViewsRequired()
          Determines whether or not the project's view list needs to be refreshed.
 boolean isRequireLockForCheckin()
          Returns true if files must be locked before they are checked in.
 void populate()
          Populates project properties, if they have not already been populated.
 void refresh()
          Updates cached properties to reflect recent changes made on the server.
 void refreshViews()
          Ensures that the latest list of views for this project has been retrieved from the server and cached locally.
 void remove()
          Removes the project from the server.
 void removeProjectListener(ProjectListener listener)
          Removes a listener for Project events.
 void removeViewListener(ViewListener listener)
          Removes a listener for View events.
 void setActiveProcessItemStateEnabled(EnumeratedValue activeState, boolean enabled)
          Defines the specified state as a legal 'Active' state for this project for it's type The set of legal active states is a subset of the set of all open states for the given enumerated property that represents the process item property For 11.0 servers, the types and the status properties are fixed.
 void setAllowedState(EnumeratedValue value, boolean isAllowed)
          Set an enumerated value of a given property as an allowed or legal state for this project.
 void setAlternateEditorPath(Item.Type typ, java.lang.String alternatePath)
          Sets the Alternate Editor Path for the Specified Item Type Specify either NULL or an empty string to turn it off
 void setCreateCheckinChangePackage(java.lang.Boolean createCP)
          Set to TRUE to always create checkin change packages (even in the absence of a process item) Set to FALSE to never create checkin change packages in the absence of a process item Set to NULL to fall back to the server wide definition (server configuration option).
 void setDefaultItemTypes(TypeCollection types)
          Sets the default item types that will be shared upon creation of a variant view.
 void setDescription(java.lang.String description)
          Set the description for this project
 void setEncryptionAlgorithm(Server.EncryptionAlgorithm encryption)
          Sets the the encryption algorithm for the project
 void setExpandKeywords(boolean bExpand)
          set to true if keywords should be expanded on checkout
 void setForceCheckinReasonRequired(boolean bForceComment)
          Set to true if a reason is required for checkin
 void setGUID(java.lang.String guid)
          Set GUID for the project
 void setKeywordExpansionFileExtensions(java.lang.String fileExtensions)
          set the file extensions for keyword expansion
 void setMarkUnlockedWorkingFilesReadOnly(boolean flag)
          Mark the unlocked working files as read only
 void setMethodology(Project.Methodology methodology)
          Sets the development methodology for this project.
 void setName(java.lang.String name)
          set the name of the project
 void setProcessItemRequired(boolean flag)
          Determines whether or not process items are required for this project.
 void setRequireLockForCheckin(boolean bRequireLock)
          require set to true if locks should be acquired for checkin
 void setRights(ACE[] acl)
          Modify the Access Control List for this project.
 void setRights(Type type, ACE[] acl)
          Modifies the Access Control List for items of the specified type for this project.
 void setStatus(Project.Status status)
          Sets the status of this project.
 void setStatus(Story.Status rfrnc, Task.Status[] mppdSts)
          Map a subset of Task Status values to specific Story States for the given project.
 void setUDAGroupings(Requirement.RequirementType typ, EnumeratedValue[] udas)
          Map a subset of UDA Grouping values to specific Requirement Types for the given project.
 java.lang.Object setValue(Property property, java.lang.Object value)
          Sets the value of the specified property and return the old value.
 void setVisibleProperties(EnumeratedValue value, PropertyCollection properties)
          Define a subset of properties of a given type that are marked visible
 java.lang.String toString()
          Returns the name of this project.
 void update()
          Persists this project's properties to its Server.
 
Methods inherited from class com.starteam.LiveObject
toStarTeamURL
 
Methods inherited from class com.starteam.TypedResource
addToIntegerArray, getBooleanValue, getByteArrayValue, getCachedProperties, getContentValue, getDateTimeValue, getDateValue, getDisplayName, getDoubleValue, getEnumDisplayName, getEnumeratedValues, getIntegerArrayValue, getIntegerValue, getLinkValue, getLongValue, getObjectID, getPossibleValues, getStringValue, getTimeSpanValue, getType, hasCachedProperties, hasValue, isDirty, isNew, removeFromIntegerArray, setBooleanValue, setByteArrayValue, setContentValue, setDateTimeValue, setDateValue, setDoubleValue, setEnumeratedValue, setEnumeratedValues, setIntegerArrayValue, setIntegerValue, setLinkValue, setLongValue, setStringValue, setTimeSpanValue
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.starteam.ISecurable
getType
 

Constructor Detail

Project

public Project(Server server,
               java.lang.String name,
               java.lang.String rootDirectory,
               Folder folderTree)
Constructs a new project.

Parameters:
server - the repository in which to create this project
name - the name of the project
rootDirectory - path to be used as the default root directory may be NULL or "", in which case the file system root directory is assumed
folderTree - the root folder of the initial folder tree, may be null
Method Detail

getProperties

public Project.Type.PropertyCollection getProperties()
Returns the PropertyCollection for the Project type

Returns:
the PropertyCollection for the Project type

populate

public void populate()
Populates project properties, if they have not already been populated.

See Also:
Project.refresh()

isRefreshRequired

public boolean isRefreshRequired()
Returns true if a refresh() operation might have resulted in project properties being updated; returns false if and only if it is known that the project properties had not been changed since the last refresh. If MPX is not enabled, then isRefreshRequired() always returns true.

Returns:
true if project properties may be out of date.
See Also:
Project.refresh(), Server.enableMPX()

refresh

public void refresh()
Updates cached properties to reflect recent changes made on the server. If MPX is enabled, refresh() is optimized to avoid unnecessary server commands.

See Also:
Project.isRefreshRequired(), Project.populate(), Server.enableMPX()

copy

public Project copy()
Creates a copy of this Project object, with project properties fully populated. Useful to applications that want to save a snapshot of the Project in a given state, for example, before calling refresh().

Returns:
A new copy of this Project object.
See Also:
Project.isEqualTo(com.starteam.Project)

isEqualTo

public boolean isEqualTo(Project project)
Compares the properties of two Projects.

Parameters:
project - The project to be compared to this one.
Returns:
true if no differences were found.
See Also:
Project.copy()

getValue

public java.lang.Object getValue(Property property)
                          throws NoSuchPropertyException
Return the value for the specified property.

Overrides:
getValue in class TypedResource
Parameters:
property - the name of property to be retreived
Returns:
the value of the specified property
Throws:
NoSuchPropertyException - if the named property does not exist

setValue

public java.lang.Object setValue(Property property,
                                 java.lang.Object value)
                          throws NoSuchPropertyException,
                                 java.lang.ClassCastException
Sets the value of the specified property and return the old value.

Overrides:
setValue in class TypedResource
Parameters:
property - the property to set
value - the new value to set for the specified property
Returns:
the old property value
Throws:
NoSuchPropertyException - if the named property does not exist
java.lang.ClassCastException - if the value is of the wrong type for the specified property

hasPermissions

public boolean hasPermissions(PermissionCollection permissions)
Returns true if desired permissions are granted for this project

Specified by:
hasPermissions in interface ISecurable
Parameters:
permissions - the desired permissions
Returns:
true if all the requested permissions are granted; false if at least one of the requested permissions is denied.
See Also:
Permission

hasPermissions

public boolean hasPermissions(PermissionCollection permissions,
                              Type type)
Returns true if desired permissions are granted for items of the specified type for this project

Specified by:
hasPermissions in interface ISecurableContainer
Parameters:
permissions - the desired permissions
type - the type for access to be tested on
Returns:
true if all the requested permissions are granted; false if at least one of the requested permissions is denied.
See Also:
Permission, Type

getRights

public ACE[] getRights(Type type)
Returns the Access Control List for items of the specified type for this project. This will return null if this project has no access control list for the specified type.

Specified by:
getRights in interface ISecurableContainer
Parameters:
type - the type being controlled by the returned ACL
Returns:
the access control list for this project or NULL.
See Also:
Type

setRights

public void setRights(Type type,
                      ACE[] acl)
Modifies the Access Control List for items of the specified type for this project. If the ACL is null then the access control list for items of the specified type will be dropped.

Specified by:
setRights in interface ISecurableContainer
Parameters:
type - the type being controlled by the returned ACL
acl - the access control list for this project
See Also:
Type

equals

public boolean equals(java.lang.Object another)
Returns true if the specified Object identifies the same exact Project.

Overrides:
equals in class java.lang.Object
Parameters:
another - the object to be compared with
Returns:
true if this project is the same as the argument

hashCode

public int hashCode()
Returns a hash code for this project.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this project.

discard

public void discard()
Discards all of the cached properties for this project. They will be re-fetched from the server on demand (even when MPX is enabled).

If the properties of a project are changed, and discard() is called without first calling update(), the changes will be lost.

See Also:
Project.refresh()

update

public void update()
Persists this project's properties to its Server. If this project wraps around a foreign archive, Folder hierarchy will be created according to the configuration file and archive path of the foreign archive specified.


remove

public void remove()
Removes the project from the server.


isDeleted

public boolean isDeleted()
Determines whether or not this project has been deleted from the server.

Specified by:
isDeleted in interface ISecurable
Specified by:
isDeleted in interface ISecurableContainer
Returns:
True if the project has been deleted from the server; false otherwise.

toString

public java.lang.String toString()
Returns the name of this project.

Overrides:
toString in class TypedResource
Returns:
the name of this project.

getDefaultView

public View getDefaultView()
Gets the default View for this Project.

The default view is retrieved from the StarTeam Server only if it is not locally cached.

If MPX is enabled, getDefaultView() is optimized to avoid unnecessary server commands.

Returns:
The default View for this Project.

setDefaultItemTypes

public void setDefaultItemTypes(TypeCollection types)
Sets the default item types that will be shared upon creation of a variant view. Supported on servers beginning with release 10.3.

Parameters:
types - TypeCollection the set of item types that will be shared upon creation of a variant view.

getDefaultItemTypes

public TypeCollection getDefaultItemTypes()
Gets the default item types that will be shared upon creation of a variant view.

Returns:
TypeCollection the set of item types that will be shared upon creation of a variant view.

getID

public int getID()
Returns the unique integer identifier for this project.

Specified by:
getID in interface ISecurable
Specified by:
getID in interface ISecurableContainer
Overrides:
getID in class TypedResource
Returns:
the unique integer identifier for this project.

getPresentationID

public int getPresentationID()
Returns the unique integer identifier for this project. on pre 14.0 servers, it returns the projectID

Returns:
the unique integer identifier for this project.

getDescription

public java.lang.String getDescription()
Returns the description of this project.

Returns:
the description of this project.

getStatus

public Project.Status getStatus()
Returns the status (Active, Parked, etc.) of this Project. This property is new to 12.0+ servers

Returns:
The status (Active, Parked, etc.) of this Project.
See Also:
Project.Status, Project.Type.StatusProperty, Project.Type.PropertyCollection.STATUS

setDescription

public void setDescription(java.lang.String description)
Set the description for this project

Parameters:
description - for this project

setStatus

public void setStatus(Project.Status status)
Sets the status of this project. This property is new to 12.0+ servers

Parameters:
status - The new status value for this project.

getExpandKeywords

public boolean getExpandKeywords()
Returns true if keywords are expanded when files are checked out. Only files matching a keyword file extension will be expanded.

Returns:
true if keywords are expanded when files are checked out.
See Also:
Project.getKeywordExpansionFileExtensions()

setExpandKeywords

public void setExpandKeywords(boolean bExpand)
set to true if keywords should be expanded on checkout

Parameters:
bExpand - set to true if keywords should be expanded on checkout

isRequireLockForCheckin

public boolean isRequireLockForCheckin()
Returns true if files must be locked before they are checked in.

Returns:
true if files must be locked before they are checked in.

setRequireLockForCheckin

public void setRequireLockForCheckin(boolean bRequireLock)
require set to true if locks should be acquired for checkin

Parameters:
bRequireLock - set to true if locks should be acquired for checkin

isForceCheckinReasonRequired

public boolean isForceCheckinReasonRequired()
Returns true if a comment must be included with file check in operations.

Returns:
true if a comment must be included with file check in operations.

setForceCheckinReasonRequired

public void setForceCheckinReasonRequired(boolean bForceComment)
Set to true if a reason is required for checkin

Parameters:
bForceComment - Set to true if a reason is required for checkin

getCreateCheckinChangePackage

public java.lang.Boolean getCreateCheckinChangePackage()
Returns true if checkin change packages should be created by the SDK in the absence of a process item Returns NULL if this project does not override the server configuration option This property was first introduced in the 12.0 release

Returns:
true if checkin change packages should be created by the SDK

setCreateCheckinChangePackage

public void setCreateCheckinChangePackage(java.lang.Boolean createCP)
Set to TRUE to always create checkin change packages (even in the absence of a process item) Set to FALSE to never create checkin change packages in the absence of a process item Set to NULL to fall back to the server wide definition (server configuration option). This property was first introduced in the 12.0 release

Parameters:
createCP - set to Treu to create Checkin Change Packages

getMethodology

public Project.Methodology getMethodology()
Returns the development methodology used for this project (Supported methodologies include Agile, Kanban, Waterfall, Migration). This property is new to 12.5+ servers

Returns:
The project methodology (Agile, Kanban, Waterfall, Migration).
See Also:
Project.Methodology, Project.Type.MethodologyProperty, Project.Type.PropertyCollection.METHODOLOGY

setMethodology

public void setMethodology(Project.Methodology methodology)
Sets the development methodology for this project. (Supported methodologies include Agile, Kanban, Waterfall, Migration). This property is new to 12.5+ servers

Parameters:
methodology - The new development methodology value for this project.

getCreatedTime

public DateTime getCreatedTime()
Returns the time at which the project was created.

Overrides:
getCreatedTime in class LiveObject
Returns:
the time at which the project was created.

getFilters

public Filter[] getFilters(Type typ)
returns the set of filters associated with this project

Parameters:
typ - the type whose filters are desired
Returns:
the set of filters associated with this project

getQueries

public Query[] getQueries(Type typ)
returns the set of queries associated with this project

Parameters:
typ - the type whose queries are desired
Returns:
the set of queries associated with this project

getCreatedBy

public User getCreatedBy()
Returns the User object that created the project.

Overrides:
getCreatedBy in class LiveObject
Returns:
the User object that created the project.

getServer

public Server getServer()
Returns the server to which this project belongs.

Specified by:
getServer in interface ISecurable
Specified by:
getServer in interface ISecurableContainer
Overrides:
getServer in class TypedResource
Returns:
the server to which this project belongs.

getKeywordExpansionFileExtensions

public java.lang.String getKeywordExpansionFileExtensions()
Returns the list of file extensions upon which to perform keyword expansion. The extension list can use the wildcards * and ? and multiple extensions can be delimited by commas, spaces or semicolons. For example: "*.class, *.obj".

Returns:
the list of file extensions for keyword expansion

setKeywordExpansionFileExtensions

public void setKeywordExpansionFileExtensions(java.lang.String fileExtensions)
set the file extensions for keyword expansion

Parameters:
fileExtensions - the file extensions for keyword expansion

isMailUsed

public boolean isMailUsed()
Return true if email is used in this project.

Returns:
true if email is used in this project.
See Also:
Project.Type.MailProperty.NAME

getName

public java.lang.String getName()
Returns the name of this project.

Returns:
the name of this project.
See Also:
LiveObject.Type.NameProperty.NAME

setName

public void setName(java.lang.String name)
set the name of the project

Parameters:
name - set the name of the project

getEncryptionAlgorithm

public Server.EncryptionAlgorithm getEncryptionAlgorithm()
Returns the encryption algorithm

Returns:
encryption algorithm used for this project
See Also:
Project.Type.EncryptionAlgorithmProperty.NAME

setEncryptionAlgorithm

public void setEncryptionAlgorithm(Server.EncryptionAlgorithm encryption)
Sets the the encryption algorithm for the project

Parameters:
encryption - - the encryption algorithm
See Also:
Project.Type.EncryptionAlgorithmProperty.NAME

getGUID

public java.lang.String getGUID()
Returns GUID

Returns:
GUID
See Also:
Project.Type.GUIDProperty.NAME

setGUID

public void setGUID(java.lang.String guid)
Set GUID for the project

Parameters:
guid -
See Also:
Project.Type.GUIDProperty.NAME

getViews

public View[] getViews()
Ensures that this project's view list has been retrieved and cached locally. The view list is retrieved from the StarTeam repository only if it has not already been retrieved. Therefore, the views may or may not be up-to-date with respect to the latest information in the repository. To ensure that the views are up-to-date, use refreshViews().

Returns:
The project's view list.
See Also:
Project.refreshViews()

isRefreshViewsRequired

public boolean isRefreshViewsRequired()
Determines whether or not the project's view list needs to be refreshed. A refresh is required if the cached views are not known to be up-to-date with respect to the latest information in the repository. Specifically, a refresh is required if:

Returns:
true if a refresh is required; false otherwise.
See Also:
Project.refreshViews(), Server.enableMPX()

getAccessibleViews

public View[] getAccessibleViews()
Gets the set of Views accessible from this Project.

The view list is retrieved from the StarTeam repository only if it has not already been retrieved. Therefore, the views may or may not be up-to-date with respect to the latest information in the repository. To ensure that the views are up-to-date, use refreshViews().

If MPX is enabled, getViews() is optimized to avoid unnecessary server commands.

Returns:
The set of Views accessible from this Project. May be empty (but is never null).

refreshViews

public void refreshViews()
Ensures that the latest list of views for this project has been retrieved from the server and cached locally. Also ensures that any previously cached view property values are up-to-date. refreshViews() re-uses existing View objects whenever possible, changing cached property values as necessary to bring older Views up-to-date. When MPX is enabled, refreshViews() is optimized to avoid unnecessary server commands.

See Also:
Project.getViews(), Project.isRefreshViewsRequired(), Project.discardViews(), Server.enableMPX()

discardViews

public void discardViews()
Discards the list of cached views. A subsequent call to getViews() will re-fetch the views from the server (even when MPX is enabled).

See Also:
Project.getViews(), Project.refreshViews(), Server.enableMPX()

findView

public View findView(int viewID)
Finds a view in the project's view collection.

Parameters:
viewID - The view ID of the desired view.
Returns:
The view with the given ID, or null if no such view was found.

findView

public View findView(java.lang.String name)
Finds a view in the project's view collection. View name can either be a simple name or a view hierarchy. Use the colon (:) or slash(/) as a delimiter between view names in a hierarchy. The view hierarchy should always include the root view.

Parameters:
name - The name of the desired view.
Returns:
The view with the given name, or null if no such view was found.

getRights

public ACE[] getRights()
Returns the Access Control List for this project. This will return null if this project has no access control list. From 12.0 release of the server onwards, MPX events are sent by the server upon ACL updates. So, the server calls are optimized when mpx is enabled. For servers prior to 12.0 release, The access control list is not cached, and will be fetched from the server on demand. Cached lists are accessible via the AccessRightsManager

Specified by:
getRights in interface ISecurable
Returns:
the access control list for this project or NULL.
See Also:
AccessRightsManager.getRights(ISecurable)

setRights

public void setRights(ACE[] acl)
Modify the Access Control List for this project. If the input parameter is null then the access control list will be dropped.

Specified by:
setRights in interface ISecurable
Parameters:
acl - the new access control list or null if to be dropped.
See Also:
ACE

addProjectListener

public void addProjectListener(ProjectListener listener)
Adds a listener for Project events.

Event handlers will be triggered if this Project is changed or deleted on the Server.

In order to handle events, an application must enable MPX.

Parameters:
listener - Application-specific event handler for Project events.
See Also:
ProjectListener, Project.removeProjectListener(com.starteam.events.ProjectListener), Server.enableMPX()

removeProjectListener

public void removeProjectListener(ProjectListener listener)
Removes a listener for Project events.

Parameters:
listener - Previously-registered event handler for Project events.
See Also:
ProjectListener, Project.addProjectListener(com.starteam.events.ProjectListener)

addViewListener

public void addViewListener(ViewListener listener)
Adds a listener for View events.

Event handlers will be triggered whenever a View is added, changed or deleted in this Project. Note that an application will not receive events for Views that the logged-in user does not have permission to access.

In order to handle events, an application must enable MPX.

Parameters:
listener - Application-specific event handler for View events.
See Also:
ViewListener, Project.removeViewListener(com.starteam.events.ViewListener), Server.enableMPX()

removeViewListener

public void removeViewListener(ViewListener listener)
Removes a listener for View events.

Parameters:
listener - Previously-registered event handler for View events.
See Also:
ViewListener, Project.addViewListener(com.starteam.events.ViewListener)

getParentContainer

public ISecurableContainer getParentContainer()
A Project has no parent container. It returns null.

Specified by:
getParentContainer in interface ISecurable
Specified by:
getParentContainer in interface ISecurableContainer
Returns:
null.
See Also:
ISecurableContainer

isProcessItemRequired

public boolean isProcessItemRequired()
Determines whether or not process items are required for this project. For 11.0 servers only the three stock types ChangeRequest, Requirement and Task are supported as process item types, in the context of their stock status properties. From 12.0+ servers, custom types are supported and custom status properties on stock types are also supported

See Also:
Project.Type.IsProcessItemRequiredProperty.NAME, ProcessItem

setProcessItemRequired

public void setProcessItemRequired(boolean flag)
Determines whether or not process items are required for this project.

Parameters:
flag - true if process items are required for this project on add and checkin operations; false otherwise.
See Also:
Project.Type.IsProcessItemRequiredProperty.NAME, Project.setActiveProcessItemStateEnabled(com.starteam.EnumeratedValue, boolean), ProcessItem

getAllowedStates

public EnumeratedValue[] getAllowedStates(EnumeratedProperty prprty)
Return the subset of enumerated values that are visible for the specified Enumerated property in the context of this project. Note that Enumerated Properties are (and continue to be) type specific. However, an application can choose to store a subset of the values as applicable (legal) to a given type. This subset may be disjoint or may overlap. The application decides Other than storing the relationships between a project, an enumerated property and its values the SDK makes no attempt to (and in reality cannot) validate the usage of Enumerated Values for item types in the context of a given project An application should make no assumption about the returned order of EnumeratedValues, or for that matter, about parent child hierarchies in a multi-select hierarchy

Parameters:
prprty - the property whose allowed states are of interest
Returns:
the set of allowed enumerated values (if specified).
See Also:
EnumeratedProperty.getAllValues()

setAllowedState

public void setAllowedState(EnumeratedValue value,
                            boolean isAllowed)
Set an enumerated value of a given property as an allowed or legal state for this project. Note that Enumerated Properties are (and continue to be) type specific. However, an application can choose to store a subset of the values as applicable (legal) to a given type. Other than storing the relationships between a project, an enumerated property and its values the SDK makes no attempt to (and in reality cannot) validate the usage of Enumerated Values for item types in the context of a given project Note that this api is not supported for pre 12.5 servers

Parameters:
value - the selected value
isAllowed - true to turn this state on, false to turn it off

hasSavedStatus

public boolean hasSavedStatus(Story.Status sts)
Returns true if an explicit Story Status mapped to a Task Status (or set) has been saved for this project Note that if a status mapping is not saved to the server, the getStatus() api returns a default mapping

Parameters:
sts - the status to test for in this project context
Returns:
true if an explicit Story Status mapped to a Task Status (or set) has been saved for this project
See Also:
Project.getStatus(com.starteam.Story.Status)

getStatus

public Task.Status[] getStatus(Story.Status sts)
Return the subset of Task Status values that match the specified Story Status for this project. Story Status of NOT_STARTED and COMPLETED may return at most one corresponding Task Status. Story Status of STARTED may return a subset of Task Status The returned subsets across all three Story States are disjoint. This feature was introduced in the 13.0 server

Parameters:
sts - the story status to test
Returns:
a mapping set of Task States or an empty array

setStatus

public void setStatus(Story.Status rfrnc,
                      Task.Status[] mppdSts)
Map a subset of Task Status values to specific Story States for the given project. Story Status of NOT_STARTED and COMPLETED must map to one and only one equivalent Task Status Story Status of STARTED may map to a subset of Task States, provided that all mappings are unique and disjoint. The calling application is responsible for ensuring that each Story Status is mapped to one or more Task States as the case demands. This feature was introduced in the 13.0 server

Parameters:
rfrnc - the reference Story Status to be mapped
mppdSts - the Task States to map it to.

getUDAGroupings

public EnumeratedValue[] getUDAGroupings(Requirement.RequirementType typ)
Return the subset of Requirement UDA Grouping values that match the specified Requirement Type for this project. This feature was introduced in the 14.0 server

Parameters:
typ - the requirement type to test
Returns:
a mapping set of UDA Groupings or an empty array

setUDAGroupings

public void setUDAGroupings(Requirement.RequirementType typ,
                            EnumeratedValue[] udas)
Map a subset of UDA Grouping values to specific Requirement Types for the given project.

Parameters:
typ - the requirement type to be mapped
udas - the set of UDA Groupings

getVisibleProperties

public PropertyCollection getVisibleProperties(EnumeratedValue value)
Return the subset of properties that are visible in the context of the specified Enumerated Value

Parameters:
value - an Enumerated Value for a specific Enumerated Property of a chosen type
Returns:
the subset of properties of the same Type that are marked visible in the context of this enum

setVisibleProperties

public void setVisibleProperties(EnumeratedValue value,
                                 PropertyCollection properties)
Define a subset of properties of a given type that are marked visible

Parameters:
value - an Enumerated Value for a specific Enumerated Property of a chosen type
properties - the set of properties marked visible in the context of the specified enum

getAlternateEditorPath

public java.lang.String getAlternateEditorPath(Item.Type typ)
returns the alternate editor path for the specified item type

Parameters:
typ - the specified (stock or custom) item type
Returns:
the alternate editor path for the specified item type

setAlternateEditorPath

public void setAlternateEditorPath(Item.Type typ,
                                   java.lang.String alternatePath)
Sets the Alternate Editor Path for the Specified Item Type Specify either NULL or an empty string to turn it off

Parameters:
typ - the specified (stock or custom) item type
alternatePath - the alternate editor path for the specified item type

getProcessItemTypes

public Item.Type[] getProcessItemTypes()
Returns the set of (stock or custom) Item Types that may be used as process items For 11.0 servers only the three stock types ChangeRequest, Requirement and Task are supported, in the context of their stock status properties. From 12.0+ servers, custom types are supported and custom status properties on stock types are also supported Only those types that have active process item states are returned. The set of all types that are Candidate Process Items Types is the set of all Types that have a non-null status property.

Returns:
the set of (stock or custom) Item Types that may be used as process items

getActiveProcessItemStates

public EnumeratedValue[] getActiveProcessItemStates(Item.Type typ)
Returns the set of legal active states for the specified (stock or custom) type

Parameters:
typ - the type whose legal active states are desired
Returns:
the set of legal active states for the specified type

setActiveProcessItemStateEnabled

public void setActiveProcessItemStateEnabled(EnumeratedValue activeState,
                                             boolean enabled)
Defines the specified state as a legal 'Active' state for this project for it's type The set of legal active states is a subset of the set of all open states for the given enumerated property that represents the process item property For 11.0 servers, the types and the status properties are fixed. (Requirement, Task, ChangeRequest) So are their Closed States. Their open states are either all or a restricted but fixed subset of states. Hence, for 11.0 servers, to specify all states as active, specify any state but the restricted ones

Parameters:
activeState - a supported active state for the enumerated property
enabled - true to enable the state

isProcessItemTypeEnabled

public boolean isProcessItemTypeEnabled(Item.Type type)
Determines whether or not process items of the given type are supported for this project. For 11.0 servers only the three stock types ChangeRequest, Requirement and Task are supported, in the context of their stock status properties. From 12.0+ servers, custom types are supported and custom status properties on stock types are also supported

Parameters:
type - An item type.
Returns:
true if process items of the given type are enabled for this project; false otherwise.
See Also:
Project.isProcessItemRequired(), Project.isActiveProcessItemStateEnabled(com.starteam.EnumeratedValue)

isActiveProcessItemStateEnabled

public boolean isActiveProcessItemStateEnabled(EnumeratedValue value)
Determines whether or not a given status value of a given type, is one that can be used for an active process item of that type.

Parameters:
value - The status value to be tested.
Returns:
true if the given status value is legal for an active process item, of a given type and false otherwise.

getMarkUnlockedWorkingFilesReadOnly

public boolean getMarkUnlockedWorkingFilesReadOnly()
Determines if unlocked working files should be marked read only

Returns:
boolean true if unlocked working files should be marked read only

setMarkUnlockedWorkingFilesReadOnly

public void setMarkUnlockedWorkingFilesReadOnly(boolean flag)
Mark the unlocked working files as read only

Parameters:
flag - true if unlocked working files should be marked as read only


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.