com.ptc.netmarkets.nmixb
Class StandardNmIxbService

java.lang.Object
  extended bywt.services.StandardManager
      extended bycom.ptc.netmarkets.nmixb.StandardNmIxbService
All Implemented Interfaces:
Manager, NetFactor, NmIxbService, Serializable

public class StandardNmIxbService
extends StandardManager
implements NmIxbService, Serializable

Use the newStandardNmIxbService static factory method(s), not the StandardNmIxbService 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 Object[] DEF_PARAMS
           
private static int[] FROM_INDICES
           
private static String RESOURCE
           
private static File saveDirectory
           
private  Map userExpSessions
           
private static boolean VERBOSE
           
 
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
StandardNmIxbService()
           
 
Method Summary
static URL _constructOutputURL(File tmpFile, String archiveName)
           
private  void _emitExportEvent(Object[] sources)
           
private  void _resetArchiveMode()
           
private  void checkArchiveName(String str)
           
private  void cleanUpContentFiles(String location)
           
private  void cleanupWorkFiles(List exportList)
           
static URL constructOutputURL(File tmpFile, String fname)
           
private  URL constructOutputURLWithEvent(File tmpFile, String fname, Object obj)
           
private  URL constructOutputURLWithEvent(File tmpFile, String fname, Object[] objs)
           
private  URL doExport(WTContainerRef contRef, Object[] objs, IxbDocument rules, String archiveName)
           
private  URL doExport(WTContainerRef contRef, Object[] objs, IxbDocument rules, String archiveName, boolean doFolders)
           
private  URL doExport(WTContainerRef contRef, Object[] objs, IxbDocument rules, String archiveName, boolean doFolders, boolean doViewables)
           
 URL exportContainerAsExternalTemplate(ObjectIdentifier projectOid, String archiveName, TemplateGeneratorWorklist worklist, GeneratedTemplateAttributes attrs)
          This method creates a jar file and genreates an url that can be used by the client to download the file.
private  File exportContentFiles(QueryResult qr)
           
 URL exportDocument(ObjectIdentifier docOid, String archiveName)
          This method exports a document into a file called called document-name.zip by getting the document name and passing it in to the method with the name in the signature.
private  File exportDocument(WTDocument doc)
           
 URL exportDocuments(ObjectIdentifier[] docOids, String archiveName)
          This method exports a set of documents into a file called called file-name.zip by getting the document name and passing it in to the method with the name in the signature.
private  File exportDocuments(WTDocument[] docs)
           
 URL exportFolderContentsWithMetadata(ObjectIdentifier folderOid, String archiveName)
          This method exports a set of objects in a given folder.
 URL exportFolderFiles(ObjectIdentifier folderOid, String archiveName)
          

Supported API: false
private  URL exportObject(WTContainerRef contRef, Object obj, IxbDocument rules, String archiveName)
           
 URL exportProject(ObjectIdentifier projectOid, String archiveName)
          

Supported API: false
 URL exportProjectDeliverables(ObjectIdentifier projectOid, String archiveName)
          This method exports all Deliverables for the project.
 URL exportProjectDocuments(ObjectIdentifier projectOid, String archiveName, boolean includeFolderStructure, boolean includeViewables)
          This method exports all documents in the project.
 URL exportProjectFiles(ObjectIdentifier projectOid, String archiveName)
          

Supported API: false
 URL exportProjectFolders(ObjectIdentifier projectOid, String archiveName)
          This method exports all Folders for the project.
 URL exportProjectParts(ObjectIdentifier projectOid, String archiveName, boolean includeFolderStructure, boolean includeViewables)
          This method exports all parts in the project.
 URL exportProjectPlan(ObjectIdentifier projectOid, String archiveName)
          This method exports all Deliverables for the project.
 URL exportProjectTeam(ObjectIdentifier projectOid, String archiveName, boolean doMembers)
          This method exports all teams in the project.
 URL exportProjectTemplateNodes(ObjectIdentifier projectOid, String archiveName, boolean doMilestones, boolean doActivities)
          This method exports the ProjectPlan including only a subset of nodes.
static QueryResult findAllParts(WTContainerRef contRef)
           
private  List findFolderDocs(Folder folder, List results)
           
private  QueryResult findFolderDocuments(Folder folder)
           
private  QueryResult findProjectDocuments(Project2 proj)
           
private  IxbDocument generateExportMappingRules(Folder folder)
           
private  IxbDocument generateExportMappingRules(WTDocument document)
           
 String getConceptualClassname()
          Deprecated.  
private  String getFileName(ApplicationData appl_data, List contentFileNames, int fileNum)
           
static InputStream getInputStreamFromContentItem(ContentItem item)
           
static File getSaveDirectory()
           
static TeamExportHolder getTeamHolder(ContainerTeamManaged prj)
           
 void importDocumentsIntoFolder(ObjectIdentifier folderOid, String archiveName)
          This method imports the contents of the file into a folder.
 void importIntoContainer(ObjectIdentifier containerOid, String archiveName)
          Imports metadata and content into a container See the documentation for the supported types.
static StandardNmIxbService newStandardNmIxbService()
          Default factory for the class.
protected  void performStartupProcess()
          Dummy method to be overridden by subclasses.
static void postFeedback(String rb, String key)
           
static void postFeedback(String rb, String key, Object[] params)
           
private  void readArchiveMode()
           
protected  void registerAsListener()
           
 void resetArchiveMode()
          Imports metadata and content into a container See the documentation for the supported types.
 void setArchiveMode(boolean archiveMode)
          Imports metadata and content into a container See the documentation for the supported types.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, 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

VERBOSE

private static final boolean VERBOSE

FROM_INDICES

private static final int[] FROM_INDICES

DEF_PARAMS

private static final Object[] DEF_PARAMS

saveDirectory

private static File saveDirectory

userExpSessions

private Map userExpSessions
Constructor Detail

StandardNmIxbService

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

newStandardNmIxbService

public static StandardNmIxbService newStandardNmIxbService()
                                                    throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardNmIxbService
Throws:
WTException

exportDocument

public URL exportDocument(ObjectIdentifier docOid,
                          String archiveName)
                   throws WTException
This method exports a document into a file called called document-name.zip by getting the document name and passing it in to the method with the name in the signature. The returned URL is the redirectURL to initiate the download from.

Supported API: false

Specified by:
exportDocument in interface NmIxbService
Parameters:
docOid -
archiveName -
Returns:
URL
Throws:
WTException

exportDocuments

public URL exportDocuments(ObjectIdentifier[] docOids,
                           String archiveName)
                    throws WTException
This method exports a set of documents into a file called called file-name.zip by getting the document name and passing it in to the method with the name in the signature. The returned URL is the redirectURL to initiate the download from.

Supported API: false

Specified by:
exportDocuments in interface NmIxbService
Parameters:
docOids -
archiveName -
Returns:
URL
Throws:
WTException

exportProject

public URL exportProject(ObjectIdentifier projectOid,
                         String archiveName)
                  throws WTException


Supported API: false

Specified by:
exportProject in interface NmIxbService
Parameters:
projectOid -
archiveName -
Returns:
URL
Throws:
WTException

exportProjectFiles

public URL exportProjectFiles(ObjectIdentifier projectOid,
                              String archiveName)
                       throws WTException


Supported API: false

Specified by:
exportProjectFiles in interface NmIxbService
Parameters:
projectOid -
archiveName -
Returns:
URL
Throws:
WTException

exportFolderContentsWithMetadata

public URL exportFolderContentsWithMetadata(ObjectIdentifier folderOid,
                                            String archiveName)
                                     throws WTException
This method exports a set of objects in a given folder. It does NOT export the full product structure.. The returned URL is the redirectURL to initiate the download from. You should append this to the base url of your download mechanism.

Supported API: false

Specified by:
exportFolderContentsWithMetadata in interface NmIxbService
Parameters:
folderOid -
archiveName -
Returns:
URL
Throws:
WTException

exportFolderFiles

public URL exportFolderFiles(ObjectIdentifier folderOid,
                             String archiveName)
                      throws WTException


Supported API: false

Specified by:
exportFolderFiles in interface NmIxbService
Parameters:
folderOid -
archiveName -
Returns:
URL
Throws:
WTException

exportProjectTeam

public URL exportProjectTeam(ObjectIdentifier projectOid,
                             String archiveName,
                             boolean doMembers)
                      throws WTException
This method exports all teams in the project. The result is a ProjectConfig XML document consistng of a projectMembership tags. The returned URL is the redirectURL to initiate the download from Typeical usage would involve adding this URL to the base url of your chosen transport mechansim.

Supported API: false

Specified by:
exportProjectTeam in interface NmIxbService
Parameters:
projectOid -
archiveName -
doMembers - If set to true, the projectmembers will be exported. If set to false, only the roles will be exported.
Returns:
URL
Throws:
WTException

exportProjectDeliverables

public URL exportProjectDeliverables(ObjectIdentifier projectOid,
                                     String archiveName)
                              throws WTException
This method exports all Deliverables for the project. The returned URL is the redirectURL to initiate the download from Typical usage of this would involve adding this URL to the base url of your chosen transport mechansim.

Supported API: false

Specified by:
exportProjectDeliverables in interface NmIxbService
Parameters:
projectOid -
archiveName -
Returns:
URL
Throws:
WTException

exportProjectPlan

public URL exportProjectPlan(ObjectIdentifier projectOid,
                             String archiveName)
                      throws WTException
This method exports all Deliverables for the project. The returned URL is the redirectURL to initiate the download from Typical usage of this would involve adding this URL to the base url of your chosen transport mechansim.

Supported API: false

Specified by:
exportProjectPlan in interface NmIxbService
Parameters:
projectOid -
archiveName -
Returns:
URL
Throws:
WTException

importDocumentsIntoFolder

public void importDocumentsIntoFolder(ObjectIdentifier folderOid,
                                      String archiveName)
                               throws WTException
This method imports the contents of the file into a folder. An exception is thrown if there is no metadata. In this release only documents are supported. The default policy is to add a new iteration to duplicate bjects based on the meta-data name and number. (This means that if you export from folder A and then import into folder B, the document will no longer be seen in Folder A since its location has been changed. )

Supported API: false

Specified by:
importDocumentsIntoFolder in interface NmIxbService
Parameters:
folderOid -
archiveName -
Throws:
WTException

exportProjectFolders

public URL exportProjectFolders(ObjectIdentifier projectOid,
                                String archiveName)
                         throws WTException
This method exports all Folders for the project. The returned URL is the redirectURL to initiate the download from Typical usage of this would involve adding this URL to the base url of your chosen transport mechansim.

Supported API: false

Specified by:
exportProjectFolders in interface NmIxbService
Parameters:
projectOid -
archiveName -
Returns:
URL
Throws:
WTException

exportProjectDocuments

public URL exportProjectDocuments(ObjectIdentifier projectOid,
                                  String archiveName,
                                  boolean includeFolderStructure,
                                  boolean includeViewables)
                           throws WTException
This method exports all documents in the project. The returned URL is the redirectURL to initiate the download from Typical usage of this would involve adding this URL to the base url of your chosen transport mechansim.

Supported API: false

Specified by:
exportProjectDocuments in interface NmIxbService
Parameters:
projectOid -
archiveName -
includeFolderStructure -
includeViewables -
Returns:
URL
Throws:
WTException

exportProjectParts

public URL exportProjectParts(ObjectIdentifier projectOid,
                              String archiveName,
                              boolean includeFolderStructure,
                              boolean includeViewables)
                       throws WTException
This method exports all parts in the project. The returned URL is the redirectURL to initiate the download from Typical usage of this would involve adding this URL to the base url of your chosen transport mechansim.

Supported API: false

Specified by:
exportProjectParts in interface NmIxbService
Parameters:
projectOid -
archiveName -
includeFolderStructure -
includeViewables -
Returns:
URL
Throws:
WTException

exportProjectTemplateNodes

public URL exportProjectTemplateNodes(ObjectIdentifier projectOid,
                                      String archiveName,
                                      boolean doMilestones,
                                      boolean doActivities)
                               throws WTException
This method exports the ProjectPlan including only a subset of nodes. You restrict the nodes to either ProjectActivity nodes, or Milestone nodes. The returned URL is the redirectURL to initiate the download from Typical usage of this would involve adding this URL to the base url of your chosen transport mechansim.

Supported API: false

Specified by:
exportProjectTemplateNodes in interface NmIxbService
Parameters:
projectOid -
archiveName -
doMilestones -
doActivities -
Returns:
URL
Throws:
WTException

exportContainerAsExternalTemplate

public URL exportContainerAsExternalTemplate(ObjectIdentifier projectOid,
                                             String archiveName,
                                             TemplateGeneratorWorklist worklist,
                                             GeneratedTemplateAttributes attrs)
                                      throws WTException
This method creates a jar file and genreates an url that can be used by the client to download the file. This ObjectIdentifier must correspond to the container to be exported. If the object is not a WTContainer an exception will be thrown The return value is an URL pointing to the jar file that is suitable for loading into external systems via a reference mechanism. This is a secure URL from the standpoint that it cannot be hijacked, and it cannot be re-used. The caller is responsible for cleaning up the generated file after download completes.

Supported API: false

Specified by:
exportContainerAsExternalTemplate in interface NmIxbService
Parameters:
projectOid -
archiveName -
worklist -
attrs - This contains the attributes of the template export file. To create this argument use the following code... import wt.inf.template.GeneratedTemplateAttributes; GeneratedTemplateAttributes attrs = new GeneratedTemplateAttributes(name,containerClassName) //set other available attributes as desired
Returns:
URL
Throws:
WTException

importIntoContainer

public void importIntoContainer(ObjectIdentifier containerOid,
                                String archiveName)
                         throws WTException
Imports metadata and content into a container See the documentation for the supported types.

Supported API: false

Specified by:
importIntoContainer in interface NmIxbService
Parameters:
containerOid -
archiveName -
Throws:
WTException

setArchiveMode

public void setArchiveMode(boolean archiveMode)
                    throws WTException
Imports metadata and content into a container See the documentation for the supported types.

Supported API: false

Specified by:
setArchiveMode in interface NmIxbService
Parameters:
archiveMode -
Throws:
WTException

resetArchiveMode

public void resetArchiveMode()
                      throws WTException
Imports metadata and content into a container See the documentation for the supported types.

Supported API: false

Specified by:
resetArchiveMode in interface NmIxbService
Throws:
WTException

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Description copied from class: StandardManager
Dummy method to be overridden by subclasses. Subclasses should override this method and provide startup processing.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerAsListener

protected void registerAsListener()
                           throws WTException
Throws:
WTException

constructOutputURLWithEvent

private URL constructOutputURLWithEvent(File tmpFile,
                                        String fname,
                                        Object obj)
                                 throws WTException
Throws:
WTException

constructOutputURLWithEvent

private URL constructOutputURLWithEvent(File tmpFile,
                                        String fname,
                                        Object[] objs)
                                 throws WTException
Throws:
WTException

constructOutputURL

public static URL constructOutputURL(File tmpFile,
                                     String fname)
                              throws WTException
Throws:
WTException

_emitExportEvent

private void _emitExportEvent(Object[] sources)
                       throws WTException
Throws:
WTException

exportDocument

private File exportDocument(WTDocument doc)
                     throws WTException
Throws:
WTException

exportDocuments

private File exportDocuments(WTDocument[] docs)
                      throws WTException
Throws:
WTException

generateExportMappingRules

private IxbDocument generateExportMappingRules(Folder folder)
                                        throws WTException
Throws:
WTException

generateExportMappingRules

private IxbDocument generateExportMappingRules(WTDocument document)
                                        throws WTException
Throws:
WTException

exportObject

private URL exportObject(WTContainerRef contRef,
                         Object obj,
                         IxbDocument rules,
                         String archiveName)
                  throws WTException
Throws:
WTException

doExport

private URL doExport(WTContainerRef contRef,
                     Object[] objs,
                     IxbDocument rules,
                     String archiveName)
              throws WTException
Throws:
WTException

doExport

private URL doExport(WTContainerRef contRef,
                     Object[] objs,
                     IxbDocument rules,
                     String archiveName,
                     boolean doFolders)
              throws WTException
Throws:
WTException

doExport

private URL doExport(WTContainerRef contRef,
                     Object[] objs,
                     IxbDocument rules,
                     String archiveName,
                     boolean doFolders,
                     boolean doViewables)
              throws WTException
Throws:
WTException

checkArchiveName

private void checkArchiveName(String str)
                       throws WTException
Throws:
WTException

getTeamHolder

public static TeamExportHolder getTeamHolder(ContainerTeamManaged prj)
                                      throws WTException
Throws:
WTException

findFolderDocuments

private QueryResult findFolderDocuments(Folder folder)
                                 throws WTException
Throws:
WTException

findFolderDocs

private List findFolderDocs(Folder folder,
                            List results)
                     throws WTException
Throws:
WTException

findProjectDocuments

private QueryResult findProjectDocuments(Project2 proj)
                                  throws WTException
Throws:
WTException

exportContentFiles

private final File exportContentFiles(QueryResult qr)
                               throws WTException
Throws:
WTException

getFileName

private String getFileName(ApplicationData appl_data,
                           List contentFileNames,
                           int fileNum)

cleanupWorkFiles

private final void cleanupWorkFiles(List exportList)

getSaveDirectory

public static final File getSaveDirectory()
                                   throws WTException
Throws:
WTException

cleanUpContentFiles

private void cleanUpContentFiles(String location)
                          throws WTException
Throws:
WTException

postFeedback

public static final void postFeedback(String rb,
                                      String key)
                               throws WTException
Throws:
WTException

postFeedback

public static final void postFeedback(String rb,
                                      String key,
                                      Object[] params)
                               throws WTException
Throws:
WTException

getInputStreamFromContentItem

public static InputStream getInputStreamFromContentItem(ContentItem item)
                                                 throws WTException
Throws:
WTException

_constructOutputURL

public static URL _constructOutputURL(File tmpFile,
                                      String archiveName)
                               throws WTException
Throws:
WTException

_resetArchiveMode

private void _resetArchiveMode()
                        throws WTException
Throws:
WTException

readArchiveMode

private void readArchiveMode()
                      throws WTException
Throws:
WTException

findAllParts

public static QueryResult findAllParts(WTContainerRef contRef)
                                throws WTException
Throws:
WTException