com.starteam
Class EnumeratedProperty.WebCacheEnumeratedProperty

java.lang.Object
  extended by com.starteam.Property.WebCacheProperty
      extended by com.starteam.EnumeratedProperty.WebCacheEnumeratedProperty
Enclosing class:
EnumeratedProperty

public static class EnumeratedProperty.WebCacheEnumeratedProperty
extends Property.WebCacheProperty

Base accessor for cached SDK objects encapsulating the statefulness of objects obtained from the artifact cache.


Method Summary
 EnumeratedValue createValue(java.lang.String displayName)
          Create a new Enumerated Value for this property.
 EnumeratedValue findValue(int enumCode)
          Finds an existing EnumeratedValue by code.
 EnumeratedValue findValue(java.lang.String internalName)
          Finds an existing EnumeratedValue by internal name.
 EnumeratedValue[] getAllowedStates(Project.WebCacheProject prjct)
          Return the subset of enumerated values that are visible for the specified project in the context of this property.
 EnumeratedValue[] getAllValues()
          A convenience method for returning an array of the possible values of an enumerated property, sorted by the specified sort order
 EnumeratedValue[] getDefaultValues()
          Returns the default array of enumerated values for this Property.
 EnumeratedValue[] getServerAssignedStates()
          Return the subset of enumerated values that are not assigned to any project Note that the set of enumerated values for a given type is and continues to be a server wide definition.
 EnumeratedValue[] getValues()
          Returns an array of the enumerated values of this property, sorted by the specified sort order
 boolean isHierarchicalEnumeration()
          Returns true if at least one of the enumerated values has child values, or false if every enumerated value is a root value with no children
 boolean isMultiSelectable()
          Returns true if this Enumerated Property supports selecting more than one enumerated value at a time.
 boolean isStatusProperty()
          Returns true if this Enumerated Property is the status property for the owning type.
 void makeMultiSelectable()
          make this property multi selectable.
 QueryPart.WebCacheQueryPart newQueryPart(QueryPart.Relation relation, EnumeratedValue value)
          Creates a new query expression that tests this property.
 QueryPart.WebCacheQueryPart newQueryPart(QueryPart.Relation relation, EnumeratedValue[] values)
          Creates a new query expression that tests this property.
 void setDefaultValues(EnumeratedValue[] defaultValues)
          Sets an array of enumerated values to be the default for the property.
 void setStatusProperty(boolean enable)
          set this property to be the status property for the owning type.
 void setValues(EnumeratedValue[] values)
          Sets an array of the enumerated values for this property
 
Methods inherited from class com.starteam.Property.WebCacheProperty
equals, getContext, getDisplayName, getDisplayNameTranslations, getDisplayValue, getGenericDefaultValue, getID, getName, getType, hashCode, isAdvanced, isCalculated, isClientCalculated, isDescriptor, isDirty, isDisabled, isEnabled, isGenericCalculated, isHeader, isItemProperty, isLegalValue, isPrimaryDescriptor, isQueryRelationSupported, isRequired, isRestricted, isRevisionIndependent, isServerCalculated, isSortByTextValueSupported, isStored, isSysDefined, isUserCustomized, isUserDefined, isUserModifiable, isViewSpecific, refresh, setDescriptor, setDisplayName, setDisplayNameTranslations, setEnabled, setGenericDefaultValue, setPrimaryDescriptor, setRequired, toXml, update
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllowedStates

public EnumeratedValue[] getAllowedStates(Project.WebCacheProject prjct)
Return the subset of enumerated values that are visible for the specified project in the context of this property. 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

Parameters:
prjct - the project to test
Returns:
the set of allowed enumerated values (if specified) for this property.
See Also:
Project.WebCacheProject.getAllowedStates(EnumeratedProperty.WebCacheEnumeratedProperty)

getServerAssignedStates

public EnumeratedValue[] getServerAssignedStates()
Return the subset of enumerated values that are not assigned to any project Note that the set of enumerated values for a given type is and continues to be a server wide definition. However, from the 12.5 server onwards, enumerated values of a given enumerated property may now be 'assigned' to a project. in a sense, this api returns the set of enumerated values that are 'assigned' to the server

Returns:
the subset of enumerated values that are not assigned to any project
See Also:
Project.WebCacheProject.getAllowedStates(EnumeratedProperty.WebCacheEnumeratedProperty), EnumeratedProperty.WebCacheEnumeratedProperty.getAllowedStates(Project.WebCacheProject)

makeMultiSelectable

public void makeMultiSelectable()
make this property multi selectable. A property can be made multi selectable when it is first created. It cannot subsequently be changed from single select to multi select or vice versa


setStatusProperty

public void setStatusProperty(boolean enable)
set this property to be the status property for the owning type. File, Folder & Audit Types cannot be set to be process item types Note that a type may have at most one status property

Parameters:
enable - true to set this property to be the status property

createValue

public EnumeratedValue createValue(java.lang.String displayName)
Create a new Enumerated Value for this property. Automatically assign the next sequential enum code to this new enum and assign the context of the enumerated property to simplify usage of the SDK api's, and eliminate the overhead of the call to setValues(), which requires client tracking the state of all changes to Enumerated Values

Parameters:
displayName - the display name for the new value
Returns:
a new Enumerated Value for this property

isMultiSelectable

public boolean isMultiSelectable()
Returns true if this Enumerated Property supports selecting more than one enumerated value at a time. This feature was introduced in the 12.0 server

Returns:
true if this Enumerated Property supports selecting multiple enumerations

isHierarchicalEnumeration

public boolean isHierarchicalEnumeration()
Returns true if at least one of the enumerated values has child values, or false if every enumerated value is a root value with no children

Returns:
boolean true if at least one of the enumerated values has child values

findValue

public EnumeratedValue findValue(int enumCode)
Finds an existing EnumeratedValue by code. Returns null if there is no such value.

Parameters:
enumCode - the code
Returns:
an EnumeratedValue or null

findValue

public EnumeratedValue findValue(java.lang.String internalName)
Finds an existing EnumeratedValue by internal name. Returns null if there is no such value. Note that there is a distinct difference between the Display Name and the Internal Name of an Enumerated value. The display name can have associated translations in languages like French, German or Japanese. The internal name cannot, and is typically used as a key for lookups.

Parameters:
internalName - the internal name
Returns:
an EnumeratedValue or null

getDefaultValues

public EnumeratedValue[] getDefaultValues()
Returns the default array of enumerated values for this Property. Single select enumerated property can have at most one default value, while multi-select enumerated property can have multiple values selected as default.

Returns:
the default EnumeratedValues

setDefaultValues

public void setDefaultValues(EnumeratedValue[] defaultValues)
Sets an array of enumerated values to be the default for the property. Multiple default values can be set for multi-select enumerated property.

Parameters:
defaultValues - the new array of default values
Throws:
SDKRuntimeException - if attempting to set multiple defaults for single select enumerated property.

getValues

public EnumeratedValue[] getValues()
Returns an array of the enumerated values of this property, sorted by the specified sort order

For hierarchical enumerations, only root enumerated values are listed. Other values may be found by traversing the enum hierarchy

Returns:
An array of the enumerated values of this property.

getAllValues

public EnumeratedValue[] getAllValues()
A convenience method for returning an array of the possible values of an enumerated property, sorted by the specified sort order

Returns:
an array of the possible values for the indicated property

isStatusProperty

public boolean isStatusProperty()
Returns true if this Enumerated Property is the status property for the owning type. This feature was introduced in the 12.0 server Note that a type may have at most one status property

Returns:
true if this Enumerated Property supports selecting multiple enumerations

setValues

public void setValues(EnumeratedValue[] values)
Sets an array of the enumerated values for this property

Parameters:
values - an array of EnumeratedValue objects

newQueryPart

public QueryPart.WebCacheQueryPart newQueryPart(QueryPart.Relation relation,
                                                EnumeratedValue[] values)
Creates a new query expression that tests this property.

Parameters:
relation - The query relation.
values - The enumerated values to be tested.
Returns:
A new query expression.

newQueryPart

public QueryPart.WebCacheQueryPart newQueryPart(QueryPart.Relation relation,
                                                EnumeratedValue value)
Creates a new query expression that tests this property.

Parameters:
relation - The query relation.
value - The enumerated value to be tested.
Returns:
A new query expression.


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