wt.clients.vc
Class CheckInTask

java.lang.Object
  extended bywt.clients.vc.CheckInTask

public class CheckInTask
extends Object

Class CheckInTask is a generic task class which performs the check-in of a checked out object. To perform a check-in of a checked out object, this class only needs to be given a parent Applet, which provides context, a Frame to parent dialogs launched in the check-in task and the Workable object to be checked in:

       CheckInTask checkin_task = new CheckInTask( my_applet, my_frame );
       checkin_task.setCheckinItem( check_in_item );
       checkin_task.checkin();
  


Supported API: true

Extendable: false

See Also:
Workable

Field Summary
private  Cabinet[] allowedCabinets
           
private  Folder checkInFolder
           
private  Workable checkinItem
           
private  ThreadGroup contextGroup
           
private static boolean DEBUG
          Flag used to provide debugging messages.
private  boolean firstCheckIn
           
private  Applet parentApplet
           
private  Frame parentFrame
           
private static ResourceBundle resources
           
private static String RESOURCES
           
private static String versionID
           
 
Constructor Summary
CheckInTask(Applet parent_applet, Frame parent_frame)
          Construct a CheckInTask to handle the checkin of a Workable object.
 
Method Summary
 Workable checkin()
          Performs the actual check-in of the item to be checked in.
private  void dispatchRefreshEvent(Object obj, int action)
           
 Cabinet[] getAllowedCabinets()
          Returns an array of cabinets from which the user can choose the location in which to place the object being checked in on a first-time check-in.
 Folder getCheckInFolder()
          Returns the folder in which the item being checked in currently is located.
 Workable getCheckinItem()
          Returns the Workable item checked in by this task.
private  WTContext getContext()
           
 Applet getParentApplet()
          Returns the parent Applet which provides context to this task.
 Frame getParentFrame()
          Returns the Frame which is used as the owner of dialogs launched in this task.
private  void initResources()
           
 void setAllowedCabinets(Cabinet[] cabinets)
          Method which sets the cabinets into which a user can check an object.
 void setCheckInFolder(Folder folder)
          Sets the Folder in which the given object is to be checked in to.
 void setCheckinItem(Workable checkin_item)
          Sets the Workable item to be checked in.
private  void setContext(boolean set)
           
 void setParentApplet(Applet parent_applet)
          Sets the parent Applet which provides context to this task.
 void setParentFrame(Frame parent_frame)
          Sets the Frame to be used as the owner of dialogs launched in this task.
private  void showMessageDialog(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

RESOURCES

private static String RESOURCES

resources

private static ResourceBundle resources

DEBUG

private static boolean DEBUG
Flag used to provide debugging messages.


parentApplet

private Applet parentApplet

parentFrame

private Frame parentFrame

checkinItem

private Workable checkinItem

firstCheckIn

private boolean firstCheckIn

contextGroup

private ThreadGroup contextGroup

checkInFolder

private Folder checkInFolder

allowedCabinets

private Cabinet[] allowedCabinets
Constructor Detail

CheckInTask

public CheckInTask(Applet parent_applet,
                   Frame parent_frame)
Construct a CheckInTask to handle the checkin of a Workable object.

Parameters:
parent_applet - The parent Applet from which this task gets its context.
parent_frame - The parent Frame which is used to provide a Frame for launching dialogs. If no frame is provided, the applet is used in launching dialogs.
Method Detail

setParentApplet

public void setParentApplet(Applet parent_applet)
Sets the parent Applet which provides context to this task. The parent Applet is used to get the appropriate WTContext object for this task.

Parameters:
parent_applet - the Applet to be used for context
See Also:
getParentApplet(), WTContext

getParentApplet

public Applet getParentApplet()
Returns the parent Applet which provides context to this task. The parent Applet is used to get the appropriate WTContext object for this task.

Returns:
the Applet used for providing context
See Also:
setParentApplet(java.applet.Applet), WTContext

setParentFrame

public void setParentFrame(Frame parent_frame)
Sets the Frame to be used as the owner of dialogs launched in this task. Since a Dialog requires a Frame to be constructed, this task must be given a frame to use.

Parameters:
parent_frame - the Frame used for launching dialogs from this task
See Also:
getParentFrame(), Dialog

getParentFrame

public Frame getParentFrame()
Returns the Frame which is used as the owner of dialogs launched in this task. If the parent frame has not been explicitly set (via setParentFrame), this method will try to retrieve a frame by traversing the parent hierarchy of the parent applet, if the parent applet has been given.

Returns:
the parent Frame used for launching dialogs from this task
See Also:
setParentFrame(java.awt.Frame), setParentApplet(java.applet.Applet)

setCheckinItem

public void setCheckinItem(Workable checkin_item)
                    throws NotCheckedOutException,
                           WTException
Sets the Workable item to be checked in. This method does not verify that the given Workable corresponds to an object that is currently checked out.

Parameters:
checkin_item - the Workable object to be checked in
Throws:
NotCheckedOutException
WTException
See Also:
getCheckinItem(), Workable

getCheckinItem

public Workable getCheckinItem()
Returns the Workable item checked in by this task.

Returns:
the Workable item checked in by this task
See Also:
setCheckinItem(wt.vc.wip.Workable), Workable

setCheckInFolder

public void setCheckInFolder(Folder folder)
Sets the Folder in which the given object is to be checked in to. Note that the check-in folder is used when an object is first being put into the vault. This method sets the folder in the vault in which the given item is to be added.

Parameters:
folder - the Folder in which the new item is to be vaulted
See Also:
getCheckInFolder(), Folder

getCheckInFolder

public Folder getCheckInFolder()
                        throws WTException
Returns the folder in which the item being checked in currently is located.

Returns:
the Folder in which the original copy of the item being checked in is located.
Throws:
WTException
See Also:
setCheckInFolder(wt.folder.Folder), Folder

checkin

public Workable checkin()
Performs the actual check-in of the item to be checked in. This method will validate that the given check-in item corresponds to an item that is currently checked out to the user. If the given item is valid for a check-in, this method will launch a CheckInDialog to perform the actual processing of the check-in task.

Returns:
the Workable object which has been checked in
See Also:
CheckInDialog, Workable

initResources

private void initResources()

getContext

private WTContext getContext()

setContext

private void setContext(boolean set)

showMessageDialog

private void showMessageDialog(String message)

dispatchRefreshEvent

private void dispatchRefreshEvent(Object obj,
                                  int action)

setAllowedCabinets

public void setAllowedCabinets(Cabinet[] cabinets)
Method which sets the cabinets into which a user can check an object. The array of cabinets given in this method are used only if the check-in is a first time check-in. If the check-in is a first time check-in, and the user chooses to browse for a location in which to place the object, only the cabinets in the given array of cabinets are shown.

Parameters:
cabinets - the array of cabinets from which the user can choose the location in which to place the object on a first-time check-in

getAllowedCabinets

public Cabinet[] getAllowedCabinets()
Returns an array of cabinets from which the user can choose the location in which to place the object being checked in on a first-time check-in. If the allowed cabinets from which the user can choose the location has not been explicitly set, this method will return null.

Returns:
the list of cabinets from which the user can choose the location on a first-time check-in