Add Views: add-view

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:

Syntax

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"]]]]
Note: The specification of a parameter such as -ba requires the server configuration setting Disable Advanced Views to be turned off. It is on by default. You must specify -cfgd, -cfgp or -cfgl so that the server does not treat the view as an advanced view.

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.

Parameter
Description
-p
Indicates the view or folder to be used. It also provides the user name and password needed to access the server. -p is retained for backward compatibility. Commands using -p continue to work, but are stateless. Each command opens a connection, executes the command syntax, and closes the connection. (New command line scripts may take advantage of the command line's stateful nature. See connect and set for examples. Old scripts may be migrated to the new command line syntax.) Stateless commands cause more client server traffic than stateful commands.
Note: If the clear text password contains the @ or the : symbols, then it cannot be specified through -p using the syntax username:password@host:port. The @ or :symbols will conflict with the syntax and cause the command to fail. In general, passwords with special characters in them such as @, :, ,, must be stored in the password file using the store-password command. Additionally, the password, when specified for storage in the encrypted file, must be quoted. For example: stcmd store-password -password "foo@bar" -epwdfile c:\tmp\pwdfl. Passwords stored in an encrypted password file can be used in conjunction with -p or the connect command as documented.

The full syntax is:

stcmd -p "userName:password@hostName:endpoint/projectName/[viewName/][folderHierarchy/]"

For example:

stcmd -p “bsmith:rocketfive@orion:49201/StarDraw/StarDraw/SourceCode/”
  • If the user name is omitted, the current user name is used.
  • If the password is omitted, the user is prompted to enter the password. When the user types a password, the characters are not displayed on the screen.
  • If the host name is omitted, the default is localhost.
  • Entering an endpoint (port number) is required. The default is 1024.
  • The project name is always required.
  • A view hierarchy should be used to identify the view. Use the colon (:) as a delimiter between view names. The view hierarchy should always include the root view. For example, "StarDraw:Release 4:Service Packs" indicates that the view to be used is the Service Packs view, which is a child of the Release 4 view and a grandchild of the StarDraw root view. If the view name is omitted, the root view is used. If the view is the only view in that project with that name, you can use only the view name. Doing this is not recommended, however, because another view with that name could be created at a later date.
  • A folder hierarchy should be used to identify the folder. Use the forward slash (/) as a delimiter between folder names. The folder hierarchy never includes the root folder. Omit the folder hierarchy if the file is in the view’s root folder. For example, if the root folder of the view is StarDraw, and the hierarchy to your files is StarDraw/SourceCode/Client, use only "SourceCode/Client".
-epwdfile

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.

Note: When -epwdfile is used, a password should not be specified as part of the -p or -sparameter.

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"
Use the following syntax to include the encrypted password in the command as clear text.
Note: This action does not access the network with the clear value.
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" "*"
Important:

If -p or -s and -epwdfile are used together, then the parameter :password must be omitted from -p. For example:

-p user@hostname:port/projectName.viewName -epwdfile "pathToPasswordFile"
-cmp

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.

-encrypt

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:

RC4
RSA RC4 stream cipher (fast).
RC2_ECB
RSA RC2 block cipher (Electronic Codebook).
RC2_CBC
RSA RC2 block cipher (Cipher Block Chaining).

These encryption types are ordered from fastest to slowest. Each of the slower encryption types is safer than the one preceding it.

Note: For platforms other than Microsoft Windows, the public and private keys used in the encryption process are not created automatically. They are stored in a file in the user’s home directory. This options file is named .starteam. It contains a variable or shell variable called keyfile. The keyfile variable specifies the location of the file that contains the public and private keys. If you do not specify the keyfile variable, an error occurs. When you specify the keyfile variable, but the file does not exist, the StarTeam Cross-Platform Client generates a random pair of keys, creates the file, and stores the keys in it. Be sure to secure this file. For example, in UNIX, only its owner should be able to read it.
-rp

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.

-d
A user specified Description. However, we continue to support -r as an alternate to -d for the description, but strictly for backward compatibility
-dr

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.

Indicates the type of view to create.
  • Use -dr to create a read/write reference view.
  • Use -dr -ro to create a read-only reference view.
  • Use -dr -ba to create a branching view in which the behavior of existing items is set to branch on change.
  • Use -dr -bn to create a branching view in which the behavior of existing items is not set to branch on change.
  • If you do not use -dr, a blank view is created.
-ro
When used with -dr, specifies a read-only reference view.
-ba

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.

-bn
When used with -dr, specifies a branching view in which the behavior of existing items is not set to branch on change. The value of the view property Set Items Shared Into View To Branch On Change is initially cleared. This option must be used with -dr.
-cst
Configures the view as of the current time on the StarTeam Server. This option must be used with one of the following combinations: -dr -ro , -dr -ba, or -dr -bn .

-cst, -cfgd, -cfpg, and -cfgl are mutually exclusive.

-cfgl
Configures the view using the specified label. Without -cfgl, -cfgp, or -cfgd, the view’s current configuration is used.
-cfgd
Configures the view as of the specified date/time. Examples include:

"12/29/13 10:52 AM"

"December 29, 2013 10:52:00 AM PST"

"Monday, December 29, 2013 10:52:00 AM PST"

-cfgp
Configures the view using the specified promotion state.
-pattern
Qualifies the datetime. It can be specified wherever a date-time is specified, such as -cfgd, -vd, etc. The pattern must match any valid pattern supported by the java JDK in java.text.SimpleDateFormat.applyLocalizedPattern(String). The pattern may be localized.
For every command that takes a -pattern parameter, a -locale parameter is optionally available. This is the "two character country code".

Examples

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