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
See Also:
  • Method Details

    • findContentStream

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

      Supported API: true
      Parameters:
      appData -
      Returns:
      InputStream
      Throws:
      WTException
    • writeContentStream

      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: true
      Parameters:
      appData -
      path -
      Throws:
      WTException
      IOException
    • 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:
      WTException
      IOException
    • getHtmlFormatNames

      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: true
      Returns:
      Enumeration
      Throws:
      WTException
    • updateContent

      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:
      WTException
      PropertyVetoException
      IOException
      FileNotFoundException
    • updateContent

      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 updated
      appData - - ApplicationData to be updated
      cachedContDesc - - 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/FvItem
      PropertyVetoException
    • 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:
      WTException
      PropertyVetoException
    • updateContent

      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:
      WTException
      PropertyVetoException
      IOException
      FileNotFoundException
    • 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:
      WTException
      PropertyVetoException
    • 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:
      holder -
      Returns:
      FormatContentHolder
      Throws:
      WTException
      PropertyVetoException
    • 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:
      WTException
      WTPropertyVetoException
    • updatePrimary

      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:
      WTException
      PropertyVetoException
      FileNotFoundException
      IOException
    • updatePrimary

      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:
      WTException
      PropertyVetoException
    • 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 updated
      appData - - ApplicationData to be updated
      cachedContDesc - - Feedback object from stage II of upload process
      mustCreateNewFile - - 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/FvItem
      PropertyVetoException
    • 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:
      WTException
      PropertyVetoException
      IOException
      FileNotFoundException
    • 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:
      WTException
      PropertyVetoException
    • updateContent

      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. 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:
      WTException
      PropertyVetoException
    • deleteContent

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

      Supported API: true
      Parameters:
      contentItemSet -
      Throws:
      WTException
      WTPropertyVetoException
    • updateHolderFormat

      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: true
      Parameters:
      inHolderSet -
      Returns:
      WTSet
      Throws:
      WTException
      PropertyVetoException
    • updateContent

      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:
      WTException
      PropertyVetoException
    • 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:
      WTException
      PropertyVetoException
      IOException
      FileNotFoundException