Class AnyContentsManager

java.lang.Object
eu.c6.gibraltar.api.common.AbstractManager
eu.c6.gibraltar.api.managers.contents.AnyContentsManager

public class AnyContentsManager extends AbstractManager
The Class AnyContentsManager to manage contents.
  • Constructor Details

    • AnyContentsManager

      public AnyContentsManager(AnySession anySession)
      Instantiates a new Any contents manager.
      Parameters:
      anySession - the Any user session
  • Method Details

    • getDuplicates

      public ApiDuplicatesResult getDuplicates(String searchField, List<String> printedFields) throws Exception
      Gets the duplicated contents.
      Parameters:
      searchField - the metadata field used to determine if contents are duplicates. Default if not provided is "sync.object_id"
      printedFields - list of metadata field in the result (i.e. aspect.metadata), if empty or not provided, all metadata will be returned
      Returns:
      duplicated contents result
      Throws:
      Exception - the exception
      See Also:
    • getContentLess

      public ScrollResult getContentLess(int fromIndex, List<String> printedFields) throws Exception
      Gets the contents without format.
      Parameters:
      fromIndex - the from index you want to get next 25 contents. Use ScrollResult.getTotalCount() from the result to get total count.
      printedFields - the printed fields you want to have in the result
      Returns:
      ScrollResult containing the list of abstract contents (ScrollResult.getResults()) and total count of contents ( ScrollResult.getTotalCount()).
      Throws:
      Exception - the exception
    • getContentNotIndexedItems

      public ScrollResult getContentNotIndexedItems(int fromIndex, List<String> printedFields) throws Exception
      Gets the contents not indexed.
      Parameters:
      fromIndex - the from index you want to get next 25 contents. Use ScrollResult.getTotalCount() from the result to get total count.
      printedFields - the printed fields you want to have in the result
      Returns:
      ScrollResult containing the list of abstract contents (ScrollResult.getResults()) and total count of contents ( ScrollResult.getTotalCount()).
      Throws:
      Exception - the exception
    • getSignUrl

      public ApiSignUrlResult getSignUrl(String id) throws Exception
      Get signature URL
      Returns:
      Throws:
      Exception - the exception
    • getRoomLess

      public ScrollResult getRoomLess(int fromIndex, List<String> printedFields) throws Exception
      Gets the contents not linked to any room.
      Parameters:
      fromIndex - the from index you want to get next 25 contents. Use ScrollResult.getTotalCount() from the result to get total count.
      printedFields - the printed fields you want to have in the result
      Returns:
      ScrollResult containing the list of abstract contents (ScrollResult.getResults()) and total count of contents ( ScrollResult.getTotalCount()).
      Throws:
      Exception - the exception
    • dumps

      public Map<String,ICObject> dumps(List<String> ids, int dataFlag) throws Exception
      Get dumps of contents.
      Parameters:
      ids - the contents identifiers
      dataFlag - the data flag to select data you want to have in the dump. This flag is the addition result of data flag described in ApiGetDataType.

      For example use ApiGetDataType.DATA_METADATA to get only metadata node or ApiGetDataType.DATA_METADATA+ ApiGetDataType.DATA_LOCATIONS to get metadata and locations.

      Returns:
      the list of objects corresponding to identifiers
      Throws:
      Exception - the exception
    • search

      public ScrollResult search(IApiFullTextSearchRequest request) throws Exception
      Search for contents.
      Parameters:
      request - used for search terms and location
      Returns:
      ScrollResult containing the list of abstract contents (ScrollResult.getResults()) and total count of contents ( ScrollResult.getTotalCount()).
      Throws:
      Exception - the exception if the current user is not authorized to access to specified location
    • indexDocs

      public boolean indexDocs(List<String> ids) throws Exception
      Request fulltext indexing for contents.
      Parameters:
      ids - the identifiers of contents to index
      Returns:
      false, if no content corresponding to identifier is found
      Throws:
      Exception - the exception if fulltext indexing cannot be requested
    • removeAspect

      public boolean removeAspect(String contentid, String aspectName) throws Exception
      Remove aspect
      Parameters:
      contentId - the content identifier
      aspectName - Aspect module name to remove from the content.
      Returns:
      true, if successfully updated
      Throws:
      Exception - the exception if current user is not authorized to edit attachments, attachment is not found or content is not found.
    • getVersions

      public List<ICObject> getVersions(String contentId) throws Exception
      Gets the content versions.
      Parameters:
      contentId - the content identifier of one content in the version tree
      Returns:
      the versions as list of CObject with :
      • contentId : String. Identifier of the content
      • version : String . content version
      • isCurrent : Boolean. True if current, false otherwise
      • versionTags : List<String> of version tags
      Throws:
      Exception - the exception if current user is not authorized to access to the content or content is not found
    • getFormats

      public List<ICObject> getFormats(String contentId) throws Exception
      Gets the content formats.
      Parameters:
      contentId - the content identifier
      Returns:
      the formats as list of CObject with :
      • formatId : String. Identifier of the format
      • contentType : String . Content type
      • extension : String . Extension
      • mimeType : String . Mime type
      • size : Long . Size
      • external : Boolean . Is external or internal.
      • primary : Boolean . Is primary or secondary format.
      • status : String . "pending" or empty
      • canView : Boolean . True if current user can view the format
      Throws:
      Exception - the exception if current user is not authorized to access to the content formats or content is not found
    • getAttachments

      public List<ICObject> getAttachments(String contentId) throws Exception
      Gets the content attachments.
      Parameters:
      contentId - the content identifier
      Returns:
      the attachments as list of CObject with :
      • formatId : String. Identifier of the format
      • contentType : String . Content type
      • extension : String . Extension
      • mimeType : String . Mime type
      • size : Long . Size
      • external : Boolean . Is external or internal.
      • canView : Boolean . True if current user can view the format
      Throws:
      Exception - the exception if current user is not authorized to access to the content formats or content is not found
    • renameAttachment

      public boolean renameAttachment(String contentId, String attachmentid, String newName) throws Exception
      Rename content attachment.
      Parameters:
      contentId - the content identifier
      attachmentid - the attachment identifier. Use getAttachments(String) to get the list of attachments with identifiers.
      newName - the new attachment name
      Returns:
      true, if successfully updated
      Throws:
      Exception - the exception if current user is not authorized to edit attachments, attachment is not found or content is not found.
    • deleteAttachment

      public boolean deleteAttachment(String contentId, String attachmentid) throws Exception
      Delete content attachment.
      Parameters:
      contentId - the content identifier
      attachmentid - the attachment identifier
      Returns:
      true, if successfully deleted
      Throws:
      Exception - the exception if current user is not authorized to edit or delete attachments, attachment is not found or content is not found.
    • viewAttachment

      public InputStream viewAttachment(String contentId, String attachmentId) throws Exception
      Download format of content attachment.
      Parameters:
      contentId - the content identifier
      attachmentId - the attachment identifier
      Returns:
      the input stream response
      Throws:
      Exception - the exception if download is not correct or failed
    • download

      public InputStream download(String contentId, ApiContentEvent event, String format) throws Exception
      Download a content format.
      Parameters:
      contentId - the content id
      event - the context event for the download (see ApiContentEvent)
      format - the format to download
      Returns:
      the response
      Throws:
      Exception - the exception if download is not correct or failed
    • synchronize

      public boolean synchronize(ICObject syncMessage) throws Exception
      Synchronize content using a message sent in the synchronization queue.
      Parameters:
      syncMessage - the synchronization message (with all the required information)
      Returns:
      true, if successfully queued
      Throws:
      Exception - the exception if synchronization message is not correct or failed to queue the message
    • synchronize

      public boolean synchronize(ICObject syncMessage, File file) throws Exception
      Synchronize content using a message sent in the synchronization queue.
      Parameters:
      syncMessage - the synchronization message (with all the required information)
      file - the file to upload associated to the action described in the synchronization message
      Returns:
      true, if successfully queued
      Throws:
      Exception - the exception if synchronization message is not correct or failed to queue the message
    • synchronizeWithFormats

      public boolean synchronizeWithFormats(ICObject syncMessage, Map<String,File> allFilesByFormatId) throws Exception
      Synchronize content using a message sent in the synchronization queue containing more than one format.
      Parameters:
      syncMessage - the synchronization message (with all the required information and formats)
      allFilesByFormatId - A map with keys corresponding to each content/format ID and value corresponding to file to upload associated to the action described in the synchronization message
      Returns:
      true, if successfully queued
      Throws:
      Exception - the exception if synchronization message is not correct or failed to queue the message
    • addFormat

      public boolean addFormat(String contentId, File file) throws Exception
      Adds a format to an existing content. The format type will be detected automatically from extension.
      Parameters:
      contentId - the content identifier
      file - the file to upload
      Returns:
      true, if successfully added
      Throws:
      Exception - the exception if you are not authorized to manage formats of this content or content is not found
    • addFormatWithType

      public boolean addFormatWithType(String contentId, String type, File file) throws Exception
      Adds a format to an existing content with a specified format type.
      Parameters:
      contentId - the content identifier
      file - the file to upload
      type - format type. The format type must exist into Any.
      Returns:
      true, if successfully added
      Throws:
      Exception - the exception if you are not authorized to manage formats of this content or content is not found
    • addRelations

      public List<ICObject> addRelations(String contentId, List<String> childIds, String relationName, boolean invertRelationDirection) throws Exception
      Adds an attachment to a content.
      Parameters:
      contentId - the content identifier
      file - the attachment file
      Returns:
      true, if successful attached
      Throws:
      Exception - the exception if you are not authorized to manage attachments of this content or content is not found
    • getRelations

      public List<ICObject> getRelations(String contentId) throws Exception
      Gets the relations of a content.
      Parameters:
      contentId - the content identifier
      Returns:
      the comments as list of CObject describing the relation and the related document metadata
      Throws:
      Exception - the exception
    • deleteRelation

      public boolean deleteRelation(String contentId, String commentId) throws Exception
      Deletes a relation from a content.
      Parameters:
      contentId - the content identifier
      relationId - the relation identifier
      Returns:
      true, if successful deleted relation
      Throws:
      Exception - the exception if you are not authorized to reate a relation on this content or content is not found
    • addAttachment

      public boolean addAttachment(String contentId, File file) throws Exception
      Adds an attachment to a content.
      Parameters:
      contentId - the content identifier
      file - the attachment file
      Returns:
      true, if successful attached
      Throws:
      Exception - the exception if you are not authorized to manage attachments of this content or content is not found
    • getComments

      public List<ICObject> getComments(String contentId) throws Exception
      Gets the comments from a content.
      Parameters:
      contentId - the content identifier
      Returns:
      the comments as list of CObject with :
      • content : String. the comment
      • creator : String. comment's creator
      • creation_date : Date. comment's creation date
      • modifier : String. comment's modifier
      • modification_date : Date. comment's modification date
      • object_id : String. comment identifier
      • parent_id : String. comment's parent identifier, empty if comment is at root level
      • creator_name : String. comment's creator name
      • modifier_name : String. comment's modifier name
      • comments : List of CObject. comment replies
      Throws:
      Exception - the exception
    • getCommentsResponses

      public List<ICObject> getCommentsResponses(String contentId, String parentId) throws Exception
      Gets the comments from a content.
      Parameters:
      contentId - the content identifier
      parentId - the comment identifier to start from
      Returns:
      the comments as list of CObject with :
      • content : String. the comment
      • creator : String. comment's creator
      • creation_date : Date. comment's creation date
      • modifier : String. comment's modifier
      • modification_date : Date. comment's modification date
      • object_id : String. comment identifier
      • parent_id : String. comment's parent identifier, empty if comment is at root level
      • creator_name : String. comment's creator name
      • modifier_name : String. comment's modifier name
      • comments : List of CObject. comment replies
      Throws:
      Exception - the exception
    • getComment

      public ICObject getComment(String contentId, String commentId) throws Exception
      Gets a specific comment from a content.
      Parameters:
      contentId - the content identifier
      Returns:
      comment as CObject with :
      • content : String. the comment
      • creator : String. comment's creator
      • creation_date : Date. comment's creation date
      • modifier : String. comment's modifier
      • modification_date : Date. comment's modification date
      • object_id : String. comment identifier
      • parent_id : String. comment's parent identifier, empty if comment is at root level
      • creator_name : String. comment's creator name
      • modifier_name : String. comment's modifier name
      Throws:
      Exception - the exception
    • addComment

      public ICObject addComment(String contentId, String comment, String parentId) throws Exception
      Adds a comment to a content.
      Parameters:
      contentId - the content identifier
      comment - the comment as a string
      parentId - the comment parent identifier (optional, to reply to another comment)
      Returns:
      comment, if successful commented
      • content : String. the comment
      • creator : String. comment's creator
      • creation_date : Date. comment's creation date
      • object_id : String. comment identifier
      • parent_id : String. comment's parent identifier, empty if comment is at root level
      • creator_name : String. comment's creator name
      Throws:
      Exception - the exception if you are not authorized to comment on this content or content is not found
    • updateComment

      public ICObject updateComment(String contentId, String commentId, String comment) throws Exception
      Updates a comment from a content.
      Parameters:
      contentId - the content identifier
      commentId - the comment identifier
      comment - the comment as a string
      Returns:
      comment, if successful updated comment
      • content : String. the comment
      • creator : String. comment's creator
      • creation_date : Date. comment's creation date
      • modifier : String. comment's modifier
      • modification_date : Date. comment's modification date
      • object_id : String. comment identifier
      • parent_id : String. comment's parent identifier, empty if comment is at root level
      • creator_name : String. comment's creator name
      • modifier_name : String. comment's modifier name
      Throws:
      Exception - the exception if you are not authorized to comment on this content or content is not found
    • deleteComment

      public boolean deleteComment(String contentId, String commentId) throws Exception
      Deletes a comment from a content.
      Parameters:
      contentId - the content identifier
      commentId - the comment identifier
      Returns:
      true, if successful deleted comment
      Throws:
      Exception - the exception if you are not authorized to comment on this content or content is not found
    • postEvent

      public boolean postEvent(String contentId, String event) throws Exception
      Post an event intercepted by the lifecycle to trigger a state change if such event is listened.
      Parameters:
      contentId - the content identifier
      event - the event name triggered.
      Returns:
      true, if successfully intercepted and state change is done
      Throws:
      Exception - the exception if you are not authorized to change state of content or content is not found
    • triggerEventOtherVersions

      public boolean triggerEventOtherVersions(String contentId, String event) throws Exception
      Post an event intercepted by each other content versions to trigger a state change if such event is listened by the lifecycle.
      Parameters:
      contentId - the content identifier
      event - the event name triggered.
      Returns:
      true, if successfully intercepted and state change is done
      Throws:
      Exception - the exception if you are not authorized to change state of version or main content is not found
    • triggerEventPackageComponents

      public boolean triggerEventPackageComponents(String contentId, String event) throws Exception
      Post an event intercepted by each package component to trigger a state change if such event is listened by the lifecycle.
      Parameters:
      contentId - the content package identifier
      event - the event name triggered.
      Returns:
      true, if successfully intercepted and state change is done
      Throws:
      Exception - the exception if you are not authorized to change state of component or main content is not found
    • triggerEventRelatedContents

      public boolean triggerEventRelatedContents(String contentId, String event, String direction, String relation) throws Exception
      Post an event intercepted by each related contents of specified relation type to trigger a state change if such event is listened by the lifecycle.
      Parameters:
      contentId - the content package identifier
      event - the event name triggered.
      direction - the direction of the relation. Direction can be "child_to_parent" or "parent_to_child";
      relation - the relation name
      Returns:
      true, if successfully intercepted and state change is done
      Throws:
      Exception - the exception if you are not authorized to change state of related content or main content is not found
    • sendNotification

      public boolean sendNotification(String contentId, String notification) throws Exception
      Send notification related to a content.
      Parameters:
      contentId - the content identifier
      notification - the notification configuration name
      Returns:
      true, if successfully sent
      Throws:
      Exception - the exception if failed to send notification
    • sendTaskWorkflow

      public ApiSendTaskResult sendTaskWorkflow(String contentid, String workflowtask, String uuid) throws Exception
      Send content into a workflow task
      Returns:
      true, if the content has been sent to workflow task and the workflow supervisor link Id, that can be re-used in following calls in case of parallel processing.
      Throws:
      Exception
    • sendTaskWorkflows

      public boolean sendTaskWorkflows(String contentid, List<String> workflowtasktypes) throws Exception
      Send content into a workflow task linked to another started workflow
      Parameters:
      application - Application name containing the contents.
      contentid - Id of the content.
      List - of existing Workflow task module names that need to be processed in parallel.
      Returns:
      true, if the content has been sent to workflow tasks
      Throws:
      Exception
    • applyMetadataComposer

      public boolean applyMetadataComposer(String contentId, String composer) throws Exception
      Apply metadata composer to a content.
      Parameters:
      contentId - the content identifier
      composer - the composer configuration name
      Returns:
      true, if successfully applied
      Throws:
      Exception - the exception if you are not authorized to edit this content metadata
    • applyPropagation

      public boolean applyPropagation(String contentId, String propagation) throws Exception
      Apply propagation.
      Parameters:
      contentId - the content id
      propagation - the propagation configuration name
      Returns:
      true, if successfully applied
      Throws:
      Exception - the exception if failed to apply propagation
    • archiveContent

      public boolean archiveContent(String contentId) throws Exception
      Archive content.
      Parameters:
      contentId - the content identifier
      Returns:
      true, if successfully archived
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • getContentDialog

      public ICObject getContentDialog(String contentId) throws Exception
      Get dialog for metadata update
      Parameters:
      contentId - the content identifier
      Returns:
      the dialog JSON for selected content
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • getCreateContentDialog

      public ICObject getCreateContentDialog(String templateObjectID, String roomID, String folderPath) throws Exception
      Get dialog for content creation
      Parameters:
      template_object_id - ID of the object to use as template for this creation
      room_id - Room id to link the content in
      folderPath - Optional path of the folder to link the content in
      Returns:
      the creation dialog JSON for selected template
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • getTemplateList

      public List<ICObject> getTemplateList(String roomID) throws Exception
      Get available templates for content creation
      Parameters:
      rromID - room ID in order to get the available templates in the context of this room
      Returns:
      the list of available templates
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • getImportContentDialog

      public ICObject getImportContentDialog(String inheritedObjectId, String roomID, String folderPath) throws Exception
      Get dialog for content import
      Parameters:
      inherited_object_id - ID of the object to inherit from - Optional
      room_id - Room id to link the content in
      folderPath - Optional path of the folder to link the content in
      Returns:
      the creation dialog JSON for selected template
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • importContent

      public String importContent(Map<String,Object> metadata, String inheritedObjectID, String roomID, String folderPath, String flowStepId, File file) throws Exception
      Import content
      Parameters:
      metadata - the metadata of new content. Map of keys/values corresponding to each metadata to set. The metadata name must match the pattern "<aspect>.<name>" (ex : standard.subject)
      inheritedObjectID - Optional id of the content to inherit metadata from
      roomID - Room id to link the content in
      folderPath - Optional path of the folder to link the content in
      flowStepID - the flow step returned by the getdialog method
      file - the file associated to your new content
      Returns:
      the identifier of the new content
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • getDataValues

      public List<ICObject> getDataValues(String name, String fieldKey, String fieldLabel, List<IPredicate> filters, Map<String,Object> metadata) throws Exception
      Get data list values
      Parameters:
      name - Name of the data list
      fieldKey - Column of the data list to use as value in the response
      fieldLabel - Column of the data list to use as label in the response
      filters - Filters to filter the data list results
      metadata - Metadata used by wildcard expressions in filters
      Returns:
      the creation dialog JSON for selected template
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • pdfTransformationRequest

      public boolean pdfTransformationRequest(String contentId) throws Exception
      PDF transformation request.
      Parameters:
      contentId - the content identifier
      Returns:
      true, if successfully requested
      Throws:
      Exception - the exception if you are not authorized to request format transformation.
    • queueSynchronization

      public boolean queueSynchronization(String contentId) throws Exception
      Sends the contents in the export synchronization queue
      Parameters:
      contentId - the content identifier
      Returns:
      true, if content is successfully sent in the queue
      Throws:
      Exception - the exception if current user is not authorized to execute the action, cannot access to the content or failed to queue content
    • lifecycleChangeState

      public boolean lifecycleChangeState(String contentId, String lifecycle, String targetState) throws Exception
      Get content lifecycle next states.
      Parameters:
      contentId - the content identifier
      lifecycle - (Nullable) the lifecycle configuration name if you want to initialize or use a specific lifecycle. Set it to NULL if you want to use default lifecycle associated to the content.
      targetState - the target state.
      Returns:
      true, if change state is successful. If target state is not a valid next state or change state conditions are not valid, the change state is not applied and return false.
      Throws:
      Exception - the exception if current user is not authorized to change state of content or content is not found
    • getLifecycleNextStates

      public List<String> getLifecycleNextStates(String contentId, String lifecycle) throws Exception
      Changes content lifecycle state.
      Parameters:
      contentId - the content identifier
      lifecycle - (Nullable) the lifecycle configuration name if you want to initialize or use a specific lifecycle. Set it to NULL if you want to use default lifecycle associated to the content.
      targetState - the target state.
      Returns:
      true, if change state is successful. If target state is not a valid next state or change state conditions are not valid, the change state is not applied and return false.
      Throws:
      Exception - the exception if current user is not authorized to change state of content or content is not found
    • setMetadataList

      public boolean setMetadataList(String contentId, String metadata, String mode, List<String> values) throws Exception
      Sets a multiple values metadata.
      Parameters:
      contentId - the content identifier
      metadata - the metadata name to update. The metadata name must match the pattern "<aspect>.<name>" (ex : standard.keywords)
      mode - the update mode. Possible values are :
      • insert : insert values before current values
      • append : append values after current values
      • truncate_set : replace current values
      values - the values to set
      Returns:
      true, if metadata is valid and successfully updated with all values.
      Throws:
      Exception - the exception if current user is not authorized to edit metadata of content, content is not found or values are not correct
    • setMetadata

      public boolean setMetadata(String contentId, String metadata, String value) throws Exception
      Sets a single value metadata.
      Parameters:
      contentId - the content identifier
      metadata - the metadata name to update. The metadata name must match the pattern "<aspect>.<name>" (ex : standard.title)
      value - the value to set
      Returns:
      true, if metadata is valid and successfully updated
      Throws:
      Exception - the exception if current user is not authorized to edit metadata of content, content is not found or value is not correct
    • setVersion

      public boolean setVersion(String contentId, ApiVersionType type, File file) throws Exception
      Sets or creates a content version.
      Parameters:
      contentId - the content identifier
      type - the version type. Possible value are :
      Returns:
      true, if version is successfully updated or new version is created
      Throws:
      Exception - the exception if current user is not authorized to create content version or content is not found
    • setVersion

      public boolean setVersion(String contentId, ApiVersionType type) throws Exception
      Sets or creates a content version.
      Parameters:
      contentId - the content identifier
      type - the version type. Possible value are :
      Returns:
      true, if version is successfully updated or new version is created
      Throws:
      Exception - the exception if current user is not authorized to create content version or content is not found
    • deleteOtherVersions

      public boolean deleteOtherVersions(String contentId) throws Exception
      Delete other content versions.
      Parameters:
      contentId - the content identifier
      Returns:
      true, if other versions are successfully deleted or nothing to delete
      Throws:
      Exception - the exception if current user is not authorized to delete content version or content is not found
    • createContent

      public String createContent(Map<String,Object> metadata, String locationId, File file) throws Exception
      Create a content into a room/folder with specified format and metadata.
      Parameters:
      metadata - the metadata of new content. Map of keys/values corresponding to each metadata to set. The metadata name must match the pattern "<aspect>.<name>" (ex : standard.subject)
      locationId - the location identifier to link manually the content. It can be a room identifier or a folder path. Set it to NULL if you do not want to link it.
      file - the file associated to your new content
      Returns:
      the identifier of the new content
      Throws:
      Exception - the exception if you are not authorized to create the new content or error occured during creation
    • createContent

      public String createContent(Map<String,Object> metadata, String locationId, File file, String ocrLanguage, String ocrRotation) throws Exception
      Create a content into a room/folder with specified format, metadata and automated internal OCR settings.
      Parameters:
      metadata - the metadata of new content. Map of keys/values corresponding to each metadata to set. The metadata name must match the pattern "<aspect>.<name>" (ex : standard.subject)
      locationId - the location identifier to link manually the content. It can be a room identifier or a folder path. Set it to NULL if you do not want to link it.
      file - the file associated to your new content
      ocrLanguage - Specify language of content in order improve OCR recognition. Can be empty.
      ocrRotation - Specify content rotation is your content does not have correct orientation. Valid values are value from "0" to "360" degrees ("0", Null or "" means no rotation). Set it to "360" to activate automatic detection (slower).
      Returns:
      the identifier of the new content
      Throws:
      Exception - the exception if you are not authorized to create the new content or error occured during creation
    • updateContent

      public boolean updateContent(String contentId, Map<String,Object> metadata) throws Exception
      Update content with specified metadata.
      Parameters:
      contentId - the content identifier
      metadata - the metadata of new content. Map of keys/values corresponding to each metadata to set. The metadata name must match the pattern "<aspect>.<name>" (ex : standard.subject)
      Returns:
      true, if successfully updated
      Throws:
      Exception - the exception if you are not authorized to edit this content properties or content is not found.
    • deleteContent

      public boolean deleteContent(String contentId) throws Exception
      Delete content.
      Parameters:
      contentId - the content identifier
      Returns:
      true, if successfully deleted
      Throws:
      Exception - the exception if you are not authorized to delete this content
    • deleteAllVersionsContent

      public boolean deleteAllVersionsContent(String contentId) throws Exception
      Delete all versions content.
      Parameters:
      contentId - the content identifier of any content in the version tree
      Returns:
      true, if successfully deleted
      Throws:
      Exception - the exception if you are not authorized to delete this content
    • createTemporaryDownloadLink

      public String createTemporaryDownloadLink(String contentId, String event, String format, String locationId, String flowStepId, String attachmentId, boolean singleUse, long ttl, ChronoUnit unit) throws Exception
      Generate temporary download link for content
      Parameters:
      contentId - ID of content
      event - Type of event triggered (view, export or print), default is export
      format - Optional Format if willing to force
      locationId - Optional Location id
      flowStepId - Optional Flow step id
      attachmentId - Optional Attachment id to download attachment instead of the content itself
      singleUse - If this link is only available once
      ttl - (Time to live) after this duration the link will not be available anymore
      unit - unit of TTL
      Returns:
      The requested download link
      Throws:
      Exception
    • createTemporaryDownloadLink

      public String createTemporaryDownloadLink(String contentId, long ttl, ChronoUnit unit) throws Exception
      Generate temporary download link for content export
      Parameters:
      contentId - ID of content
      ttl - (Time to live) after this duration the link will not be available anymore
      unit - unit of TTL
      Returns:
      The requested download link
      Throws:
      Exception
    • synchronizeContentFromOCR

      public ApiOcrResult synchronizeContentFromOCR(String ocrProviderName, ICObject ocrData, File ocrFile) throws Exception
      Synchronize content from OCR
      Parameters:
      ocrProviderName - a Valid OCR provider
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizeContentFromOCRWithOperation

      public ApiOcrResult synchronizeContentFromOCRWithOperation(String ocrProviderName, String syncOperation, ICObject ocrData, File ocrFile) throws Exception
      Synchronize content from OCR with operation
      Parameters:
      ocrProviderName - a Valid OCR provider
      operation - Synchronize content operation (add, replace, update, add_format); *
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - ocrData Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizeContentFromOCRWithQueue

      public ApiOcrResult synchronizeContentFromOCRWithQueue(String ocrProviderName, String inputQueueName, ICObject ocrData, File ocrFile) throws Exception
      Synchronize content from OCR on specific queue
      Parameters:
      ocrProviderName - a Valid OCR provider
      inputQueueName - Input queue name
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - ocrData Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizeContentFromOCRWithTask

      public ApiOcrResult synchronizeContentFromOCRWithTask(String ocrProviderName, String taskType, String taskRecipient, ICObject ocrData, File ocrFile) throws Exception
      Synchronize content from OCR as task
      Parameters:
      ocrProviderName - a Valid OCR provider
      taskType - the task type (task_authoring, task_indexing, task_distribution)
      taskRecipient - the task recipient (login of the recipient)
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - ocrData Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizeContentFromOCRWithTaskQueue

      public ApiOcrResult synchronizeContentFromOCRWithTaskQueue(String ocrProviderName, String taskType, String taskRecipient, String inputQueueName, ICObject ocrData, File ocrFile) throws Exception
      Synchronize content from OCR as task on specific queue
      Parameters:
      ocrProviderName - a Valid OCR provider
      inputQueueName - the input queue name
      taskType - the task type (task_authoring, task_indexing, task_distribution)
      taskRecipient - the task recipient (login of the recipient)
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - ocrData Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizePackageFromOCR

      public ApiOcrResult synchronizePackageFromOCR(String ocrProviderName, ICObject ocrData, File ocrFile) throws Exception
      Parameters:
      ocrProviderName - a Valid OCR provider
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizePackageFromOCRWithQueue

      public ApiOcrResult synchronizePackageFromOCRWithQueue(String ocrProviderName, String inputQueueName, ICObject ocrData, File ocrFile) throws Exception
      Synchronize package from OCR on specific queue
      Parameters:
      ocrProviderName - a Valid OCR provider
      inputQueueName - Input queue name
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - ocrData Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizePackageFromOCRWithTask

      public ApiOcrResult synchronizePackageFromOCRWithTask(String ocrProviderName, String taskType, String taskRecipient, ICObject ocrData, File ocrFile) throws Exception
      Synchronize package from OCR as task
      Parameters:
      ocrProviderName - a Valid OCR provider
      taskType - the task type (task_authoring, task_indexing, task_distribution)
      taskRecipient - the task recipient (login of the recipient)
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - ocrData Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • synchronizePackageFromOCRWithTaskQueue

      public ApiOcrResult synchronizePackageFromOCRWithTaskQueue(String ocrProviderName, String taskType, String taskRecipient, String inputQueueName, ICObject ocrData, File ocrFile) throws Exception
      Synchronize package from OCR as task on specific queue
      Parameters:
      ocrProviderName - a Valid OCR provider
      inputQueueName - the input queue name
      taskType - the task type (task_authoring, task_indexing, task_distribution)
      taskRecipient - the task recipient (login of the recipient)
      ocrData - OCR data compatible with specified provider. Will be parsed by provider on server side to compute metadata.
      ocrFile - ocrData Synchronized file
      Returns:
      OCR synchronization result.
      Throws:
      Exception
    • seal

      public boolean seal(String contentid) throws Exception
      Seal content
      Parameters:
      contentid - Id of the content.
      Returns:
      true if sealed, false otherwise.
      Throws:
      Exception
    • hold

      public boolean hold(String contentid) throws Exception
      Hold content
      Parameters:
      contentid - Id of the content.
      Returns:
      true if hold, false otherwise.
      Throws:
      Exception
    • subscribe

      public void subscribe(String contentid, List<String> users, List<String> groups, List<String> metadata) throws Exception
      Subscribe to content
      Parameters:
      contentid - Id of the content.
      users - Optional List of users (id, name or login), each will subscribe to this content updates (ex: ["User 01", "user02"]). Set NULL or empty if not used.
      groups - Optional Each member of this list of groups will subscribe to this content updates (ex: ["managers"]). Set NULL or empty if not used.
      metadata - Optional List of metadata from which a list of users will be extracted and will subscribe to this content updates (ex: ["standard.authors"]). Set NULL or empty if not used.
      Throws:
      Exception
    • isSubscribedContent

      public boolean isSubscribedContent(String contentid, String login) throws Exception
      Test if a user has subscribed to a content
      Parameters:
      contentid - Id of the content.
      login - User login to test
      Throws:
      Exception
    • getTransformationRequest

      public javax.ws.rs.core.Response getTransformationRequest() throws Exception
      Dequeue transformation message request
      Returns:
      Returns the output content transformed (content-disposition: attachment)
      Throws:
      Exception
    • getWaitingDocument

      public javax.ws.rs.core.Response getWaitingDocument() throws Exception
      Dequeue synchronization message request
      Returns:
      Returns the synchronization message using HTTP response multi-parted Form Data (file content and sync message)
      Throws:
      Exception
    • applyMetadataTransfer

      public boolean applyMetadataTransfer(String contentId) throws Exception
      Apply metadata transfer.
      Parameters:
      contentId - the content identifier
      Returns:
      true, if successfully requested and content is updated
      Throws:
      Exception - the exception if you are not authorized to apply transfer.