Use add-view to add a view to a StarTeam Server configuration from the command line. When the view is created, its parent view is the view specified with the -p option and its root folder is the folder specified with the -p option or it is the directory used in a previous session when not specifying a directory using the -p option. In this command, the -rp option specifies the working folder for the root folder. Use the following options to create the following types of views:
The syntax for this command is:
stcmd{Ex} add-view [[-p "projectSpecifier"] [-epwdfile "filePath"]
[-cmp] [-encrypt encryptionType] ][-rp "folderPath"] [-d "description"]
[-dr [-ro | -ba | -bn [-cst | -cfgl "labelName" | -cfgp "stateName" |
-cfgd "asOfDate" [-pattern "date-pattern"]]]]
For example:
add-view -p "user:password@host:port/project" -name "viewname" -rp "working folder" -dr -ba -cfgd "10/17/2014" -pattern "M/d/y"
If you use the syntax above, then you don't need the option DisableAdvancedViews to have been set in the starteam-configs.xml file.
Note that if you use -cfgd, then the date time specified must be after the parent view was created.
The full syntax is:
stcmd -p "userName:password@hostName:endpoint/projectName/[viewName/][folderHierarchy/]"
For example:
stcmd -p “bsmith:rocketfive@orion:49201/StarDraw/StarDraw/SourceCode/”
The -epwdfile keyword specifies the path to the file that contains the encrypted password. Like -pwdfile , -epwdfile replaces the password being used as part of the -p or -s option, preventing others from seeing the user's password on the command line. The full syntax is: -epwdfile "filePath" .
The -pwdfile is supported for backward compatibility. Un-encrypted passwords stored using older versions of stcmd are read. However, passwords cannot be stored to files using -pwdfile anymore.
In this case, the syntax of -p or -s reduces to -p "username@hostname:port/... -epwdfile "fullyQualifiedPathToPasswordFile"".
The following is the syntax of the commands that can be used to store an encrypted password.
Use the following syntax to be prompted for the password that will be encrypted and stored in a file.
stcmd store-password -epwdfile "filePath"
stcmd store-password -epwdfile "filePath" -password "password"
After an encrypted password is stored, other stcmd commands can specify -epwdfile "filePath"' as parameters. For example:
stcmd delete-local -p "JMarsh@Orion:1024/StarDraw/StarDraw/SourceCode" -epwdfile "C:\estuff\myfile.txt" -filter "N" "*"
Compresses all the data sent between the workstation and the server and decompresses it when it arrives. Without this option, no compression takes place.
Compression speeds transmission across the network, but it takes time on the front end to compress the data and at the back end to decompress the data.
This is an optional parameter. If not specified, then the platform default is not to compress.
Encrypts all data sent between the workstation and the server and decrypts it when it arrives. Without this option, no encryption takes place. Encryption protects files, data and other project information from being read by unauthorized parties over unsecured networks.
This is an optional parameter. If not specified, then the server and the command line negotiate the encryption required by the server.
The full syntax is: -encrypt encryptionType.
The types of encryption are:
These encryption types are ordered from fastest to slowest. Each of the slower encryption types is safer than the one preceding it.
Overrides the working folder or working directory for the StarTeam view’s root folder.
While this option allows you to use a different working folder than the one specified by the StarTeam view, its critical importance is to provide cross-platform compatibility. For example, UNIX and Microsoft Windows systems specify drive and directory path names in incompatible ways.
While the path D:\MYPRODUCT\DEVELOPMENT\SOURCE is understood on a Microsoft Windows platform, it is not understood on a UNIX platform. Use this option to define the working path if your platform does not understand the path specified in the StarTeam project.
The UNIX shell interprets a backslash (\) as an escape character when it precedes certain characters, such as quotation marks. As a result, an error occurs in the following example:
stcmd ci -p "xxx" -rp "C:\" "*"
which is interpreted as:
stcmd ci -p "xxx" -rp "C:" *"
To avoid a situation like this, escape the final character in "C:\" as follows:
stcmd ci -p "xxx" -rp "C:\\" "*"
Or avoid it as follows when the -rp path doesn’t end with the root folder as in "C:\orion\":
stcmd ci -p "xxx" -rp "C:\orion" "*"
The full syntax is: -rp "folderName" .
Folder is the Microsoft Windows term and appears in the StarTeam user interface. Directory is the correct term for the UNIX platform.
Specifies a derived view. All views, except blank views are derived. See also -ba, -bn, and -ro.
When used without -ba, -bn, or -ro, a read/write reference view is created. The configuration of a read/write reference view is the same configuration as its parent view. Therefore, using -dr without -ba, -bn, or -ro, but with -cfgl, -fgp, or -cfgd results in an error message.
When this option is not used, a blank view is created. For blank views, the value of the view property named Set Items Shared Into View To Branch On Change is initially cleared.
When used with -dr, specifies a branching view in which the behavior of existing items is set to branch on change. The value of the view property Set Items Shared Into View To Branch On Change is initially set. This option must be used with -dr.
-cst, -cfgd, -cfpg, and -cfgl are mutually exclusive.
"12/29/13 10:52 AM"
"December 29, 2013 10:52:00 AM PST"
"Monday, December 29, 2013 10:52:00 AM PST"
The following example uses add-view to create a branching view named Maintenance 5.1 on the computer named Orion. (Orion is running an instance of the StarTeam Server with a server configuration that uses port 1024.)
This command creates the view as a child of the existing StarDraw view and uses the StarDraw folder as its root folder. The new view is based on the label used for the last build of the 5.1 product before it shipped (Build 403). It has a working folder that is different from the parent’s working folder. All existing items in the view will have their behavior set to branch on change.
Use -p with add-view or the stateful set command to set the context of the project/view/parent folder.
stcmd add-view -rp "C:\StarDraw\Maintenance 5.1" -d "Maintenance view for 5.1 product release" -dr -ba -cfgl "Build 403"
The following example uses add-view to create a read/write reference view named Rooted At Source Code on the computer named Orion. This command creates the view as a child of the existing StarDraw view and uses the SourceCode folder as its root folder. It has the same working folder as its parent. Because a read/write reference view must have the same configuration as its parent, none of the -cfgl, -cfgp, and -cfgd options can be used.
stcmd add-view -cmp -encrypt "RC4" -name "Rooted At SourceCode" -d "StarDraw main view but with SourceCode folder as the root of the hierarchy" -dr