com.ptc.windchill.uwgm.common.pdm
Class WipHelper
java.lang.Object
com.ptc.windchill.uwgm.common.pdm.WipHelper
- public class WipHelper
- extends Object
Basically, a wrapper around WorkInProgressHelper.service.getCheckedOutToWorkingMap(),
but digs up some additional useful information, such as the name of the
user who checked out the document, and the location where it was checked out to
by current user.
Initialized by a collection of seed documents passed to the constructor.
If a document passed to a query method not found among the seeds,
empty value (null or false) is returned.
All information is retrieved from DB upon first call of any query method.
In case of an exception upon a retrieval, first called method throws it,
but all subsequent calls of any methods will just return empty values.
Nested Class Summary |
private static class |
WipHelper.Info
Auxiliary data structure to keep collected information |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static Log log
EMPTY_INFO
private static final WipHelper.Info EMPTY_INFO
workables
private final WTCollection workables
user
private final WTPrincipal user
infoMap
private WTKeyedMap infoMap
myWrkCopies
private WTCollection myWrkCopies
WipHelper
public WipHelper(WTPrincipal user,
WTCollection workables)
- Construct helper for a given set of PDM documents.
- Parameters:
user
- WTPrincipal - current userworkables
- Collection of EPMDocument or WTPart objects
- Throws:
IllegalArgumentException
- if any of the parameters is null
ClassCastException
- if a member of the Collection is not Workable
getInfo
private WipHelper.Info getInfo(Workable doc)
throws WTException
- Throws:
WTException
getCheckedOutBy
public String getCheckedOutBy(Workable doc)
throws WTException
- Throws:
WTException
isCheckedOutByYou
public boolean isCheckedOutByYou(Workable doc)
throws WTException
- Throws:
WTException
getCheckedOutTo
public String getCheckedOutTo(Workable doc)
throws WTException
- Throws:
WTException
getOriginalCopy
public Workable getOriginalCopy(Workable doc)
throws WTException
- Throws:
WTException
populateWipInfo
private void populateWipInfo()
throws WTException
- Throws:
WTException
retrieveCheckedOutToWorkingMap
private WTValuedMap retrieveCheckedOutToWorkingMap()
throws WTException
- Throws:
WTException
getLocation
private String getLocation(WTKeyedMap folderMap,
Workable doc)