Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Latest commit

 

History

History
534 lines (374 loc) · 15.2 KB

ContentApi.md

File metadata and controls

534 lines (374 loc) · 15.2 KB

ContentApi

All URIs are relative to /activiti-app/api

Method HTTP request Description
createRelatedContentOnProcessInstance POST /enterprise/process-instances/{processInstanceId}/content Attach existing content to a process instance
createRelatedContentOnProcessInstance POST /enterprise/process-instances/{processInstanceId}/raw-content Upload content and attach to a process instance
createRelatedContentOnTask POST /enterprise/tasks/{taskId}/content Attach existing content to a task
createRelatedContentOnTask POST /enterprise/tasks/{taskId}/raw-content Upload content and attach to a task
createTemporaryRawRelatedContent POST /enterprise/content/raw Upload content and create a local representation
createTemporaryRelatedContent POST /enterprise/content Create a local representation of content from a remote repository
deleteContent DELETE /enterprise/content/{contentId} Remove a local content representation
getContent GET /enterprise/content/{contentId} Get a local content representation
getRawContent GET /enterprise/content/{contentId}/rendition/{renditionType} Stream content rendition
getRawContent GET /enterprise/content/{contentId}/raw Stream content from a local content representation
getRelatedContentForProcessInstance GET /enterprise/process-instances/{processInstanceId}/content List content attached to a process instance
getRelatedContentForTask GET /enterprise/tasks/{taskId}/content List content attached to a task
getProcessesAndTasksOnContent GET enterprise/content/document-runtime Lists processes and tasks on workflow started with provided document

createRelatedContentOnProcessInstance

RelatedContentRepresentation createRelatedContentOnProcessInstance(processInstanceIdrelatedContentopts)

Attach existing content to a process instance

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);

let opts = { 
  'isRelatedContent': true //  | isRelatedContent
};

contentApi.createRelatedContentOnProcessInstance(processInstanceIdrelatedContentopts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
processInstanceId string processInstanceId
relatedContent RelatedContentRepresentation relatedContent
isRelatedContent boolean isRelatedContent [optional]

Return type

RelatedContentRepresentation

createRelatedContentOnProcessInstance

RelatedContentRepresentation createRelatedContentOnProcessInstance(processInstanceIdfileopts)

Upload content and attach to a process instance

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);

let opts = { 
  'isRelatedContent': true //  | isRelatedContent
};

contentApi.createRelatedContentOnProcessInstance(processInstanceIdfileopts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
processInstanceId string processInstanceId
file Blob file
isRelatedContent boolean isRelatedContent [optional]

Return type

RelatedContentRepresentation

createRelatedContentOnTask

RelatedContentRepresentation createRelatedContentOnTask(taskIdrelatedContentopts)

Attach existing content to a task

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);

let opts = { 
  'isRelatedContent': true //  | isRelatedContent
};

contentApi.createRelatedContentOnTask(taskIdrelatedContentopts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
taskId string taskId
relatedContent RelatedContentRepresentation relatedContent
isRelatedContent boolean isRelatedContent [optional]

Return type

RelatedContentRepresentation

createRelatedContentOnTask

RelatedContentRepresentation createRelatedContentOnTask(taskIdfileopts)

Upload content and attach to a task

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);

let opts = { 
  'isRelatedContent': true //  | isRelatedContent
};

contentApi.createRelatedContentOnTask(taskIdfileopts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
taskId string taskId
file Blob file
isRelatedContent boolean isRelatedContent [optional]

Return type

RelatedContentRepresentation

createTemporaryRawRelatedContent

RelatedContentRepresentation createTemporaryRawRelatedContent(file)

Upload content and create a local representation

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);


contentApi.createTemporaryRawRelatedContent(file).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
file Blob file

Return type

RelatedContentRepresentation

createTemporaryRelatedContent

RelatedContentRepresentation createTemporaryRelatedContent(relatedContent)

Create a local representation of content from a remote repository

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);


contentApi.createTemporaryRelatedContent(relatedContent).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
relatedContent RelatedContentRepresentation relatedContent

Return type

RelatedContentRepresentation

deleteContent

deleteContent(contentId)

Remove a local content representation

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);


contentApi.deleteContent(contentId).then(() => {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
contentId number contentId

Return type

null (empty response body)

getContent

RelatedContentRepresentation getContent(contentId)

Get a local content representation

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);


contentApi.getContent(contentId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
contentId number contentId

Return type

RelatedContentRepresentation

getRawContent

getRawContent(contentIdrenditionType)

Stream content rendition

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);


contentApi.getRawContent(contentIdrenditionType).then(() => {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
contentId number contentId
renditionType string renditionType

Return type

null (empty response body)

getRawContent

getRawContent(contentId)

Stream content from a local content representation

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);


contentApi.getRawContent(contentId).then(() => {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
contentId number contentId

Return type

null (empty response body)

getRelatedContentForProcessInstance

ResultListDataRepresentationRelatedContentRepresentation getRelatedContentForProcessInstance(processInstanceIdopts)

List content attached to a process instance

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);

let opts = { 
  'isRelatedContent': true //  | isRelatedContent
};

contentApi.getRelatedContentForProcessInstance(processInstanceIdopts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
processInstanceId string processInstanceId
isRelatedContent boolean isRelatedContent [optional]

Return type

ResultListDataRepresentationRelatedContentRepresentation

getRelatedContentForTask

ResultListDataRepresentationRelatedContentRepresentation getRelatedContentForTask(taskIdopts)

List content attached to a task

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

this.alfrescoApi = new AlfrescoApi();
this.alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

let contentApi = new ContentApi(this.alfrescoApi);

let opts = { 
  'isRelatedContent': true //  | isRelatedContent
};

contentApi.getRelatedContentForTask(taskIdopts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
taskId string taskId
isRelatedContent boolean isRelatedContent [optional]

Return type

ResultListDataRepresentationRelatedContentRepresentation

getProcessesAndTasksOnContent

ResultListDataRepresentationRelatedProcessTask getProcessesAndTasksOnContent(sourceId, source, size, page)

Lists processes and tasks on workflow started with provided document

Example

import ContentApi from 'ContentApi';
import { AlfrescoApi } from '@alfresco/js-api';

const alfrescoApi = new AlfrescoApi();
alfrescoApi.setConfig({
    hostEcm: 'http://127.0.0.1:8080'
});

const contentApi = new ContentApi(alfrescoApi);

contentApi.getProcessesAndTasksOnContent('sourceId', 'source').then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
sourceId string id of the document that workflow or task was started with
source string source of the document that workflow or task was started with
sourceId number size of the entries to get optional param
sourceId number page number optional param

Return type

ResultListDataRepresentationRelatedProcessTask