|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.clients.vc.CheckInOutTaskLogic
Class CheckInOutTaskLogic
is a utility class that provides
static
methods for manipulating Workable
objects.
The methods in this class encapsulate the server-side processing needed
to manipulate Workable
objects.
Supported API: true
Extendable: false
Workable
Field Summary | |
private static String |
MESSAGES_RESOURCE
|
private static String |
versionID
|
Constructor Summary | |
CheckInOutTaskLogic()
|
Method Summary | |
static Workable |
checkInObject(Workable workable,
Folder checkin_folder,
String note)
Checks in the given Workable object to the vault for the first
time. |
static Workable |
checkInObject(Workable workable,
String note)
Checks in the given Workable object. |
static Workable |
checkInObject(Workable workable,
String folder_path,
String note)
Checks in the given Workable object to the vault for the first
time. |
static CheckoutLink |
checkOutObject(Workable workable,
Folder folder,
String note)
Checks out the given Workable object. |
static WTPrincipal |
getCheckedOutBy(Workable workable)
Returns the WTPrincipal that currently has the given
Workable object checked out. |
static String |
getCheckedOutBy(Workable workable,
Locale locale)
Returns the String display name of the WTPrincipal that
currently has the given Workable object checked out. |
static Folder |
getCheckoutFolder()
Returns the default check-out folder for the current user. |
static Folder |
getCheckoutFolder(Workable workable)
Returns the folder in which the working copy of the given checked out item exists. |
static Workable |
getOriginalCopy(Workable working_copy)
Returns the original copy of the given Workable object. |
static Workable |
getWorkingCopy(Workable original_copy)
Returns the working copy of the given Workable object. |
static boolean |
hasChanged(Workable workable)
Returns a boolean value indicating whether or not the given workable has been modified since it has been checked out. |
static boolean |
isCheckedOut(Workable item)
Determines if the given Workable object is currently checked out. |
static boolean |
isCheckedOut(Workable item,
WTPrincipal user)
Determines if the given Workable object is currently checked
out by the given WTPrincipal . |
static boolean |
isCheckedOutByOther(Workable workable)
Determines if the given Workable object is currently checked out
by a user other than the current user. |
static boolean |
isCheckedOutByUser(Workable workable)
Determines if the given Workable object is currently checked out
by the current user. |
static boolean |
isCheckinAllowed(Workable workable)
Determines if the given Workable object is available to be
checked in by the current user. |
static boolean |
isCheckoutAllowed(Workable workable)
Checks if the current user is allowed to check out the given Workable
object. |
static boolean |
isInVault(Workable workable)
Determines whether or not the given Workable already exists
in the vault. |
static boolean |
isWorkingCopy(Workable workable)
Determines if the given Workable object is a working copy. |
static Workable |
refresh(Workable workable)
Returns a refreshed copy of the given workable. |
static Workable |
undoCheckout(Workable original)
Undoes the checkout of the given Workable object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String versionID
private static String MESSAGES_RESOURCE
Constructor Detail |
public CheckInOutTaskLogic()
Method Detail |
public static boolean isCheckoutAllowed(Workable workable) throws LockException, WTException
Workable
object. If the given object is not a working copy, and the object is not
currently checked out, then the user is allowed to check out the object.
workable
- the Workable
object which is checked to determine
if the current user can check it out
true
, the current user is allowed to check out the given
object.
LockException
- if an error occurs determining if the given object is
currently checked out
WTException
- if an error occurs determining if the given object is a
working copyWorkable
public static boolean isCheckedOutByUser(Workable workable) throws WTException
Workable
object is currently checked out
by the current user.
workable
- the Workable
object to determine if the
current user has checked out
true
, the current user has the given object checked
out
WTException
- if an error occurs determining if the current user has
the given object checked outWorkable
public static boolean isCheckedOutByOther(Workable workable) throws WTException
Workable
object is currently checked out
by a user other than the current user. Note that a returned value of
false
does not imply that the current user has the object checked
out, but only that a user other than the current user does not have the
object checked out.
workable
- the Workable
object to determine if a user
other than the current user has checked out
true
, a user other than the current user has the
given object checked out
WTException
- if an error occurs determining if a user other than
the current user has the given object checked outWorkable
public static boolean isCheckedOut(Workable item) throws WorkInProgressException, WTException
Workable
object is currently checked out.
item
- the Workable
item to be tested for being
in a checked out state
true
, the given object is currently checked out
WorkInProgressException
- if an error occurs determining the
checked out status of the given Workable
WTException
- if an error occurs determining the
checked out status of the given Workable
public static boolean isCheckedOut(Workable item, WTPrincipal user) throws WorkInProgressException, WTException
Workable
object is currently checked
out by the given WTPrincipal
.
item
- the Workable
item to be tested for being
checked out by the given WTPrincipal
user
- the WTPrincipal
to be tested for having
the given Workable
checked out
true
, the given WTPrincipal
currently has the given Workable
checked out
WorkInProgressException
- if an error occurs determining if the
given WTPrincipal
has the given Workable
checked out
WTException
- if an error occurs determining if the
given WTPrincipal
has the given Workable
checked outpublic static WTPrincipal getCheckedOutBy(Workable workable) throws LockException, WorkInProgressException, WTException
WTPrincipal
that currently has the given
Workable
object checked out. If the given object is
not in a checked out state, a null
value is returned.
workable
- the Workable
object for which the
WTPrincipal
having this object checked out
is returned
WTPrincipal
which has the given object
checked out; if the object is not checked out,
null
is returned
LockException
- if an error occurs retrieving the
WTPrincipal
which has the given object checked out
WorkInProgressException
- if an error occurs determining
if the given object is checked out
WTException
- if an error occurs determining if the given
object is checked outpublic static String getCheckedOutBy(Workable workable, Locale locale) throws LockException, WorkInProgressException, WTException
WTPrincipal
that
currently has the given Workable
object checked out. If
the given object is not in a checked out state, a null
value is returned.
workable
- the Workable
object for which the
name of the WTPrincipal
having this object checked
out is returnedlocale
- the Locale in which to display the name
WTPrincipal
which has
the given object checked out; if the object is not checked out,
null
is returned
LockException
- if an error occurs retrieving the
WTPrincipal
which has the given object checked out
WorkInProgressException
- if an error occurs determining
if the given object is checked out
WTException
- if an error occurs determining if the given
object is checked outpublic static boolean isWorkingCopy(Workable workable)
Workable
object is a working copy.
workable
- the Workable
item that is checked to see
if it is a working copy
true
, the given object is a working copypublic static Workable getWorkingCopy(Workable original_copy) throws WorkInProgressException, WTException
Workable
object. If
the given object itself is a working copy, then that object is returned.
Otherwise, the working copy of the given original is retrieved and
returned.
original_copy
- the Workable
whose working copy is to
be returned
WorkInProgressException
- if an error occurs attempting to retrieve
the working copy of the given object
WTException
- if an error occurs attempting to retrieve the working
copy of the given objectgetOriginalCopy(wt.vc.wip.Workable)
,
Workable
public static CheckoutLink checkOutObject(Workable workable, Folder folder, String note) throws CheckInOutException, WTPropertyVetoException, WorkInProgressException, WTException
Workable
object. The working copy of
the checked out object is placed into the given Folder
. If
the given folder is null, an exception is thrown. The given String
note is used as the check-out note.
workable
- the Workable
object to be checked outfolder
- the Folder
in which to place the
working copy created by the check-outnote
- the String
note describing the check-out
CheckoutLink
created by checking out the given
object
CheckInOutException
- if the given Folder
in which to
place the working copy is not given
WTPropertyVetoException
- if an error occurs checking out the
given object
WorkInProgressException
- if an error occurs checking out the
given object
WTVetoException
- if an error occurs checking out the
given object
WTException
CheckoutLink
,
Workable
public static Workable undoCheckout(Workable original) throws WorkInProgressException, WTPropertyVetoException, WTException
Workable
object.
original
- the checked out Workable
object for which
the check-out is undone
Workable
object for which the check-out was
undone
WorkInProgressException
- if an error occurs undoing the check-out
of the given object
WTPropertyVetoException
- if an error occurs undoing the check-out
of the given object
WTException
- if an error occurs undoing the check-out
of the given objectpublic static Workable getOriginalCopy(Workable working_copy) throws WorkInProgressException, WTException
Workable
object. If
the given object itself is an original object, then that object is returned.
Otherwise, the original of the given working copy is retrieved and
returned.
working_copy
- the Workable
whose original is to
be returned
WorkInProgressException
- if an error occurs attempting to retrieve
the original of the given object
WTException
- if an error occurs attempting to retrieve the original
of the given objectgetWorkingCopy(wt.vc.wip.Workable)
,
Workable
public static boolean isCheckinAllowed(Workable workable) throws WTException
Workable
object is available to be
checked in by the current user. If the given object is currently checked
out by the current user, or if the current user is a member of the
"Administrators" group, then the checkin is allowed, and this method
returns true
.
workable
- the Workable
object which is tested for
check-in by the current user
true
if the given object is currently checked out
by the current user
WTException
- if an error occurs determining if the current user
has the given object checked outpublic static Workable checkInObject(Workable workable, String note) throws WTPropertyVetoException, WorkInProgressException, WTException
Workable
object. The given String
note is associated as a description for the check-in operation.
workable
- the Workable
object to be checked innote
- the String
note associated with this checkin.
Workable
object updated as a result of being
checked in
WTPropertyVetoException
- if an error occurs attempting to check
in the given object
WorkInProgressException
- if an error occurs attempting to check
in the given object
WTException
- if an error occurs attempting to check
in the given objectpublic static Workable checkInObject(Workable workable, Folder checkin_folder, String note) throws WTPropertyVetoException, VersionControlException, WTException
Workable
object to the vault for the first
time. The given Folder
specifies where to check the object in
to. The given String
note is associated as a description for
the initial check-in operation.
workable
- the Workable
object to be checked incheckin_folder
- the Folder
in which to place the
checked in objectnote
- the String
note associated with this checkin.
Workable
object updated as a result of being
checked in
WTPropertyVetoException
- if an error occurs attempting to check
in the given object
WorkInProgressException
- if an error occurs attempting to check
in the given object
WTException
- if an error occurs attempting to check
in the given object
VersionControlException
public static Workable checkInObject(Workable workable, String folder_path, String note) throws WTPropertyVetoException, VersionControlException, WTException
Workable
object to the vault for the first
time. The given String
folder path specifies the path of the
folder where the object is to be checked in to. The given String
note is associated as a description for the initial check-in operation.
workable
- the Workable
object to be checked infolder_path
- the String
folder path of the folder
in which to place the checked in objectnote
- the String
note associated with this checkin.
Workable
object updated as a result of being
checked in
WTPropertyVetoException
- if an error occurs attempting to check
in the given object
WorkInProgressException
- if an error occurs attempting to check
in the given object
WTException
- if an error occurs attempting to check
in the given object
VersionControlException
public static Folder getCheckoutFolder() throws WTException
Folder
for the current user
WTException
- if an error occurs retrieving the check-out folderFolder
public static Folder getCheckoutFolder(Workable workable) throws CheckInOutException, WTException
workable
- the original copy for which the folder containing the
working copy is returned. If the given object is
the working copy, its containing folder is returned
Folder
in which the working copy of the given
object is contained
CheckInOutException
WTException
public static boolean isInVault(Workable workable) throws WTException
Workable
already exists
in the vault. If the given Workable already exists in a shared cabinet
and is under revision control, true
is returned. Otherwise,
if the given Workable is not in a shared cabinet and is not under
revision control by the Windchill system, false
is returned.
workable
- the Workable
whose existence in the
vault is test
true
if the given Workable exists in
the vault (a shared cabinet)
WTException
Cabinet
,
Workable
public static Workable refresh(Workable workable) throws ObjectNoLongerExistsException, WTException
workable
- the Workable to be refreshed
ObjectNoLongerExistsException
WTException
public static boolean hasChanged(Workable workable) throws WTException
workable
- the Workable to be tested for modification
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |