Skip to content

Latest commit

 

History

History
493 lines (345 loc) · 13.7 KB

ContentApi.md

File metadata and controls

493 lines (345 loc) · 13.7 KB

ContentApi

All URIs are relative to https://adfdev.envalfresco.com/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

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