wt.content
Class StandardContentService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.content.StandardContentService
All Implemented Interfaces:
ContentService, ContentServiceSvr, Manager, NetFactor, Serializable

public class StandardContentService
extends StandardManager
implements ContentServiceSvr, ContentService, Serializable

This is a Windchill standard manager for Content services.

Use the newStandardContentService static factory method(s), not the StandardContentService 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

Nested Class Summary
(package private)  class StandardContentService.ContentEventListener
           
(package private)  class StandardContentService.ContentEventMultiObjectListener
          Event listener to handle multi objects events.
(package private) static class StandardContentService.WaitNotifier
          Each of the holder in the holders set will have a HashSet of AppDatas corresponds to it, the HashSet will also be used to store strings (file names) in addition to AppDatas object type.
 
Field Summary
private static String CLASSNAME
           
private static boolean CONTENT_ITEM_DEBUG
           
private  String CONTENT_TMP_FILE_BASE
           
private static Hashtable DATA_FORMAT_MAP
           
private static boolean DEBUG
           
private  int DOWNLOAD_TIME_OUT
           
private static Hashtable EXTENSION_MAP
           
private static Hashtable FORMAT_ID_MAP
           
private static Hashtable FORMAT_NAME_MAP
           
private  String HTTP_CLASS
           
private  int IMPORT_NUMBER
           
private static Hashtable INDEXABLE_MAP
           
private  int JOINIDS_CHUNKSIZE
           
private  KeyedEventListener listener
           
private static String LOCK
           
private static ResourceBundle messagesResource
           
private static Hashtable MIME_TYPE_MAP
           
private  KeyedEventListener multiObjectListener
           
private static Hashtable notifiers
           
private static boolean POLL_DEBUG
           
private  int POM_CHUNKSIZE
           
private static FileFolder previousNewFolder
           
private static long previousNewFolderId
           
private static long previousOldFolderId
           
private static String RESOURCE
           
private static Vector SERVER_FORMAT_NAMES
           
private  int UPLOAD_TIME_OUT
           
private static boolean USE_PRIMARY
           
private static boolean VALID_EMPTY_FILE
           
private static boolean WAIT_DEBUG
           
static String WORKSPACE_KEY_IN_METHOD_CONTEXT_CACHE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.content.ContentService
FILE_SET, NONE, UNKNOWN, URL
 
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
StandardContentService()
           
 
Method Summary
private  void addItemToHolder(ContentHolder holder, ContentItem item, WTKeyedMap holders, HashSet itemIds, HashSet streamIds)
           
private static void cacheDataFormatInfo()
           
private  boolean checkModifyAccess(ContentHolder holder)
           
private  void cleanUpAllContent(ContentHolder holder, ContentItem item, boolean onDeleteEvent)
           
private  void cleanUpContent(ContentItem item, boolean onDeleteEvent)
           
private  void cleanUpContent(Streamed sd, boolean onDeleteEvent)
           
private  void cleanUpContent(WTSet cleanupContents, boolean onDeleteEvent)
          This method removes the contentItem objects as well as the associated streamed objects.
private  void collectStreamedForContentItem(ContentItem item, boolean onDeleteEvent, WTCollection streameds)
           
 ContentHolder contentUpdate(ContentHolder holder, TransactionContainer txnCntr)
          This method adds, removes, and updates content based on a ContentHolder and a TransactionContainer object.
 ContentHolder contentUpdateDownload(ContentHolder holder, TransactionContainer txnCntr)
          Deprecated.  
 ContentHolder contentUpdateUpload(ContentHolder holder, TransactionContainer txnCntr)
          Deprecated.  
private  void CopyAggregateContentForHolder(Aggregate agg)
           
 ContentHolder copyContent(ContentHolder copyFrom, ContentHolder copyTo)
          Copy all the content from one content holder to another (not regarding the content role.
 void copyContent(WTKeyedMap old2newMapping)
          Copy all the content from one content holder to another (not regarding the content role.
private  void copyContentFromHolder(ContentHolder oldCH, ContentHolder target)
           
private  void copyContentFromMultiHolders(WTKeyedMap old2newMapping)
           
 ContentItem copyContentItem(ContentHolder holder, ContentItem item)
          Make an exact copy of the ContentItem for the passed holder.
 void copyContentItemsNoRoleCheck(WTKeyedMap holderToItemMap)
          Make a copy of the ContentItem objects for the corresponding ContentHolder objects.
 void deleteContent(ContentHolder holder, ContentItem item)
          Deletes the passed ContentItem for the given ContentHolder.
 void deleteContent(WTSet contentItemSet)
          Deletes the contents associated with the input content item set.
 void dispatchPostDownloadEvent(ContentHolder holder, ApplicationData appData)
          This method should only be called after the complete and successful download of a file.
protected  void dispatchVetoableEvent(ContentServiceEvent event, boolean isMultiObject)
           
protected  void dispatchVetoableEvent(String eventType, ContentHolder holder, ApplicationData appData)
          Dispatches a VersionControlServiceEvent that includes the event type and target (i.e., either an Iterated or Versioned object).
protected  void dispatchVetoableEvent(String eventType, WTKeyedHashMap holderAppDataMap)
           
private  HttpOperationItem downloadWait(HttpOperationItem opItem)
           
private  ApplicationData findCachedAppData(ContentHolder holder, String appDataName, WTKeyedMap appDataCache)
          Find any appData object in the hashtable for the holder that matches the input appDataName.
 InputStream findContentStream(ApplicationData appData)
          Return the stream based on a ContentHolder and an ApplicationData object.
 ApplicationData get3DThumbnail(ContentHolder contentHolder)
          Get an associated Thumbnail content item for the passed ContentHolder.
 ApplicationData getApplicationData(ObjectIdentifier itemId)
          Get a ContentItemInfo object based on an object identifier passed on the query string.
 String getConceptualClassname()
          Deprecated.  
 ContentHolder getContentHolder(HttpContentOperation op)
          

Supported API: false
 ContentHolder getContentHolder(ObjectIdentifier itemId)
          Get a ContentItemInfo object based on an object identifier passed on the query string.
 ContentHolder getContents(ContentHolder holder)
          Set the cookie in an ContentHolder object to contain all ContentItems associated with it.
 HashMap getContents(HashMap holders)
          Set the cookie in an every ContentHolder object in HashMap to contain all ContentItems associated with it.
 QueryResult getContentsByRole(ContentHolder holder, ContentRoleType role)
          Query for all the associated ContentItems that have the passed Role for the ContentHolder.
 WTKeyedMap getContentsByRole(WTSet holderSet, ContentRoleType role)
          Query for all the associated ContentItems that have the passed Role for the ContentHolder.
private  QueryResult getContentStatuses(ContentHolder holder, boolean returnNotComplete)
           
 DataFormat getDataFormat(String idStr)
          Get a DataFormat object based on a stringified object identifier.
 QueryResult getDataFormats()
          Deprecated.  
private static String getFileExtension(String filename)
           
 DataFormat getFormatByName(String formatName)
          Get a DataFormat object based on the formatName

Supported API: false
 String getFormatName(ContentItem item)
          

Supported API: false
 Vector getFormatNames()
          Returns a Vector of the FormatNames in the system from DataFormat class that are applicable for ApplicationData objects.
 Enumeration getHtmlFormatNames()
          Returns the list of valid formats for ApplicationData objects in the system.
 HttpContentOperation getHttpContentOperation(ObjectIdentifier opID)
          Deprecated.  
 HttpContentOperation getHttpContentOperationStatuses(HttpContentOperation operation)
          Deprecated.  
 HttpOperationItem getHttpOperationItem(ObjectIdentifier itemId)
          Deprecated.  
private  WTKeyedMap getLockContentItemSet(WTCollection holders)
           
 String getMimeType(ApplicationData item)
          Return the mime type of an ApplicationData object for download.
 int getNumberForImport()
          Get the configurable number to allow on a new import of content.
 ContentItem getPrimary(FormatContentHolder holder)
          Deprecated.  
 ContentItem getPrimaryContent(ObjectReference formatContentHolderRef)
          Get the primary ContentItem for the passed reference to a ContentHolder.
 ApplicationData getThumbnail(ContentHolder contentHolder)
          Get an associated Thumbnail content item for the passed ContentHolder.
private  ApplicationData getThumbnail(ContentHolder contentHolder, ContentRoleType roleType)
           
 boolean indexable(ApplicationData appData)
          Returns true if the passed ContentItem is an Indexable class.
 HttpContentOperation initializeNewUploads(ContentHolder holder, HttpContentOperation operation, int numberToInit)
          Used to initialize empty uploads from a import html page.
private  void initProperties()
           
 void initTrx(Persistable obj)
          Deprecated.  
private  void lockObjects(HashSet objs, Class objCl)
           
private  void lockStoredItems(WTCollection cItems)
           
 void newContentServiceSvr(ContentHolder holder, ApplicationData appData)
           
static StandardContentService newStandardContentService()
          Default factory for the class.
protected  void performStartupProcess()
          

Supported API: false
private  void postMakeUnrestorable(ContentHolder holder)
           
 HttpContentOperation prepareForDownload(ContentHolder holder, Vector contentV)
          Deprecated.  
 HttpContentOperation prepareForFullDownload(ContentHolder holder)
          Deprecated.  
 HttpContentOperation prepareForFullUpload(ContentHolder holder)
          Deprecated.  
 HttpContentOperation prepareForUpload(ContentHolder holder)
          Deprecated.  
 HttpContentOperation prepareForUpload(ContentHolder holder, Vector contentV)
          Deprecated.  
private  Hashtable prepareStoredItemMap(Object[][] holderDataArray)
          Returns a hashtable for the mapping between stream id (key) and StoredItem (value).
protected  void processCleanupLinkEvent(Persistable target, Persistable plink)
           
protected  void processCleanupLinkMultiObjectEvent(WTKeyedMap target)
          CLEANUP_LINK event will be fired when a content holder (e.g.
protected  void processNewIterationEvent(ContentHolder target)
           
private  void processNewIterationMultiObjectEvent(WTCollection newHolders)
           
protected  void processPostCopyEvent(ContentHolder orig, ContentHolder copy, CopyRules copy_rules)
           
protected  void processPostDeleteEvent(Persistable target)
           
protected  void processPostDeleteMultiObjectEvent(WTCollection targets)
           
private  void processPostMultiCopyEvent(WTKeyedMap target, Map copyRulesMap)
           
protected  void processPostRefreshEvent(Persistable target)
           
protected  void processPostRefreshMultiObjectEvent(WTCollection targets)
           
protected  void processPostStoreEvent(Persistable target)
           
protected  void processPostStoreMultiObjectEvent(WTCollection targets)
           
protected  void processPreStoreEvent(Persistable target)
           
protected  void processPreStoreMultiObjectEvent(WTCollection targets)
          This method sets the format for all the FormatContentHolder in the collection.
 void registerEvents(ManagerService mService)
          Register events with the passed ManagerService.
private  Aggregate resolveAgg(Aggregate agg)
           
private  void setFileName(ContentHolder holder, ApplicationData appData)
           
private  void setFileName(ContentHolder holder, ApplicationData appData, boolean mustCreateNewFile)
          Assign file name to the app data.
private  void setFileName(ContentHolder holder, ApplicationData appData, boolean mustCreateNewFile, WTKeyedMap appDataCache)
          Assign file name to the app data.
private  void setFormat(ContentItem item)
           
private  void setFormat(ContentItem item, String name)
           
static void setFormat(String filename, ContentItem item)
           
 void setFormatByMimeType(ApplicationData appData, String mimeType)
          Attempt to set the format of an ApplicationData based on the passed mime type.
private  void setFormatContentHolderFormat(FormatContentHolder holder)
           
 ApplicationData store3DThumbnail(ContentHolder contentHolder, ApplicationData thumbnail, InputStream is)
          Store a thumbnail content item for the passed ContentHolder.
 ApplicationData storeThumbnail(ContentHolder contentHolder, ApplicationData thumbnail, InputStream is)
          Store a thumbnail content item for the passed ContentHolder.
 Aggregate updateAggregateFile(ContentHolder holder, Aggregate agg, ApplicationData appData, InputStream is)
          Update an ApplicationData that is part of the passed Aggregate.
 Aggregate updateAggregateFile(ContentHolder holder, Aggregate agg, ApplicationData appData, InputStream is, boolean mustCreateNewFile)
          

Supported API: false
 Aggregate updateAggregateFile(ContentHolder holder, Aggregate agg, ApplicationData appData, String fullPath)
          Update an ApplicationData that is part of the passed Aggregate.
 Aggregate updateAggregateURL(ContentHolder holder, Aggregate agg, URLData urlData)
          Update an URLData that is part of the passed Aggregate.
 ApplicationData updateAppData(ContentHolder holder, ApplicationData appData)
          This method updates an ApplicationData without changing the timestamp.
private  void updateCacheAppData(WTKeyedMap appDataCache, ContentHolder holder, ApplicationData appData)
           
 Aggregate updateContent(ContentHolder holder, Aggregate agg)
          Update a ContentHolder with the given Aggreate.
 ApplicationData updateContent(ContentHolder holder, ApplicationData appData, CachedContentDescriptor cachedContDesc)
          Update a ContentHolder with the given content passed in with a CachedContDesc.
 ApplicationData updateContent(ContentHolder holder, ApplicationData appData, CachedContentDescriptor cachedContDesc, boolean mustCreateNewFile)
          

Supported API: false
 ApplicationData updateContent(ContentHolder holder, ApplicationData appData, InputStream is)
          Update a ContentHolder based on a persised ContentHolder and ContentItemInfo object and a new ApplicationData object and the corresponding stream to the content.
 ApplicationData updateContent(ContentHolder holder, ApplicationData appData, InputStream is, boolean mustCreateNewFile)
          

Supported API: false
 ApplicationData updateContent(ContentHolder holder, ApplicationData appData, String fullPath)
          Update a ContentHolder with the given content passed in with a path.
 URLData updateContent(ContentHolder holder, URLData urlData)
          Update a ContentHolder with the given content passed in with a path.
 Object[] updateContent(Object[][] holderDataArray)
          Update multiple ContentHolders with its corresponding ApplicationData passed in as part of the object[][2].
 Object[] updateContent(Object[][] holderDataArray, boolean mustCreateNewFile)
          Update multiple ContentHolders with its corresponding ApplicationData passed in as part of the object[][2].
 FormatContentHolder updateHolderFormat(FormatContentHolder holder)
          This method will update the format for a FormatContentHolder based on the content in it at it's current state.
 FormatContentHolder updateHolderFormat(FormatContentHolder holder, ContentItem item)
           
 WTSet updateHolderFormat(WTSet inHolderSet)
          This method will update the format for a FormatContentHolder based on the content in it at it's current state.
 ApplicationData updatePrimary(FormatContentHolder holder, ApplicationData appData, InputStream is)
          Update the primary for the passed FormatContentHolder with the passed ApplicationData and stream.
 ContentItem updatePrimary(FormatContentHolder holder, ContentItem item)
          Update the primary for the passed FormatContentHolder with the passed ContentItem.
 HttpContentOperation updateStatus(HttpContentOperation op, HttpOperationItem itemStatus, HttpOperationStatus stat)
          Deprecated.  
 HttpContentOperation updateStatus(HttpContentOperation op, HttpOperationStatus stat)
          Deprecated.  
 HttpContentOperation updateStatusAsFailed(HttpContentOperation op)
          Deprecated.  
private  HttpContentOperation uploadWait(HttpContentOperation op)
           
 HttpContentOperation waitForStatus(HttpContentOperation op)
          Deprecated.  
 HttpOperationItem waitForStatus(HttpOperationItem opItem)
          Deprecated.  
 void writeContentStream(ApplicationData appData, String path)
          Write out the content to a path based on a ContentHolder and an ApplicationData object.
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, 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

previousOldFolderId

private static long previousOldFolderId

previousNewFolderId

private static long previousNewFolderId

previousNewFolder

private static FileFolder previousNewFolder

WORKSPACE_KEY_IN_METHOD_CONTEXT_CACHE

public static String WORKSPACE_KEY_IN_METHOD_CONTEXT_CACHE

CONTENT_ITEM_DEBUG

private static final boolean CONTENT_ITEM_DEBUG
See Also:
Constant Field Values

DEBUG

private static boolean DEBUG

POLL_DEBUG

private static boolean POLL_DEBUG

WAIT_DEBUG

private static boolean WAIT_DEBUG

USE_PRIMARY

private static boolean USE_PRIMARY

VALID_EMPTY_FILE

private static boolean VALID_EMPTY_FILE

LOCK

private static final String LOCK
See Also:
Constant Field Values

HTTP_CLASS

private String HTTP_CLASS

CONTENT_TMP_FILE_BASE

private String CONTENT_TMP_FILE_BASE

IMPORT_NUMBER

private int IMPORT_NUMBER

UPLOAD_TIME_OUT

private int UPLOAD_TIME_OUT

DOWNLOAD_TIME_OUT

private int DOWNLOAD_TIME_OUT

JOINIDS_CHUNKSIZE

private int JOINIDS_CHUNKSIZE

POM_CHUNKSIZE

private int POM_CHUNKSIZE

SERVER_FORMAT_NAMES

private static Vector SERVER_FORMAT_NAMES

FORMAT_NAME_MAP

private static Hashtable FORMAT_NAME_MAP

FORMAT_ID_MAP

private static Hashtable FORMAT_ID_MAP

INDEXABLE_MAP

private static Hashtable INDEXABLE_MAP

MIME_TYPE_MAP

private static Hashtable MIME_TYPE_MAP

EXTENSION_MAP

private static Hashtable EXTENSION_MAP

DATA_FORMAT_MAP

private static Hashtable DATA_FORMAT_MAP

notifiers

private static Hashtable notifiers

messagesResource

private static ResourceBundle messagesResource

listener

private KeyedEventListener listener

multiObjectListener

private KeyedEventListener multiObjectListener
Constructor Detail

StandardContentService

public StandardContentService()
Method Detail

newContentServiceSvr

public void newContentServiceSvr(ContentHolder holder,
                                 ApplicationData appData)
                          throws WTException,
                                 WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

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

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException


Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerEvents

public void registerEvents(ManagerService mService)
Register events with the passed ManagerService.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
mService - the ManagerService with which to register events.

dispatchVetoableEvent

protected void dispatchVetoableEvent(String eventType,
                                     ContentHolder holder,
                                     ApplicationData appData)
                              throws WTException,
                                     WTPropertyVetoException
Dispatches a VersionControlServiceEvent that includes the event type and target (i.e., either an Iterated or Versioned object).

Supported API: false

Parameters:
eventType - The name of the PersistentManagerEvent type.
holder - The target of the persistable operation.
appData -
Throws:
WTException
WTPropertyVetoException

newStandardContentService

public static StandardContentService newStandardContentService()
                                                        throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardContentService
Throws:
WTException

getHttpContentOperation

public HttpContentOperation getHttpContentOperation(ObjectIdentifier opID)
                                             throws ContentException,
                                                    WTException
Deprecated.  

Get the HttpContentOperation object based on an object identifier. Internal use only.

Supported API: false

Specified by:
getHttpContentOperation in interface ContentServiceSvr
Parameters:
opID -
Returns:
HttpContentOperation
Throws:
ContentException
WTException

getHttpOperationItem

public HttpOperationItem getHttpOperationItem(ObjectIdentifier itemId)
                                       throws WTException
Deprecated.  

Get a ContentItemInfo object based on an object identifier. Internally used.

Supported API: false

Specified by:
getHttpOperationItem in interface ContentServiceSvr
Parameters:
itemId -
Returns:
HttpOperationItem
Throws:
WTException

findContentStream

public InputStream findContentStream(ApplicationData appData)
                              throws WTException
Return the stream based on a ContentHolder and an ApplicationData object.

Supported API: false

Specified by:
findContentStream in interface ContentServiceSvr
Parameters:
appData -
Returns:
InputStream
Throws:
WTException

writeContentStream

public void writeContentStream(ApplicationData appData,
                               String path)
                        throws WTException,
                               IOException
Write out the content to a path based on a ContentHolder and an ApplicationData object.

Supported API: false

Specified by:
writeContentStream in interface ContentServiceSvr
Parameters:
appData -
path -
Throws:
WTException
IOException

updateStatus

public HttpContentOperation updateStatus(HttpContentOperation op,
                                         HttpOperationStatus stat)
                                  throws WTException,
                                         PropertyVetoException
Deprecated.  

update the HttpContentOperation to the passed status internal use

Supported API: false

Specified by:
updateStatus in interface ContentServiceSvr
Parameters:
op -
stat -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

updateStatus

public HttpContentOperation updateStatus(HttpContentOperation op,
                                         HttpOperationItem itemStatus,
                                         HttpOperationStatus stat)
                                  throws WTException,
                                         PropertyVetoException
Deprecated.  

update the HttpOperationItem object to the passed status. internal use

Supported API: false

Specified by:
updateStatus in interface ContentServiceSvr
Parameters:
op -
itemStatus -
stat -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

updateStatusAsFailed

public HttpContentOperation updateStatusAsFailed(HttpContentOperation op)
                                          throws WTException,
                                                 PropertyVetoException
Deprecated.  

Attempts to update an HttpContentOperation to a failed status - however it does NOT throw an exception if it is not successful. internal use.

Supported API: false

Specified by:
updateStatusAsFailed in interface ContentServiceSvr
Parameters:
op -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

getHtmlFormatNames

public Enumeration getHtmlFormatNames()
                               throws WTException
Returns the list of valid formats for ApplicationData objects in the system. These values are cached in the server, so this does not require a database hit every time.

Supported API: false

Specified by:
getHtmlFormatNames in interface ContentServiceSvr
Returns:
Enumeration
Throws:
WTException

getMimeType

public String getMimeType(ApplicationData item)
                   throws WTException
Return the mime type of an ApplicationData object for download. internally used.

Supported API: false

Specified by:
getMimeType in interface ContentServiceSvr
Parameters:
item -
Returns:
String
Throws:
WTException

updateContent

public ApplicationData updateContent(ContentHolder holder,
                                     ApplicationData appData,
                                     String fullPath)
                              throws WTException,
                                     PropertyVetoException,
                                     IOException,
                                     FileNotFoundException
Update a ContentHolder with the given content passed in with a path. This would be used for data migration tools.

Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holder -
appData -
fullPath -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

updateContent

public ApplicationData updateContent(ContentHolder holder,
                                     ApplicationData appData,
                                     CachedContentDescriptor cachedContDesc)
                              throws WTException,
                                     PropertyVetoException
Update a ContentHolder with the given content passed in with a CachedContDesc. This would be used for Cached Content.

Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holder -
appData -
cachedContDesc -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException

updateContent

public URLData updateContent(ContentHolder holder,
                             URLData urlData)
                      throws WTException,
                             PropertyVetoException
Update a ContentHolder with the given content passed in with a path. This would be used for data migration tools.

Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holder -
urlData -
Returns:
URLData
Throws:
WTException
PropertyVetoException

updateContent

public ApplicationData updateContent(ContentHolder holder,
                                     ApplicationData appData,
                                     InputStream is)
                              throws WTException,
                                     PropertyVetoException,
                                     IOException,
                                     FileNotFoundException
Update a ContentHolder based on a persised ContentHolder and ContentItemInfo object and a new ApplicationData object and the corresponding stream to the content.

Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holder -
appData -
is -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

updateContent

public Aggregate updateContent(ContentHolder holder,
                               Aggregate agg)
                        throws WTException,
                               PropertyVetoException
Update a ContentHolder with the given Aggreate. The Aggregate is attached as secondary content by default.

Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holder -
agg -
Returns:
Aggregate
Throws:
WTException
PropertyVetoException

getNumberForImport

public int getNumberForImport()
Get the configurable number to allow on a new import of content. There will be this many open spots avaliable on the bottom of the generated html on an upload to allow the user to define new content from the server side.

Supported API: false

Specified by:
getNumberForImport in interface ContentServiceSvr
Returns:
int

getApplicationData

public ApplicationData getApplicationData(ObjectIdentifier itemId)
                                   throws WTException
Get a ContentItemInfo object based on an object identifier passed on the query string. This is only used for download. internal use

Supported API: false

Specified by:
getApplicationData in interface ContentServiceSvr
Parameters:
itemId -
Returns:
ApplicationData
Throws:
WTException

getContentHolder

public ContentHolder getContentHolder(ObjectIdentifier itemId)
                               throws WTException
Get a ContentItemInfo object based on an object identifier passed on the query string. This is only used for download.

Supported API: false

Specified by:
getContentHolder in interface ContentServiceSvr
Parameters:
itemId -
Returns:
ContentHolder
Throws:
WTException

initializeNewUploads

public HttpContentOperation initializeNewUploads(ContentHolder holder,
                                                 HttpContentOperation operation,
                                                 int numberToInit)
                                          throws WTException,
                                                 PropertyVetoException
Used to initialize empty uploads from a import html page. internal use.

Supported API: false

Specified by:
initializeNewUploads in interface ContentServiceSvr
Parameters:
holder -
operation -
numberToInit -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

indexable

public boolean indexable(ApplicationData appData)
                  throws WTException
Returns true if the passed ContentItem is an Indexable class.

Supported API: false

Specified by:
indexable in interface ContentServiceSvr
Parameters:
appData -
Returns:
boolean
Throws:
WTException

updateHolderFormat

public FormatContentHolder updateHolderFormat(FormatContentHolder holder)
                                       throws WTException,
                                              PropertyVetoException
This method will update the format for a FormatContentHolder based on the content in it at it's current state. This method should be called after modifying a FormatContentHolder for a load or an upload.

Supported API: false

Specified by:
updateHolderFormat in interface ContentServiceSvr
Parameters:
holder -
Returns:
FormatContentHolder
Throws:
WTException
PropertyVetoException

getFormatName

public String getFormatName(ContentItem item)
                     throws WTException


Supported API: false

Specified by:
getFormatName in interface ContentServiceSvr
Parameters:
item -
Returns:
String
Throws:
WTException

initTrx

public void initTrx(Persistable obj)
             throws WTException
Deprecated.  

initialize a content transaction for tracking in the server so the client can do a transaction wait.

Supported API: false

Specified by:
initTrx in interface ContentServiceSvr
Parameters:
obj -
Throws:
WTException

getContentHolder

public ContentHolder getContentHolder(HttpContentOperation op)
                               throws WTException


Supported API: false

Specified by:
getContentHolder in interface ContentServiceSvr
Parameters:
op -
Returns:
ContentHolder
Throws:
WTException

deleteContent

public void deleteContent(ContentHolder holder,
                          ContentItem item)
                   throws WTException,
                          WTPropertyVetoException
Deletes the passed ContentItem for the given ContentHolder.

Supported API: false

Specified by:
deleteContent in interface ContentServiceSvr
Parameters:
holder -
item -
Throws:
WTException
WTPropertyVetoException

setFormatByMimeType

public void setFormatByMimeType(ApplicationData appData,
                                String mimeType)
                         throws WTPropertyVetoException,
                                WTException
Attempt to set the format of an ApplicationData based on the passed mime type.

Supported API: false

Specified by:
setFormatByMimeType in interface ContentServiceSvr
Parameters:
appData -
mimeType -
Throws:
WTPropertyVetoException
WTException

updatePrimary

public ApplicationData updatePrimary(FormatContentHolder holder,
                                     ApplicationData appData,
                                     InputStream is)
                              throws WTException,
                                     PropertyVetoException,
                                     FileNotFoundException,
                                     IOException
Update the primary for the passed FormatContentHolder with the passed ApplicationData and stream. This can be an update or the save of a new primary.

Supported API: false

Specified by:
updatePrimary in interface ContentServiceSvr
Parameters:
holder -
appData -
is -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
FileNotFoundException
IOException

updatePrimary

public ContentItem updatePrimary(FormatContentHolder holder,
                                 ContentItem item)
                          throws WTException,
                                 PropertyVetoException
Update the primary for the passed FormatContentHolder with the passed ContentItem. This can be an update or the save of a new primary.

Supported API: false

Specified by:
updatePrimary in interface ContentServiceSvr
Parameters:
holder -
item -
Returns:
ContentItem
Throws:
WTException
PropertyVetoException

updateAggregateFile

public Aggregate updateAggregateFile(ContentHolder holder,
                                     Aggregate agg,
                                     ApplicationData appData,
                                     InputStream is)
                              throws WTException,
                                     PropertyVetoException
Update an ApplicationData that is part of the passed Aggregate. The Aggregate and the ContentHolder should be saved appropriately before being passed to this method. This can update an aggregate or create a new one.

Supported API: false

Specified by:
updateAggregateFile in interface ContentServiceSvr
Parameters:
holder -
agg -
appData -
is -
Returns:
Aggregate
Throws:
WTException
PropertyVetoException

updateAggregateFile

public Aggregate updateAggregateFile(ContentHolder holder,
                                     Aggregate agg,
                                     ApplicationData appData,
                                     String fullPath)
                              throws WTException,
                                     PropertyVetoException,
                                     IOException,
                                     FileNotFoundException
Update an ApplicationData that is part of the passed Aggregate. The Aggregate and the ContentHolder should be saved appropriately before being passed to this method. This can update an aggregate or create a new one. For use with the loader.

Supported API: false

Specified by:
updateAggregateFile in interface ContentServiceSvr
Parameters:
holder -
agg -
appData -
fullPath -
Returns:
Aggregate
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

updateAggregateURL

public Aggregate updateAggregateURL(ContentHolder holder,
                                    Aggregate agg,
                                    URLData urlData)
                             throws WTException,
                                    PropertyVetoException
Update an URLData that is part of the passed Aggregate. The Aggregate and the ContentHolder should be saved appropriately before being passed to this method. This can update an aggregate or create a new one.

Supported API: false

Specified by:
updateAggregateURL in interface ContentServiceSvr
Parameters:
holder -
agg -
urlData -
Returns:
Aggregate
Throws:
WTException
PropertyVetoException

dispatchPostDownloadEvent

public void dispatchPostDownloadEvent(ContentHolder holder,
                                      ApplicationData appData)
                               throws WTException,
                                      WTPropertyVetoException
This method should only be called after the complete and successful download of a file. This occurs OOTB in the ContentHttp class. This will cover any customization using the Windchill content beans or the wt.util.clients.http.HTTPContentUploadDownload class. As well as accessing the ContentHttp.viewContent method.

Supported API: false

Specified by:
dispatchPostDownloadEvent in interface ContentServiceSvr
Parameters:
holder -
appData -
Throws:
WTException
WTPropertyVetoException

storeThumbnail

public ApplicationData storeThumbnail(ContentHolder contentHolder,
                                      ApplicationData thumbnail,
                                      InputStream is)
                               throws WTException,
                                      PropertyVetoException,
                                      IOException,
                                      FileNotFoundException
Store a thumbnail content item for the passed ContentHolder. Will allow more than one thumbnail content item for the ContentHolder. The attributes on the ApplicationData need to be set appropriately.

Supported API: false

Specified by:
storeThumbnail in interface ContentServiceSvr
Parameters:
contentHolder -
thumbnail -
is -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

store3DThumbnail

public ApplicationData store3DThumbnail(ContentHolder contentHolder,
                                        ApplicationData thumbnail,
                                        InputStream is)
                                 throws WTException,
                                        PropertyVetoException,
                                        IOException,
                                        FileNotFoundException
Store a thumbnail content item for the passed ContentHolder. Will allow more than one thumbnail content item for the ContentHolder. The attributes on the ApplicationData need to be set appropriately.

Supported API: false

Specified by:
store3DThumbnail in interface ContentServiceSvr
Parameters:
contentHolder -
thumbnail -
is -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

updateContent

public ApplicationData updateContent(ContentHolder holder,
                                     ApplicationData appData,
                                     CachedContentDescriptor cachedContDesc,
                                     boolean mustCreateNewFile)
                              throws WTException,
                                     PropertyVetoException


Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holder -
appData -
cachedContDesc -
mustCreateNewFile -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException

updateContent

public ApplicationData updateContent(ContentHolder holder,
                                     ApplicationData appData,
                                     InputStream is,
                                     boolean mustCreateNewFile)
                              throws WTException,
                                     PropertyVetoException,
                                     IOException,
                                     FileNotFoundException


Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holder -
appData -
is -
mustCreateNewFile -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException
IOException
FileNotFoundException

updateAggregateFile

public Aggregate updateAggregateFile(ContentHolder holder,
                                     Aggregate agg,
                                     ApplicationData appData,
                                     InputStream is,
                                     boolean mustCreateNewFile)
                              throws WTException,
                                     PropertyVetoException


Supported API: false

Specified by:
updateAggregateFile in interface ContentServiceSvr
Parameters:
holder -
agg -
appData -
is -
mustCreateNewFile -
Returns:
Aggregate
Throws:
WTException
PropertyVetoException

updateContent

public Object[] updateContent(Object[][] holderDataArray,
                              boolean mustCreateNewFile)
                       throws WTException,
                              PropertyVetoException
Update multiple ContentHolders with its corresponding ApplicationData passed in as part of the object[][2]. The first index object is a ContentHolder, the second index object is a Hashtable containing ApplicationData and CachedContentDescriptor information, i.e. each element in the table, the key is a ApplicationData, the value is the corresponding CachedContentDescriptor. Returns an array of WTReference objects corresponding with the ApplicationData objects from the input array.

Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holderDataArray -
mustCreateNewFile -
Returns:
Object[]
Throws:
WTException
PropertyVetoException

updateContent

public Object[] updateContent(Object[][] holderDataArray)
                       throws WTException,
                              PropertyVetoException
Update multiple ContentHolders with its corresponding ApplicationData passed in as part of the object[][2]. The first index object is a ContentHolder, the second index object is a Hashtable containing ApplicationData and CachedContentDescriptor information, i.e. each element in the table, the key is a ApplicationData, the value is the corresponding CachedContentDescriptor. This will call updateContent() with mustCreateNewFile set to true. Returns an array of WTReference objects corresponding with the ApplicationData objects from the input array.

Supported API: false

Specified by:
updateContent in interface ContentServiceSvr
Parameters:
holderDataArray -
Returns:
Object[]
Throws:
WTException
PropertyVetoException

deleteContent

public void deleteContent(WTSet contentItemSet)
                   throws WTException,
                          WTPropertyVetoException
Deletes the contents associated with the input content item set.

Supported API: false

Specified by:
deleteContent in interface ContentServiceSvr
Parameters:
contentItemSet -
Throws:
WTException
WTPropertyVetoException

updateHolderFormat

public WTSet updateHolderFormat(WTSet inHolderSet)
                         throws WTException,
                                PropertyVetoException
This method will update the format for a FormatContentHolder based on the content in it at it's current state. This method should be called after modifying a FormatContentHolder for a load or an upload.

Supported API: false

Specified by:
updateHolderFormat in interface ContentServiceSvr
Parameters:
inHolderSet -
Returns:
WTSet
Throws:
WTException
PropertyVetoException

prepareForUpload

public HttpContentOperation prepareForUpload(ContentHolder holder)
                                      throws WTException,
                                             PropertyVetoException
Deprecated.  

Sets up an HttpContentOperation object for a content upload given a particular ContentHolder. When the upload is initiated with this object, it will allow the definition of new content from a generated html page.

Supported API: false

Specified by:
prepareForUpload in interface ContentService
Parameters:
holder -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

prepareForFullUpload

public HttpContentOperation prepareForFullUpload(ContentHolder holder)
                                          throws WTException,
                                                 PropertyVetoException
Deprecated.  

Sets up an HttpContentOperation object for a content upload given a particular ContentHolder. This will initiate an upload of all content associated with the given ContentHolder.

Supported API: false

Specified by:
prepareForFullUpload in interface ContentService
Parameters:
holder -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

prepareForUpload

public HttpContentOperation prepareForUpload(ContentHolder holder,
                                             Vector contentV)
                                      throws WTException,
                                             PropertyVetoException
Deprecated.  

Sets up an HttpContentOperation object for a content upload given a particular ContentHolder. This method will set up for an upload of all the content in the passed Vector.

Supported API: false

Specified by:
prepareForUpload in interface ContentService
Parameters:
holder -
contentV -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

prepareForFullDownload

public HttpContentOperation prepareForFullDownload(ContentHolder holder)
                                            throws WTException,
                                                   PropertyVetoException
Deprecated.  

Sets up a HttpContentOperation object for a download. This will set up for a download of all the content associated with this ContentHolder

Supported API: false

Specified by:
prepareForFullDownload in interface ContentService
Parameters:
holder -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

prepareForDownload

public HttpContentOperation prepareForDownload(ContentHolder holder,
                                               Vector contentV)
                                        throws WTException,
                                               PropertyVetoException
Deprecated.  

Sets up a HttpContentOperation object for a download. This will download the content for every ApplicationData object in the passed vector.

Supported API: false

Specified by:
prepareForDownload in interface ContentService
Parameters:
holder -
contentV -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

waitForStatus

public HttpContentOperation waitForStatus(HttpContentOperation op)
                                   throws PropertyVetoException,
                                          ContentException,
                                          InterruptedException,
                                          WTException
Deprecated.  

Wait for the given HttpContentOperation object to move to a "done" status. Uses time-out values found in the wt.properties file. This would typically be done after calling a ContentHelper.doUpload( HttpContentOperation op ) from the client.

Supported API: false

Specified by:
waitForStatus in interface ContentService
Parameters:
op -
Returns:
HttpContentOperation
Throws:
PropertyVetoException
ContentException
InterruptedException
WTException
See Also:
HttpOperationStatus

waitForStatus

public HttpOperationItem waitForStatus(HttpOperationItem opItem)
                                throws PropertyVetoException,
                                       ContentException,
                                       InterruptedException,
                                       WTException
Deprecated.  

Wait for the given HttpOperationitem object to move to a "done" status. Uses time-out values found in the wt.properties file. This would typically be done for downloading mutliple ApplicationData objects consecutively. This would typically be done after calling a ContentHelper.doDownload( HttpContentItem opItem ) from the client.

Supported API: false

Specified by:
waitForStatus in interface ContentService
Parameters:
opItem -
Returns:
HttpOperationItem
Throws:
PropertyVetoException
ContentException
InterruptedException
WTException
See Also:
HttpOperationStatus

getFormatNames

public Vector getFormatNames()
                      throws WTException
Returns a Vector of the FormatNames in the system from DataFormat class that are applicable for ApplicationData objects.

Supported API: false

Specified by:
getFormatNames in interface ContentService
Returns:
Vector
Throws:
WTException

getContents

public ContentHolder getContents(ContentHolder holder)
                          throws WTException,
                                 PropertyVetoException
Set the cookie in an ContentHolder object to contain all ContentItems associated with it. This need to be called only once and refreshing can be done as needed.

Supported API: false

Specified by:
getContents in interface ContentService
Parameters:
holder -
Returns:
ContentHolder
Throws:
WTException
PropertyVetoException

getHttpContentOperationStatuses

public HttpContentOperation getHttpContentOperationStatuses(HttpContentOperation operation)
                                                     throws WTException,
                                                            PropertyVetoException
Deprecated.  

Set the cookie in an HttpContentOperation object to contain statuses of the individual pieces of content associated with this content operation.

Supported API: false

Specified by:
getHttpContentOperationStatuses in interface ContentService
Parameters:
operation -
Returns:
HttpContentOperation
Throws:
WTException
PropertyVetoException

getDataFormat

public DataFormat getDataFormat(String idStr)
                         throws WTException
Get a DataFormat object based on a stringified object identifier. This is used for Icon handling.

Supported API: false

Specified by:
getDataFormat in interface ContentService
Parameters:
idStr -
Returns:
DataFormat
Throws:
WTException
See Also:
ObjectIdentifier

getFormatByName

public DataFormat getFormatByName(String formatName)
                           throws WTException
Get a DataFormat object based on the formatName

Supported API: false

Specified by:
getFormatByName in interface ContentService
Parameters:
formatName -
Returns:
DataFormat
Throws:
WTException

getDataFormats

public QueryResult getDataFormats()
                           throws WTException
Deprecated.  

Get all the DataFormat objects defined in the system

Supported API: false

Specified by:
getDataFormats in interface ContentService
Returns:
QueryResult
Throws:
WTException

contentUpdate

public ContentHolder contentUpdate(ContentHolder holder,
                                   TransactionContainer txnCntr)
                            throws WTException,
                                   PropertyVetoException
This method adds, removes, and updates content based on a ContentHolder and a TransactionContainer object.

Supported API: false

Specified by:
contentUpdate in interface ContentService
Parameters:
holder -
txnCntr -
Returns:
ContentHolder
Throws:
WTException
PropertyVetoException
See Also:
TransactionContainer

contentUpdateUpload

public ContentHolder contentUpdateUpload(ContentHolder holder,
                                         TransactionContainer txnCntr)
                                  throws WTException,
                                         PropertyVetoException
Deprecated.  

This method adds, removes, and updates content based on a ContentHolder and a TransactionContainer object. It also sets up an HttpContentOperation object for a corresponding upload of the marked ApplicationData objects.

Supported API: false

Specified by:
contentUpdateUpload in interface ContentService
Parameters:
holder -
txnCntr -
Returns:
ContentHolder
Throws:
WTException
PropertyVetoException
See Also:
TransactionContainer, HttpContentOperation, ApplicationData

contentUpdateDownload

public ContentHolder contentUpdateDownload(ContentHolder holder,
                                           TransactionContainer txnCntr)
                                    throws WTException,
                                           PropertyVetoException
Deprecated.  

TThis method adds, removes, and updates content based on a ContentHolder and a TransactionContainer object. It also sets up an HttpContentOperation object for a corresponding download of the marked ApplicationData objects.

Supported API: false

Specified by:
contentUpdateDownload in interface ContentService
Parameters:
holder -
txnCntr -
Returns:
ContentHolder
Throws:
WTException
PropertyVetoException
See Also:
TransactionContainer, HttpContentOperation, ApplicationData

updateAppData

public ApplicationData updateAppData(ContentHolder holder,
                                     ApplicationData appData)
                              throws WTException,
                                     PropertyVetoException
This method updates an ApplicationData without changing the timestamp. Meant to only be used after the download of content on a checkout. (i.e to update the Path and the Checksum of the AppData)

Supported API: false

Specified by:
updateAppData in interface ContentService
Parameters:
holder -
appData -
Returns:
ApplicationData
Throws:
WTException
PropertyVetoException

getPrimary

public ContentItem getPrimary(FormatContentHolder holder)
                       throws WTException,
                              PropertyVetoException
Deprecated.  

Get the primary ContentItem for the passed FormatContentHolder. This method does not appear to work at this time so it is deprecated at release 6.0 in favor of ContentHelper.getPrimary.

Supported API: false

Specified by:
getPrimary in interface ContentService
Parameters:
holder -
Returns:
ContentItem
Throws:
WTException
PropertyVetoException

copyContent

public ContentHolder copyContent(ContentHolder copyFrom,
                                 ContentHolder copyTo)
                          throws WTException,
                                 PropertyVetoException
Copy all the content from one content holder to another (not regarding the content role. This will not do the copy unless there are NO content items for the passed ContentHolder (should be a new holder)

This method returns the ContentHolder with the cookie populated (so the ContentHelper methods will work after a call to it)

NOTE - this shares the actual file streams. The files are not actually duplicated

Supported API: false

Specified by:
copyContent in interface ContentService
Parameters:
copyFrom -
copyTo -
Returns:
ContentHolder
Throws:
WTException
PropertyVetoException

copyContentItem

public ContentItem copyContentItem(ContentHolder holder,
                                   ContentItem item)
                            throws WTException,
                                   PropertyVetoException
Make an exact copy of the ContentItem for the passed holder. This includes the role, so an exception will be thrown if you try to copy a primary and a primary already exists for the passed ContentHolder.

The passed ContentItem should be queried from another ContentHolder. This method returns the newly created ContentItem

NOTE - this shares the actual file streams. The files are not actually duplicated

Supported API: false

Specified by:
copyContentItem in interface ContentService
Parameters:
holder -
item -
Returns:
ContentItem
Throws:
WTException
PropertyVetoException

getContentsByRole

public QueryResult getContentsByRole(ContentHolder holder,
                                     ContentRoleType role)
                              throws WTException
Query for all the associated ContentItems that have the passed Role for the ContentHolder.

Supported API: false

Specified by:
getContentsByRole in interface ContentService
Parameters:
holder -
role -
Returns:
QueryResult
Throws:
WTException

getThumbnail

public ApplicationData getThumbnail(ContentHolder contentHolder)
                             throws WTException
Get an associated Thumbnail content item for the passed ContentHolder. If no thumbnail found, returns null. If more than one thumbnail found, returns only one and throws a ContentException to indicate multiple thumbnails were found.

Supported API: false

Specified by:
getThumbnail in interface ContentService
Parameters:
contentHolder -
Returns:
ApplicationData
Throws:
WTException

getContents

public HashMap getContents(HashMap holders)
                    throws WTException,
                           PropertyVetoException
Set the cookie in an every ContentHolder object in HashMap to contain all ContentItems associated with it. This need to be called only once and refreshing can be done as needed.

Supported API: false

Specified by:
getContents in interface ContentService
Parameters:
holders -
Returns:
HashMap
Throws:
WTException
PropertyVetoException

get3DThumbnail

public ApplicationData get3DThumbnail(ContentHolder contentHolder)
                               throws WTException
Get an associated Thumbnail content item for the passed ContentHolder. If no thumbnail found, returns null. If more than one thumbnail found, returns only one and throws a ContentException to indicate multiple thumbnails were found.

Supported API: false

Specified by:
get3DThumbnail in interface ContentService
Parameters:
contentHolder -
Returns:
ApplicationData
Throws:
WTException

getPrimaryContent

public ContentItem getPrimaryContent(ObjectReference formatContentHolderRef)
                              throws WTException
Get the primary ContentItem for the passed reference to a ContentHolder. This method eliminates the need to inflate formatContentHolderRef for performance reasons.

Supported API: false

Specified by:
getPrimaryContent in interface ContentService
Parameters:
formatContentHolderRef -
Returns:
ContentItem
Throws:
WTException

getContentsByRole

public WTKeyedMap getContentsByRole(WTSet holderSet,
                                    ContentRoleType role)
                             throws WTException
Query for all the associated ContentItems that have the passed Role for the ContentHolder.

Supported API: false

Specified by:
getContentsByRole in interface ContentService
Parameters:
holderSet -
role -
Returns:
WTKeyedMap
Throws:
WTException

copyContent

public void copyContent(WTKeyedMap old2newMapping)
                 throws WTException,
                        PropertyVetoException
Copy all the content from one content holder to another (not regarding the content role. The keys in the input map are the original ContentHolder objects while the values are the new copy of ContentHolder objects. NOTE - this shares the actual file streams. The files are not actually duplicated

Supported API: false

Specified by:
copyContent in interface ContentService
Parameters:
old2newMapping -
Throws:
WTException
PropertyVetoException

copyContentItemsNoRoleCheck

public void copyContentItemsNoRoleCheck(WTKeyedMap holderToItemMap)
                                 throws WTException,
                                        PropertyVetoException
Make a copy of the ContentItem objects for the corresponding ContentHolder objects.

This method does not check for Content Role and does not enforce uniqueness of content with RIMARY role.

NOTE - this shares the actual file streams. The files are not actually duplicated

Supported API: false

Specified by:
copyContentItemsNoRoleCheck in interface ContentService
Parameters:
holderToItemMap - A map between recipient ContentHolder objects and WTSet instances filled with ContentItem objects to be copied.

Throws:
WTException
PropertyVetoException

processCleanupLinkMultiObjectEvent

protected void processCleanupLinkMultiObjectEvent(WTKeyedMap target)
                                           throws WTException
CLEANUP_LINK event will be fired when a content holder (e.g. WTDocument) is deleted. It will also be fired when a content item is removed from a content holder. For each of the ContentHolder in the Map, we need to delete the associated HttpContentOperation objects [could be multiple]. And for each ContentHolder, we need to get its associated ContentItem and delete it (also delete the "stream" object corresponding with the ContentItem if it is ApplicationData). NOTE: the Map is set up in StandardPersistentManager.processRemoveOids(). The Map's keys are ObjectIdentifier and the values are WTSet of link object ids.

Throws:
WTException

addItemToHolder

private void addItemToHolder(ContentHolder holder,
                             ContentItem item,
                             WTKeyedMap holders,
                             HashSet itemIds,
                             HashSet streamIds)

lockObjects

private void lockObjects(HashSet objs,
                         Class objCl)
                  throws WTException
Throws:
WTException

getLockContentItemSet

private WTKeyedMap getLockContentItemSet(WTCollection holders)
                                  throws WTException
Throws:
WTException

lockStoredItems

private void lockStoredItems(WTCollection cItems)
                      throws WTException
Throws:
WTException

processNewIterationMultiObjectEvent

private void processNewIterationMultiObjectEvent(WTCollection newHolders)
                                          throws WTException
Throws:
WTException

copyContentFromMultiHolders

private void copyContentFromMultiHolders(WTKeyedMap old2newMapping)
                                  throws WTException,
                                         PropertyVetoException
Throws:
WTException
PropertyVetoException

CopyAggregateContentForHolder

private void CopyAggregateContentForHolder(Aggregate agg)
                                    throws WTException
Throws:
WTException

processPostMultiCopyEvent

private void processPostMultiCopyEvent(WTKeyedMap target,
                                       Map copyRulesMap)
                                throws WTException
Throws:
WTException

initProperties

private void initProperties()
                     throws WTException,
                            IOException
Throws:
WTException
IOException

cacheDataFormatInfo

private static void cacheDataFormatInfo()
                                 throws WTException
Throws:
WTException

processPostRefreshEvent

protected void processPostRefreshEvent(Persistable target)
                                throws WTException,
                                       WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

processPostRefreshMultiObjectEvent

protected void processPostRefreshMultiObjectEvent(WTCollection targets)
                                           throws WTException
Throws:
WTException

processPostDeleteEvent

protected void processPostDeleteEvent(Persistable target)
                               throws WTException
Throws:
WTException

processPostDeleteMultiObjectEvent

protected void processPostDeleteMultiObjectEvent(WTCollection targets)
                                          throws WTException
Throws:
WTException

processCleanupLinkEvent

protected void processCleanupLinkEvent(Persistable target,
                                       Persistable plink)
                                throws WTException
Throws:
WTException

setFormatContentHolderFormat

private void setFormatContentHolderFormat(FormatContentHolder holder)
                                   throws WTException
Throws:
WTException

processPreStoreEvent

protected void processPreStoreEvent(Persistable target)
                             throws WTException
Throws:
WTException

processPreStoreMultiObjectEvent

protected void processPreStoreMultiObjectEvent(WTCollection targets)
                                        throws WTException
This method sets the format for all the FormatContentHolder in the collection.

Throws:
WTException

processPostStoreEvent

protected void processPostStoreEvent(Persistable target)
                              throws WTException
Throws:
WTException

processPostStoreMultiObjectEvent

protected void processPostStoreMultiObjectEvent(WTCollection targets)
                                         throws WTException
Throws:
WTException

processNewIterationEvent

protected void processNewIterationEvent(ContentHolder target)
                                 throws WTException
Throws:
WTException

processPostCopyEvent

protected void processPostCopyEvent(ContentHolder orig,
                                    ContentHolder copy,
                                    CopyRules copy_rules)
                             throws WTException
Throws:
WTException

copyContentFromHolder

private void copyContentFromHolder(ContentHolder oldCH,
                                   ContentHolder target)
                            throws WTException
Throws:
WTException

resolveAgg

private Aggregate resolveAgg(Aggregate agg)
                      throws WTException,
                             WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

collectStreamedForContentItem

private void collectStreamedForContentItem(ContentItem item,
                                           boolean onDeleteEvent,
                                           WTCollection streameds)
                                    throws WTException
Throws:
WTException

cleanUpAllContent

private void cleanUpAllContent(ContentHolder holder,
                               ContentItem item,
                               boolean onDeleteEvent)
                        throws WTException
Throws:
WTException

cleanUpContent

private void cleanUpContent(ContentItem item,
                            boolean onDeleteEvent)
                     throws WTException
Throws:
WTException

cleanUpContent

private void cleanUpContent(Streamed sd,
                            boolean onDeleteEvent)
                     throws WTException
Throws:
WTException

cleanUpContent

private void cleanUpContent(WTSet cleanupContents,
                            boolean onDeleteEvent)
                     throws WTException
This method removes the contentItem objects as well as the associated streamed objects. This method takes a collection of contentItem objects, identify those that has no object references, collection those and delete them in one shot.

Throws:
WTException

setFormat

private void setFormat(ContentItem item)
                throws WTPropertyVetoException,
                       WTException
Throws:
WTPropertyVetoException
WTException

setFormat

public static void setFormat(String filename,
                             ContentItem item)
                      throws WTPropertyVetoException,
                             WTException
Throws:
WTPropertyVetoException
WTException

getFileExtension

private static String getFileExtension(String filename)

getContentStatuses

private QueryResult getContentStatuses(ContentHolder holder,
                                       boolean returnNotComplete)
                                throws WTException
Throws:
WTException

updateHolderFormat

public FormatContentHolder updateHolderFormat(FormatContentHolder holder,
                                              ContentItem item)
                                       throws WTException,
                                              PropertyVetoException
Throws:
WTException
PropertyVetoException

setFormat

private void setFormat(ContentItem item,
                       String name)
                throws WTException,
                       PropertyVetoException
Throws:
WTException
PropertyVetoException

setFileName

private void setFileName(ContentHolder holder,
                         ApplicationData appData)
                  throws WTException,
                         PropertyVetoException
Throws:
WTException
PropertyVetoException

setFileName

private void setFileName(ContentHolder holder,
                         ApplicationData appData,
                         boolean mustCreateNewFile)
                  throws WTException,
                         PropertyVetoException
Assign file name to the app data. But before the assignment, we need to make sure the filename has not been used by other app data assoicated with this content holder. This method doesn't use any caching for holder to app data mapping, so it will be slower because it will fall back to query database for

Throws:
WTException
PropertyVetoException

setFileName

private void setFileName(ContentHolder holder,
                         ApplicationData appData,
                         boolean mustCreateNewFile,
                         WTKeyedMap appDataCache)
                  throws WTException,
                         PropertyVetoException
Assign file name to the app data. But before the assignment, we need to make sure the filename has not been used by other app data assoicated with this content holder. To speed things up, we use a cache to keep track of all the app data for a holder so that we don't need to query database to test if a name has been used.

Throws:
WTException
PropertyVetoException

findCachedAppData

private ApplicationData findCachedAppData(ContentHolder holder,
                                          String appDataName,
                                          WTKeyedMap appDataCache)
Find any appData object in the hashtable for the holder that matches the input appDataName. private ApplicationData findCachedAppDataByName (ContentHolder holder, String appDataName, Hashtable appDataCache) { if (appDataCache == null) return (null); // Get the record by holder HashSet datas = (HashSet) appDataCache.get(holder); if (datas == null) return (null); // Go through the appData/String to match the input appDataName Iterator iter = datas.iterator(); ApplicationData appData; String strData; while (iter.hasNext()) { Object data = iter.next(); if (data instanceof ApplicationData) { appData = (ApplicationData) data; if (appDataName.equals(appData.getFileName())) { return (appData); } } else if (data instanceof String) { strData = (String) data; if (appDataName.equals(strData)) return (strData); } } return (null); }


updateCacheAppData

private void updateCacheAppData(WTKeyedMap appDataCache,
                                ContentHolder holder,
                                ApplicationData appData)

uploadWait

private HttpContentOperation uploadWait(HttpContentOperation op)
                                 throws InterruptedException,
                                        WTException
Throws:
InterruptedException
WTException

downloadWait

private HttpOperationItem downloadWait(HttpOperationItem opItem)
                                throws InterruptedException,
                                       WTException
Throws:
InterruptedException
WTException

checkModifyAccess

private boolean checkModifyAccess(ContentHolder holder)
                           throws WTException
Throws:
WTException

getThumbnail

private ApplicationData getThumbnail(ContentHolder contentHolder,
                                     ContentRoleType roleType)
                              throws WTException
Throws:
WTException

postMakeUnrestorable

private void postMakeUnrestorable(ContentHolder holder)
                           throws WTException
Throws:
WTException

dispatchVetoableEvent

protected void dispatchVetoableEvent(String eventType,
                                     WTKeyedHashMap holderAppDataMap)
                              throws WTException,
                                     WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

dispatchVetoableEvent

protected void dispatchVetoableEvent(ContentServiceEvent event,
                                     boolean isMultiObject)
                              throws WTException,
                                     WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

prepareStoredItemMap

private Hashtable prepareStoredItemMap(Object[][] holderDataArray)
                                throws WTException
Returns a hashtable for the mapping between stream id (key) and StoredItem (value).

Throws:
WTException