wt.clients.replication.unit
Class UnitItem

java.lang.Object
  extended bywt.clients.beans.explorer.WTBusinessObject
      extended bywt.clients.replication.unit.UnitItem
All Implemented Interfaces:
Explorable, Identifiable, ReferenceHolder, Serializable

public class UnitItem
extends WTBusinessObject

UnitItem is a model class for manipulating WTUnit objects. It contains helper methods for manipulating attributes and relationships of the WTunit class. It extends wt.clients.beans.WTBusinessObject to allow easy manipulation in the wt.clients.beans.WTExplorer.

Supported API: true

Extendable: true

See Also:
WTUnit, Serialized Form

Field Summary
private  ConfigSpecItem configSpecItem
          The ConfigSpecItem used for navigation with this unit.
private  Folder folder
          The folder.
private  boolean isNew
          If the unit is new.
private  String iteration
           
private  String iterationIdentifier
           
private  String lifecycle
           
private  String location
          The location.
private  boolean modified
          If the unit has been modified.
private  String name
          The unit name
private  String number
          The unit number
private static ResourceBundle resource
           
private static String RESOURCE
           
private  String revision
          The revision.
private  String state
          The state.
private  String teamTemplate
           
private  UsedByList usedBy
          A list of the parts this part uses.
private  UnitUsesInterfaceList usesInterface
          A list of the PART masters this unit uses.
private  String version
           
 
Fields inherited from class wt.clients.beans.explorer.WTBusinessObject
 
Constructor Summary
UnitItem()
          Constructs a new UnitItem.
UnitItem(WTUnit unit)
          Constructs a new UnitItem.
 
Method Summary
 void create()
          Create a new contained part for this unititem.
 void delete()
          Delete the contained unit of this unititem.
 void dispatchRefresh()
          Dispatch a RefeshEvent for modifications to the contained WTUnit
 ConfigSpecItem getConfigSpecItem()
          Return the contained ConfigSpecItem
 String getCreatedByPersonName()
          Returns the Created by person name.
 String getCreationDate()
          Returns the creation date.
 String getDisplayIdentity(Locale locale)
          Returns the identity of this object.
 Folder getFolder()
          Returns the current folder of this UnitItem.
 String getIdentity()
          Deprecated. replaced with getDisplayIdentity
 String getIteration()
          Returns the current Iteration.
 String getIterationIdentifier()
          Returns the current IterationIdentifier.
 String getLastUpdated()
          Returns the last updated date.
 String getLifecycleName()
          Get the lifecycle name for this object
 String getLocation()
          Returns the current location of this UnitItem.
 String getModifiedByPersonName()
          Returns the Modified by person name.
 String getName()
          Returns the current name of this UnitItem.
 String getNumber()
          Returns the current number of this UnitItem.
protected  ResourceBundle getResource()
           
 String getRevision()
          Returns the current revision of this UnitItem.
 Source getSource()
          JHB removed Returns the current source of this UnitItem.
 String getState()
          Returns the current state of this UnitItem.
 String getStatusText()
          Return a string indicating the checkout status of this object
 String getTeamTemplateName()
          Get the teamTemplate name for this object
 PartType getType()
          JHB removed Returns the current type of this UnitItem.
 String getUniqueIdentity()
          Override the default behavior defined in wt.clients.beans.WTBusinessObject.
 WTUnit getUnit()
          Return the contained WTUnit object.
 Explorable[] getUses()
          Returns an array of Explorable objects this UnitItem uses.
 UnitUsesInterfaceList getUsesInterfaceList()
          Returns the a list of the PARTS this UnitItem uses.
 String getVersion()
          Returns the current Version.
 String getViewName()
          JHB removed Returns the name of the view for this object.
protected  void init()
          Initialize the UnitItem unit without any side effect.
private  void initResources()
           
 boolean isModified()
          gets the modified flag for this unititem.
 boolean isNew()
          gets the isNew flag for this partitem.
 void setConfigSpecItem(ConfigSpecItem configSpecItem)
          Set the contained ConfigSpecItem
 void setFields()
          Copies values from the UnitItem to contained WTUnit
 void setFolder(Folder folder)
          Sets the folder of this UnitItem.
 void setIteration(String iteration)
           
 void setLocation(String location)
          Sets the location of this partitem.
 void setModified(boolean modified)
          Sets the modified flag for this unititem.
 void setName(String name)
          Sets the name of this UnitItem.
 void setNew(boolean isNew)
          Sets the isNew flag for this partitem.
 void setNumber(String number)
          Sets the number of this unititem.
 void setRevision(String revision)
          Sets the revision of this UnitItem.
 void setSource(Source source)
           
 void setState(String state)
          Sets the state of this UnitItem.
 void setStatusText(String value)
           
 void setTeamTemplateName(String teamTemplateName)
           
 void setType(PartType type)
          Sets the type of this partitem.
 void setUnit(WTUnit unit)
          Sets the contained unit.
protected  void setUnitSimply(WTUnit unit)
          Sets the contained unit without any side effect.
 void setViewName(String viewname)
           
 String toString()
          Returns a string representation of the unititem.
 void update()
          Save the contained unit of this unititem.
 
Methods inherited from class wt.clients.beans.explorer.WTBusinessObject
getAttributeValue, getAttributeValue, getContents, getObject, getOpenIcon, getStandardIcon, setIdentity, setObject, setObject, setStandardIcon, setStandardIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

resource

private static ResourceBundle resource

RESOURCE

private static String RESOURCE

configSpecItem

private ConfigSpecItem configSpecItem
The ConfigSpecItem used for navigation with this unit.


modified

private boolean modified
If the unit has been modified.


isNew

private boolean isNew
If the unit is new.


number

private String number
The unit number


name

private String name
The unit name


revision

private String revision
The revision.


version

private String version

iteration

private String iteration

iterationIdentifier

private String iterationIdentifier

state

private String state
The state.


teamTemplate

private String teamTemplate

lifecycle

private String lifecycle

location

private String location
The location.


folder

private Folder folder
The folder.


usesInterface

private UnitUsesInterfaceList usesInterface
A list of the PART masters this unit uses.


usedBy

private UsedByList usedBy
A list of the parts this part uses.

Constructor Detail

UnitItem

public UnitItem()
         throws WTException
Constructs a new UnitItem.

Throws:
WTException

UnitItem

public UnitItem(WTUnit unit)
Constructs a new UnitItem.

Parameters:
unit - the contained wt.replication.unit.WTUnit.
See Also:
WTUnit
Method Detail

setUnit

public void setUnit(WTUnit unit)
Sets the contained unit. This will initialize many of the attributes in the UnitItem class.

Parameters:
unit - the contained wt.replication.unit.WTUnit.
See Also:
WTUnit

setUnitSimply

protected void setUnitSimply(WTUnit unit)
Sets the contained unit without any side effect.

Parameters:
unit - the contained wt.replication.unit.WTUnit.
See Also:
WTUnit

init

protected void init()
             throws WTException
Initialize the UnitItem unit without any side effect.

Throws:
WTException
VersionException
See Also:
WTUnit

getUnit

public WTUnit getUnit()
Return the contained WTUnit object.

Returns:
the contained wt.part.WTPart.
See Also:
WTPart

setConfigSpecItem

public void setConfigSpecItem(ConfigSpecItem configSpecItem)
Set the contained ConfigSpecItem

Parameters:
configSpecItem - the contained ConfigSpecItem
See Also:
ConfigSpecItem

getConfigSpecItem

public ConfigSpecItem getConfigSpecItem()
Return the contained ConfigSpecItem

Returns:
the contained ConfigSpecItem
See Also:
ConfigSpecItem

setNew

public void setNew(boolean isNew)
Sets the isNew flag for this partitem.

Parameters:
isNew - the new isNew value of this unititem.

isNew

public boolean isNew()
gets the isNew flag for this partitem.

Returns:
boolean the isNew value of this unititem.

setModified

public void setModified(boolean modified)
Sets the modified flag for this unititem.

Parameters:
modified - the new modified value of this unititem.

isModified

public boolean isModified()
gets the modified flag for this unititem.

Returns:
boolean the modified value of this unititem.

create

public void create()
            throws WTException
Create a new contained part for this unititem.

Throws:
WTException

setFields

public void setFields()
               throws WTException,
                      WTPropertyVetoException
Copies values from the UnitItem to contained WTUnit

Throws:
WTException
WTPropertyVetoException

update

public void update()
            throws WTException,
                   WTPropertyVetoException
Save the contained unit of this unititem.

Throws:
WTException
WTPropertyVetoException

delete

public void delete()
            throws WTException
Delete the contained unit of this unititem.

Throws:
WTException

dispatchRefresh

public void dispatchRefresh()
Dispatch a RefeshEvent for modifications to the contained WTUnit

See Also:
wt.clients.util.RefeshEvent

setNumber

public void setNumber(String number)
Sets the number of this unititem.

Parameters:
number - the new number of this unititem.

getNumber

public String getNumber()
Returns the current number of this UnitItem.

Returns:
the current number of this UnitItem.

setFolder

public void setFolder(Folder folder)
Sets the folder of this UnitItem.

Parameters:
folder - the new folder of this UnitItem.
See Also:
Folder

getFolder

public Folder getFolder()
Returns the current folder of this UnitItem.

Returns:
the current folder of this UnitItem.
See Also:
Folder

getIterationIdentifier

public String getIterationIdentifier()
Returns the current IterationIdentifier.

Returns:
the current IterationIdentifier.

getVersion

public String getVersion()
Returns the current Version.

Returns:
the current Version.

setIteration

public void setIteration(String iteration)

getIteration

public String getIteration()
Returns the current Iteration.

Returns:
the current Iteration.

setRevision

public void setRevision(String revision)
Sets the revision of this UnitItem.

Parameters:
revision - the new revision of this UnitItem.

getRevision

public String getRevision()
Returns the current revision of this UnitItem.

Returns:
the current revision of this UnitItem.

setName

public void setName(String name)
Sets the name of this UnitItem.

Parameters:
name - the new name of this UnitItem.

getName

public String getName()
Returns the current name of this UnitItem.

Returns:
the current name of this UnitItem.

setState

public void setState(String state)
Sets the state of this UnitItem.

Parameters:
state - the new state of this UnitItem.

getState

public String getState()
Returns the current state of this UnitItem.

Returns:
the current state of this UnitItem.

getType

public PartType getType()
JHB removed Returns the current type of this UnitItem.

Returns:
the current type of this UnitItem.

setType

public void setType(PartType type)
Sets the type of this partitem.

Parameters:
type - the new type of this partitem.

getSource

public Source getSource()
JHB removed Returns the current source of this UnitItem.

Returns:
the current source of this UnitItem.

setSource

public void setSource(Source source)

setLocation

public void setLocation(String location)
Sets the location of this partitem.

Parameters:
location - the new location of this partitem.

getLocation

public String getLocation()
Returns the current location of this UnitItem.

Returns:
the current location of this UnitItem.

getCreatedByPersonName

public String getCreatedByPersonName()
Returns the Created by person name.

Returns:
the Created by person name.
Throws:
WTException
VersionException

getModifiedByPersonName

public String getModifiedByPersonName()
Returns the Modified by person name.

Returns:
the Modified by person name.
Throws:
WTException
VersionException

getCreationDate

public String getCreationDate()
Returns the creation date.

Returns:
the creation date.

getLastUpdated

public String getLastUpdated()
Returns the last updated date.

Returns:
the last updated date.

getUsesInterfaceList

public UnitUsesInterfaceList getUsesInterfaceList()
                                           throws WTException
Returns the a list of the PARTS this UnitItem uses.

Returns:
a list of the Parts this UnitItem uses.
Throws:
WTException

getUses

public Explorable[] getUses()
                     throws WTException
Returns an array of Explorable objects this UnitItem uses.

Specified by:
getUses in interface Explorable
Overrides:
getUses in class WTBusinessObject
Returns:
an array of Explorable objects this UnitItem uses.
Throws:
WTException
See Also:
Explorable

toString

public String toString()
Returns a string representation of the unititem.

Returns:
a string representation of the unititem.

getDisplayIdentity

public String getDisplayIdentity(Locale locale)
Returns the identity of this object. Replaces the deprecated getIdentity.

Returns:
the identity of this object.

getIdentity

public String getIdentity()
Deprecated. replaced with getDisplayIdentity

Returns the identity of this object.

Specified by:
getIdentity in interface Identifiable
Overrides:
getIdentity in class WTBusinessObject
Returns:
athe identity of this object.
See Also:
String

getViewName

public String getViewName()
JHB removed Returns the name of the view for this object.

Returns:
the name of the view for this object.

setViewName

public void setViewName(String viewname)

getTeamTemplateName

public String getTeamTemplateName()
Get the teamTemplate name for this object

Returns:
the teamTemplate name for this object

setTeamTemplateName

public void setTeamTemplateName(String teamTemplateName)

getLifecycleName

public String getLifecycleName()
Get the lifecycle name for this object

Returns:
the lifecycle name for this object

setStatusText

public void setStatusText(String value)

getStatusText

public String getStatusText()
Return a string indicating the checkout status of this object

Returns:
a string indicating the checkout status of this object

initResources

private void initResources()

getResource

protected ResourceBundle getResource()

getUniqueIdentity

public String getUniqueIdentity()
Override the default behavior defined in wt.clients.beans.WTBusinessObject. Use the branch identifier instead of the oid to uniquely identify the contained WTPart object.

Specified by:
getUniqueIdentity in interface Identifiable
Overrides:
getUniqueIdentity in class WTBusinessObject
Returns:
the unique identity of the object.