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

public Class CCMkelem

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 mkelem.

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 Yes
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
nowarn Suppress warning messages No
nocheckout Do not checkout after element creation No
checkin Checkin element after creation No
preservetime Preserve the modification time (for checkin) No
master Assign mastership of the main branch to the current site No
eltype Element type to use during element creation 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_CHECKIN

-ci flag -- checkin element after creation

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_ELTYPE

-eltype flag -- element type to use during creation

public static final String
FLAG_MASTER

-master flag -- change mastership of main branch to current site

public static final String
FLAG_NOCHECKOUT

-nco flag -- do not checkout element after creation

public static final String
FLAG_NOCOMMENT

-nc flag -- no comment is specified

public static final String
FLAG_NOWARN

-nwarn flag -- suppresses warning messages

public static final String
FLAG_PRESERVETIME

-ptime flag -- preserves the modification time on checkin

private String
private boolean
private String
private String
private boolean
private boolean
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 boolean

Returns:

boolean containing status of ci flag
getCheckin
()

Get ci flag status

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 String

Returns:

String containing the element type
getEltype
()

Get element type

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

Get the 'element type' command

public boolean

Returns:

boolean containing status of master flag
getMaster
()

Get master flag status

public boolean

Returns:

boolean containing status of noco flag
getNoCheckout
()

Get no checkout flag status

public boolean

Returns:

boolean containing status of nwarn flag
getNoWarn
()

Get nowarn flag status

public boolean

Returns:

boolean containing status of preservetime flag
getPreserveTime
()

Get preservetime flag status

public void
setCheckin(boolean
the status to set the flag to
ci
)

If true, checkin the element after creation

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
setEltype(String
to create element
eltype
)

Specifies the element type to use.

public void
setMaster(boolean
the status to set the flag to
master
)

If true, changes mastership of the main branch to the current site

public void
setNoCheckout(boolean
the status to set the flag to
co
)

If true, do not checkout element after creation.

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

If true, suppress warning messages.

public void
setPreserveTime(boolean
the status to set the flag to
ptime
)

If true, preserve the modification time.

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

Field Detail

FLAG_CHECKINback to summary
public static final String FLAG_CHECKIN

-ci flag -- checkin element after creation

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_ELTYPEback to summary
public static final String FLAG_ELTYPE

-eltype flag -- element type to use during creation

FLAG_MASTERback to summary
public static final String FLAG_MASTER

-master flag -- change mastership of main branch to current site

FLAG_NOCHECKOUTback to summary
public static final String FLAG_NOCHECKOUT

-nco flag -- do not checkout element after creation

FLAG_NOCOMMENTback to summary
public static final String FLAG_NOCOMMENT

-nc flag -- no comment is specified

FLAG_NOWARNback to summary
public static final String FLAG_NOWARN

-nwarn flag -- suppresses warning messages

FLAG_PRESERVETIMEback to summary
public static final String FLAG_PRESERVETIME

-ptime flag -- preserves the modification time on checkin

mCfileback to summary
private String mCfile
mCheckinback to summary
private boolean mCheckin
mCommentback to summary
private String mComment
mEltypeback to summary
private String mEltype
mMasterback to summary
private boolean mMaster
mNocoback to summary
private boolean mNoco
mNwarnback to summary
private boolean mNwarn
mPtimeback to summary
private boolean mPtime

Constructor Detail

CCMkelemback to summary
public CCMkelem()

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
getCheckinback to summary
public boolean getCheckin()

Get ci flag status

Returns:boolean

boolean containing status of ci flag

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

getEltypeback to summary
public String getEltype()

Get element type

Returns:String

String containing the element type

getEltypeCommandback to summary
private void getEltypeCommand(Commandline cmd)

Get the 'element type' command

Parameters
cmd:Commandline

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

getMasterback to summary
public boolean getMaster()

Get master flag status

Returns:boolean

boolean containing status of master flag

getNoCheckoutback to summary
public boolean getNoCheckout()

Get no checkout flag status

Returns:boolean

boolean containing status of noco flag

getNoWarnback to summary
public boolean getNoWarn()

Get nowarn flag status

Returns:boolean

boolean containing status of nwarn flag

getPreserveTimeback to summary
public boolean getPreserveTime()

Get preservetime flag status

Returns:boolean

boolean containing status of preservetime flag

setCheckinback to summary
public void setCheckin(boolean ci)

If true, checkin the element after creation

Parameters
ci:boolean

the status to set the flag to

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

setEltypeback to summary
public void setEltype(String eltype)

Specifies the element type to use.

Parameters
eltype:String

to create element

setMasterback to summary
public void setMaster(boolean master)

If true, changes mastership of the main branch to the current site

Parameters
master:boolean

the status to set the flag to

setNoCheckoutback to summary
public void setNoCheckout(boolean co)

If true, do not checkout element after creation.

Parameters
co:boolean

the status to set the flag to

setNoWarnback to summary
public void setNoWarn(boolean nwarn)

If true, suppress warning messages.

Parameters
nwarn:boolean

the status to set the flag to

setPreserveTimeback to summary
public void setPreserveTime(boolean ptime)

If true, preserve the modification time.

Parameters
ptime:boolean

the status to set the flag to