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

public Class CCCheckout

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

Performs ClearCase checkout.

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
reserved Specifies whether to check out the file as reserved or not Yes
out Creates a writable file under a different filename No
nodata Checks out the file but does not create an editable file containing its data No
branch Specify a branch to check out the file to No
version Allows checkout of a version other than main latest No
nowarn Suppress warning messages 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
notco Fail if it's already checked out to the current view. Set to false to ignore it. 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_BRANCH

-branch flag -- checks out the file on a specified branch

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_NODATA

-ndata flag -- checks out the file but does not create an editable file containing its data

public static final String
FLAG_NOWARN

-nwarn flag -- suppresses warning messages

public static final String
FLAG_OUT

-out flag -- create a writable file under a different filename

public static final String
FLAG_RESERVED

-reserved flag -- check out the file as reserved

public static final String
FLAG_UNRESERVED

-reserved flag -- check out the file as unreserved

public static final String
FLAG_VERSION

-version flag -- allows checkout of a version that is not main latest

private String
private String
private String
private boolean
private boolean
private boolean
private String
private boolean
private boolean
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 name of the branch
getBranch
()

Get branch name

private void
getBranchCommand(Commandline
containing the command line string with or without the branch flag and name appended
cmd
)

Get the 'branch' command

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 cfile flag and file appended
cmd
)

Get the 'cfile' command

public boolean

Returns:

boolean containing status of ndata flag
getNoData
()

Get nodata flag status

public boolean

Returns:

boolean containing status of notco flag
getNotco
()

Get notco flag status

public boolean

Returns:

boolean containing status of nwarn flag
getNoWarn
()

Get nowarn flag status

public String

Returns:

String containing the path to the out file
getOut
()

Get out file

private void
getOutCommand(Commandline
containing the command line string with or without the out flag and path appended
cmd
)

Get the 'out' command

public boolean

Returns:

boolean containing status of reserved flag
getReserved
()

Get reserved flag status

public boolean

Returns:

boolean containing status of version flag
getVersion
()

Get version flag status

private boolean
lsCheckout()

Check to see if the element is checked out in the current view.

public void
setBranch(String
the name of the branch
branch
)

Specify a branch to check out the file to.

public void
setComment(String
the comment string
comment
)

Sets the comment string.

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

Specifies a file containing a comment.

public void
setNoData(boolean
the status to set the flag to
ndata
)

If true, checks out the file but does not create an editable file containing its data.

public void
setNotco(boolean
the status to set the flag to
notco
)

If true, checkout fails if the element is already checked out to the current view.

public void
setNoWarn(boolean
the status to set the flag to
nwarn
)

If true, warning messages are suppressed.

public void
setOut(String
the path to the out file
outf
)

Creates a writable file under a different filename.

public void
setReserved(boolean
the status to set the flag to
reserved
)

If true, checks out the file as reserved.

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

If true, allows checkout of a version other than main latest.

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

Field Detail

FLAG_BRANCHback to summary
public static final String FLAG_BRANCH

-branch flag -- checks out the file on a specified branch

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_NODATAback to summary
public static final String FLAG_NODATA

-ndata flag -- checks out the file but does not create an editable file containing its data

FLAG_NOWARNback to summary
public static final String FLAG_NOWARN

-nwarn flag -- suppresses warning messages

FLAG_OUTback to summary
public static final String FLAG_OUT

-out flag -- create a writable file under a different filename

FLAG_RESERVEDback to summary
public static final String FLAG_RESERVED

-reserved flag -- check out the file as reserved

FLAG_UNRESERVEDback to summary
public static final String FLAG_UNRESERVED

-reserved flag -- check out the file as unreserved

FLAG_VERSIONback to summary
public static final String FLAG_VERSION

-version flag -- allows checkout of a version that is not main latest

mBranchback to summary
private String mBranch
mCfileback to summary
private String mCfile
mCommentback to summary
private String mComment
mNdataback to summary
private boolean mNdata
mNotcoback to summary
private boolean mNotco
mNwarnback to summary
private boolean mNwarn
mOutback to summary
private String mOut
mReservedback to summary
private boolean mReserved
mVersionback to summary
private boolean mVersion

Constructor Detail

CCCheckoutback to summary
public CCCheckout()

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
getBranchback to summary
public String getBranch()

Get branch name

Returns:String

String containing the name of the branch

getBranchCommandback to summary
private void getBranchCommand(Commandline cmd)

Get the 'branch' command

Parameters
cmd:Commandline

containing the command line string with or without the branch flag and name appended

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 'cfile' command

Parameters
cmd:Commandline

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

getNoDataback to summary
public boolean getNoData()

Get nodata flag status

Returns:boolean

boolean containing status of ndata flag

getNotcoback to summary
public boolean getNotco()

Get notco flag status

Returns:boolean

boolean containing status of notco flag

Since
ant 1.6.1
getNoWarnback to summary
public boolean getNoWarn()

Get nowarn flag status

Returns:boolean

boolean containing status of nwarn flag

getOutback to summary
public String getOut()

Get out file

Returns:String

String containing the path to the out file

getOutCommandback to summary
private void getOutCommand(Commandline cmd)

Get the 'out' command

Parameters
cmd:Commandline

containing the command line string with or without the out flag and path appended

getReservedback to summary
public boolean getReserved()

Get reserved flag status

Returns:boolean

boolean containing status of reserved flag

getVersionback to summary
public boolean getVersion()

Get version flag status

Returns:boolean

boolean containing status of version flag

lsCheckoutback to summary
private boolean lsCheckout()

Check to see if the element is checked out in the current view.

setBranchback to summary
public void setBranch(String branch)

Specify a branch to check out the file to.

Parameters
branch:String

the name of the branch

setCommentback to summary
public void setComment(String comment)

Sets the comment string.

Parameters
comment:String

the comment string

setCommentFileback to summary
public void setCommentFile(String cfile)

Specifies a file containing a comment.

Parameters
cfile:String

the path to the comment file

setNoDataback to summary
public void setNoData(boolean ndata)

If true, checks out the file but does not create an editable file containing its data.

Parameters
ndata:boolean

the status to set the flag to

setNotcoback to summary
public void setNotco(boolean notco)

If true, checkout fails if the element is already checked out to the current view.

Parameters
notco:boolean

the status to set the flag to

Since
ant 1.6.1
setNoWarnback to summary
public void setNoWarn(boolean nwarn)

If true, warning messages are suppressed.

Parameters
nwarn:boolean

the status to set the flag to

setOutback to summary
public void setOut(String outf)

Creates a writable file under a different filename.

Parameters
outf:String

the path to the out file

setReservedback to summary
public void setReserved(boolean reserved)

If true, checks out the file as reserved.

Parameters
reserved:boolean

the status to set the flag to

setVersionback to summary
public void setVersion(boolean version)

If true, allows checkout of a version other than main latest.

Parameters
version:boolean

the status to set the flag to