How to move CR across folders in WebEdition Client

0 Likes

Problem:

How to move CR across folders in WebEdition Client

Resolution:

Information in this Brief applies to:

Product Name : StarTeam

Product Version : 5.x and above

Product Component : StarTeam WebEdition Client

Platform Version : All supported platforms

JDK Version : All supported JDK versions

* Overview

This article details the steps to move CR across folders in StarTeam Web Edition client

Details

Following are some of the ways to move CRs across folders in StarTeam Web Edition client :

1. Recreate a new CR and delete the old CR

2. Add a custom field, say (Usr_MovedToFolder) which can be used to keep track of the destination folder to which the CR needs to be moved to. Then someone using the StarTeam client can move the CR to the mentioned destination folder.

3. Add a custom field, say (Usr_MovedToFolder) which can be used to keep track of the destination folder to which the CR needs to be moved to. Create a Java program (or VB script. Please refer to the StarTeam SDK documentation for details on other supported languages) to automatically scan through the projects for CR?s that are marked for move. These CR?s can be moved to the mentioned ?MovedToFolder? using the SDK API?s

Here is a code snippet using SDK 7.0 for moving the CR"s (this is provided as-is and without support from Borland):

ChangeRequest cr; // change request object to be moved

View v; // view in which the cr is present

boolean hasCustomField;

if (cr != null) {

hasCustomField = cr.getType().hasPropertyForName("Usr_MoveToFolder");

// Check if the custom property is valid for this CR

if (hasCustomField) {

Folder destnFolder;

destnFolder = StarTeamFinder.findFolder(v.getRootFolder(),

CR.getString("Usr_MoveToFolder"));

// Use the StarTeamFinder to get the destination folder object. Give

// the entire path name relative to the root folder.

if (destnFolder != null)

cr.move(destnFolder);

}

}

Old KB# 28223
Comment List
Related
Recommended