Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.clearcase

public Class CCMklabel

extends ClearCase
Class Inheritance
Imports
org.apache.tools.ant.BuildException, .Project, org.apache.tools.ant.taskdefs.Execute, org.apache.tools.ant.types.Commandline

Task to perform mklabel command to ClearCase.

The following attributes are interpreted:

Task attributes
Attribute Values Required
viewpath Path to the ClearCase view file or directory that the command will operate on No
replace Replace a label of the same type on the same branch No
recurse Process each subdirectory under viewpath No
version Identify a specific version to attach the label to No
typename Name of the label type Yes
vob Name of the VOB No
comment Specify a comment. Only one of comment or cfile may be used. No
commentfile Specify a file containing a comment. Only one of comment or cfile may be used. No
failonerr Throw an exception if the command fails. Default is true No

Field Summary

Modifier and TypeField and Description
public static final String
FLAG_COMMENT

-c flag -- comment to attach to the file

public static final String
FLAG_COMMENTFILE

-cfile flag -- file containing a comment to attach to the file

public static final String
FLAG_NOCOMMENT

-nc flag -- no comment is specified

public static final String
FLAG_RECURSE

-recurse flag -- process all subdirectories

public static final String
FLAG_REPLACE

-replace flag -- replace another label of the same type

public static final String
FLAG_VERSION

-version flag -- attach label to specified version

private String
private String
private boolean
private boolean
private String
private String
private String
Inherited from org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase:
COMMAND_CHECKINCOMMAND_CHECKOUTCOMMAND_LOCKCOMMAND_LSCOCOMMAND_MKATTRCOMMAND_MKBLCOMMAND_MKDIRCOMMAND_MKELEMCOMMAND_MKLABELCOMMAND_MKLBTYPECOMMAND_RMTYPECOMMAND_UNCHECKOUTCOMMAND_UNLOCKCOMMAND_UPDATE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
checkOptions(Commandline cmd)

Check the command line options.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Executes the task.
public String

Returns:

String containing the comment
getComment
()

Get comment string

private void
getCommentCommand(Commandline
containing the command line string with or without the comment flag and string appended
cmd
)

Get the 'comment' command

public String

Returns:

String containing the path to the comment file
getCommentFile
()

Get comment file

private void
getCommentFileCommand(Commandline
containing the command line string with or without the commentfile flag and file appended
cmd
)

Get the 'commentfile' command

public boolean

Returns:

boolean containing status of recurse flag
getRecurse
()

Get recurse flag status

public boolean

Returns:

boolean containing status of replace flag
getReplace
()

Get replace flag status

private void
getTypeCommand(Commandline
containing the command line string with or without the type-name
cmd
)

Get the type-name

public String

Returns:

String containing type name
getTypeName
()

Get type-name

public String

Returns:

boolean containing status of version flag
getVersion
()

Get version flag status

private void
getVersionCommand(Commandline
CommandLine containing the command line string with or without the version flag and string appended
cmd
)

Get the 'version' command

public String

Returns:

String containing VOB name
getVOB
()

Get VOB name

public void
setComment(String
the comment string
comment
)

Set comment string

public void
setCommentFile(String
the path to the comment file
cfile
)

Set comment file

public void
setRecurse(boolean
the status to set the flag to
recurse
)

Set recurse flag

public void
setReplace(boolean
the status to set the flag to
replace
)

Set the replace flag

public void
setTypeName(String
the type name
tn
)

Set the type-name

public void
setVersion(String
the status to set the flag to
version
)

Set the version flag

public void
setVOB(String
the VOB name
vob
)

Set the VOB name

Inherited from org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase:
getClearToolCommandgetFailOnErrgetObjSelectgetViewPathgetViewPathBasenamerunrunSrunSsetClearToolDirsetFailOnErrsetObjSelectsetViewPath

Field Detail

FLAG_COMMENTback to summary
public static final String FLAG_COMMENT

-c flag -- comment to attach to the file

FLAG_COMMENTFILEback to summary
public static final String FLAG_COMMENTFILE

-cfile flag -- file containing a comment to attach to the file

FLAG_NOCOMMENTback to summary
public static final String FLAG_NOCOMMENT

-nc flag -- no comment is specified

FLAG_RECURSEback to summary
public static final String FLAG_RECURSE

-recurse flag -- process all subdirectories

FLAG_REPLACEback to summary
public static final String FLAG_REPLACE

-replace flag -- replace another label of the same type

FLAG_VERSIONback to summary
public static final String FLAG_VERSION

-version flag -- attach label to specified version

mCfileback to summary
private String mCfile
mCommentback to summary
private String mComment
mRecurseback to summary
private boolean mRecurse
mReplaceback to summary
private boolean mReplace
mTypeNameback to summary
private String mTypeName
mVersionback to summary
private String mVersion
mVOBback to summary
private String mVOB

Constructor Detail

CCMklabelback to summary
public CCMklabel()

Method Detail

checkOptionsback to summary
private void checkOptions(Commandline cmd)

Check the command line options.

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Executes the task.

Builds a command line to execute cleartool and then calls Exec's run method to execute the command line.

Annotations
@Override
Exceptions
BuildException:
if the command fails and failonerr is set to true
getCommentback to summary
public String getComment()

Get comment string

Returns:String

String containing the comment

getCommentCommandback to summary
private void getCommentCommand(Commandline cmd)

Get the 'comment' command

Parameters
cmd:Commandline

containing the command line string with or without the comment flag and string appended

getCommentFileback to summary
public String getCommentFile()

Get comment file

Returns:String

String containing the path to the comment file

getCommentFileCommandback to summary
private void getCommentFileCommand(Commandline cmd)

Get the 'commentfile' command

Parameters
cmd:Commandline

containing the command line string with or without the commentfile flag and file appended

getRecurseback to summary
public boolean getRecurse()

Get recurse flag status

Returns:boolean

boolean containing status of recurse flag

getReplaceback to summary
public boolean getReplace()

Get replace flag status

Returns:boolean

boolean containing status of replace flag

getTypeCommandback to summary
private void getTypeCommand(Commandline cmd)

Get the type-name

Parameters
cmd:Commandline

containing the command line string with or without the type-name

getTypeNameback to summary
public String getTypeName()

Get type-name

Returns:String

String containing type name

getVersionback to summary
public String getVersion()

Get version flag status

Returns:String

boolean containing status of version flag

getVersionCommandback to summary
private void getVersionCommand(Commandline cmd)

Get the 'version' command

Parameters
cmd:Commandline

CommandLine containing the command line string with or without the version flag and string appended

getVOBback to summary
public String getVOB()

Get VOB name

Returns:String

String containing VOB name

setCommentback to summary
public void setComment(String comment)

Set comment string

Parameters
comment:String

the comment string

setCommentFileback to summary
public void setCommentFile(String cfile)

Set comment file

Parameters
cfile:String

the path to the comment file

setRecurseback to summary
public void setRecurse(boolean recurse)

Set recurse flag

Parameters
recurse:boolean

the status to set the flag to

setReplaceback to summary
public void setReplace(boolean replace)

Set the replace flag

Parameters
replace:boolean

the status to set the flag to

setTypeNameback to summary
public void setTypeName(String tn)

Set the type-name

Parameters
tn:String

the type name

setVersionback to summary
public void setVersion(String version)

Set the version flag

Parameters
version:String

the status to set the flag to

setVOBback to summary
public void setVOB(String vob)

Set the VOB name

Parameters
vob:String

the VOB name