com.starbase.starteam
Class View

java.lang.Object
  |
  +--com.starbase.starteam.CacheRef
        |
        +--com.starbase.starteam.NamedCacheRef
              |
              +--com.starbase.starteam.TypedResource
                    |
                    +--com.starbase.starteam.SimpleTypedResource
                          |
                          +--com.starbase.starteam.View
All Implemented Interfaces:
java.lang.Cloneable, ISecurable, ISecurableContainer, ISecurableObject
Direct Known Subclasses:
MergePreview, RecycleBin

public class View
extends SimpleTypedResource
implements ISecurableObject, ISecurableContainer

Represents a StarTeam View.


Constructor Summary
View(View parent, boolean bIsVariantView, boolean bIsROView, java.lang.String name, java.lang.String description, Folder rootFolder, java.lang.String defaultWorkingFolder, ViewConfiguration baseConfig, boolean bIsBranched)
          A constructor used to create a new view.
View(View parent, java.lang.String name, java.lang.String description, java.lang.String defaultWorkingFolder)
          A constructor used to create a blank view.
View(View view, ViewConfiguration configuration)
          A view "copy" constructor that allows the specification of an arbitrary configuration.
 
Method Summary
 void acquireOwnership()
          Sets ownership of this securable object to the logged in user.
 void addFolderListener(IFolderListener listener)
          Adds a listener for Folder-related events.
 void addFolderUpdateListener(FolderUpdateListener listener)
          Listens for updates to this view's folder tree.
 void addItemListener(IItemListener listener, Type type)
          Adds a listener for Item-related events.
 void addItemListener(IItemListener listener, Type type, java.lang.String[] propertyNames)
          Adds a listener for Item-related events.
 void addItemUpdateListener(ItemUpdateListener listener, Type type)
          Listens for updates to the items of a given type in this view.
 void addLabelListener(LabelListener listener)
          Adds a listener for Label events.
 void addViewListener(ViewListener listener)
          Adds a listener for View events.
 Label cloneRevisionLabel(Label source, java.lang.String name, java.lang.String description, boolean frozen)
          Clones the specified "Revision" label.
 Label cloneViewLabel(Label source, java.lang.String name, java.lang.String description, boolean buildLabel, boolean frozen)
          Clones the specified "View" label.
 void close()
          Frees all cached resources associated with this view, and closes the associated view session.
 View copy()
          Creates a copy of this View object, with view properties fully populated.
 CheckinManager createCheckinManager()
          Constructs a CheckinManager with default options for this view.
 CheckinManager createCheckinManager(CheckinOptions options)
          Constructs a CheckinManager using a specific set of options.
 CheckoutManager createCheckoutManager()
          Constructs a CheckoutManager with default options for this view.
 CheckoutManager createCheckoutManager(CheckoutOptions options)
          Constructs a CheckoutManager using a specific set of options.
 View createChildViewShareAllItems(java.lang.String name, java.lang.String description, Folder rootFolder, java.lang.String defaultWorkingFolder, ViewConfiguration baseConfig, boolean bIsBranched)
          Create a new variant view as a child of this view, that initially shares items of all item types supported on this server.
 View createChildViewShareDefaultItems(java.lang.String name, java.lang.String description, Folder rootFolder, java.lang.String defaultWorkingFolder, ViewConfiguration baseConfig, boolean bIsBranched)
          Create a new variant view as a child of this view, that initially shares items of the default set of item types defined for this view's Project.
 View createChildViewShareNoItems(java.lang.String name, java.lang.String description, Folder rootFolder, java.lang.String defaultWorkingFolder, ViewConfiguration baseConfig, boolean bIsBranched)
          Create a new variant view as a child of this view, that initially shares no items.
 View createChildViewShareTheseItems(java.lang.String name, java.lang.String description, Folder rootFolder, java.lang.String defaultWorkingFolder, ViewConfiguration baseConfig, boolean bIsBranched, Type[] itemTypes)
          Create a new variant view as a child of this view, that initially shares items based on the set of item Types provided.
 Label createRevisionLabel(java.lang.String name, java.lang.String description, boolean frozen)
          Create a new "Revision" label with the specified properties.
 Label createViewLabel(java.lang.String name, java.lang.String description, OLEDate time, boolean buildLabel, boolean frozen)
          Create a new "View" label with the specified properties.
 void discard()
          Discards all of the cached properties for this view.
 void discardActiveLabels()
          Discard any cached active (non-deleted) labels.
 void discardFolders()
          Discards all cached Folder information.
 void discardLabels()
          Discards cached Label information.
 boolean equals(java.lang.Object another)
          Returns true if the specified object identifies the same view as this one.
 Label[] fetchAllLabels()
          Returns all the active (non-deleted) labels for this view.
 Label[] fetchAllLabelsFromView(int projectID, int viewID)
          Returns all the active (non-deleted) labels for the given project and view.
 Folder findFolder(int itemID)
          Returns a Folder in the View, given its Item ID, or NULL if none found.
 Item findItem(Type type, int itemID)
          Returns an Item in the View, given its Type and Item ID, or NULL if none found.
 java.lang.Object get(java.lang.String propertyName)
          Return the value for the specified property.
 AclEntry[] getACL()
          Returns the Access Control List for this view.
 Label[] getActiveLabels()
          Returns all the active (non-deleted) labels for this view.
 java.lang.String getAlternatePath()
          Returns the alternate working file path to be used for this view.
 ViewConfiguration getBaseConfiguration()
          Returns the ViewConfiguration from which this View was derived.
 ViewConfiguration getConfiguration()
          Returns this view's configuration.
 AclEntry[] getContainerLevelACL(java.lang.String typeName)
          Returns the Access Control List for items of the specified type for this view.
 int getCreatedBy()
          Returns the user ID of the user that created the view.
 OLEDate getCreatedTime()
          Returns the time at which the view was created.
 java.lang.String getDefaultPath()
          Returns the default working file path to be used for this view.
 View[] getDerivedViews()
          Returns the set of views derived from this one.
 java.lang.String getDescription()
          Returns the description of this view.
 Item getDisembodiedItem(int itemID, Type type)
          Retrieves an Item by Item ID.
 FileBasedStatusManager getFileStatusManager()
          Get the FileBasedStatusManager that manages file status information for this View.
 java.lang.String getFullName()
          Returns the full hierarchical name of this view--that is, the concatentation of the root view and each descendent to this view.
 boolean getHaveAccessRights()
          Indicates whether or not the logged on user has rights to access this view.
 Item[] getHistoryForItemID(int itemID, Type type)
          Returns "disembodied" Items from the item history
 int getID()
          Returns the unique integer identifier for this view.
 Label[] getLabels()
          Returns the labels that exist in this view, including both active and deleted labels.
 java.lang.String getName()
          Returns the name of this view.
 NotificationItem[] getNewNotificationItems(java.lang.String typeName)
          Return the list of "notification" items for the specified type.
 int getOwner()
          If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container.
 ISecurableContainer getParentContainer()
          If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container.
 View getParentView()
          Returns the parent of this view.
 java.lang.String getPath()
          Returns the working file path being used for this view.
 Project getProject()
          Returns the project to which this view belongs.
 PromotionModel getPromotionModel()
          Returns the promotion model associated with this view.
 RecycleBin getRecycleBin()
          Provides access to the items that have been deleted from a view.
 Folder getRootFolder()
          Gets the root folder of this view.
 Server getServer()
          Returns the server to which this view belongs.
 StatusMethod getStatusMethodOverride()
          Returns the status method used to determine status for files in this view.
 int getViewID()
          Returns the unique integer identifier for this view.
 int hashCode()
          Returns a hash code for this view.
 boolean hasNewNotificationItems(java.lang.String typeName)
          Return true if any new notification items are available in this view for the specified item type.
 boolean hasPermission(int permissions)
          Returns true if desired permissions are granted for this view
 boolean hasPermission(int permissions, java.lang.String typeName)
          Returns true if desired permissions are granted for items of the specified type for this view
 boolean isBranch()
          Return true if this view is a Branch view.
 boolean isBranchAll()
          Return true if this view's original branching default was set "All".
 boolean isBranchNone()
          Return true if this view's original branching default was set "None".
 boolean isBranchOnShare()
          Returns true if this view is set to branch shared items.
 boolean isDeleted()
          Determines whether or not this view has been deleted from the server.
 boolean isEqualTo(View view)
          Compares the properties of two Views.
 boolean isNonDerived()
          Return true if this view is a Non-Derived view.
 boolean isReadOnly()
          Return true if this is a ReadOnly view, otherwise false.
 boolean isReference()
          Return true if this is a reference view, otherwise false.
 boolean isRefreshActiveLabelsRequired()
          Returns true if a refreshLabels() operation might have resulted in Label information for active (non-deleted) labels being updated; returns false if and only if it is known that the Labels had not been changed since the last refresh.
 boolean isRefreshFoldersRequired()
          Returns true if a View.refreshFolders() operation might have resulted in Folder information being updated; returns false if and only if it is known that the folders had not been changed since the last refresh.
 boolean isRefreshLabelsRequired()
          Returns true if a refreshLabels() operation might have resulted in Label information being updated; returns false if and only if it is known that the Labels had not been changed since the last refresh.
 boolean isRefreshRequired()
          Returns true if a refresh() operation might have resulted in view properties being updated; returns false if and only if it is known that the view properties had not been changed since the last refresh.
 boolean isRoot()
          Return true if this view is a Root view.
 void modifyItemsFlagForUser(int[] itemIDs, Type type, boolean setFlagged)
          Modifies this items flag for the logged-in user.
 void modifyItemsReadStatusForUser(int[] itemIDs, Type type, boolean bSetAsRead)
          Modifies this list of item's read status for the logged-in user.
 void populate()
          Populates project properties, if they have not already been populated.
 java.lang.Object put(java.lang.String propertyName, java.lang.Object value)
          Sets the value of the specified property and return the old value.
 java.lang.Object putByPropertyID(int propertyID, java.lang.Object value)
          Set the value of the property specified by its property ID and return the old value.
 void refresh()
          Updates cached properties to reflect recent changes made on the server.
 void refreshActiveLabels()
          Refreshes cached Label information for active (non-deleted) labels to reflect recent changes to the repository.
 void refreshFolders()
          Updates cached Folder information to reflect recent changes to the server.
 void refreshLabels()
          Refreshes cached Label information to reflect recent changes to the repository.
 void refreshPromotionModel()
          Refreshes the local cached information about this view's promotion model.
 void remove()
          Removes the view from the server.
 void removeFolderListener(IFolderListener listener)
          Removes a listener for Folder-related events.
 void removeFolderUpdateListener(FolderUpdateListener listener)
          Removes a listener for folder update events.
 void removeItemListener(IItemListener listener, Type type)
          Removes a listener for Item-related events.
 void removeItemUpdateListener(ItemUpdateListener listener, Type type)
          Removes a listener for item update events.
 void removeLabelListener(LabelListener listener)
          Removes a listener for Label events.
 void removeViewListener(ViewListener listener)
          Removes a listener for View events.
 Item resolveLinkEndpoint(LinkEndpoint endpoint)
          Returns the item in this view referred to by the LinkEndpoint.
 void setACL(AclEntry[] acl)
          Modify the Access Control List for this view.
 void setAlternatePath(java.lang.String path)
          Sets the alternate working file path to be used for this view.
 void setBranchOnShare(boolean branchOnShare)
          Sets the Branch On Share behavior for this view (only on servers that support it).
 void setContainerLevelACL(AclEntry[] acl, java.lang.String typeName)
          Modifies the Access Control List for items of the specified type for this view.
 void setDefaultPath(java.lang.String path)
          Sets the default working file path to be used for this view.
 void setDescription(java.lang.String description)
          Sets the description for this view.
 void setName(java.lang.String name)
           
 void setStatusMethodOverride(StatusMethod method)
          Changes the status method to use for files in this view.
 java.lang.String toString()
          Returns a string representation of this view and its properties.
 void update()
          Persists this view's properties to its Server.
 
Methods inherited from class com.starbase.starteam.SimpleTypedResource
getByteArray, getDouble, getEnumDisplayName, getInt, getIntArray, getOLEDate, getPossibleValues, getPropertyNames, getString, getType, getTypeNames
 
Methods inherited from class com.starbase.starteam.TypedResource
addToIntArray, removeFromIntArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.starbase.starteam.ISecurable
getType
 

Constructor Detail

View

public View(View parent,
            boolean bIsVariantView,
            boolean bIsROView,
            java.lang.String name,
            java.lang.String description,
            Folder rootFolder,
            java.lang.String defaultWorkingFolder,
            ViewConfiguration baseConfig,
            boolean bIsBranched)
A constructor used to create a new view.

Parameters:
parent - the new view's parent view.
bIsVariantView - true for a variant view, false for a reference view.
bIsROView - true for a read-only view, false for a normal view.
name - the new view's name.
description - the new view's description.
rootFolder - the root folder for the view. This must be a valid folder from the specified configuration of the parent view.
defaultWorkingFolder - the default working folder path for the view. This can be overridden on each workstation as needed.
baseConfig - the ViewConfiguration for the view. For a derived view, specify the parent view's configuration. For a floating view, specify a "current" configuration.
bIsBranched - true for branch on change. Sets initial branching behavior in derived variant views for all items shared during the view creation from the active view. Specify true for default branching, false for default floating.
See Also:
ViewConfiguration

View

public View(View parent,
            java.lang.String name,
            java.lang.String description,
            java.lang.String defaultWorkingFolder)
A constructor used to create a blank view.

Parameters:
parent - the new view's parent view.
name - the new view's name.
description - the new view's description.
defaultWorkingFolder - the default working folder path for the view. This can be overridden on each workstation as needed.

View

public View(View view,
            ViewConfiguration configuration)
A view "copy" constructor that allows the specification of an arbitrary configuration. This does not really create a new view on the server but rather creates a client side View object set to the specified configuration.

Parameters:
view - the view being configured
configuration - the desired configuration of the specified view.
Method Detail

createChildViewShareAllItems

public View createChildViewShareAllItems(java.lang.String name,
                                         java.lang.String description,
                                         Folder rootFolder,
                                         java.lang.String defaultWorkingFolder,
                                         ViewConfiguration baseConfig,
                                         boolean bIsBranched)
Create a new variant view as a child of this view, that initially shares items of all item types supported on this server.

Parameters:
rootFolder - may not be null
name - the new view's name.
description - the new view's description.
defaultWorkingFolder - the default working folder path for the view. This can be overridden on each workstation as needed.
baseConfig - the ViewConfiguration for the view. Specify the configuration of this view that is used as a starting point for the new variant view.
bIsBranched - true for branch on change. Sets initial branching behavior for all items shared from this view during view creation. Specify true for default branching, false for default floating.
Returns:
the new variant view.
See Also:
ViewConfiguration

createChildViewShareDefaultItems

public View createChildViewShareDefaultItems(java.lang.String name,
                                             java.lang.String description,
                                             Folder rootFolder,
                                             java.lang.String defaultWorkingFolder,
                                             ViewConfiguration baseConfig,
                                             boolean bIsBranched)
Create a new variant view as a child of this view, that initially shares items of the default set of item types defined for this view's Project.

Parameters:
rootFolder - may not be null
name - the new view's name.
description - the new view's description.
defaultWorkingFolder - the default working folder path for the view. This can be overridden on each workstation as needed.
baseConfig - the ViewConfiguration for the view. Specify the configuration of this view that is used as a starting point for the new variant view.
bIsBranched - true for branch on change. Sets initial branching behavior for all items shared from this view during view creation. Specify true for default branching, false for default floating.
Returns:
the new variant view.
See Also:
ViewConfiguration

createChildViewShareNoItems

public View createChildViewShareNoItems(java.lang.String name,
                                        java.lang.String description,
                                        Folder rootFolder,
                                        java.lang.String defaultWorkingFolder,
                                        ViewConfiguration baseConfig,
                                        boolean bIsBranched)
Create a new variant view as a child of this view, that initially shares no items. Supported on servers beginning with release 10.3.

Parameters:
rootFolder - may not be null
name - the new view's name.
description - the new view's description.
defaultWorkingFolder - the default working folder path for the view. This can be overridden on each workstation as needed.
baseConfig - the ViewConfiguration for the view. Specify the configuration of this view that is used as a starting point for the new variant view.
bIsBranched - true for branch on change. Sets initial branching behavior for all items shared from this view during view creation. Specify true for default branching, false for default floating.
Returns:
the new variant view.
See Also:
ViewConfiguration

createChildViewShareTheseItems

public View createChildViewShareTheseItems(java.lang.String name,
                                           java.lang.String description,
                                           Folder rootFolder,
                                           java.lang.String defaultWorkingFolder,
                                           ViewConfiguration baseConfig,
                                           boolean bIsBranched,
                                           Type[] itemTypes)
Create a new variant view as a child of this view, that initially shares items based on the set of item Types provided. Supported on servers beginning with release 10.3.

Parameters:
rootFolder - may not be null
name - the new view's name.
description - the new view's description.
defaultWorkingFolder - the default working folder path for the view. This can be overridden on each workstation as needed.
baseConfig - the ViewConfiguration for the view. Specify the configuration of this view that is used as a starting point for the new variant view.
bIsBranched - true for branch on change. Sets initial branching behavior for all items shared from this view during view creation. Specify true for default branching, false for default floating.
itemTypes - an array containing the set of Types of the items that will initially be shared from this view during view creation.
Returns:
the new variant view.
See Also:
ViewConfiguration, Type

get

public java.lang.Object get(java.lang.String propertyName)
                     throws NoSuchPropertyException
Return the value for the specified property.

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

put

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

Overrides:
put in class SimpleTypedResource
Parameters:
propertyName - the name of 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

putByPropertyID

public java.lang.Object putByPropertyID(int propertyID,
                                        java.lang.Object value)
                                 throws NoSuchPropertyException,
                                        java.lang.ClassCastException
Set the value of the property specified by its property ID and return the old value.

Overrides:
putByPropertyID in class SimpleTypedResource
Parameters:
propertyID - the ID of 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
See Also:
Property.getID()

populate

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

See Also:
View.refresh()

getPath

public java.lang.String getPath()
Returns the working file path being used for this view. This path is either the default path or the alternate path. A non-null alternate path takes precedence over a default path.

Returns:
the working file path being used for this view.

isRefreshRequired

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

Returns:
true if view properties may be out of date.
See Also:
View.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:
View.isRefreshRequired(), View.populate(), Server.enableMPX()

copy

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

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

isEqualTo

public boolean isEqualTo(View view)
Compares the properties of two Views.

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

isReference

public boolean isReference()
Return true if this is a reference view, otherwise false.

Returns:
true if this is a reference view, otherwise false.

isReadOnly

public boolean isReadOnly()
Return true if this is a ReadOnly view, otherwise false.

Returns:
true if this view is ReadOnly, otherwise false.

isRoot

public boolean isRoot()
Return true if this view is a Root view.

Returns:
true if this view is a Root view.

isBranch

public boolean isBranch()
Return true if this view is a Branch view.

Returns:
true if this view is a Branch view.

isNonDerived

public boolean isNonDerived()
Return true if this view is a Non-Derived view.

Returns:
true if this view is Non-Derived view.

isBranchAll

public boolean isBranchAll()
Return true if this view's original branching default was set "All".

Returns:
true if this view's original branching default was set "All".

isBranchNone

public boolean isBranchNone()
Return true if this view's original branching default was set "None".

Returns:
true if this view's original branching default was set "None".

isBranchOnShare

public boolean isBranchOnShare()
Returns true if this view is set to branch shared items.

Returns:
true if this view is set to branch shared items.

setBranchOnShare

public void setBranchOnShare(boolean branchOnShare)
                      throws NoSuchPropertyException
Sets the Branch On Share behavior for this view (only on servers that support it).

Parameters:
branchOnShare - true = branch shared items.
NoSuchPropertyException

getHaveAccessRights

public boolean getHaveAccessRights()
Indicates whether or not the logged on user has rights to access this view.

Returns:
true if the logged on user has rights to access this view.

getViewID

public int getViewID()
Returns the unique integer identifier for this view.

Returns:
the unique integer identifier for this view.

getID

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

Overrides:
getID in class SimpleTypedResource
Returns:
the unique integer identifier for this view. Same as getViewID.

getLabels

public Label[] getLabels()
Returns the labels that exist in this view, including both active and deleted labels. The labels are cached until explicitly refreshed.

Returns:
The labels (both active and deleted) that exist in this view.
See Also:
View.refreshLabels(), View.getActiveLabels()

getActiveLabels

public Label[] getActiveLabels()
Returns all the active (non-deleted) labels for this view. The labels are cached until explicitly refreshed.

Returns:
The active (non-deleted) labels for this view.
See Also:
View.refreshActiveLabels(), View.getLabels()

discardActiveLabels

public void discardActiveLabels()
Discard any cached active (non-deleted) labels. Subsequent calls to getActiveLabels() will fetch the label information from the StarTeam Server (even when MPX is enabled).

See Also:
View.getActiveLabels(), View.refreshActiveLabels(), Server.enableMPX()

isRefreshActiveLabelsRequired

public boolean isRefreshActiveLabelsRequired()
Returns true if a refreshLabels() operation might have resulted in Label information for active (non-deleted) labels being updated; returns false if and only if it is known that the Labels had not been changed since the last refresh. If MPX is not enabled, then isRefreshLabelsRequired() always returns true.

Returns:
true if the active label information may be out of date.
See Also:
View.refreshActiveLabels(), Server.enableMPX()

refreshActiveLabels

public void refreshActiveLabels()
Refreshes cached Label information for active (non-deleted) labels to reflect recent changes to the repository. Modifies existing Label objects in place whenever possible. If MPX is enabled, refreshActiveLabels() is optimized to avoid unnecessary server commands.

See Also:
View.isRefreshActiveLabelsRequired(), View.getActiveLabels(), View.discardActiveLabels(), View.refreshLabels(), Server.enableMPX()

fetchAllLabels

public Label[] fetchAllLabels()
Returns all the active (non-deleted) labels for this view.

The labels are not cached in the View object. Each call to fetchAllLabels() returns an up-to-date list consisting of newly allocated Label objects.

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

Returns:
The active (non-deleted) labels for this view. May be empty (but is never null).

fetchAllLabelsFromView

public Label[] fetchAllLabelsFromView(int projectID,
                                      int viewID)
Returns all the active (non-deleted) labels for the given project and view. This method is only available for 4.1 and later servers.

The labels are not cached. Each call to fetchAllLabels() returns an up-to-date list consisting of newly allocated Label objects.

fetchAllLabelsFromView() is not MPX-enabled; the labels are always retrieved directly from the repository.

Returns:
The active (non-deleted) labels for the given project and view. May be empty (but is never null).

createViewLabel

public Label createViewLabel(java.lang.String name,
                             java.lang.String description,
                             OLEDate time,
                             boolean buildLabel,
                             boolean frozen)
Create a new "View" label with the specified properties. This method creates the label on the server so a call to update() is not needed.

Parameters:
name - the label name (may not be null)
description - the label description (may not be null)
time - the view configuration time (may not be null)
buildLabel - true if the label is to be a "Build Label"
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)

createRevisionLabel

public Label createRevisionLabel(java.lang.String name,
                                 java.lang.String description,
                                 boolean frozen)
Create a new "Revision" label with the specified properties. This method creates the label on the server so a call to update() is not needed.

Parameters:
name - the label name (may not be null)
description - the label description (may not be null)
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)

cloneViewLabel

public Label cloneViewLabel(Label source,
                            java.lang.String name,
                            java.lang.String description,
                            boolean buildLabel,
                            boolean frozen)
Clones the specified "View" label. This method creates the label on the server so a call to update() is not needed.

Parameters:
source - the label to be cloned (it must be from the active view)
name - the label name (may not be null)
description - the label description (may not be null)
buildLabel - true if the label is to be a "Build Label"
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)

cloneRevisionLabel

public Label cloneRevisionLabel(Label source,
                                java.lang.String name,
                                java.lang.String description,
                                boolean frozen)
Clones the specified "Revision" label. This method creates the label on the server so a call to update() is not needed.

Parameters:
source - the label to be cloned (it must be from the active view)
name - the label name (may not be null)
description - the label description (may not be null)
frozen - true if the label is "frozen" (a frozen label can not be moved from one revision to another)

getPromotionModel

public PromotionModel getPromotionModel()
Returns the promotion model associated with this view.

Returns:
the promotion model associated with this view.

getDefaultPath

public java.lang.String getDefaultPath()
Returns the default working file path to be used for this view. This is the value stored in the repository.

Returns:
the default working file path to be used for this view.

setDefaultPath

public void setDefaultPath(java.lang.String path)
Sets the default working file path to be used for this view. This is the value stored in the repository.

Parameters:
path - the new default path

getAlternatePath

public java.lang.String getAlternatePath()
Returns the alternate working file path to be used for this view. This is the value stored client-side as an override to the default path.

Returns:
the alternate working file path to be used for this view.

setAlternatePath

public void setAlternatePath(java.lang.String path)
Sets the alternate working file path to be used for this view. This is the value stored client-side as an override to the default path.

Parameters:
path - the new alternate path

setStatusMethodOverride

public void setStatusMethodOverride(StatusMethod method)
Changes the status method to use for files in this view. This is a client side setting and will not change the behavior for other users of this view.

Parameters:
method - the new status method to use, may not be null.

getStatusMethodOverride

public StatusMethod getStatusMethodOverride()
Returns the status method used to determine status for files in this view. This method will not return null.


getFileStatusManager

public FileBasedStatusManager getFileStatusManager()
Get the FileBasedStatusManager that manages file status information for this View. The corresponding StarTeam Server must support client-managed status.

Returns:
The FileBasedStatusManager for this View.
See Also:
SupportedFeatures.hasClientManagedFileStatus(), StatusMethod.getStatusManagerForView(com.starbase.starteam.View)

getRootFolder

public Folder getRootFolder()
Gets the root folder of this view. The Folder hierarchy is cached in the View object, until explicitly refreshed or discarded.

Returns:
The root folder of this view.
See Also:
View.refreshFolders(), View.discardFolders()

getConfiguration

public ViewConfiguration getConfiguration()
Returns this view's configuration.

Returns:
this view's configuration.

getBaseConfiguration

public ViewConfiguration getBaseConfiguration()
Returns the ViewConfiguration from which this View was derived.

Returns:
the ViewConfiguration from which this View was derived.
See Also:
ViewConfiguration

getCreatedTime

public OLEDate getCreatedTime()
Returns the time at which the view was created.

Returns:
the time at which the view was created.

getCreatedBy

public int getCreatedBy()
Returns the user ID of the user that created the view.

Returns:
the user ID of the user that created the view.

getDescription

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

Returns:
the description of this view.

setDescription

public void setDescription(java.lang.String description)
Sets the description for this view.

Parameters:
description - the description for this view

getFullName

public java.lang.String getFullName()
Returns the full hierarchical name of this view--that is, the concatentation of the root view and each descendent to this view.

Returns:
the full hierarchical name of this view.

getServer

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

Returns:
the server to which this view belongs.

getName

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

Returns:
the name of this view.
See Also:
PropertyNames.VIEW_NAME

setName

public void setName(java.lang.String name)

getProject

public Project getProject()
Returns the project to which this view belongs.

Returns:
the project to which this view belongs.

getParentView

public View getParentView()
Returns the parent of this view.

Returns:
the parent of this view, or null if there is no parent.

getDerivedViews

public View[] getDerivedViews()
Returns the set of views derived from this one.

Returns:
The set of views derived from this one. Returns an empty array if there are no derived views.

createCheckinManager

public CheckinManager createCheckinManager()
Constructs a CheckinManager with default options for this view.


createCheckinManager

public CheckinManager createCheckinManager(CheckinOptions options)
Constructs a CheckinManager using a specific set of options.

Note that individual options can be overridden on a file-by-file basis by registering a CheckinListener, and changing options as necessary in the onStartFile event handler.

Parameters:
options - The specific CheckinOtions to be used.
See Also:
CheckinOptions, #addCheckinListener, CheckinListener.onStartFile(com.starbase.starteam.CheckinEvent)

createCheckoutManager

public CheckoutManager createCheckoutManager()
Constructs a CheckoutManager with default options for this view.


createCheckoutManager

public CheckoutManager createCheckoutManager(CheckoutOptions options)
Constructs a CheckoutManager using a specific set of options.

Note that individual options can be overridden on a file-by-file basis by registering a CheckoutListener, and changing options as necessary in the onStartFile event handler.

Parameters:
options - The specific CheckoutOtions to be used.
See Also:
CheckoutOptions, #addCheckoutListener, CheckoutListener.onStartFile(com.starbase.starteam.CheckoutEvent)

hasPermission

public boolean hasPermission(int permissions)
Returns true if desired permissions are granted for this view

Specified by:
hasPermission 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

hasPermission

public boolean hasPermission(int permissions,
                             java.lang.String typeName)
Returns true if desired permissions are granted for items of the specified type for this view

Specified by:
hasPermission in interface ISecurableContainer
Parameters:
permissions - the desired permissions
typeName - the name of 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, TypeNames

getACL

public AclEntry[] getACL()
Returns the Access Control List for this view. This will return null if this view has not access control list.

Specified by:
getACL in interface ISecurable
Returns:
the access control list for this view. May return null.
See Also:
AclEntry

setACL

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

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

getContainerLevelACL

public AclEntry[] getContainerLevelACL(java.lang.String typeName)
Returns the Access Control List for items of the specified type for this view. This will return null if this view has not access control list for the specified type.

Specified by:
getContainerLevelACL in interface ISecurableContainer
Parameters:
typeName - the name of the type being controlled by the returned ACL
Returns:
the access control list for this view. May return null.
See Also:
TypeNames

setContainerLevelACL

public void setContainerLevelACL(AclEntry[] acl,
                                 java.lang.String typeName)
Modifies the Access Control List for items of the specified type for this view. If the ACL is null then the access control list for items of the specified type will be dropped.

Specified by:
setContainerLevelACL in interface ISecurableContainer
Parameters:
acl - the new access control list or null if to be dropped
typeName - the name of the type being controlled by the returned ACL
See Also:
TypeNames

findFolder

public Folder findFolder(int itemID)
Returns a Folder in the View, given its Item ID, or NULL if none found.

Parameters:
itemID - the Item ID of the Folder to be retrieved.
Returns:
a Folder in the View, given its Item ID, or NULL if none found.

findItem

public Item findItem(Type type,
                     int itemID)
Returns an Item in the View, given its Type and Item ID, or NULL if none found.

Parameters:
type - the Type of the Item to be retrieved.
itemID - the Item ID of the Item to be retrieved.
Returns:
an Item in the View, given its Type and Item ID, or NULL if none found.

remove

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


isDeleted

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

Returns:
True if the view has been deleted from the server; false otherwise.

discard

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

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

See Also:
View.refresh()

update

public void update()
Persists this view's properties to its Server.


discardLabels

public void discardLabels()
Discards cached Label information. The next call to getLabels() will re-fetch the label information from the StarTeam Server (even when MPX is enabled).

See Also:
View.getLabels(), View.refreshLabels()

isRefreshLabelsRequired

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

Returns:
true if label information may be out of date.
See Also:
View.refreshLabels(), Server.enableMPX()

refreshLabels

public void refreshLabels()
Refreshes cached Label information to reflect recent changes to the repository. Modifies existing Label objects in place whenever possible. If MPX is enabled, refreshLabels() is optimized to avoid unnecessary server commands.

See Also:
View.isRefreshLabelsRequired(), View.getLabels(), View.discardLabels(), Server.enableMPX()

refreshPromotionModel

public void refreshPromotionModel()
Refreshes the local cached information about this view's promotion model.


refreshFolders

public void refreshFolders()
Updates cached Folder information to reflect recent changes to the server. Existing Folder objects are modified in place whenever possible.

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

In all cases, refreshFolders() has the side effect of clearing any Item lists that have already been populated. Thus, the next attempt to retrieve the Items will return an up-to-date list consisting of newly allocated Item objects. If MPX is enabled, the process of re-populating the Item lists is optimized to avoid unnecessary server commands.

See Also:
View.isRefreshFoldersRequired(), View.getRootFolder(), View.discardFolders(), Server.enableMPX()

isRefreshFoldersRequired

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

Returns:
true if folder information may be out of date.
See Also:
View.refreshFolders(), Server.enableMPX()

discardFolders

public void discardFolders()
Discards all cached Folder information. It will be re-fetched from the server on demand (even when MPX is enabled).

See Also:
View.getRootFolder(), View.refreshFolders()

resolveLinkEndpoint

public Item resolveLinkEndpoint(LinkEndpoint endpoint)
Returns the item in this view referred to by the LinkEndpoint. If the reference is pinned to a historical (non-tip) version, that version is returned from the history of the tip item in this view.

Parameters:
endpoint - the endpoint to be resolved
Returns:
the item referred to by the LinkEndpoint or null if the reference does not refer to a valid item in this view.

modifyItemsReadStatusForUser

public void modifyItemsReadStatusForUser(int[] itemIDs,
                                         Type type,
                                         boolean bSetAsRead)
Modifies this list of item's read status for the logged-in user. Note that this is an "immediate" command, i.e., no update() call is required. Note also that only the currently logged-in user is affected. The result of getReadStatus() after this call may not be changed because its value will be based on cached information. To get the most up to date property values you should first call discard() on the item. This is not supported for File items.

Parameters:
itemIDs - the collection of Item IDs to modify (may not be null)
type - the Type of the Items represented by the Item IDs (may not be null)
bSetAsRead - this items new read status
See Also:
Item.getReadStatus()

modifyItemsFlagForUser

public void modifyItemsFlagForUser(int[] itemIDs,
                                   Type type,
                                   boolean setFlagged)
Modifies this items flag for the logged-in user. Note that this is an "immediate" command, i.e., no update() call is required. Note also that only the currently logged-in user is affected. The result of getFlag() after this call may not be changed because its value will be based on cached information. To get the most up to date property values you should first call discard() on the item.

Parameters:
itemIDs - the collection of Item IDs to modify (may not be null)
type - the Type of the Items represented by the Item IDs (may not be null)
setFlagged - this items new flag value
See Also:
Item.getFlag(), Item.getPossibleFlag(), Item.getFlagDisplayName(int), PropertyNames.FLAG

getDisembodiedItem

public Item getDisembodiedItem(int itemID,
                               Type type)
Retrieves an Item by Item ID. The Item can reside anywhere in this view, or in any other view on the same server. However, the resulting Item is "disembodied"; that is, it is not attached to its normal parent Folder.

Disembodied Items are useful for resolving LinkEndpoints, which can cross project and view boundaries. However, many normal Item operations are not supported for disembodied items.

getDisembodiedItem() is not MPX-enabled; each call to getDisembodiedItem() retrieves data directly from the server.

See Also:
Item.isDisembodied(), LinkEndpoint.getItem()

getHistoryForItemID

public Item[] getHistoryForItemID(int itemID,
                                  Type type)
Returns "disembodied" Items from the item history

See Also:
Item.isDisembodied()

equals

public boolean equals(java.lang.Object another)
Returns true if the specified object identifies the same view as this one.

Overrides:
equals in class SimpleTypedResource
Parameters:
another - the object being tested for equality
Returns:
true if the specified object identifies that same view as this one

hashCode

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

Overrides:
hashCode in class SimpleTypedResource
Returns:
a hash code for this view.

hasNewNotificationItems

public boolean hasNewNotificationItems(java.lang.String typeName)
Return true if any new notification items are available in this view for the specified item type.

Parameters:
typeName - the desired item type

getNewNotificationItems

public NotificationItem[] getNewNotificationItems(java.lang.String typeName)
Return the list of "notification" items for the specified type. This method will not return null but may return an empty list. Once this call has been made to the server for a particular view subsequent calls will not return the same information. The act of getting the information "clears" it from the server.

Parameters:
typeName - the desired item type
Returns:
the list of "notification" items for the logged in user.

toString

public java.lang.String toString()
Returns a string representation of this view and its properties.

Overrides:
toString in class TypedResource
Returns:
a string representation of this view and its properties.

close

public void close()
Frees all cached resources associated with this view, and closes the associated view session.

Many view-related resources, such as the folder tree, item lists and so on, can be discarded separately. Others, however, are freed only by an explicit call to close().

After a view is closed, the view object is still useful. The view session is automatically re-opened when needed, and data is re-fetched from the server on demand.

See Also:
View.discard(), View.discardFolders(), View.discardLabels(), Folder.discardItems(java.lang.String, int), Server.disconnect()

getRecycleBin

public RecycleBin getRecycleBin()
Provides access to the items that have been deleted from a view.

For example:

     RecycleBin bin = view.getRecycleBin();
     Folder root = bin.getRootFolder();
     Item[] files = root.getItems(TypeNames.FILE);
     for (int i = 0; i < files.length; i++) {
         assertTrue(files[i].isDeleted());
     }
 
Note that this method is supported by StarTeam Server versions 9.0 and later.

Returns:
The recycle bin associated with this view.
See Also:
RecycleBin

addViewListener

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

Event handlers will be tiggered when this View is changed or deleted.

In order to handle events, an application must enable MPX. The logged-in user must have access permissions for this View.

Parameters:
listener - Application-specific event handler for View events.
See Also:
ViewListener, ViewAdapter, View.removeViewListener(com.starbase.starteam.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, View.addViewListener(com.starbase.starteam.ViewListener)

addLabelListener

public void addLabelListener(LabelListener listener)
Adds a listener for Label events.

Event handlers will be tiggered whenever a Label is added, changed, or deleted in this View.

In order to handle events, an application must enable MPX. The logged-in user must have access permissions for this View.

Parameters:
listener - Application-specific event handler for Label events.
See Also:
LabelListener, LabelAdapter, View.removeLabelListener(com.starbase.starteam.LabelListener), Server.enableMPX()

removeLabelListener

public void removeLabelListener(LabelListener listener)
Removes a listener for Label events.

Parameters:
listener - Previously-registered event handler for Label events.
See Also:
LabelListener, View.addLabelListener(com.starbase.starteam.LabelListener)

addFolderListener

public void addFolderListener(IFolderListener listener)
Adds a listener for Folder-related events.

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

Parameters:
listener - Application-specific event handler for Folder-related events. Any class that implements the FolderListener or FolderTreeListener interface (or both) is supported.
See Also:
IFolderListener, FolderListener, FolderAdapter, FolderTreeListener, FolderTreeAdapter, View.removeFolderListener(com.starbase.starteam.IFolderListener), Server.enableMPX()

removeFolderListener

public void removeFolderListener(IFolderListener listener)
Removes a listener for Folder-related events.

Parameters:
listener - Previously-registered event handlers for Folder-related events.
See Also:
IFolderListener, View.addFolderListener(com.starbase.starteam.IFolderListener)

addFolderUpdateListener

public void addFolderUpdateListener(FolderUpdateListener listener)
Listens for updates to this view's folder tree.

Similar to addFolderListener(), except that events are triggered by explicit operations performed by the client application. For example, calling View.refreshFolders(), Folder.update() or Folder.remove() might each trigger update events.

MPX is not required to receive folder update events.

Parameters:
listener - Application-specific event handler for folder update events.
See Also:
FolderUpdateListener, View.removeFolderUpdateListener(com.starbase.starteam.FolderUpdateListener), View.addFolderListener(com.starbase.starteam.IFolderListener)

removeFolderUpdateListener

public void removeFolderUpdateListener(FolderUpdateListener listener)
Removes a listener for folder update events.

Parameters:
listener - Previously-registered event handler for folder update events.
See Also:
FolderUpdateListener, View.addFolderUpdateListener(com.starbase.starteam.FolderUpdateListener)

addItemListener

public void addItemListener(IItemListener listener,
                            Type type)
Adds a listener for Item-related events.

If listener is an ItemListener, then Item objects passed to application event handlers may not have fully-populated properties. The only properties that are guaranteed to be populated in all cases are the Item's descriptors.

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

Parameters:
listener - Application-specific event handler for Item-related events. Any class that implements one (or more) of the IItemListener interfaces is supported.
type - The Type of the items of interest.
See Also:
IItemListener, ItemListener, ItemIDListener, ItemListListener, NotificationListener, View.addItemListener(IItemListener,Type,String[]), View.removeItemListener(com.starbase.starteam.IItemListener, com.starbase.starteam.Type), Server.enableMPX()

addItemListener

public void addItemListener(IItemListener listener,
                            Type type,
                            java.lang.String[] propertyNames)
Adds a listener for Item-related events.

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

Parameters:
listener - Application-specific event handler for Item-related events. Any class that implements one (or more) of the IItemListener interfaces is supported.
type - The Type of the items of interest.
propertyNames - Names of properties that must always be populated whenever an Item object is passed to an application event-handler. Relevant only when listener is an ItemListener.
See Also:
IItemListener, ItemListener, ItemIDListener, ItemListListener, NotificationListener, View.addItemListener(IItemListener,Type), View.removeItemListener(com.starbase.starteam.IItemListener, com.starbase.starteam.Type), Server.enableMPX()

removeItemListener

public void removeItemListener(IItemListener listener,
                               Type type)
Removes a listener for Item-related events.

Parameters:
listener - Previously-registered event handlers for Item-related events.
type - The Type of the items of interest.
See Also:
IItemListener, View.addItemListener(com.starbase.starteam.IItemListener, com.starbase.starteam.Type)

addItemUpdateListener

public void addItemUpdateListener(ItemUpdateListener listener,
                                  Type type)
Listens for updates to the items of a given type in this view.

Similar to addItemListener(), except that events are triggered by explicit operations performed by the client application. For example, calling Folder.refreshItems(), Item.update() or Item.remove() might each trigger update events.

MPX is not required to receive item update events.

Parameters:
listener - Application-specific event handler for item update events.
type - The Type of the items of interest.
See Also:
ItemUpdateListener, View.removeItemUpdateListener(com.starbase.starteam.ItemUpdateListener, com.starbase.starteam.Type), View.addItemListener(com.starbase.starteam.IItemListener, com.starbase.starteam.Type)

removeItemUpdateListener

public void removeItemUpdateListener(ItemUpdateListener listener,
                                     Type type)
Removes a listener for item update events.

Parameters:
listener - Previously-registered event handler for item update events.
type - The Type of the items of interest.
See Also:
ItemUpdateListener, View.addItemUpdateListener(com.starbase.starteam.ItemUpdateListener, com.starbase.starteam.Type)

getOwner

public int getOwner()
If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container.

Specified by:
getOwner in interface ISecurableObject
Returns:
This object's parent container.
See Also:
SystemPolicy.getSkipOwnershipCheck()

acquireOwnership

public void acquireOwnership()
Sets ownership of this securable object to the logged in user.

Specified by:
acquireOwnership in interface ISecurableObject

getParentContainer

public ISecurableContainer getParentContainer()
If there are no access rights explicitly assigned to this object, then the effective access rights come from a parent container.

Specified by:
getParentContainer in interface ISecurable
Returns:
This object's parent container.
See Also:
ISecurableContainer


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.