Package mks.si.brain.triggers.beans
Class ScriptCheckInArgumentsBean
- java.lang.Object
-
- mks.frame.triggers.ScriptExposableBaseBean
-
- mks.frame.triggers.beans.ScriptBaseBean
-
- mks.si.brain.triggers.beans.ScriptBaseBean
-
- mks.si.brain.triggers.beans.ScriptCheckInArgumentsBean
-
- All Implemented Interfaces:
mks.frame.triggers.ScriptExposableBean
public class ScriptCheckInArgumentsBean extends ScriptBaseBean implements mks.frame.triggers.ScriptExposableBean
The class for arguments to a check in API call; this bean is available during a Member.checkIn event. A ScriptMemberBean object is also available for determining what member member is being checked in.- See Also:
ScriptMemberBean
-
-
Constructor Summary
Constructors Constructor Description ScriptCheckInArgumentsBean(mks.si.api.CheckInInfo cii, java.io.File checkInTempFile)
Construct a ScriptCheckInArgumentsBean object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAuthor()
Returns the author of the newly checked in revision.ScriptUserBean
getAuthorBean()
Return the author of the newly checked in revision.java.lang.String
getChangePackage()
Returns the identifier of the change package associated with this check in.boolean
getCheckInSame()
Whether or not to check in a revision if its contents are the same as the previous revision.boolean
getCreateBranch()
Returns whether or not to create a branch during the checkin.boolean
getDeleteWorkfile()
Returns whether or not to delete the working file after the checkin.java.lang.String
getDescription()
Returns the description of the new revision.boolean
getExpandKeywords()
Returns whether or not keywords are expanded in the working file of the checked in file.java.lang.String
getExposedName()
Returns the name of this bean that is exposed to the scripting language.java.lang.String
getLabel()
Returns the label to apply during the checkin.java.lang.String
getLockType()
Returns type of lock whether exclusive or no lockboolean
getMoveLabel()
Whether or not to move the existing label when adding a labeljava.lang.String
getRevisionFrom()
Returns the revision we are checking in from.java.lang.String
getRevisionTo()
Returns the revision to checkin to.java.lang.String
getSandboxRevision()
Returns the revision currently in the user's sandbox.boolean
getSaveTimestamp()
Whether or not to save the atimestampjava.lang.String
getState()
Returns the state to apply during the checkin.java.io.BufferedReader
getTempFileReader()
Returns a reader object that can be used to examine the contents of the file being checked in.boolean
getUpdateMemberRev()
Returns whether or not to update member revision after the check in of the new revision.void
releaseTempFileReader()
Releases the reader opened with a call to getTempFileReader.-
Methods inherited from class mks.frame.triggers.beans.ScriptBaseBean
getEnvironmentBean, setEnvironmentBean
-
-
-
-
Method Detail
-
getExposedName
public java.lang.String getExposedName()
Returns the name of this bean that is exposed to the scripting language.- Specified by:
getExposedName
in interfacemks.frame.triggers.ScriptExposableBean
- Specified by:
getExposedName
in classScriptBaseBean
- Returns:
- The script-exposed bean name: siCheckInArgumentsBean.
-
getState
public java.lang.String getState()
Returns the state to apply during the checkin.- Returns:
- A String object containing the state to set the new revision to.
-
getLabel
public java.lang.String getLabel()
Returns the label to apply during the checkin.- Returns:
- A String object containing the label to set on the new revision.
-
getAuthor
public java.lang.String getAuthor()
Returns the author of the newly checked in revision.- Returns:
- a string version of the author. This is the author uid, not the author full name.
-
getAuthorBean
public ScriptUserBean getAuthorBean() throws mks.frame.triggers.TriggerException
Return the author of the newly checked in revision.- Returns:
- a ScriptUserBean object of the user who is the author of this newly checked in member.
- Throws:
mks.frame.triggers.TriggerException
-
getDescription
public java.lang.String getDescription()
Returns the description of the new revision.- Returns:
- A String object containing the description of the new revision.
-
getRevisionFrom
public java.lang.String getRevisionFrom()
Returns the revision we are checking in from. If StrictLocks is true, then this is the revision id that the checking in person has locked. If StrictLocks is false, then if there is no locked revision, this is member revision.- Returns:
- A String object corresponding to the revision to check in from.
-
getRevisionTo
public java.lang.String getRevisionTo()
Returns the revision to checkin to. If this argument is not set explicitly by the user, the next suitable revision (i.e. from 1.1 to 1.2) is calculated and used. This value is set (and valid) in both the pre- and post-event trigger.- Returns:
- Pre-event trigger: A String object corresponding to the revision to check in to. Post-event trigger: A String object corresponding to the newly created revision.
-
getSandboxRevision
public java.lang.String getSandboxRevision()
Returns the revision currently in the user's sandbox.- Returns:
- A string object corresponding to the revision that the file being checked in is at in the sandbox. Null is returned if the revision is not known; if the checkin is being performed through the project; if the client is too old.
-
getCheckInSame
public boolean getCheckInSame()
Whether or not to check in a revision if its contents are the same as the previous revision.- Returns:
- true if we are supposed to check in a revision if it is the same as its previous revision, false otherwise.
-
getUpdateMemberRev
public boolean getUpdateMemberRev()
Returns whether or not to update member revision after the check in of the new revision.- Returns:
- true if we are supposed to update to member revision, false otherwise.
-
getExpandKeywords
public boolean getExpandKeywords()
Returns whether or not keywords are expanded in the working file of the checked in file.- Returns:
- true if keywords should be expanded, false otherwise.
-
getCreateBranch
public boolean getCreateBranch()
Returns whether or not to create a branch during the checkin.- Returns:
- true if a branch is to be created, false otherwise.
-
getDeleteWorkfile
public boolean getDeleteWorkfile()
Returns whether or not to delete the working file after the checkin.- Returns:
- true if the working file is to be deleted, false otherwise.
-
getChangePackage
public java.lang.String getChangePackage()
Returns the identifier of the change package associated with this check in.- Returns:
- A String object identifier of the change package that this checkin is associated with. Null or the string ":none" if no change package id.
-
getTempFileReader
public java.io.BufferedReader getTempFileReader()
Returns a reader object that can be used to examine the contents of the file being checked in. If you call this script method you must call releaseTempFileReader before exiting the script, and allowing the operation to proceed. The following code illustrates:
var envBean = bsf.lookupBean("siEnvironmentBean"); var argsBean = bsf.lookupBean("siCheckInArgumentsBean"); var reader = argsBean.getTempFileReader(); var line = reader.readLine(); while (line != null) { if (line.indexOf("an unacceptable sentence") != -1) { argsBean.releaseTempFileReader(); envBean.abortScript( "The file you were attempting to checkin contained an invalid sentence.", true); } line = reader.readLine(); }
- Returns:
- a BufferedReader object.
-
releaseTempFileReader
public void releaseTempFileReader()
Releases the reader opened with a call to getTempFileReader.
-
getSaveTimestamp
public boolean getSaveTimestamp()
Whether or not to save the atimestamp- Returns:
- true if the timestamp on the working file is to be saved, false otherwise.
-
getMoveLabel
public boolean getMoveLabel()
Whether or not to move the existing label when adding a label- Returns:
- true if the label should be moved, false otherwise.
-
getLockType
public java.lang.String getLockType()
Returns type of lock whether exclusive or no lock- Returns:
- String type of lock
-
-