com.ptc.windchill.uwgm.common.pdm
Class WipHelper

java.lang.Object
  extended bycom.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
 
Field Summary
private static WipHelper.Info EMPTY_INFO
           
private  WTKeyedMap infoMap
           
private static Log log
           
private  WTCollection myWrkCopies
           
private  WTPrincipal user
           
private  WTCollection workables
           
 
Constructor Summary
WipHelper(WTPrincipal user, WTCollection workables)
          Construct helper for a given set of PDM documents.
 
Method Summary
 String getCheckedOutBy(Workable doc)
           
 String getCheckedOutTo(Workable doc)
           
private  WipHelper.Info getInfo(Workable doc)
           
private  String getLocation(WTKeyedMap folderMap, Workable doc)
           
 Workable getOriginalCopy(Workable doc)
           
 boolean isCheckedOutByYou(Workable doc)
           
private  void populateWipInfo()
           
private  WTValuedMap retrieveCheckedOutToWorkingMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

WipHelper

public WipHelper(WTPrincipal user,
                 WTCollection workables)
Construct helper for a given set of PDM documents.

Parameters:
user - WTPrincipal - current user
workables - 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
Method Detail

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)