|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.enterprise.nativeapp.server.WindchillAttributeUtility
Utility class for static methods to help the application interface to
get the Windchill attribute values from the objects and present them
back to the client in a displayable way. Also helps to convert attribute
data from one input/output format to another. Provides some utilities
for handling of the soft type attributes.
Supported API: false
Extendable: false
Field Summary | |
(package private) AttributeHelper |
attributeHelper
|
private static String |
CLASSNAME
|
private static String |
DEFAULT_LIFECYCLE
|
private static IdentifierFactory |
IDENTIFIER_FACTORY
|
private static String |
RESOURCE
|
private static boolean |
VERBOSE
|
Constructor Summary | |
WindchillAttributeUtility(WTObject object)
Constructor that sets the class of the object for all of the rest of the attributes. |
Method Summary | |
static Object |
convertStringToValue(String stringValue,
String dataType,
ClientConfiguration clientInfo,
Locale locale)
Convert a string input value to the correct value for the data type. |
static String |
convertValueToString(Object value,
ClientConfiguration clientInfo,
Locale locale)
Convert an object into the string value for return to the client. |
private static WindchillAttributeInformation |
getAttributeInfo(NetFactor object,
WindchillAttributeInformation attribInfo,
String name,
ClientConfiguration clientInfo,
AttributeHelper attributeHelper,
Locale locale)
|
String |
getAttributeValue(WTObject object,
String attributeName,
ClientConfiguration clientInfo,
Locale locale)
Return the localized and displayable value for the attribute. |
private static String |
getDateString(ClientConfiguration clientInfo,
Timestamp time)
|
private static EnumeratedType[] |
getEnumeratedTypeList(PropertyDescriptor pd,
Locale locale)
|
private static AttributeContainerSpec |
getFilter(TypeIdentifier type)
|
private static HashMap |
getHashMap(TypeInstance ti,
HashMap hashMap,
Locale locale)
|
private static WindchillAttributeInformation |
getLocalizedName(NetFactor object,
String name,
WindchillAttributeInformation attrib,
Locale locale)
|
private static String |
getOid(WTObject object)
|
private static ContentItem |
getPrimaryContentItem(FormatContentHolder holder)
|
private static String |
getRepository(Persistable object,
Locale locale)
|
static WindchillAttributeInformation |
getShortWindchillAttributeInformation(Persistable object,
String name,
int order,
AttributeHelper attributeHelper,
ClientConfiguration clientInfo,
Locale locale)
Populate the WindchillAttributeInformation instance with the information for this attribute. |
static HashMap |
getSoftAttributes(TypeInstanceIdentifier tii,
HashMap hashMap,
Locale locale)
Retrieve the soft attributes for the object. |
static HashMap |
getSoftAttributes(WTObject object,
HashMap hashMap,
Locale locale)
Retrieve the soft attributes for the object. |
private static TypeInstance |
getTypeInstance(TypeInstanceIdentifier tii,
Locale locale)
|
static HashMap |
getViewSoftAttributes(TypeInstanceIdentifier tii,
HashMap hashMap,
Locale locale)
Retrieve the soft attributes for the object. |
static HashMap |
getViewSoftAttributes(WTObject object,
HashMap hashMap,
Locale locale)
Retrieve the soft attributes for the object. |
static WindchillAttributeInformation |
getWindchillAttributeInformation(Persistable object,
String name,
int order,
boolean editable,
AttributeHelper attributeHelper,
Locale locale)
Populate the WindchillAttributeInformation instance with the information for this attribute. |
private static Method |
obtainFromCovertProperty(PropertyDescriptor pd)
|
static HashMap |
propertiesToHashMap(Properties formData,
HashMap hashMap,
TimeZone timeZone,
Locale locale)
Converts the soft attribute form data from an HTML template to a HashMap which can be used in the other methods. |
private static float |
roundToTwoDecimals(float number)
|
static WindchillAttributeInformation |
setOrgInAttribInfo(WindchillAttributeInformation attrib,
WTOrganization org,
Locale locale)
This method is very specific to generating the most recently visited list of Organizations into a WindchillAttributeInformation. |
private static String |
trimValue(String longString)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
AttributeHelper attributeHelper
private static boolean VERBOSE
private static String DEFAULT_LIFECYCLE
private static final IdentifierFactory IDENTIFIER_FACTORY
Constructor Detail |
public WindchillAttributeUtility(WTObject object) throws WTException
object
-
WTException
Method Detail |
public String getAttributeValue(WTObject object, String attributeName, ClientConfiguration clientInfo, Locale locale) throws WTException
object
- The persistent object that hold the values or references to the values.attributeName
- Name of the attribute that can be used to retrieve the information from the object.clientInfo
- Information from the client application.locale
- Locale of the client machine so attribute values that require localization can be converted.
WTException
public static HashMap propertiesToHashMap(Properties formData, HashMap hashMap, TimeZone timeZone, Locale locale) throws WTException
formData
- Data that is input from the template processing.hashMap
- Either a started hash map for the data or null if one is to be created inside of this method.timeZone
- TimeZone of the client.locale
- The locale of the client, used to return some of the strings in the locale of the client.
WTException
public static Object convertStringToValue(String stringValue, String dataType, ClientConfiguration clientInfo, Locale locale) throws WTException
stringValue
- Value to convert.dataType
- Type to convert it to.clientInfo
- Information from the client application.locale
- The locale of the client, used to return some of the strings in the locale of the client.
WTException
public static String convertValueToString(Object value, ClientConfiguration clientInfo, Locale locale) throws WTException
value
- Value to convert.clientInfo
- Information from the client application.locale
- The locale of the client, used to return some of the strings in the locale of the client.
WTException
public static HashMap getSoftAttributes(TypeInstanceIdentifier tii, HashMap hashMap, Locale locale) throws WTException
tii
- Identifies the object that the soft attributes are going to be retrieved for.hashMap
- HashMap that is returned can be prepopulated with some information or null. This method will just add entries to it.locale
- Locale of the client for localization processing of information returned to the client.
WTException
public static HashMap getSoftAttributes(WTObject object, HashMap hashMap, Locale locale) throws WTException
object
- Identifies the object that the soft attributes are going to be retrieved for.hashMap
- HashMap that is returned can be prepopulated with some information or null. This method will just add entries to it.locale
- Locale of the client for localization processing of information returned to the client.
WTException
public static WindchillAttributeInformation getWindchillAttributeInformation(Persistable object, String name, int order, boolean editable, AttributeHelper attributeHelper, Locale locale) throws WTException
object
- The object to get the value from.name
- Name of the attribute.order
- The order the attribute should be used in.editable
- If this attribute is considered editable in this usage of it.attributeHelper
- Instance of AttributeHelper.locale
- Locale of the client.
WTException
public static WindchillAttributeInformation getShortWindchillAttributeInformation(Persistable object, String name, int order, AttributeHelper attributeHelper, ClientConfiguration clientInfo, Locale locale) throws WTException
object
- The object to get the value from.name
- Name of the attribute.order
- The order the attribute should be used in.attributeHelper
- Instance of AttributeHelper.clientInfo
- Information from the client application.locale
- Locale of the client.
WTException
public static HashMap getViewSoftAttributes(TypeInstanceIdentifier tii, HashMap hashMap, Locale locale) throws WTException
tii
- hashMap
- locale
-
WTException
public static HashMap getViewSoftAttributes(WTObject object, HashMap hashMap, Locale locale) throws WTException
object
- hashMap
- locale
-
WTException
private static HashMap getHashMap(TypeInstance ti, HashMap hashMap, Locale locale) throws WTException
ti
- hashMap
- locale
-
WTException
public static WindchillAttributeInformation setOrgInAttribInfo(WindchillAttributeInformation attrib, WTOrganization org, Locale locale) throws WTException, WTPropertyVetoException
attrib
- The attribute object to set all of the display and values on and return.org
- The org to use as th default.locale
-
WTException
WTPropertyVetoException
private static String getOid(WTObject object) throws WTException
WTException
private static ContentItem getPrimaryContentItem(FormatContentHolder holder) throws WTException
WTException
private static float roundToTwoDecimals(float number)
private static String getRepository(Persistable object, Locale locale)
private static EnumeratedType[] getEnumeratedTypeList(PropertyDescriptor pd, Locale locale) throws IllegalAccessException, InvocationTargetException
IllegalAccessException
InvocationTargetException
private static Method obtainFromCovertProperty(PropertyDescriptor pd)
private static String getDateString(ClientConfiguration clientInfo, Timestamp time)
private static WindchillAttributeInformation getLocalizedName(NetFactor object, String name, WindchillAttributeInformation attrib, Locale locale) throws WTIntrospectionException, WTPropertyVetoException
WTIntrospectionException
WTPropertyVetoException
private static TypeInstance getTypeInstance(TypeInstanceIdentifier tii, Locale locale) throws WTException
WTException
private static AttributeContainerSpec getFilter(TypeIdentifier type) throws IllegalFormatException
IllegalFormatException
private static WindchillAttributeInformation getAttributeInfo(NetFactor object, WindchillAttributeInformation attribInfo, String name, ClientConfiguration clientInfo, AttributeHelper attributeHelper, Locale locale) throws WTPropertyVetoException, WTIntrospectionException, IllegalAccessException, InvocationTargetException, WTException
WTPropertyVetoException
WTIntrospectionException
IllegalAccessException
InvocationTargetException
WTException
private static String trimValue(String longString)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |