wt.clients.prodmgmt
Class InstanceHelper

java.lang.Object
  extended bywt.clients.prodmgmt.InstanceHelper

public class InstanceHelper
extends Object

PartHelper is a facade class that contains static methods for manipulating Parts. It encapsulates some of the persistence and navigation operations for Parts.

Supported API: false

Extendable: false

See Also:
wt.part.WTProductInstance2

Field Summary
private static ResourceBundle resource
           
private static String RESOURCE
           
 
Constructor Summary
InstanceHelper()
           
 
Method Summary
static WTProductInstance2 deleteInstance(WTProductInstance2 instance)
          Deletes a instance.
static WTPartConfigSpec getConfigSpec()
          Gets the current ConfigSpec for the current user.
static WTProductInstance2 getInstanceForOID(String theInstanceID)
          Get the instance with the specified object id
static String getLifeCycle(WTProductInstance2 instance)
          Get the name of the lifecycle the part is assigned to
static String getLifeCycleState(WTProductInstance2 instance)
          Get the lifecycle state of the specified part
static int getMaxLength(Class a_class, String attribute_constant)
          Get the maximum length for the specified attribute in the specified class.
protected  ResourceBundle getResource()
           
static String getTeamTemplate(WTProductInstance2 instance)
          Get the name of the teamTemplate the part is assigned to
protected  void initResources()
           
static Object refresh(Persistable obj)
          Refresh the specified object.
static WTProductInstance2 refresh(WTProductInstance2 instance)
          Refresh the specified instance.
static WTProductInstance2 revisePart(WTProductInstance2 instance)
          Revises a Part.
static WTProductInstance2 saveInstance(WTProductInstance2 instance)
          Saves a Instance.
static WTPartConfigSpec setConfigSpec(WTPartConfigSpec spec)
          Sets the ConfigSpec for the current principal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resource

private static ResourceBundle resource

RESOURCE

private static String RESOURCE
Constructor Detail

InstanceHelper

public InstanceHelper()
Method Detail

initResources

protected void initResources()

getResource

protected ResourceBundle getResource()

getInstanceForOID

public static WTProductInstance2 getInstanceForOID(String theInstanceID)
Get the instance with the specified object id

Returns:
the instance with the specified object id

refresh

public static Object refresh(Persistable obj)
                      throws WTException
Refresh the specified object.

Parameters:
obj - the object to refresh
Returns:
the refreshed object
Throws:
WTException

refresh

public static WTProductInstance2 refresh(WTProductInstance2 instance)
                                  throws WTException
Refresh the specified instance.

Parameters:
instance - the instance to refresh
Returns:
the refreshed instance
Throws:
WTException

getConfigSpec

public static WTPartConfigSpec getConfigSpec()
                                      throws WTException
Gets the current ConfigSpec for the current user.

Returns:
the current wt.vc.config.ConfigSpec for the user
Throws:
WTException
See Also:
ConfigSpec

setConfigSpec

public static WTPartConfigSpec setConfigSpec(WTPartConfigSpec spec)
                                      throws WTException
Sets the ConfigSpec for the current principal.

Parameters:
spec - the wt.vc.config.ConfigSpec.
Throws:
WTException
See Also:
ConfigSpec

saveInstance

public static WTProductInstance2 saveInstance(WTProductInstance2 instance)
                                       throws WTException
Saves a Instance.

Parameters:
instance - the part to save
Returns:
the saved instance
Throws:
WTException
See Also:
Part

deleteInstance

public static WTProductInstance2 deleteInstance(WTProductInstance2 instance)
                                         throws WTException
Deletes a instance.

Parameters:
instance - the instance to delete
Returns:
the deleted instance
Throws:
WTException
See Also:
WTProductInstance2

revisePart

public static WTProductInstance2 revisePart(WTProductInstance2 instance)
                                     throws WTException,
                                            WTPropertyVetoException
Revises a Part.

Parameters:
instance - the instance to revise
Returns:
the revised instance
Throws:
WTException
WTPropertyVetoException
See Also:
WTProductInstance2

getLifeCycle

public static String getLifeCycle(WTProductInstance2 instance)
                           throws WTException
Get the name of the lifecycle the part is assigned to

Returns:
the lifecycle name for the specified part
Throws:
WTException

getTeamTemplate

public static String getTeamTemplate(WTProductInstance2 instance)
                              throws WTException
Get the name of the teamTemplate the part is assigned to

Returns:
the teamTemplate name for the specified part
Throws:
WTException

getLifeCycleState

public static String getLifeCycleState(WTProductInstance2 instance)
                                throws WTException
Get the lifecycle state of the specified part

Returns:
the lifecycle state name for the part
Throws:
WTException

getMaxLength

public static int getMaxLength(Class a_class,
                               String attribute_constant)
                        throws WTIntrospectionException
Get the maximum length for the specified attribute in the specified class.

Parameters:
a_class - the class
attribute_constant - the string constant for the attribute
Returns:
the maximum length of the attribute
Throws:
WTIntrospectionException