Class AnyContentsManager
java.lang.Object
eu.c6.gibraltar.api.common.AbstractManager
eu.c6.gibraltar.api.managers.contents.AnyContentsManager
The Class AnyContentsManager to manage contents.
-
Field Summary
Fields inherited from class eu.c6.gibraltar.api.common.AbstractManager
APPLICATION_XLS, APPLICATION_XLS_TYPE, APPLICATION_XLSX, APPLICATION_XLSX_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionAnyContentsManager(AnySession anySession) Instantiates a new Any contents manager. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAttachment(String contentId, File file) Adds an attachment to a content.addComment(String contentId, String comment, String parentId) Adds a comment to a content.booleanAdds a format to an existing content.booleanaddFormatWithType(String contentId, String type, File file) Adds a format to an existing content with a specified format type.addRelations(String contentId, List<String> childIds, String relationName, boolean invertRelationDirection) Adds an attachment to a content.booleanapplyMetadataComposer(String contentId, String composer) Apply metadata composer to a content.booleanapplyMetadataTransfer(String contentId) Apply metadata transfer.booleanapplyPropagation(String contentId, String propagation) Apply propagation.booleanarchiveContent(String contentId) Archive content.Create a content into a room/folder with specified format and metadata.createContent(Map<String, Object> metadata, String locationId, File file, String ocrLanguage, String ocrRotation) Create a content into a room/folder with specified format, metadata and automated internal OCR settings.createTemporaryDownloadLink(String contentId, long ttl, ChronoUnit unit) Generate temporary download link for content exportcreateTemporaryDownloadLink(String contentId, String event, String format, String locationId, String flowStepId, String attachmentId, boolean singleUse, long ttl, ChronoUnit unit) Generate temporary download link for contentbooleandeleteAllVersionsContent(String contentId) Delete all versions content.booleandeleteAttachment(String contentId, String attachmentid) Delete content attachment.booleandeleteComment(String contentId, String commentId) Deletes a comment from a content.booleandeleteContent(String contentId) Delete content.booleandeleteOtherVersions(String contentId) Delete other content versions.booleandeleteRelation(String contentId, String commentId) Deletes a relation from a content.download(String contentId, ApiContentEvent event, String format) Download a content format.Get dumps of contents.getAttachments(String contentId) Gets the content attachments.getComment(String contentId, String commentId) Gets a specific comment from a content.getComments(String contentId) Gets the comments from a content.getCommentsResponses(String contentId, String parentId) Gets the comments from a content.getContentDialog(String contentId) Get dialog for metadata updategetContentLess(int fromIndex, List<String> printedFields) Gets the contents without format.getContentNotIndexedItems(int fromIndex, List<String> printedFields) Gets the contents not indexed.getCreateContentDialog(String templateObjectID, String roomID, String folderPath) Get dialog for content creationgetDataValues(String name, String fieldKey, String fieldLabel, List<IPredicate> filters, Map<String, Object> metadata) Get data list valuesgetDuplicates(String searchField, List<String> printedFields) Gets the duplicated contents.getFormats(String contentId) Gets the content formats.getImportContentDialog(String inheritedObjectId, String roomID, String folderPath) Get dialog for content importgetLifecycleNextStates(String contentId, String lifecycle) Changes content lifecycle state.getRelations(String contentId) Gets the relations of a content.getRoomLess(int fromIndex, List<String> printedFields) Gets the contents not linked to any room.getSignUrl(String id) Get signature URLgetTemplateList(String roomID) Get available templates for content creationjavax.ws.rs.core.ResponseDequeue transformation message requestgetVersions(String contentId) Gets the content versions.javax.ws.rs.core.ResponseDequeue synchronization message requestbooleanHold contentimportContent(Map<String, Object> metadata, String inheritedObjectID, String roomID, String folderPath, String flowStepId, File file) Import contentbooleanRequest fulltext indexing for contents.booleanisSubscribedContent(String contentid, String login) Test if a user has subscribed to a contentbooleanlifecycleChangeState(String contentId, String lifecycle, String targetState) Get content lifecycle next states.booleanpdfTransformationRequest(String contentId) PDF transformation request.booleanPost an event intercepted by the lifecycle to trigger a state change if such event is listened.booleanqueueSynchronization(String contentId) Sends the contents in the export synchronization queuebooleanremoveAspect(String contentid, String aspectName) Remove aspectbooleanrenameAttachment(String contentId, String attachmentid, String newName) Rename content attachment.booleanSeal contentsearch(IApiFullTextSearchRequest request) Search for contents.booleansendNotification(String contentId, String notification) Send notification related to a content.sendTaskWorkflow(String contentid, String workflowtask, String uuid) Send content into a workflow taskbooleansendTaskWorkflows(String contentid, List<String> workflowtasktypes) Send content into a workflow task linked to another started workflowbooleansetMetadata(String contentId, String metadata, String value) Sets a single value metadata.booleanSets a multiple values metadata.booleansetVersion(String contentId, ApiVersionType type) Sets or creates a content version.booleansetVersion(String contentId, ApiVersionType type, File file) Sets or creates a content version.voidSubscribe to contentbooleansynchronize(ICObject syncMessage) Synchronize content using a message sent in the synchronization queue.booleansynchronize(ICObject syncMessage, File file) Synchronize content using a message sent in the synchronization queue.synchronizeContentFromOCR(String ocrProviderName, ICObject ocrData, File ocrFile) Synchronize content from OCRsynchronizeContentFromOCRWithOperation(String ocrProviderName, String syncOperation, ICObject ocrData, File ocrFile) Synchronize content from OCR with operationsynchronizeContentFromOCRWithQueue(String ocrProviderName, String inputQueueName, ICObject ocrData, File ocrFile) Synchronize content from OCR on specific queuesynchronizeContentFromOCRWithTask(String ocrProviderName, String taskType, String taskRecipient, ICObject ocrData, File ocrFile) Synchronize content from OCR as tasksynchronizeContentFromOCRWithTaskQueue(String ocrProviderName, String taskType, String taskRecipient, String inputQueueName, ICObject ocrData, File ocrFile) Synchronize content from OCR as task on specific queuesynchronizePackageFromOCR(String ocrProviderName, ICObject ocrData, File ocrFile) synchronizePackageFromOCRWithQueue(String ocrProviderName, String inputQueueName, ICObject ocrData, File ocrFile) Synchronize package from OCR on specific queuesynchronizePackageFromOCRWithTask(String ocrProviderName, String taskType, String taskRecipient, ICObject ocrData, File ocrFile) Synchronize package from OCR as tasksynchronizePackageFromOCRWithTaskQueue(String ocrProviderName, String taskType, String taskRecipient, String inputQueueName, ICObject ocrData, File ocrFile) Synchronize package from OCR as task on specific queuebooleansynchronizeWithFormats(ICObject syncMessage, Map<String, File> allFilesByFormatId) Synchronize content using a message sent in the synchronization queue containing more than one format.booleantriggerEventOtherVersions(String contentId, String event) Post an event intercepted by each other content versions to trigger a state change if such event is listened by the lifecycle.booleantriggerEventPackageComponents(String contentId, String event) Post an event intercepted by each package component to trigger a state change if such event is listened by the lifecycle.booleantriggerEventRelatedContents(String contentId, String event, String direction, String relation) 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.updateComment(String contentId, String commentId, String comment) Updates a comment from a content.booleanupdateContent(String contentId, Map<String, Object> metadata) Update content with specified metadata.viewAttachment(String contentId, String attachmentId) Download format of content attachment.
-
Constructor Details
-
AnyContentsManager
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
Gets the contents without format.- Parameters:
fromIndex- the from index you want to get next 25 contents. UseScrollResult.getTotalCount()from the result to get total count.printedFields- the printed fields you want to have in the result- Returns:
ScrollResultcontaining 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. UseScrollResult.getTotalCount()from the result to get total count.printedFields- the printed fields you want to have in the result- Returns:
ScrollResultcontaining the list of abstract contents (ScrollResult.getResults()) and total count of contents (ScrollResult.getTotalCount()).- Throws:
Exception- the exception
-
getSignUrl
Get signature URL- Returns:
- Throws:
Exception- the exception
-
getRoomLess
Gets the contents not linked to any room.- Parameters:
fromIndex- the from index you want to get next 25 contents. UseScrollResult.getTotalCount()from the result to get total count.printedFields- the printed fields you want to have in the result- Returns:
ScrollResultcontaining the list of abstract contents (ScrollResult.getResults()) and total count of contents (ScrollResult.getTotalCount()).- Throws:
Exception- the exception
-
dumps
Get dumps of contents.- Parameters:
ids- the contents identifiersdataFlag- the data flag to select data you want to have in the dump. This flag is the addition result of data flag described inApiGetDataType.For example use
ApiGetDataType.DATA_METADATAto get only metadata node orApiGetDataType.DATA_METADATA+ApiGetDataType.DATA_LOCATIONSto get metadata and locations.- Returns:
- the list of objects corresponding to identifiers
- Throws:
Exception- the exception
-
search
Search for contents.- Parameters:
request- used for search terms and location- Returns:
ScrollResultcontaining 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
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
Remove aspect- Parameters:
contentId- the content identifieraspectName- 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
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
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
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 identifierattachmentid- the attachment identifier. UsegetAttachments(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
Delete content attachment.- Parameters:
contentId- the content identifierattachmentid- 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
Download format of content attachment.- Parameters:
contentId- the content identifierattachmentId- 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 idevent- the context event for the download (seeApiContentEvent)format- the format to download- Returns:
- the response
- Throws:
Exception- the exception if download is not correct or failed
-
synchronize
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
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 ExceptionSynchronize 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
Adds a format to an existing content. The format type will be detected automatically from extension.- Parameters:
contentId- the content identifierfile- 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
Adds a format to an existing content with a specified format type.- Parameters:
contentId- the content identifierfile- the file to uploadtype- 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 identifierfile- 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
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
Deletes a relation from a content.- Parameters:
contentId- the content identifierrelationId- 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
Adds an attachment to a content.- Parameters:
contentId- the content identifierfile- 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
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
Gets the comments from a content.- Parameters:
contentId- the content identifierparentId- 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
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
Adds a comment to a content.- Parameters:
contentId- the content identifiercomment- the comment as a stringparentId- 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
Updates a comment from a content.- Parameters:
contentId- the content identifiercommentId- the comment identifiercomment- 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
Deletes a comment from a content.- Parameters:
contentId- the content identifiercommentId- 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
Post an event intercepted by the lifecycle to trigger a state change if such event is listened.- Parameters:
contentId- the content identifierevent- 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
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 identifierevent- 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
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 identifierevent- 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 identifierevent- 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
Send notification related to a content.- Parameters:
contentId- the content identifiernotification- 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
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
Apply metadata composer to a content.- Parameters:
contentId- the content identifiercomposer- the composer configuration name- Returns:
- true, if successfully applied
- Throws:
Exception- the exception if you are not authorized to edit this content metadata
-
applyPropagation
Apply propagation.- Parameters:
contentId- the content idpropagation- the propagation configuration name- Returns:
- true, if successfully applied
- Throws:
Exception- the exception if failed to apply propagation
-
archiveContent
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
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 creationroom_id- Room id to link the content infolderPath- 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
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 - Optionalroom_id- Room id to link the content infolderPath- 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 ExceptionImport 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 fromroomID- Room id to link the content infolderPath- Optional path of the folder to link the content inflowStepID- the flow step returned by the getdialog methodfile- 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 ExceptionGet data list values- Parameters:
name- Name of the data listfieldKey- Column of the data list to use as value in the responsefieldLabel- Column of the data list to use as label in the responsefilters- Filters to filter the data list resultsmetadata- 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
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
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 identifierlifecycle- (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
Changes content lifecycle state.- Parameters:
contentId- the content identifierlifecycle- (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 identifiermetadata- 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
Sets a single value metadata.- Parameters:
contentId- the content identifiermetadata- 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
Sets or creates a content version.- Parameters:
contentId- the content identifiertype- the version type. Possible value are :ApiVersionType.SAME: override existing versionApiVersionType.MINOR: create a new minor versionApiVersionType.MAJOR: create a new minor versionApiVersionType.UPGRADE_TO_MAJOR: upgrade version to major version but do not create a new versionApiVersionType.UPGRADE_TO_MINOR: upgrade version to minor version but do not create a new version
- 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
Sets or creates a content version.- Parameters:
contentId- the content identifiertype- the version type. Possible value are :ApiVersionType.SAME: override existing versionApiVersionType.MINOR: create a new minor versionApiVersionType.MAJOR: create a new minor versionApiVersionType.UPGRADE_TO_MAJOR: upgrade version to major version but do not create a new versionApiVersionType.UPGRADE_TO_MINOR: upgrade version to minor version but do not create a new version
- 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
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 ExceptionCreate 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 ExceptionCreate 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 contentocrLanguage- 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
Update content with specified metadata.- Parameters:
contentId- the content identifiermetadata- 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
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
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 contentevent- Type of event triggered (view, export or print), default is exportformat- Optional Format if willing to forcelocationId- Optional Location idflowStepId- Optional Flow step idattachmentId- Optional Attachment id to download attachment instead of the content itselfsingleUse- If this link is only available oncettl- (Time to live) after this duration the link will not be available anymoreunit- 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 contentttl- (Time to live) after this duration the link will not be available anymoreunit- 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 providerocrData- 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 provideroperation- 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 providerinputQueueName- Input queue nameocrData- 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 providertaskType- 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 providerinputQueueName- the input queue nametaskType- 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 providerocrData- 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 providerinputQueueName- Input queue nameocrData- 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 providertaskType- 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 providerinputQueueName- the input queue nametaskType- 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
Seal content- Parameters:
contentid- Id of the content.- Returns:
- true if sealed, false otherwise.
- Throws:
Exception
-
hold
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
Test if a user has subscribed to a content- Parameters:
contentid- Id of the content.login- User login to test- Throws:
Exception
-
getTransformationRequest
Dequeue transformation message request- Returns:
- Returns the output content transformed (content-disposition: attachment)
- Throws:
Exception
-
getWaitingDocument
Dequeue synchronization message request- Returns:
- Returns the synchronization message using HTTP response multi-parted Form Data (file content and sync message)
- Throws:
Exception
-
applyMetadataTransfer
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.
-