Package wt.content
Interface ContentServiceSvr
public interface ContentServiceSvr
These methods are only able to be invoked from classes running in the
server. Most of these methods are only needed by the ContentHttp class.
They are also used by the loader and the indexing modules.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteContent(ContentHolder holder, ContentItem item) Deletes the passed ContentItem for the given ContentHolder.voiddeleteContent(WTSet contentItemSet) Deletes the contents associated with the input content item set.findContentStream(ApplicationData appData) Return the stream based on a ContentHolder and an ApplicationData object.Returns the list of valid formats for ApplicationData objects in the system.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].updateContent(ContentHolder holder, Aggregate agg) Update a ContentHolder with the given Aggreate.updateContent(ContentHolder holder, ApplicationData appData, InputStream is) Update a ContentHolder based on a persisted ContentHolder and ContentItemInfo object and a new ApplicationData object and the corresponding stream to the content.updateContent(ContentHolder holder, ApplicationData appData, InputStream is, boolean mustCreateNewFile)
Supported API: trueupdateContent(ContentHolder holder, ApplicationData appData, String fullPath) Update a ContentHolder with the given content passed in with a path.updateContent(ContentHolder holder, ApplicationData appData, String fullPath, String mountType) Update a ContentHolder with the given content passed in with a path.updateContent(ContentHolder holder, ApplicationData appData, CachedContentDescriptor cachedContDesc) This API represents stage III of 3 stage upload process.updateContent(ContentHolder holder, ApplicationData appData, CachedContentDescriptor cachedContDesc, boolean mustCreateNewFile) This API represents stage III of 3 stage upload process.updateContent(ContentHolder holder, ExternalStoredData xStoredData) Update a ContentHolder with the given content passed in with a path.updateContent(ContentHolder holder, URLData urlData) Update a ContentHolder with the given content passed in with a path.This method will update the format for a FormatContentHolder based on the content in it at it's current state.updateHolderFormat(WTSet inHolderSet) This method will update the format for a FormatContentHolder based on the content in it at it's current state.updatePrimary(FormatContentHolder holder, ApplicationData appData, InputStream is) Update the primary for the passed FormatContentHolder with the passed ApplicationData and stream.updatePrimary(FormatContentHolder holder, ContentItem item) Update the primary for the passed FormatContentHolder with the passed ContentItem.voidwriteContentStream(ApplicationData appData, String path) Write out the content to a path based on a ContentHolder and an ApplicationData object.voidwriteContentStream(ApplicationData appData, String path, String mountType) Write out the content to a path.
-
Method Details
-
findContentStream
Return the stream based on a ContentHolder and an ApplicationData object.
Supported API: true- Parameters:
appData-- Returns:
- InputStream
- Throws:
WTException
-
writeContentStream
Write out the content to a path based on a ContentHolder and an ApplicationData object.
Supported API: true- Parameters:
appData-path-- Throws:
WTExceptionIOException
-
writeContentStream
void writeContentStream(ApplicationData appData, String path, String mountType) throws WTException, IOException Write out the content to a path. Mount type specifies the storage type for the path.
Supported API: true- Parameters:
appData-path-mountType-- Throws:
WTExceptionIOException
-
getHtmlFormatNames
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: true- Returns:
- Enumeration
- Throws:
WTException
-
updateContent
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: true- Parameters:
holder-appData-fullPath-- Returns:
- ApplicationData
- Throws:
WTExceptionPropertyVetoExceptionIOExceptionFileNotFoundException
-
updateContent
ApplicationData updateContent(ContentHolder holder, ApplicationData appData, CachedContentDescriptor cachedContDesc) throws WTException, PropertyVetoException This API represents stage III of 3 stage upload process.
API checks MODIFY_CONTENT permission on ContentHolder if ApplicationData has role PRIMARY/SECONDARY
API checks MODIFY permission on ContentHolder if ApplicationData has other role.
If above permissions are denied, and ContentHolder is first iteration, API checks CREATE permission.
This API sets following information on ApplicationData:
CreatedBy, ModifiedBy, DataFormat, MasteredOnReplicaItem/FvItem reference, actual file size, file name, role.
In case of multi-chapter content, delegate name is set and ApplicationData is marked as ChapteredContent.
If supplied ApplicationData is persistant, it is deleted.
ContentServiceEvent.PRE_UPLOAD event is dispatched before ApplicationData & HolderToContent are persisted.
ApplicationData and HolderToContent link are persisted. For multi-chapter content FvFraction, AppDataToFvFractionLink and StreamedToFvFractionLink are persisted.
ContentServiceEvent.POST_UPLOAD & ModifyContentSummaryEvent.ADD_CONTENT_ITEM events are dispatched at the end of transaction.
Supported API: true- Parameters:
holder- - ContentHolder object for which content is updatedappData- - ApplicationData to be updatedcachedContDesc- - Feedback object from stage II of upload process- Returns:
- ApplicationData - Updated ApplicationData
- Throws:
WTException- - Exception is thrown
if multiple PRIMARY content items found OR
if file size is zero & empty file is not allowed in system OR
if folderId from CachedContentDescriptor found negative OR
if streamdId from CachedContentDescriptor found negative OR
if MasteredOnReplicaItem/FvItem not found for given streamId OR
if content identity from ApplicationData and CachedContentDescriptor do not match
if Folder not found from MasteredOnReplicaItem/FvItemPropertyVetoException
-
updateContent
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: true- Parameters:
holder-urlData-- Returns:
- URLData
- Throws:
WTExceptionPropertyVetoException
-
updateContent
ApplicationData updateContent(ContentHolder holder, ApplicationData appData, InputStream is) throws WTException, PropertyVetoException, IOException, FileNotFoundException Update a ContentHolder based on a persisted ContentHolder and ContentItemInfo object and a new ApplicationData object and the corresponding stream to the content.
Supported API: true- Parameters:
holder-appData-is-- Returns:
- ApplicationData
- Throws:
WTExceptionPropertyVetoExceptionIOExceptionFileNotFoundException
-
updateContent
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. x
Supported API: true- Parameters:
holder-aggs-- Returns:
- Aggregate
- Throws:
WTExceptionPropertyVetoException
-
updateHolderFormat
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: true- Parameters:
holder-- Returns:
- FormatContentHolder
- Throws:
WTExceptionPropertyVetoException
-
deleteContent
void deleteContent(ContentHolder holder, ContentItem item) throws WTException, WTPropertyVetoException Deletes the passed ContentItem for the given ContentHolder.
Supported API: true- Parameters:
holder-item-- Throws:
WTExceptionWTPropertyVetoException
-
updatePrimary
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.In case of an update - the existing primary content must be removed else it would throw an exception.
Supported API: true- Parameters:
holder-appData-is-- Returns:
- ApplicationData
- Throws:
WTExceptionPropertyVetoExceptionFileNotFoundExceptionIOException
-
updatePrimary
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.In case of an update - the existing primary content must be removed else it would throw an exception.
Supported API: true- Parameters:
holder-item-- Returns:
- ContentItem
- Throws:
WTExceptionPropertyVetoException
-
updateContent
ApplicationData updateContent(ContentHolder holder, ApplicationData appData, CachedContentDescriptor cachedContDesc, boolean mustCreateNewFile) throws WTException, PropertyVetoException This API represents stage III of 3 stage upload process.
API checks MODIFY_CONTENT permission on ContentHolder if ApplicationData has role PRIMARY/SECONDARY
API checks MODIFY permission on ContentHolder if ApplicationData has other role.
If above permissions are denied, and ContentHolder is first iteration, API checks CREATE permission.
This API sets following information on ApplicationData:
CreatedBy, ModifiedBy, DataFormat, MasteredOnReplicaItem/FvItem reference, actual file size, file name, role.
In case of multi-chapter content, delegate name is set and ApplicationData is marked as ChapteredContent.
If supplied ApplicationData is persistent, it is deleted.
ContentServiceEvent.PRE_UPLOAD event is dispatched before ApplicationData & HolderToContent are persisted.
ApplicationData and HolderToContent link are persisted. For multi-chapter content FvFraction, AppDataToFvFractionLink and StreamedToFvFractionLink are persisted.
ContentServiceEvent.POST_UPLOAD & ModifyContentSummaryEvent.ADD_CONTENT_ITEM events are dispatched at the end of transaction.
Supported API: true- Parameters:
holder- - ContentHolder object for which content is updatedappData- - ApplicationData to be updatedcachedContDesc- - Feedback object from stage II of upload processmustCreateNewFile- - value used by RenameFileDelegate to generate the FileName of ApplicationData- Returns:
- ApplicationData - Updated ApplicationData
- Throws:
WTException- - Exception is thrown
if multiple PRIMARY content items found OR
if file size is zero & empty file is not allowed in system OR
if folderId from CachedContentDescriptor found negative OR
if streamdId from CachedContentDescriptor found negative OR
if MasteredOnReplicaItem/FvItem not found for given streamId OR
if content identity from ApplicationData and CachedContentDescriptor do not match
if Folder not found from MasteredOnReplicaItem/FvItemPropertyVetoException
-
updateContent
ApplicationData updateContent(ContentHolder holder, ApplicationData appData, InputStream is, boolean mustCreateNewFile) throws WTException, PropertyVetoException, IOException, FileNotFoundException
Supported API: true- Parameters:
holder-appData-is-mustCreateNewFile-- Returns:
- ApplicationData
- Throws:
WTExceptionPropertyVetoExceptionIOExceptionFileNotFoundException
-
updateContent
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. The third index object is a optional Hashtable containing ApplicationData and Map information. Map contains attributes of ApplicationData. Valid Keys in Map are ContentItem.CREATED_BY, ContentItem.MODIFIED_BY. Valid Values in Map are WTPrincipalReference. Returns an array of WTReference objects corresponding with the ApplicationData objects from the input array.
Supported API: true- Parameters:
holderDataArray-mustCreateNewFile-- Returns:
- Object[]
- Throws:
WTExceptionPropertyVetoException
-
updateContent
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. The third index object is a optional Hashtable containing ApplicationData and Map information. Map contains attributes of ApplicationData. Valid Keys in Map are ContentItem.CREATED_BY, ContentItem.MODIFIED_BY. Valid Values in Map are WTPrincipalReference. 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: true- Parameters:
holderDataArray-- Returns:
- Object[]
- Throws:
WTExceptionPropertyVetoException
-
deleteContent
Deletes the contents associated with the input content item set.
Supported API: true- Parameters:
contentItemSet-- Throws:
WTExceptionWTPropertyVetoException
-
updateHolderFormat
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: true- Parameters:
inHolderSet-- Returns:
- WTSet
- Throws:
WTExceptionPropertyVetoException
-
updateContent
ExternalStoredData updateContent(ContentHolder holder, ExternalStoredData xStoredData) 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: true- Parameters:
holder-xStoredData-- Returns:
- ExternalStoredData
- Throws:
WTExceptionPropertyVetoException
-
updateContent
ApplicationData updateContent(ContentHolder holder, ApplicationData appData, String fullPath, String mountType) 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: true- Parameters:
holder-appData-fullPath-mountType-- Returns:
- ApplicationData
- Throws:
WTExceptionPropertyVetoExceptionIOExceptionFileNotFoundException
-