com.ptc.netmarkets.document
Class StandardNmDocumentService

java.lang.Object
  extended bywt.services.StandardManager
      extended bycom.ptc.netmarkets.document.StandardNmDocumentService
All Implemented Interfaces:
Manager, NetFactor, NmDocumentService, Serializable

public class StandardNmDocumentService
extends StandardManager
implements NmDocumentService, Serializable

Use the newStandardNmDocumentService static factory method(s), not the StandardNmDocumentService 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 DOC_CREATE_NAME_RESOURCE
           
private static String ENTERPRISE_RESOURCE
           
private static Boolean hasGlobalTemplates
           
private static String OBJECT_RESOURCE
           
private static String RESOURCE
           
private static String SECONDARY_EXCLUDE
           
private static boolean VERBOSE
           
private static VisualizationHelperIfc visHelper
           
 
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
StandardNmDocumentService()
           
 
Method Summary
 void addAttachment(NmCommandBean cb)
          

Supported API: false
 NmOid create(NmCommandBean cb, NmDocument nmDocument, String tempFile)
          

Supported API: false
 NmOid createFromTemplate(NmCommandBean cb, NmDocument nmDocument, String templateOid)
          

Supported API: false
 NmChangeModel[] disable(NmCommandBean cb)
          

Supported API: false
 String download(NmOid nmOid)
          

Supported API: false
 String edit(NmCommandBean cb)
          

Supported API: false
 String edit(NmOid docOid)
          

Supported API: false
 String edit(NmOid docOid, boolean redirect)
          

Supported API: false
 NmChangeModel[] enable(NmCommandBean cb)
          

Supported API: false
 String getConceptualClassname()
          Deprecated.  
 HashMap getDocDetailsModels(NmCommandBean cb, boolean showOld)
          

Supported API: false
 NmDocument getDocumentProperties(NmCommandBean cb)
          

Supported API: false
 NmDocument getDocumentProperties(NmOid nmOid)
          

Supported API: false
 NmDocument getDocumentProperties(NmOid oid, boolean viewOld)
          

Supported API: false
private  String getFileSize(ApplicationData file)
          Returns a String containing the size of the given file in Kilobytes.
 NmDocument getMinimalDocumentProperties(NmOid nmOid)
          

Supported API: false
 NmDocument getMinimalDocumentProperties(NmOid nmOid, Persistable ref)
          

Supported API: false
 NmDocument getNmDocument(NmCommandBean cb)
          

Supported API: false
 NmDocument getNmDocument(NmOid oid)
          

Supported API: false
 NmDocument getNmDocumentWithContent(NmOid oid)
          

Supported API: false
 NmDocument getNmDocumentWithType(NmOid oid)
          

Supported API: false
 ArrayList getTemplates(NmOid projectOid)
          

Supported API: false
 boolean hasTemplates(WTContainerRef containerRef)
          

Supported API: false
private static boolean isDocNameUniqueInFolder(String name, Folder aFolder)
           
 boolean isTemplate(NmCommandBean cb)
          

Supported API: false
 boolean isTemplate(NmOid oid)
          

Supported API: false
 NmDefaultHTMLTable listAttachments(NmCommandBean cb)
          

Supported API: false
private  NmHTMLTable listContent(NmCommandBean cb, boolean showOld)
           Method to retrieve the secondary content items of an object and put them into a table.
 NmHTMLTable listDescribes(NmCommandBean cb, boolean showOld)
          

Supported API: false
private  NmHTMLTable listDescribesWindchillPDM(NmCommandBean cb, boolean showOld)
           
 NmDefaultHTMLTable listHistory(NmCommandBean cb)
          

Supported API: false
 NmHTMLTable listReferences(NmCommandBean cb, boolean showOld)
          

Supported API: false
private  NmHTMLTable listReferencesPDMLink(NmCommandBean cb, boolean showOld)
           
private  NmHTMLTable listReferencesWindchillPDM(NmCommandBean cb, boolean showOld)
           
static StandardNmDocumentService newStandardNmDocumentService()
          Default factory for the class.
 void rename(NmCommandBean cb, NmDocument nmDocument)
          

Supported API: false
 String replaceCRs(String description)
           
private  float roundToTwoDecimals(float number)
          Returns the given float rounded to two decimal places.
 void update(NmCommandBean cb, NmDocument nmDocument, String tempFile, String checkInComments, boolean checkOut)
          

Supported API: false
private  void validateDocTemplateName(String name, Folder aFolder)
           
private static void verifyUniqueness(String name, Folder aFolder, WTContainerRef containerRef, NmCommandBean cb)
           
 
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

VERBOSE

private static boolean VERBOSE

DOC_CREATE_NAME_RESOURCE

private static final String DOC_CREATE_NAME_RESOURCE
See Also:
Constant Field Values

OBJECT_RESOURCE

private static final String OBJECT_RESOURCE
See Also:
Constant Field Values

ENTERPRISE_RESOURCE

private static final String ENTERPRISE_RESOURCE
See Also:
Constant Field Values

visHelper

private static VisualizationHelperIfc visHelper

hasGlobalTemplates

private static Boolean hasGlobalTemplates

SECONDARY_EXCLUDE

private static final String SECONDARY_EXCLUDE
Constructor Detail

StandardNmDocumentService

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

newStandardNmDocumentService

public static StandardNmDocumentService newStandardNmDocumentService()
                                                              throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardNmDocumentService
Throws:
WTException

create

public NmOid create(NmCommandBean cb,
                    NmDocument nmDocument,
                    String tempFile)
             throws WTException


Supported API: false

Specified by:
create in interface NmDocumentService
Parameters:
cb -
nmDocument -
tempFile -
Returns:
NmOid
Throws:
WTException

edit

public String edit(NmCommandBean cb)
            throws WTException


Supported API: false

Specified by:
edit in interface NmDocumentService
Parameters:
cb -
Returns:
String
Throws:
WTException

update

public void update(NmCommandBean cb,
                   NmDocument nmDocument,
                   String tempFile,
                   String checkInComments,
                   boolean checkOut)
            throws WTException


Supported API: false

Specified by:
update in interface NmDocumentService
Parameters:
cb -
nmDocument -
tempFile -
checkInComments -
checkOut -
Throws:
WTException

getDocumentProperties

public NmDocument getDocumentProperties(NmCommandBean cb)
                                 throws WTException


Supported API: false

Specified by:
getDocumentProperties in interface NmDocumentService
Parameters:
cb -
Returns:
NmDocument
Throws:
WTException

getDocumentProperties

public NmDocument getDocumentProperties(NmOid oid,
                                        boolean viewOld)
                                 throws WTException


Supported API: false

Specified by:
getDocumentProperties in interface NmDocumentService
Parameters:
oid -
viewOld -
Returns:
NmDocument
Throws:
WTException

listHistory

public NmDefaultHTMLTable listHistory(NmCommandBean cb)
                               throws WTException


Supported API: false

Specified by:
listHistory in interface NmDocumentService
Parameters:
cb -
Returns:
NmDefaultHTMLTable
Throws:
WTException

download

public String download(NmOid nmOid)
                throws WTException


Supported API: false

Specified by:
download in interface NmDocumentService
Parameters:
nmOid -
Returns:
String
Throws:
WTException

createFromTemplate

public NmOid createFromTemplate(NmCommandBean cb,
                                NmDocument nmDocument,
                                String templateOid)
                         throws WTException


Supported API: false

Specified by:
createFromTemplate in interface NmDocumentService
Parameters:
cb -
nmDocument -
templateOid -
Returns:
NmOid
Throws:
WTException

getTemplates

public ArrayList getTemplates(NmOid projectOid)
                       throws WTException


Supported API: false

Specified by:
getTemplates in interface NmDocumentService
Parameters:
projectOid -
Returns:
ArrayList
Throws:
WTException

edit

public String edit(NmOid docOid)
            throws WTException


Supported API: false

Specified by:
edit in interface NmDocumentService
Parameters:
docOid -
Returns:
String
Throws:
WTException

getDocumentProperties

public NmDocument getDocumentProperties(NmOid nmOid)
                                 throws WTException


Supported API: false

Specified by:
getDocumentProperties in interface NmDocumentService
Parameters:
nmOid -
Returns:
NmDocument
Throws:
WTException

getMinimalDocumentProperties

public NmDocument getMinimalDocumentProperties(NmOid nmOid)
                                        throws WTException


Supported API: false

Specified by:
getMinimalDocumentProperties in interface NmDocumentService
Parameters:
nmOid -
Returns:
NmDocument
Throws:
WTException

getMinimalDocumentProperties

public NmDocument getMinimalDocumentProperties(NmOid nmOid,
                                               Persistable ref)
                                        throws WTException


Supported API: false

Specified by:
getMinimalDocumentProperties in interface NmDocumentService
Parameters:
nmOid -
ref -
Returns:
NmDocument
Throws:
WTException

enable

public NmChangeModel[] enable(NmCommandBean cb)
                       throws WTException


Supported API: false

Specified by:
enable in interface NmDocumentService
Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

disable

public NmChangeModel[] disable(NmCommandBean cb)
                        throws WTException


Supported API: false

Specified by:
disable in interface NmDocumentService
Parameters:
cb -
Returns:
NmChangeModel[]
Throws:
WTException

getNmDocument

public NmDocument getNmDocument(NmOid oid)
                         throws WTException


Supported API: false

Specified by:
getNmDocument in interface NmDocumentService
Parameters:
oid -
Returns:
NmDocument
Throws:
WTException

getNmDocument

public NmDocument getNmDocument(NmCommandBean cb)
                         throws WTException


Supported API: false

Specified by:
getNmDocument in interface NmDocumentService
Parameters:
cb -
Returns:
NmDocument
Throws:
WTException

listReferences

public NmHTMLTable listReferences(NmCommandBean cb,
                                  boolean showOld)
                           throws WTException


Supported API: false

Specified by:
listReferences in interface NmDocumentService
Parameters:
cb -
showOld -
Returns:
NmHTMLTable
Throws:
WTException

listDescribes

public NmHTMLTable listDescribes(NmCommandBean cb,
                                 boolean showOld)
                          throws WTException


Supported API: false

Specified by:
listDescribes in interface NmDocumentService
Parameters:
cb -
showOld -
Returns:
NmHTMLTable
Throws:
WTException

listAttachments

public NmDefaultHTMLTable listAttachments(NmCommandBean cb)
                                   throws WTException


Supported API: false

Specified by:
listAttachments in interface NmDocumentService
Parameters:
cb -
Returns:
NmDefaultHTMLTable
Throws:
WTException

addAttachment

public void addAttachment(NmCommandBean cb)
                   throws WTException


Supported API: false

Specified by:
addAttachment in interface NmDocumentService
Parameters:
cb -
Throws:
WTException

isTemplate

public boolean isTemplate(NmOid oid)
                   throws WTException


Supported API: false

Specified by:
isTemplate in interface NmDocumentService
Parameters:
oid -
Returns:
boolean
Throws:
WTException

isTemplate

public boolean isTemplate(NmCommandBean cb)
                   throws WTException


Supported API: false

Specified by:
isTemplate in interface NmDocumentService
Parameters:
cb -
Returns:
boolean
Throws:
WTException

hasTemplates

public boolean hasTemplates(WTContainerRef containerRef)
                     throws WTException


Supported API: false

Specified by:
hasTemplates in interface NmDocumentService
Parameters:
containerRef -
Returns:
boolean
Throws:
WTException

getNmDocumentWithContent

public NmDocument getNmDocumentWithContent(NmOid oid)
                                    throws WTException


Supported API: false

Specified by:
getNmDocumentWithContent in interface NmDocumentService
Parameters:
oid -
Returns:
NmDocument
Throws:
WTException

edit

public String edit(NmOid docOid,
                   boolean redirect)
            throws WTException


Supported API: false

Specified by:
edit in interface NmDocumentService
Parameters:
docOid -
redirect -
Returns:
String
Throws:
WTException

getDocDetailsModels

public HashMap getDocDetailsModels(NmCommandBean cb,
                                   boolean showOld)
                            throws WTException


Supported API: false

Specified by:
getDocDetailsModels in interface NmDocumentService
Parameters:
cb -
showOld -
Returns:
HashMap
Throws:
WTException

getNmDocumentWithType

public NmDocument getNmDocumentWithType(NmOid oid)
                                 throws WTException


Supported API: false

Specified by:
getNmDocumentWithType in interface NmDocumentService
Parameters:
oid -
Returns:
NmDocument
Throws:
WTException

rename

public void rename(NmCommandBean cb,
                   NmDocument nmDocument)
            throws WTException


Supported API: false

Specified by:
rename in interface NmDocumentService
Parameters:
cb -
nmDocument -
Throws:
WTException

replaceCRs

public String replaceCRs(String description)
                  throws WTException
Throws:
WTException

listReferencesWindchillPDM

private NmHTMLTable listReferencesWindchillPDM(NmCommandBean cb,
                                               boolean showOld)
                                        throws WTException
Throws:
WTException

listDescribesWindchillPDM

private NmHTMLTable listDescribesWindchillPDM(NmCommandBean cb,
                                              boolean showOld)
                                       throws WTException
Throws:
WTException

listReferencesPDMLink

private NmHTMLTable listReferencesPDMLink(NmCommandBean cb,
                                          boolean showOld)
                                   throws WTException
Throws:
WTException

listContent

private NmHTMLTable listContent(NmCommandBean cb,
                                boolean showOld)
                         throws WTException

Method to retrieve the secondary content items of an object and put them into a table.



Supported API: false

Parameters:
cb -
showOld -
Returns:
HashMap
Throws:
WTException

getFileSize

private String getFileSize(ApplicationData file)
                    throws WTException
Returns a String containing the size of the given file in Kilobytes. The string returned also contains the units (e.g "100 KB").

Supported API: false

Parameters:
file - the ApplicationData item whose size is returned
Returns:
a String containing the size of the file and the units.
Throws:
WTException

roundToTwoDecimals

private float roundToTwoDecimals(float number)
Returns the given float rounded to two decimal places.

Supported API: false

Parameters:
number - the float to be rounded
Returns:
the given number rounded to two decimal places

verifyUniqueness

private static void verifyUniqueness(String name,
                                     Folder aFolder,
                                     WTContainerRef containerRef,
                                     NmCommandBean cb)
                              throws WTException
Throws:
WTException

isDocNameUniqueInFolder

private static boolean isDocNameUniqueInFolder(String name,
                                               Folder aFolder)
                                        throws WTException
Throws:
WTException

validateDocTemplateName

private void validateDocTemplateName(String name,
                                     Folder aFolder)
                              throws WTException
Throws:
WTException