com.ptc.netmarkets.model
Class NmObjectHelper

java.lang.Object
  extended bycom.ptc.netmarkets.model.NmObjectHelper
All Implemented Interfaces:
Externalizable, Serializable

public class NmObjectHelper
extends Object
implements Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Nested Class Summary
static class NmObjectHelper.RequestAttConstants
           
 
Field Summary
static String CB_COPY
           
static String CB_LINK
           
static String CB_SHARE
           
static String CGI_DATA
           
static String CHECKEDIN_BY
           
static String CHECKEDOUT_BY
           
static String CHECKOUT_DATE
           
static String CHOICE
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
static String HTTPSTATE_OBJECT
           
static String IS_SANDBOX_CHECKEDOUT
           
static String IS_SANDBOX_OBJECT
           
static String IS_VIEW_FROM_SHARE
           
static String LOCATION
           
static String MISC_RESOURCE
           
static String MODEL_DEFAULT
           
static String OBJECT_NAME
           
protected static long OLD_FORMAT_VERSION_UID
           
static String PJLJ_IGNORE_CACHE
           
static String PRODUCT_STRUCTURE
           
static String PROJMGMT_RESOURCE
           
static String QUERY_0
           
static String QUERY_1
           
static String QUERY_2
           
static String QUERY_3
           
private static String RESOURCE
           
static String SCOPE_GLOBAL
           
static String SCOPE_PROJECT
           
static int SELECT_TYPE_MULTI
           
static int SELECT_TYPE_NONE
           
static int SELECT_TYPE_SINGLE
           
(package private) static long serialVersionUID
           
static NmObjectService service
          

Supported API: false
static String SHARED_BY
           
static String SHARED_ON
           
static String SKIP_IF_NOT
           
static String SOURCE_CONTAINER
           
static String SOURCE_LOCATION
           
static String SOURCE_PROPS_URL
           
static String SOURCE_SHARE_CONTAINER
           
static String SOURCE_SHARE_LOCATION
           
static String TARGET_SHARE_LOCATION
           
static String TYPE_ALL
           
static String TYPE_DELIVERABLE
           
static String TYPE_DOCUMENT
           
static String TYPE_MEETING
           
static String TYPE_MILESTONE
           
static String TYPE_PART
           
static String TYPE_PROJ_ACTIVITY
           
static String TYPE_PROJECT
           
 
Constructor Summary
NmObjectHelper()
           
 
Method Summary
static void addDiscussTable(NmCommandBean cb, HashMap map)
           
static HashMap addSandboxInfo(HashMap info, RevisionControlled object)
          Returns the Map passed in, altered to contain the following keys...
static HashMap addShareInfo(HashMap info, Persistable object, SharedContainerMap scm)
           
static boolean canSeeAllDetails(NmCommandBean cb)
           
static boolean canSeeAllDetails(NmCommandBean cb, NmOid oid)
           
static EnumeratedType[] filterEnumeratedType(EnumeratedType[] values)
          Return a set of EnumeratedType's with the values whose selectable flag is true.
static Integer getIntFromString(String view, int defaultInt)
           
static String getName(Object obj, Locale locale)
           
static boolean getProjectLinkPref(String key, boolean defaultValue)
           
static boolean getProjectLinkPref(String key, WTContainerRef containerRef, boolean defaultValue)
           
static Integer getSelectedForumView(NmOid contextOid, NmSessionBean sessionBean, Object req)
           
static Timestamp getTimestamp(String date_str)
          Parse the specified date string and return a Timestamp representing the date specified by the string.
static String getVersionDisplay(Iterated iteration)
          Returns the string representing the version identifier to be displayed in the UI.
static boolean hasModifyOnOid(NmOid oid)
           
static boolean hasSoftAttributes(String type)
           
static boolean isPasteCopy(NmCommandBean cb)
           
static boolean isPasteLink(NmCommandBean cb)
           
static boolean isPasteShare(NmCommandBean cb)
           
static boolean isReadOnlyUser(WTContainer container)
          Determines whether the user who is trying to access a given container is a "read only" user, such as a member of the Guest group or a person for whom a Read rule has been written at the Org Default domain.
private static String prettyUpLocation(String location)
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(NmObjectHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

service

public static final NmObjectService service


Supported API: false


serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

MISC_RESOURCE

public static final String MISC_RESOURCE
See Also:
Constant Field Values

PROJMGMT_RESOURCE

public static final String PROJMGMT_RESOURCE
See Also:
Constant Field Values

PJLJ_IGNORE_CACHE

public static final String PJLJ_IGNORE_CACHE
See Also:
Constant Field Values

TYPE_ALL

public static final String TYPE_ALL
See Also:
Constant Field Values

TYPE_PROJECT

public static final String TYPE_PROJECT
See Also:
Constant Field Values

TYPE_DOCUMENT

public static final String TYPE_DOCUMENT
See Also:
Constant Field Values

TYPE_PART

public static final String TYPE_PART
See Also:
Constant Field Values

TYPE_MILESTONE

public static final String TYPE_MILESTONE
See Also:
Constant Field Values

TYPE_DELIVERABLE

public static final String TYPE_DELIVERABLE
See Also:
Constant Field Values

TYPE_MEETING

public static final String TYPE_MEETING
See Also:
Constant Field Values

TYPE_PROJ_ACTIVITY

public static final String TYPE_PROJ_ACTIVITY
See Also:
Constant Field Values

SCOPE_PROJECT

public static final String SCOPE_PROJECT
See Also:
Constant Field Values

SCOPE_GLOBAL

public static final String SCOPE_GLOBAL
See Also:
Constant Field Values

MODEL_DEFAULT

public static final String MODEL_DEFAULT
See Also:
Constant Field Values

SELECT_TYPE_NONE

public static final int SELECT_TYPE_NONE
See Also:
Constant Field Values

SELECT_TYPE_SINGLE

public static final int SELECT_TYPE_SINGLE
See Also:
Constant Field Values

SELECT_TYPE_MULTI

public static final int SELECT_TYPE_MULTI
See Also:
Constant Field Values

QUERY_0

public static final String QUERY_0
See Also:
Constant Field Values

QUERY_1

public static final String QUERY_1
See Also:
Constant Field Values

QUERY_2

public static final String QUERY_2
See Also:
Constant Field Values

QUERY_3

public static final String QUERY_3
See Also:
Constant Field Values

CB_COPY

public static final String CB_COPY
See Also:
Constant Field Values

CB_LINK

public static final String CB_LINK
See Also:
Constant Field Values

CB_SHARE

public static final String CB_SHARE
See Also:
Constant Field Values

CHOICE

public static final String CHOICE
See Also:
Constant Field Values

PRODUCT_STRUCTURE

public static final String PRODUCT_STRUCTURE
See Also:
Constant Field Values

IS_SANDBOX_OBJECT

public static final String IS_SANDBOX_OBJECT
See Also:
Constant Field Values

IS_SANDBOX_CHECKEDOUT

public static final String IS_SANDBOX_CHECKEDOUT
See Also:
Constant Field Values

SOURCE_LOCATION

public static final String SOURCE_LOCATION
See Also:
Constant Field Values

SOURCE_PROPS_URL

public static final String SOURCE_PROPS_URL
See Also:
Constant Field Values

SOURCE_CONTAINER

public static final String SOURCE_CONTAINER
See Also:
Constant Field Values

SOURCE_SHARE_CONTAINER

public static final String SOURCE_SHARE_CONTAINER
See Also:
Constant Field Values

SOURCE_SHARE_LOCATION

public static final String SOURCE_SHARE_LOCATION
See Also:
Constant Field Values

TARGET_SHARE_LOCATION

public static final String TARGET_SHARE_LOCATION
See Also:
Constant Field Values

SHARED_BY

public static final String SHARED_BY
See Also:
Constant Field Values

SHARED_ON

public static final String SHARED_ON
See Also:
Constant Field Values

CHECKEDOUT_BY

public static final String CHECKEDOUT_BY
See Also:
Constant Field Values

CHECKEDIN_BY

public static final String CHECKEDIN_BY
See Also:
Constant Field Values

CHECKOUT_DATE

public static final String CHECKOUT_DATE
See Also:
Constant Field Values

OBJECT_NAME

public static final String OBJECT_NAME
See Also:
Constant Field Values

LOCATION

public static final String LOCATION
See Also:
Constant Field Values

IS_VIEW_FROM_SHARE

public static final String IS_VIEW_FROM_SHARE
See Also:
Constant Field Values

CGI_DATA

public static final String CGI_DATA
See Also:
Constant Field Values

HTTPSTATE_OBJECT

public static final String HTTPSTATE_OBJECT
See Also:
Constant Field Values

SKIP_IF_NOT

public static final String SKIP_IF_NOT
See Also:
Constant Field Values
Constructor Detail

NmObjectHelper

public NmObjectHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(NmObjectHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

isReadOnlyUser

public static boolean isReadOnlyUser(WTContainer container)
Determines whether the user who is trying to access a given container is a "read only" user, such as a member of the Guest group or a person for whom a Read rule has been written at the Org Default domain.

Parameters:
container -
Returns:
boolean

hasSoftAttributes

public static boolean hasSoftAttributes(String type)
                                 throws WTException
Throws:
WTException

isPasteCopy

public static boolean isPasteCopy(NmCommandBean cb)

isPasteShare

public static boolean isPasteShare(NmCommandBean cb)

isPasteLink

public static boolean isPasteLink(NmCommandBean cb)

getIntFromString

public static Integer getIntFromString(String view,
                                       int defaultInt)

getVersionDisplay

public static String getVersionDisplay(Iterated iteration)
                                throws WTException
Returns the string representing the version identifier to be displayed in the UI. The string is of the form A.1, A-1.1, or 1 depending on whether the object is Versioned, OneOffVersioned, or Iterated.

Parameters:
iteration -
Returns:
String
Throws:
WTException

addSandboxInfo

public static HashMap addSandboxInfo(HashMap info,
                                     RevisionControlled object)
                              throws WTException
Returns the Map passed in, altered to contain the following keys...


The information held in these keys is used to display sandbox related information on the details pages of RevisionControlled objects that have been checked out to a project.

Parameters:
info - the Map to be altered to contain sandbox information
object - the object that is to supply the sandbox information
Returns:
Map
Throws:
WTException

addShareInfo

public static HashMap addShareInfo(HashMap info,
                                   Persistable object,
                                   SharedContainerMap scm)
                            throws WTException
Throws:
WTException

getName

public static String getName(Object obj,
                             Locale locale)

canSeeAllDetails

public static boolean canSeeAllDetails(NmCommandBean cb)
                                throws WTException
Throws:
WTException

canSeeAllDetails

public static boolean canSeeAllDetails(NmCommandBean cb,
                                       NmOid oid)
                                throws WTException
Throws:
WTException

hasModifyOnOid

public static boolean hasModifyOnOid(NmOid oid)
                              throws WTException
Throws:
WTException

getSelectedForumView

public static Integer getSelectedForumView(NmOid contextOid,
                                           NmSessionBean sessionBean,
                                           Object req)
                                    throws Exception
Throws:
Exception

addDiscussTable

public static void addDiscussTable(NmCommandBean cb,
                                   HashMap map)
                            throws WTException
Throws:
WTException

prettyUpLocation

private static String prettyUpLocation(String location)
                                throws WTException
Throws:
WTException

filterEnumeratedType

public static EnumeratedType[] filterEnumeratedType(EnumeratedType[] values)
                                             throws WTException
Return a set of EnumeratedType's with the values whose selectable flag is true.

Parameters:
values - - the array of EnumeratedType objects to be filtered.
Returns:
a filtered array of EnumeratedType objects.
Throws:
WTException

getTimestamp

public static Timestamp getTimestamp(String date_str)
                              throws WTException
Parse the specified date string and return a Timestamp representing the date specified by the string. The string is expected to be in the format specified by projmgmtResource.PARSE_DATE. That format only specifies month, day and year. The returned timestamp is midnight on the day specified in the time zone of the current user. Therefore if the date string specifies May 15, 2002 and the current user's time zone is Central Daylight Time then the timestamp that is returned will represent May 15, 2002 12:00 AM CDT.

Parameters:
date_str - the string to parse
Returns:
the parsed timestamp or null
Throws:
WTException

getProjectLinkPref

public static boolean getProjectLinkPref(String key,
                                         boolean defaultValue)
                                  throws WTException
Throws:
WTException

getProjectLinkPref

public static boolean getProjectLinkPref(String key,
                                         WTContainerRef containerRef,
                                         boolean defaultValue)
                                  throws WTException
Throws:
WTException