com.ptc.netmarkets.msproject
Class NmMsProjectHelper

java.lang.Object
  extended bycom.ptc.netmarkets.msproject.NmMsProjectHelper
All Implemented Interfaces:
Externalizable, Serializable

public class NmMsProjectHelper
extends Object
implements Externalizable

This helper class provides access to the NmMsProjectService implementation. It also provides some useful utilities for working with the Microsoft Project Integration features of ProjectLink.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
static String CLASS
           
private static String CLASSNAME
           
static String DEFAULT_XML_FILE_EXT
           
static String DEFAULT_XML_MIME_TYPE
           
static String ENCODING
           
static long EXTERNALIZATION_VERSION_UID
           
static String ID
           
static String IMPORT_ACTION
           
static String IMPORT_DEPENDENCIES
           
static String IMPORT_MODE
           
static String IMPORT_RESOURCES
           
static String IMPORT_TASKS
           
static String MPP_FILE_EXT
           
static String NATIVE_FILE
           
static String NATIVE_FILE_TEMP
           
static String NATIVE_PATH
           
static String OID
           
protected static long OLD_FORMAT_VERSION_UID
           
static String PROVIDE_FEEDBACK
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
static NmMsProjectService service
          

Supported API: false
static String START_DATE_TO_USE
           
static String TASK_IMPORT_SCOPE
           
static String TEMP_PATH
           
static File TMP_DIR
           
static String TMP_FILE_PREFIX
           
static String USE_PTC_START_DATE
           
static String USE_XML_START_DATE
           
static boolean VERBOSE
           
static String XML_FILE
           
static String XML_FILE_EXT
           
static String XML_MIME_TYPE
           
static String XML_PATH
           
 
Constructor Summary
NmMsProjectHelper()
           
 
Method Summary
private static ExecutionObject checkForExecutionObject(Object obj)
           
static File createTempFile()
          Create a temporary file in the Windchill temporary directory.
static WfContainer getContainer(NmCommandBean cb, Hashtable params)
          Return the WfContainer that is referenced byby data in the params or by the OID data in the specified NmCommandBean.
static File getContent(javax.servlet.http.HttpServletRequest request)
          Copy the content of the request to a temporary file.
static ExecutionObject getExecutionObject(NmCommandBean cb, Hashtable params)
          Return the ExecutionObject that is referenced by data in the params or by the OID data in the specified NmCommandBean.
static void printRequestParameters(Hashtable params)
          Print out the request parameters contained in the hashtable.
 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(NmMsProjectHelper 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 NmMsProjectService 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

OID

public static final String OID
See Also:
Constant Field Values

ID

public static final String ID
See Also:
Constant Field Values

CLASS

public static final String CLASS
See Also:
Constant Field Values

XML_FILE

public static final String XML_FILE
See Also:
Constant Field Values

XML_PATH

public static final String XML_PATH
See Also:
Constant Field Values

NATIVE_FILE

public static final String NATIVE_FILE
See Also:
Constant Field Values

NATIVE_FILE_TEMP

public static final String NATIVE_FILE_TEMP
See Also:
Constant Field Values

NATIVE_PATH

public static final String NATIVE_PATH
See Also:
Constant Field Values

IMPORT_TASKS

public static final String IMPORT_TASKS
See Also:
Constant Field Values

TASK_IMPORT_SCOPE

public static final String TASK_IMPORT_SCOPE
See Also:
Constant Field Values

IMPORT_RESOURCES

public static final String IMPORT_RESOURCES
See Also:
Constant Field Values

IMPORT_DEPENDENCIES

public static final String IMPORT_DEPENDENCIES
See Also:
Constant Field Values

START_DATE_TO_USE

public static final String START_DATE_TO_USE
See Also:
Constant Field Values

USE_XML_START_DATE

public static final String USE_XML_START_DATE
See Also:
Constant Field Values

USE_PTC_START_DATE

public static final String USE_PTC_START_DATE
See Also:
Constant Field Values

IMPORT_MODE

public static final String IMPORT_MODE
See Also:
Constant Field Values

IMPORT_ACTION

public static final String IMPORT_ACTION
See Also:
Constant Field Values

PROVIDE_FEEDBACK

public static final String PROVIDE_FEEDBACK
See Also:
Constant Field Values

TEMP_PATH

public static final String TEMP_PATH
See Also:
Constant Field Values

TMP_DIR

public static final File TMP_DIR

MPP_FILE_EXT

public static final String MPP_FILE_EXT
See Also:
Constant Field Values

XML_FILE_EXT

public static final String XML_FILE_EXT

DEFAULT_XML_FILE_EXT

public static final String DEFAULT_XML_FILE_EXT
See Also:
Constant Field Values

XML_MIME_TYPE

public static final String XML_MIME_TYPE

DEFAULT_XML_MIME_TYPE

public static final String DEFAULT_XML_MIME_TYPE
See Also:
Constant Field Values

TMP_FILE_PREFIX

public static final String TMP_FILE_PREFIX
See Also:
Constant Field Values

VERBOSE

public static final boolean VERBOSE

ENCODING

public static final String ENCODING
Constructor Detail

NmMsProjectHelper

public NmMsProjectHelper()
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(NmMsProjectHelper 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

getExecutionObject

public static ExecutionObject getExecutionObject(NmCommandBean cb,
                                                 Hashtable params)
                                          throws WTException
Return the ExecutionObject that is referenced by data in the params or by the OID data in the specified NmCommandBean. When searching for the execution object these method follows the following steps:
  1. First, it retrieves the values associated with the NmMsProjectHelper.ID and NmMsProjectHelper.CLASS keys in the specified params hashtable and tries to find an execution object that corresponds to this data. If an object is found that is an instance of the specified class, has the specified persistence ID and is an instance of ExecutionObject, then that object is returned.
  2. Next, it tries to find the execution object referenced by the command bean's element OID. If it finds this object and it is an instance of ExecutionObject, then that object is returned.
  3. Last, it tries to find the execution object referenced by the command bean's primary OID. If it finds this object and it is an instance of ExecutionObject, then that object is returned.
Ifit fails to find an execution object an exception is thrown.

One special case is handled: If the object found in any of the cases above is a Project2 object, then the project's ProjectPlan is returned if it has one.

Parameters:
cb -
params - the request parameters
Returns:
ExecutionObject
Throws:
WTException

getContainer

public static WfContainer getContainer(NmCommandBean cb,
                                       Hashtable params)
                                throws WTException
Return the WfContainer that is referenced byby data in the params or by the OID data in the specified NmCommandBean.

This method first calls getExecutionObject(com.ptc.netmarkets.util.beans.NmCommandBean, java.util.Hashtable). It returns the result of that method cast to a WfContainer if it is an instance of WfContainer. Otherwise, it throws an exception.

Supported API: false

Parameters:
cb -
params - the request parameters
Returns:
WfContainer
Throws:
WTException
See Also:
getExecutionObject(com.ptc.netmarkets.util.beans.NmCommandBean, java.util.Hashtable)

printRequestParameters

public static final void printRequestParameters(Hashtable params)
Print out the request parameters contained in the hashtable.


createTempFile

public static final File createTempFile()
                                 throws IOException
Create a temporary file in the Windchill temporary directory. Mark it as deleteOnExit.

Throws:
IOException

getContent

public static File getContent(javax.servlet.http.HttpServletRequest request)
                       throws IOException
Copy the content of the request to a temporary file. Return null if the request has no content.

Throws:
IOException

checkForExecutionObject

private static ExecutionObject checkForExecutionObject(Object obj)
                                                throws WTException
Throws:
WTException