com.ptc.netmarkets.msproject
Class StandardNmMsProjectService

java.lang.Object
  extended bywt.services.StandardManager
      extended bycom.ptc.netmarkets.msproject.StandardNmMsProjectService
All Implemented Interfaces:
Manager, NetFactor, NmMsProjectService, Serializable

public class StandardNmMsProjectService
extends StandardManager
implements NmMsProjectService, Serializable

Use the newStandardNmMsProjectService static factory method(s), not the StandardNmMsProjectService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardNmMsProjectService()
           
 
Method Summary
 void deleteTempFile(File tempFile)
          Delete a temporary file that was created by the method server.
private  void enablePlanInCache(NmOid oid)
          Adds the ProjectPlan for the specified NmOid to the project plan cache.
private  File export(WfContainer c, ImportExportInfo info)
          Export XML to the file specified by tempPath.
 File exportProjectPlan(NmCommandBean cb, Hashtable params, ExportInfo info)
          Export the project plan as XML that conforms to the Microsoft Project XML Schema.
 String getConceptualClassname()
          Deprecated.  
 NmChangeModel[] importProjectPlan(NmCommandBean cb, Hashtable params, ImportInfo info)
          Update the project plan using the specified XML file.
static StandardNmMsProjectService newStandardNmMsProjectService()
          Default factory for the class.
private  NmOid removePlanFromCache(ExecutionObject exObj)
          Removes the ProjectPlan for the specified ExecutionObject from the project plan cache.
private  NmOid removePlanFromCache(WTContainer project)
          Removes the ProjectPlan for the specified WTContainer from the project plan cache.
 File requestImportProjectPlan(NmCommandBean cb, Hashtable params, ImportInfo info)
          Generate a request for the client to import a file into a ProjectPlan or SummaryActivity.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, performStartupProcess, registerEvents, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME
Constructor Detail

StandardNmMsProjectService

public StandardNmMsProjectService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

newStandardNmMsProjectService

public static StandardNmMsProjectService newStandardNmMsProjectService()
                                                                throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardNmMsProjectService
Throws:
WTException

importProjectPlan

public NmChangeModel[] importProjectPlan(NmCommandBean cb,
                                         Hashtable params,
                                         ImportInfo info)
                                  throws WTException,
                                         WTPropertyVetoException,
                                         IOException
Update the project plan using the specified XML file. The XML file should conform to the Microsoft Project XML Schema.

Since an import will usually cause substantial changes and occurs infrequently, return a NmChangeModel that invalidates all the caches.

Supported API: false

Specified by:
importProjectPlan in interface NmMsProjectService
Parameters:
cb -
params -
info -
Returns:
NmChangeModel[]
Throws:
WTException
WTPropertyVetoException
IOException

exportProjectPlan

public File exportProjectPlan(NmCommandBean cb,
                              Hashtable params,
                              ExportInfo info)
                       throws WTException,
                              IOException
Export the project plan as XML that conforms to the Microsoft Project XML Schema.

If info.isEdit() returns true, then additional information is included in the XML file that identifies the Windchill objects that the data corresponds to. This allows the client to save changes back to the server.

The method returns a pointer to the File into which the XML was written.

Supported API: false

Specified by:
exportProjectPlan in interface NmMsProjectService
Parameters:
cb -
params -
info -
Returns:
File
Throws:
WTException
IOException

requestImportProjectPlan

public File requestImportProjectPlan(NmCommandBean cb,
                                     Hashtable params,
                                     ImportInfo info)
                              throws WTException,
                                     IOException
Generate a request for the client to import a file into a ProjectPlan or SummaryActivity.

The client should use the information in the generated XML to send an importProjectPlan request to the server.

The generated XML conforms to the Existing Project XML Schema. The method returns a pointer to the File into which the XML was written.

Supported API: false

Specified by:
requestImportProjectPlan in interface NmMsProjectService
Parameters:
cb -
params -
info -
Returns:
File
Throws:
WTException
IOException

deleteTempFile

public void deleteTempFile(File tempFile)
                    throws WTException
Delete a temporary file that was created by the method server. If the method server and servlet engine are running as different users this method prevents a potential permission denied error.

Supported API: false

Specified by:
deleteTempFile in interface NmMsProjectService
Parameters:
tempFile -
Throws:
WTException

export

private final File export(WfContainer c,
                          ImportExportInfo info)
                   throws WTException,
                          IOException
Export XML to the file specified by tempPath. The XML is produced using the specified op: export, edit or request.

Throws:
WTException
IOException

removePlanFromCache

private final NmOid removePlanFromCache(ExecutionObject exObj)
                                 throws WTException
Removes the ProjectPlan for the specified ExecutionObject from the project plan cache. If the plan doesn't belong to a WTContainer then nothing is done.

This speeds up the import processing because the cache does not respond to changes that are made to the plan while it is being updated by the importer.

Parameters:
exObj - the execution object
Throws:
WTException

removePlanFromCache

private final NmOid removePlanFromCache(WTContainer project)
                                 throws WTException
Removes the ProjectPlan for the specified WTContainer from the project plan cache. If the container is null then do nothing.

This speeds up the import processing because the cache does not respond to changes that are made to the plan while it is being updated by the importer.

Parameters:
project - the project to remove from the cache
Throws:
WTException

enablePlanInCache

private final void enablePlanInCache(NmOid oid)
                              throws WTException
Adds the ProjectPlan for the specified NmOid to the project plan cache.

Parameters:
oid - the project to add to the cache
Throws:
WTException