[ADF-2557] Updated docs with new props script (#3149)

* [ADF-2557] Updated docs for services with new props script

* [ADF-2557] Updated service docs with new props script
This commit is contained in:
Andy Stark
2018-04-08 16:23:04 +01:00
committed by Eugenio Romano
parent 8769c257f8
commit 1d517d3a8a
27 changed files with 612 additions and 299 deletions

View File

@@ -1,48 +1,63 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Document List service # Document List service
Implements node operations used by the Document List component. Implements node operations used by the Document List component.
## Methods ## Class members
- `deleteNode(nodeId: string): Observable<any>` ### Methods
Deletes a node.
- `nodeId` - ID of the node to delete - `copyNode(nodeId: string = null, targetParentId: string = null): any`<br/>
- `copyNode(nodeId: string, targetParentId: string): any`
Copy a node to destination node Copy a node to destination node
- `nodeId` - The id of the node to be copied - `nodeId: string = null` - The id of the node to be copied
- `targetParentId` - The id of the folder where the node will be copied - `targetParentId: string = null` - The id of the folder where the node will be copied
- `moveNode(nodeId: string, targetParentId: string): any` - **Returns** `any` - NodeEntry for the copied node
Move a node to destination node - `createFolder(name: string = null, parentId: string = null): Observable<MinimalNodeEntity>`<br/>
- `nodeId` - The id of the node to be moved
- `targetParentId` - The id of the folder where the node will be moved
- `createFolder(name: string, parentId: string): Observable<MinimalNodeEntity>`
Create a new folder in the path. Create a new folder in the path.
- `name` - Folder name - `name: string = null` - Folder name
- `parentId` - Parent folder ID - `parentId: string = null` - Parent folder ID
- `getFolder(folder: string, opts?: any): any` - **Returns** `Observable<MinimalNodeEntity>` - Details of the created folder node
Gets the folder node with the specified relative name path below the root node. - `deleteNode(nodeId: string = null): Observable<any>`<br/>
- `folder` - Path to folder. Deletes a node.
- `opts` - (Optional) Options. - `nodeId: string = null` - ID of the node to delete
- `getFolderNode(nodeId: string): Promise<MinimalNodeEntryEntity>` - **Returns** `Observable<any>` - Empty response when the operation is complete
Gets a folder node via its node ID. - `getDefaultMimeTypeIcon(): string`<br/>
- `nodeId` - ID of the folder node
- `getDocumentThumbnailUrl(node: MinimalNodeEntity): any`
Get thumbnail URL for the given document node.
- `node` - Node to get URL for.
- `getMimeTypeIcon(mimeType: string): string`
Gets the icon that represents a MIME type.
- `mimeType` - MIME type to get the icon for
- `getDefaultMimeTypeIcon(): string`
Gets a default icon for MIME types with no specific icon. Gets a default icon for MIME types with no specific icon.
- **Returns** `string` - Path to the icon file
- `hasPermission(node: any, permission: PermissionsEnum|string): boolean` - `getDocumentThumbnailUrl(node: MinimalNodeEntity = null): string`<br/>
Get thumbnail URL for the given document node.
- `node: MinimalNodeEntity = null` - Node to get URL for.
- **Returns** `string` - Thumbnail URL string
- `getFolder(folder: string = null, opts?: any = null, includeFields: string[] = []): Observable<NodePaging>`<br/>
Gets the folder node with the specified relative name path below the root node.
- `folder: string = null` - Path to folder.
- `opts?: any = null` - (Optional) Options.
- `includeFields: string[] = []` - Extra information to include (available options are "aspectNames", "isLink" and "association")
- **Returns** `Observable<NodePaging>` - Details of the folder
- `getFolderNode(nodeId: string = null, includeFields: string[] = []): Promise<MinimalNodeEntryEntity>`<br/>
Gets a folder node via its node ID.
- `nodeId: string = null` - ID of the folder node
- `includeFields: string[] = []` - Extra information to include (available options are "aspectNames", "isLink" and "association")
- **Returns** `Promise<MinimalNodeEntryEntity>` - Details of the folder
- `getMimeTypeIcon(mimeType: string = null): string`<br/>
Gets the icon that represents a MIME type.
- `mimeType: string = null` - MIME type to get the icon for
- **Returns** `string` - Path to the icon file
- `hasPermission(node: any = null, permission: PermissionsEnum | string = null): boolean`<br/>
Checks if a node has the specified permission. Checks if a node has the specified permission.
- `node` - Target node - `node: any = null` - Target node
- `permission` - Permission level to query - `permission: PermissionsEnum | string = null` - Permission level to query
- **Returns** `boolean` - True if the node has the permission, false otherwise
- `moveNode(nodeId: string = null, targetParentId: string = null): any`<br/>
Move a node to destination node
- `nodeId: string = null` - The id of the node to be moved
- `targetParentId: string = null` - The id of the folder where the node will be moved
- **Returns** `any` - NodeEntry for the moved node
## Details ## Details

View File

@@ -1,23 +1,30 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Folder Actions service # Folder Actions service
Implements the folder menu actions for the Document List component. Implements the folder menu actions for the Document List component.
## Methods ## Class members
- `getHandler(key: string): ContentActionHandler` ### Methods
Gets the handler function for an action.
- `key` - Identifier for the action - `canExecuteAction(obj: any = null): boolean`<br/>
- `setHandler(key: string, handler: ContentActionHandler): boolean`
Sets a new handler function for an action.
- `key` - Identifier for the action
- `handler` - The new handler function
- `canExecuteAction(obj: any): boolean`
Checks if an action is available for a particular item. Checks if an action is available for a particular item.
- `obj` - Item to check - `obj: any = null` - Item to check
- **Returns** `boolean` - True if the action is available, false otherwise
- `getHandler(key: string = null): ContentActionHandler`<br/>
Gets the handler function for an action.
- `key: string = null` - Identifier for the action
- **Returns** `ContentActionHandler` - The handler function
- `setHandler(key: string = null, handler: ContentActionHandler = null): boolean`<br/>
Sets a new handler function for an action.
- `key: string = null` - Identifier for the action
- `handler: ContentActionHandler = null` - The new handler function
- **Returns** `boolean` - True if the key was a valid action identifier, false otherwise
## Details ## Details

View File

@@ -1,27 +1,34 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Tag service # Tag service
Manages tags in Content Services. Manages tags in Content Services.
## Methods ## Class members
- `getTagsByNodeId(nodeId: string): any` ### Methods
Gets a list of tags added to a node.
- `nodeId` - ID of the target node
- `getAllTheTags(): any`
Gets a list of all the tags already defined in the repository.
- `addTag(nodeId: string, tagName: string): any` - `addTag(nodeId: string = null, tagName: string = null): any`<br/>
Adds a tag to a node. Adds a tag to a node.
- `nodeId` - ID of the target node - `nodeId: string = null` - ID of the target node
- `tagName` - Name of the tag to add - `tagName: string = null` - Name of the tag to add
- `removeTag(nodeId: string, tag: string): any` - **Returns** `any` - TagEntry object (defined in JSAPI) with details of the new tag
- `getAllTheTags(): any`<br/>
Gets a list of all the tags already defined in the repository.
- **Returns** `any` - TagPaging object (defined in JSAPI) containing the tags
- `getTagsByNodeId(nodeId: string = null): any`<br/>
Gets a list of tags added to a node.
- `nodeId: string = null` - ID of the target node
- **Returns** `any` - TagPaging object (defined in JSAPI) containing the tags
- `removeTag(nodeId: string = null, tag: string = null): any`<br/>
Removes a tag from a node. Removes a tag from a node.
- `nodeId` - ID of the target node - `nodeId: string = null` - ID of the target node
- `tag` - Name of the tag to remove - `tag: string = null` - Name of the tag to remove
- **Returns** `any` - Null object when the operation completes
## Details ## Details

View File

@@ -0,0 +1,40 @@
---
Added: v2.0.0
Status: Active
Last reviewed: 2018-04-05
---
# Apps Process service
Gets details of the Process Services apps that are deployed for the user.
## Class members
### Methods
- `getApplicationDetailsById(appId: number = null): Observable<AppDefinitionRepresentation>`<br/>
Gets the details for a specific app ID number.
- `appId: number = null` - ID of the target app
- **Returns** `Observable<AppDefinitionRepresentation>` - Details of the app
- `getDeployedApplications(): Observable<AppDefinitionRepresentation[]>`<br/>
Gets a list of deployed apps for this user.
- **Returns** `Observable<AppDefinitionRepresentation[]>` - The list of deployed apps
- `getDeployedApplicationsByName(name: string = null): Observable<AppDefinitionRepresentation>`<br/>
Gets a list of deployed apps for this user, where the app name is \`name\`.
- `name: string = null` - Name of the app
- **Returns** `Observable<AppDefinitionRepresentation>` - The list of deployed apps
## Details
This service can be used to access the Process Services apps that are available
to the current user. You can find more information about the
returned `AppDefinitionRepresentation` class in the [Filter model page](filter.model.md)
and in the
[Process Services Apps API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppsApi.md#getAppDefinitions).
The methods of this service make use of the
[getAppDefinitions](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppsApi.md#getAppDefinitions)
method, also from the Apps API.
## See also
- [Filter model](filter.model.md)

View File

@@ -1,24 +1,35 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Comment Process service # Comment Process service
Adds and retrieves comments for task and process instances in Process Services. Adds and retrieves comments for task and process instances in Process Services.
## Methods ## Class members
`addTaskComment(taskId: string, message: string): Observable<CommentProcessModel>`<br/> ### Methods
Adds a comment to a task.
`getTaskComments(taskId: string): Observable<CommentProcessModel[]>`<br/> - `addProcessInstanceComment(processInstanceId: string = null, message: string = null): Observable<CommentModel>`<br/>
Gets all comments that have been added to a task. Adds a comment to a process instance.
- `processInstanceId: string = null` - ID of the target process instance
`addProcessInstanceComment(processInstanceId: string, message: string): Observable<CommentProcessModel>`<br/> - `message: string = null` - Text for the comment
Adds a comment to a process instance. - **Returns** `Observable<CommentModel>` - Details of the comment added
- `addTaskComment(taskId: string = null, message: string = null): Observable<CommentModel>`<br/>
`getProcessInstanceComments(processInstanceId: string): Observable<CommentProcessModel[]>`<br/> Adds a comment to a task.
Gets all comments that have been added to a process instance. - `taskId: string = null` - ID of the target task
- `message: string = null` - Text for the comment
- **Returns** `Observable<CommentModel>` - Details about the comment
- `getProcessInstanceComments(processInstanceId: string = null): Observable<CommentModel[]>`<br/>
Gets all comments that have been added to a process instance.
- `processInstanceId: string = null` - ID of the target process instance
- **Returns** `Observable<CommentModel[]>` - Details for each comment
- `getTaskComments(taskId: string = null): Observable<CommentModel[]>`<br/>
Gets all comments that have been added to a task.
- `taskId: string = null` - ID of the target task
- **Returns** `Observable<CommentModel[]>` - Details for each comment
## Details ## Details

View File

@@ -1,16 +1,21 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Deleted Nodes Api service # Deleted Nodes Api service
Gets a list of Content Services nodes currently in the trash. Gets a list of Content Services nodes currently in the trash.
## Methods ## Class members
- `getDeletedNodes(options?: Object): Observable<NodePaging>` ### Methods
- `getDeletedNodes(options?: Object = null): Observable<NodePaging>`<br/>
Gets a list of nodes in the trash. Gets a list of nodes in the trash.
- `options` - (Optional) Options for JSAPI call - `options?: Object = null` - (Optional) Options for JSAPI call
- **Returns** `Observable<NodePaging>` - List of nodes in the trash
## Details ## Details

View File

@@ -1,18 +1,23 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Discovery Api service # Discovery Api service
Gets version and license information for Process Services and Content Services. Gets version and license information for Process Services and Content Services.
## Methods ## Class members
- `getEcmProductInfo(): any` ### Methods
Gets product information for Content Services.
- `getBpmProductInfo(): any` - `getBpmProductInfo(): any`<br/>
Gets product information for Process Services. Gets product information for Process Services.
- **Returns** `any` - ProductVersionModel containing product details
- `getEcmProductInfo(): any`<br/>
Gets product information for Content Services.
- **Returns** `any` - ProductVersionModel containing product details
## Details ## Details

View File

@@ -1,22 +1,28 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Ecm User service # Ecm User service
Gets information about a Content Services user. Gets information about a Content Services user.
## Methods ## Class members
- `getUserInfo(userName: string): Observable<EcmUserModel>` ### Methods
Gets information about a user identified by their username.
- `userName` - Target username - `getCurrentUserInfo(): any`<br/>
- `getCurrentUserInfo(): Observable<EcmUserModel>`
Gets information about the user who is currently logged-in. Gets information about the user who is currently logged-in.
- **Returns** `any` - User information as for getUserInfo
- `getUserProfileImage(avatarId: string): string` - `getUserInfo(userName: string = null): Observable<EcmUserModel>`<br/>
Gets information about a user identified by their username.
- `userName: string = null` - Target username
- **Returns** `Observable<EcmUserModel>` - User information
- `getUserProfileImage(avatarId: string = null): string`<br/>
Returns a profile image as a URL. Returns a profile image as a URL.
- `avatarId` - Target avatar - `avatarId: string = null` - Target avatar
- **Returns** `string` - Image URL
## Details ## Details

View File

@@ -1,46 +1,58 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-06
--- ---
# Nodes Api service # Nodes Api service
Accesses and manipulates ACS document nodes using their node IDs. Accesses and manipulates ACS document nodes using their node IDs.
## Methods ## Class members
- `getNode(nodeId: string, options: any = {}): Observable<MinimalNodeEntryEntity>` ### Methods
Gets the stored information about a node.
- `nodeId` - ID of the target node - `createFolder(parentNodeId: string = null, nodeBody: any = null, options: any = {}): Observable<MinimalNodeEntryEntity>`<br/>
- `options` - Optional parameters supported by JSAPI
- `getNodeChildren(nodeId: string, options: any = {}): Observable<NodePaging>`
Gets the items contained in a folder node.
- `nodeId` - ID of the target node
- `options` - Optional parameters supported by JSAPI
- `createNode(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity>`
Creates a new document node inside a folder.
- `parentNodeId` - ID of the parent folder node
- `nodeBody` - Data for the new node
- `options` - Optional parameters supported by JSAPI
- `createFolder(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity>`
Creates a new folder node inside a parent folder. Creates a new folder node inside a parent folder.
- `parentNodeId` - ID of the parent folder node - `parentNodeId: string = null` - ID of the parent folder node
- `nodeBody` - Data for the new folder - `nodeBody: any = null` - Data for the new folder
- `options` - Optional parameters supported by JSAPI - `options: any = {}` - Optional parameters supported by JSAPI
- `updateNode(nodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity>` - **Returns** `Observable<MinimalNodeEntryEntity>` - Details of the new folder
Updates the information about a node. - `createNode(parentNodeId: string = null, nodeBody: any = null, options: any = {}): Observable<MinimalNodeEntryEntity>`<br/>
- `nodeId` - ID of the target node Creates a new document node inside a folder.
- `nodeBody` - New data for the node - `parentNodeId: string = null` - ID of the parent folder node
- `options` - Optional parameters supported by JSAPI - `nodeBody: any = null` - Data for the new node
- `deleteNode(nodeId: string, options: any = {}): Observable<void>` - `options: any = {}` - Optional parameters supported by JSAPI
- **Returns** `Observable<MinimalNodeEntryEntity>` - Details of the new node
- `deleteNode(nodeId: string = null, options: any = {}): Observable<void>`<br/>
Moves a node to the trashcan. Moves a node to the trashcan.
- `nodeId` - ID of the target node - `nodeId: string = null` - ID of the target node
- `options` - Optional parameters supported by JSAPI - `options: any = {}` - Optional parameters supported by JSAPI
- `restoreNode(nodeId: string): Observable<MinimalNodeEntryEntity>` - **Returns** `Observable<void>` - Empty result that notifies when the deletion is complete
Restores a node previously moved to the trashcan. - `getNode(nodeId: string = null, options: any = {}): Observable<MinimalNodeEntryEntity>`<br/>
- `nodeId` - ID of the node to restore Gets the stored information about a node.
- `handleError(error: any): Observable<any>` - `nodeId: string = null` - ID of the target node
- `options: any = {}` - Optional parameters supported by JSAPI
- **Returns** `Observable<MinimalNodeEntryEntity>` - Node information
- `getNodeChildren(nodeId: string = null, options: any = {}): Observable<NodePaging>`<br/>
Gets the items contained in a folder node.
- `nodeId: string = null` - ID of the target node
- `options: any = {}` - Optional parameters supported by JSAPI
- **Returns** `Observable<NodePaging>` - List of child items from the folder
- `handleError(error: any = null): Observable<any>`<br/>
Reports an error. Reports an error.
- `error` - Object representing the error - `error: any = null` - Object representing the error
- **Returns** `Observable<any>` - Error information
- `restoreNode(nodeId: string = null): Observable<MinimalNodeEntryEntity>`<br/>
Restores a node previously moved to the trashcan.
- `nodeId: string = null` - ID of the node to restore
- **Returns** `Observable<MinimalNodeEntryEntity>` - Details of the restored node
- `updateNode(nodeId: string = null, nodeBody: any = null, options: any = {}): Observable<MinimalNodeEntryEntity>`<br/>
Updates the information about a node.
- `nodeId: string = null` - ID of the target node
- `nodeBody: any = null` - New data for the node
- `options: any = {}` - Optional parameters supported by JSAPI
- **Returns** `Observable<MinimalNodeEntryEntity>` - Updated node information
## Details ## Details

View File

@@ -1,19 +1,24 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-06
--- ---
# People Content service # People Content service
Gets information about a Content Services user. Gets information about a Content Services user.
## Methods ## Class members
- `getPerson(personId: string): Observable<any>` ### Methods
- `getCurrentPerson(): Observable<any>`<br/>
Gets information about the user who is currently logged in.
- **Returns** `Observable<any>` - User information
- `getPerson(personId: string = null): Observable<any>`<br/>
Gets information about a user identified by their username. Gets information about a user identified by their username.
- `personId` - ID of the target user - `personId: string = null` - ID of the target user
- `getCurrentPerson(): Observable<any>` - **Returns** `Observable<any>` - User information
Gets information about the user who is currently logged-in.
## Details ## Details

View File

@@ -1,28 +1,36 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# People Process service # People Process service
Gets information about Process Services users. Gets information about Process Services users.
## Methods ## Class members
- `getWorkflowUsers(taskId?: string, searchWord?: string): Observable<UserProcessModel[]>` ### Methods
Gets information about users across all tasks.
- `taskId` - (Optional) ID of the task - `getUserImage(user: UserProcessModel = null): string`<br/>
- `searchWord` - (Optional) Filter text to search for
- `getUserImage(user: UserProcessModel): string`
Gets the profile picture URL for the specified user. Gets the profile picture URL for the specified user.
- `user` - The target user - `user: UserProcessModel = null` - The target user
- `involveUserWithTask(taskId: string, idToInvolve: string): Observable<UserProcessModel[]>` - **Returns** `string` - Profile picture URL
- `getWorkflowUsers(taskId?: string = null, searchWord?: string = null): Observable<UserProcessModel[]>`<br/>
Gets information about users across all tasks.
- `taskId?: string = null` - (Optional) ID of the task
- `searchWord?: string = null` - (Optional) Filter text to search for
- **Returns** `Observable<UserProcessModel[]>` - Array of user information objects
- `involveUserWithTask(taskId: string = null, idToInvolve: string = null): Observable<UserProcessModel[]>`<br/>
Sets a user to be involved with a task. Sets a user to be involved with a task.
- `taskId` - ID of the target task - `taskId: string = null` - ID of the target task
- `idToInvolve` - ID of the user to involve - `idToInvolve: string = null` - ID of the user to involve
- `removeInvolvedUser(taskId: string, idToRemove: string): Observable<UserProcessModel[]>` - **Returns** `Observable<UserProcessModel[]>` - Empty response when the update completes
- `removeInvolvedUser(taskId: string = null, idToRemove: string = null): Observable<UserProcessModel[]>`<br/>
Removes a user who is currently involved with a task. Removes a user who is currently involved with a task.
- `taskId` - ID of the target task - `taskId: string = null` - ID of the target task
- `idToRemove` - ID of the user to remove - `idToRemove: string = null` - ID of the user to remove
- **Returns** `Observable<UserProcessModel[]>` - Empty response when the update completes
## Details ## Details

View File

@@ -2,27 +2,80 @@
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
--- ---
# Process Content Service # Process Content Service
Manipulates content related to a Process Instance or Task Instance in APS. Manipulates content related to a Process Instance or Task Instance in APS.
Related content can be uploaded to APS via for example a file upload dialog. ## Class members
## Importing ### Methods
```ts - `createProcessRelatedContent(processInstanceId: string = null, content: any = null, opts?: any = null): Observable<any>`<br/>
import { RelatedContentRepresentation } from 'alfresco-js-api'; Associates an uploaded file with a process instance.
import { ProcessContentService } from '@alfresco/adf-core'; - `processInstanceId: string = null` - ID of the target process instance
- `content: any = null` - File to associate
export class SomePageComponent implements OnInit { - `opts?: any = null` - (Optional) Options supported by JSAPI
- **Returns** `Observable<any>` - Details of created content
constructor(private contentService: ProcessContentService) { - `createTaskRelatedContent(taskId: string = null, file: any = null, opts?: any = null): any`<br/>
} Associates an uploaded file with a task instance.
``` - `taskId: string = null` - ID of the target task
- `file: any = null` - File to associate
- `opts?: any = null` - (Optional) Options supported by JSAPI
- **Returns** `any` - Details of created content
- `createTemporaryRawRelatedContent(file: any = null): Observable<RelatedContentRepresentation>`<br/>
Create temporary related content from an uploaded file.
- `file: any = null` - File to use for content
- **Returns** `Observable<RelatedContentRepresentation>` - The created content data
- `deleteRelatedContent(contentId: number = null): Observable<any>`<br/>
Deletes related content.
- `contentId: number = null` - Identifier of the content to delete
- **Returns** `Observable<any>` - Null response that notifies when the deletion is complete
- `getContentPreview(contentId: number = null): Observable<Blob>`<br/>
Gets the preview for a related content file.
- `contentId: number = null` - ID of the related content
- **Returns** `Observable<Blob>` - Binary data of the content preview
- `getContentThumbnail(contentId: number = null): Observable<Blob>`<br/>
Gets the thumbnail for a related content file.
- `contentId: number = null` - ID of the related content
- **Returns** `Observable<Blob>` - Binary data of the thumbnail image
- `getFileContent(contentId: number = null): Observable<RelatedContentRepresentation>`<br/>
Gets the metadata for a related content item.
- `contentId: number = null` - ID of the content item
- **Returns** `Observable<RelatedContentRepresentation>` - Metadata for the content
- `getFileRawContent(contentId: number = null): Observable<Blob>`<br/>
Gets raw binary content data for a related content file.
- `contentId: number = null` - ID of the related content
- **Returns** `Observable<Blob>` - Binary data of the related content
- `getFileRawContentUrl(contentId: number = null): string`<br/>
Gets a URL for direct access to a related content file.
- `contentId: number = null` - ID of the related content
- **Returns** `string` - URL to access the content
- `getProcessRelatedContent(processId: string = null): Observable<any>`<br/>
Gets related content items for a process instance.
- `processId: string = null` - ID of the target process
- **Returns** `Observable<any>` - Metadata for the content
- `getTaskRelatedContent(taskId: string = null): Observable<any>`<br/>
Gets related content items for a task instance.
- `taskId: string = null` - ID of the target task
- **Returns** `Observable<any>` - Metadata for the content
- `handleError(error: any = null): Observable<any>`<br/>
Reports an error message.
- `error: any = null` - Data object with optional `message` and `status` fields for the error
- **Returns** `Observable<any>` - Callback when an error occurs
- `toJson(res: any = null): any`<br/>
Creates a JSON representation of data.
- `res: any = null` - Object representing data
- **Returns** `any` - JSON object
- `toJsonArray(res: any = null): any`<br/>
Creates a JSON array representation of data.
- `res: any = null` - Object representing data
- **Returns** `any` - JSON array object
## Methods ## Methods
#### createProcessRelatedContent(processInstanceId: string, content: any, opts?: any): Observable`<any>` #### createProcessRelatedContent(processInstanceId: string, content: any, opts?: any): Observable`<any>`
Associate an uploaded file with a Process Instance. Associate an uploaded file with a Process Instance.
Let's say we have an upload button as follows: Let's say we have an upload button as follows:
@@ -67,8 +120,7 @@ In the above sample code the `file` is uploaded via an HTML input element.
The `processInstanceId` refers to a process instance ID for a running process in APS. The `processInstanceId` refers to a process instance ID for a running process in APS.
The returned `relContent` object looks like in this sample: The returned `relContent` object looks like in this sample:
``` Related content:
Related content:
contentAvailable: true contentAvailable: true
created: Wed Nov 08 2017 10:50:30 GMT+0000 (GMT) {} created: Wed Nov 08 2017 10:50:30 GMT+0000 (GMT) {}
createdBy: {id: 1, firstName: null, lastName: "Administrator", email: "admin@app.activiti.com"} createdBy: {id: 1, firstName: null, lastName: "Administrator", email: "admin@app.activiti.com"}
@@ -80,13 +132,14 @@ Related content:
relatedContent: true relatedContent: true
simpleType: "pdf" simpleType: "pdf"
thumbnailStatus: "queued" thumbnailStatus: "queued"
```
The related content `id` can be used by other methods in this service to get to the content and to The related content `id` can be used by other methods in this service to get to the content and to
delete it. It is referred to as the `contentId`. delete it. It is referred to as the `contentId`.
If you look at attachments for the process instance it should now display the new file. If you look at attachments for the process instance it should now display the new file.
#### createTaskRelatedContent(taskId: string, file: any, opts?: any) #### createTaskRelatedContent(taskId: string, file: any, opts?: any)
Associate an uploaded file with a Task Instance. This is in effect very similar Associate an uploaded file with a Task Instance. This is in effect very similar
to the `createProcessRelatedContent` call. Just use `taskInstanceId` instead of `processInstanceId`. to the `createProcessRelatedContent` call. Just use `taskInstanceId` instead of `processInstanceId`.
@@ -112,6 +165,7 @@ onUploadFile() {
For more information see the docs for `createProcessRelatedContent`. For more information see the docs for `createProcessRelatedContent`.
#### createTemporaryRawRelatedContent(file: any): Observable`<RelatedContentRepresentation>` #### createTemporaryRawRelatedContent(file: any): Observable`<RelatedContentRepresentation>`
Create temporary related content from an uploaded file. This means that the related content Create temporary related content from an uploaded file. This means that the related content
is not yet associated with a process instance or a task instance. is not yet associated with a process instance or a task instance.
@@ -133,6 +187,7 @@ is not yet associated with a process instance or a task instance.
For more information see the docs for `createProcessRelatedContent`. For more information see the docs for `createProcessRelatedContent`.
#### deleteRelatedContent(contentId: number): Observable`<any>` #### deleteRelatedContent(contentId: number): Observable`<any>`
Delete related content via the content identifier: Delete related content via the content identifier:
```ts ```ts
@@ -144,11 +199,13 @@ Delete related content via the content identifier:
console.log('Error: ', error); console.log('Error: ', error);
}); });
``` ```
The response is going to be `null` if the delete was successful. The response is going to be `null` if the delete was successful.
See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`. See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`.
#### getFileContent(contentId: number): Observable`<RelatedContentRepresentation>` #### getFileContent(contentId: number): Observable`<RelatedContentRepresentation>`
Get the metadata for a related content item in the format of a `RelatedContentRepresentation` object: Get the metadata for a related content item in the format of a `RelatedContentRepresentation` object:
```ts ```ts
@@ -163,23 +220,22 @@ this.contentService.getFileContent(contentId).subscribe(
The metadata response looks like in this example: The metadata response looks like in this example:
``` contentAvailable: true
contentAvailable: true created: Wed Nov 08 2017 11:26:14 GMT+0000 (GMT) {}
created: Wed Nov 08 2017 11:26:14 GMT+0000 (GMT) {} createdBy: {id: 1, firstName: null, lastName: "Administrator", email: "admin@app.activiti.com"}
createdBy: {id: 1, firstName: null, lastName: "Administrator", email: "admin@app.activiti.com"} id: 6008
id: 6008 link: false
link: false mimeType: "application/pdf"
mimeType: "application/pdf" name: "simple.pdf"
name: "simple.pdf" previewStatus: "created"
previewStatus: "created" relatedContent: true
relatedContent: true simpleType: "pdf"
simpleType: "pdf" thumbnailStatus: "created"
thumbnailStatus: "created"
```
See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`. See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`.
#### getFileRawContentUrl(contentId: number): string #### getFileRawContentUrl(contentId: number): string
Get the URL for direct access to a related content file: Get the URL for direct access to a related content file:
```ts ```ts
@@ -197,6 +253,7 @@ This URL can be used to directly access the content file, such as from a browser
See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`. See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`.
#### getFileRawContent(contentId: number): Observable`<Blob>` #### getFileRawContent(contentId: number): Observable`<Blob>`
Get the raw content bytes as a BLOB for a related content file: Get the raw content bytes as a BLOB for a related content file:
```ts ```ts
@@ -216,6 +273,7 @@ The BLOB response looks something like this:
See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`. See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`.
#### getContentPreview(contentId: number): Observable`<Blob>` #### getContentPreview(contentId: number): Observable`<Blob>`
Get the preview file for a related content file. A content file might be for example a Get the preview file for a related content file. A content file might be for example a
MS Word document. This method would give you the PDF preview for this document, MS Word document. This method would give you the PDF preview for this document,
if it has been generated: if it has been generated:
@@ -237,11 +295,11 @@ The preview BLOB response looks something like this:
See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`. See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`.
#### getContentThumbnail(contentId: number): Observable`<Blob>` #### getContentThumbnail(contentId: number): Observable`<Blob>`
Get the thumbnail file for a related content file. A content file might be for example a Get the thumbnail file for a related content file. A content file might be for example a
MS Word document. This method would give you the image thumbnail for this document, MS Word document. This method would give you the image thumbnail for this document,
if it has been generated: if it has been generated:
```ts ```ts
const contentId = 5006; const contentId = 5006;
this.contentService.getContentThumbnail(contentId).subscribe( this.contentService.getContentThumbnail(contentId).subscribe(
@@ -259,6 +317,7 @@ The response looks like in this sample:
See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`. See `getProcessRelatedContent` and `getTaskRelatedContent` for how to get to the `contentId`.
#### getProcessRelatedContent(processId: string): Observable`<any>` #### getProcessRelatedContent(processId: string): Observable`<any>`
Get related content items for passed in Process Instance ID, only metadata for related content is returned: Get related content items for passed in Process Instance ID, only metadata for related content is returned:
```ts ```ts
@@ -273,11 +332,10 @@ this.contentService.getProcessRelatedContent(processId).subscribe(
The response looks like in the following sample: The response looks like in the following sample:
``` size: 2
size: 2 start:0
start:0 total:2
total:2 data:
data:
0: 0:
contentAvailable: true contentAvailable: true
created: "2017-10-29T07:28:15.546+0000" created: "2017-10-29T07:28:15.546+0000"
@@ -297,11 +355,11 @@ data:
createdBy: {…}, createdBy: {…},
relatedContent: true, relatedContent: true,
…} …}
```
The `id` property corresponds to the `contentId` property used in many of the other methods of this service. The `id` property corresponds to the `contentId` property used in many of the other methods of this service.
#### getTaskRelatedContent(taskId: string): Observable`<any>` #### getTaskRelatedContent(taskId: string): Observable`<any>`
Get related content items for passed in Task Instance ID, only metadata for related content is returned: Get related content items for passed in Task Instance ID, only metadata for related content is returned:
```ts ```ts
@@ -316,6 +374,16 @@ this.contentService.getTaskRelatedContent(taskId).subscribe(
The response format is the same as for the `getProcessRelatedContent` method, see its docs. The response format is the same as for the `getProcessRelatedContent` method, see its docs.
<!-- seealso start --> ## Details
<!-- seealso end --> ## Importing
```ts
import { RelatedContentRepresentation } from 'alfresco-js-api';
import { ProcessContentService } from '@alfresco/adf-core';
export class SomePageComponent implements OnInit {
constructor(private contentService: ProcessContentService) {
}
```

View File

@@ -1,57 +1,66 @@
--- ---
Added: v2.0.0 Added: v2.0.0
Status: Active Status: Active
Last reviewed: 2018-04-05
--- ---
# Upload Service # Upload Service
Provides access to various APIs related to file upload features. Provides access to various APIs related to file upload features.
## Methods ## Class members
- `isUploading(): boolean` ### Methods
Checks whether the service is uploading a file.
- `getQueue(): FileModel[]` - `addToQueue(files: FileModel[] = null): FileModel[]`<br/>
Returns the file Queue
- `addToQueue(files: FileModel[]): FileModel[]`
Adds files to the uploading queue to be uploaded Adds files to the uploading queue to be uploaded
- `files` - One or more separate parameters or an array of files to queue - `files: FileModel[] = null` - One or more separate parameters or an array of files to queue
- `uploadFilesInTheQueue(emitter: EventEmitter<any>)` - **Returns** `FileModel[]` - Array of files that were not blocked from upload by the ignore list
Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder. - `cancelUpload(files: FileModel[] = null)`<br/>
- `emitter` - (Deprecated) Emitter to invoke on file status change
- `cancelUpload(files: FileModel[])`
Cancels uploading of files. Cancels uploading of files.
- `files` - One or more separate parameters or an array of files - `files: FileModel[] = null` - One or more separate parameters or an array of files specifying uploads to cancel
- `clearQueue()` - `clearQueue()`<br/>
Clears the upload queue Clears the upload queue
- `getQueue(): FileModel[]`<br/>
- `getUploadPromise(file: FileModel): any` Gets the file Queue
- **Returns** `FileModel[]` - Array of files that form the queue
- `getUploadPromise(file: FileModel = null): any`<br/>
Gets an upload promise for a file. Gets an upload promise for a file.
- `file` - The target file - `file: FileModel = null` - The target file
- **Returns** `any` - Promise that is resolved if the upload is successful or error otherwise
- `isUploading(): boolean`<br/>
Checks whether the service is uploading a file.
- **Returns** `boolean` - True if a file is uploading, false otherwise
- `uploadFilesInTheQueue(emitter: EventEmitter<any> = null)`<br/>
Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder.
- `emitter: EventEmitter<any> = null` - (Deprecated) Emitter to invoke on file status change
## Events ## Events
| Name | Type | Description | | Name | Type | Description |
| ---- | ---- | ----------- | | ---- | ---- | ----------- |
| queueChanged | FileModel\[] | Raised every time the file queue changes. | | queueChanged | FileModel\[] | Emitted when the file queue changes. |
| fileUpload | FileUploadEvent | Raised every time a File model changes its state. | | fileUpload | FileUploadEvent | Emitted when a File model changes its state. |
| fileUploadStarting | FileUploadEvent | Raised when upload starts. | | fileUploadStarting | FileUploadEvent | Emitted when an upload starts. |
| fileUploadCancelled | FileUploadEvent | Raised when upload gets cancelled by user. | | fileUploadCancelled | FileUploadEvent | Emitted when an upload gets cancelled by the user. |
| fileUploadProgress | FileUploadEvent | Raised during file upload process and contains the current progress for the particular File model. | | fileUploadProgress | FileUploadEvent | Emitted during the file upload process and contains the current progress for a particular File model. |
| fileUploadAborted | FileUploadEvent | Raised when file upload gets aborted by the server. | | fileUploadAborted | FileUploadEvent | Emitted when a file upload gets aborted by the server. |
| fileUploadError | FileUploadEvent | Raised when an error occurs to file upload. | | fileUploadError | FileUploadEvent | Emitted when an error occurs during a file upload. |
| fileUploadComplete | FileUploadCompleteEvent | Raised when file upload is complete. | | fileUploadComplete | FileUploadCompleteEvent | Emitted when a file upload is complete. |
| fileUploadDelete | FileUploadDeleteEvent | Raised when uploaded file is removed from server. | | fileUploadDelete | FileUploadDeleteEvent | Emitted when an uploaded file is removed from server. |
| fileDeleted | string | This can be invoked when a file is deleted from an external source to upload the file dialog status. | | fileDeleted | string | This can be invoked when a file is deleted from an external source to upload the file dialog status. |
## Details ## Details
### Ignore list configuration ### Ignore list configuration
Is possible add an ignore list for files that you don't want to allow upload on your CS. You can add an ignore list for files that you don't want to be uploaded on your CS.
The configuration of this service is saved in the **_app.config.json file_**.If you want more details about the configuration service follow this [link](https://github.com/Alfresco/alfresco-ng2-components/tree/master/ng2-components/ng2-alfresco-core#appconfigservice). The configuration of this service is saved in the `app.config.json` file
In the example below you can see how filtered out the : '.git', '.DS_Store' and 'desktop.ini'. **Every element is a glob pattern string.** So, if you want to exclude all the txt files, you can add the "\*.txt". (notice the asterisk at the beginning of the pattern!) (see the [App Config service](app-config.service.md) for more information).
The example below shows how to filter out the : '.git', '.DS_Store' and 'desktop.ini' files.
Each element of the ignore list is a glob pattern string, so you could exclude all the `.txt`
files, for example, by adding a `*.txt` pattern to the list.
**app.config.json** **app.config.json**
@@ -68,7 +77,5 @@ In the example below you can see how filtered out the : '.git', '.DS_Store' and
} }
``` ```
Note: Note that all standard glob patterns work and you can end patterns with a forward
slash `/` character to specify a directory.
- Standard glob patterns work.
- You can end patterns with a forward slash / to specify a directory.

View File

@@ -1,36 +0,0 @@
---
Added: v2.0.0
Status: Active
---
# Apps Process service
Gets details of the Process Services apps that are deployed for the user.
## Methods
`getDeployedApplications(): Observable<AppDefinitionRepresentation[]>`<br/>
Gets a list of deployed apps for this user.
`getDeployedApplicationsByName(name: string): Observable<AppDefinitionRepresentation>`<br/>
Gets a list of deployed apps for this user, where the app name is `name`.
`getApplicationDetailsById(appId: number): Observable<AppDefinitionRepresentation>`<br/>
Get the details for a specific app ID number.
## Details
This service can be used to access the Process Services apps that are available
to the current user. You can find more information about the
returned `AppDefinitionRepresentation` class in the [Filter model page](filter.model.md)
and in the
[Process Services Apps API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppsApi.md#getAppDefinitions).
The methods of this service make use of the
[getAppDefinitions](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-activiti-rest-api/docs/AppsApi.md#getAppDefinitions)
method, also from the Apps API.
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
<!-- seealso start -->
## See also
- [Filter model](filter.model.md)
<!-- seealso end -->

View File

@@ -75,6 +75,7 @@ export class DocumentListService {
/** /**
* Deletes a node. * Deletes a node.
* @param nodeId ID of the node to delete * @param nodeId ID of the node to delete
* @returns Empty response when the operation is complete
*/ */
deleteNode(nodeId: string): Observable<any> { deleteNode(nodeId: string): Observable<any> {
return Observable.fromPromise(this.apiService.getInstance().nodes.deleteNode(nodeId)); return Observable.fromPromise(this.apiService.getInstance().nodes.deleteNode(nodeId));
@@ -85,6 +86,7 @@ export class DocumentListService {
* *
* @param nodeId The id of the node to be copied * @param nodeId The id of the node to be copied
* @param targetParentId The id of the folder where the node will be copied * @param targetParentId The id of the folder where the node will be copied
* @returns NodeEntry for the copied node
*/ */
copyNode(nodeId: string, targetParentId: string) { copyNode(nodeId: string, targetParentId: string) {
return Observable.fromPromise(this.apiService.getInstance().nodes.copyNode(nodeId, { targetParentId })) return Observable.fromPromise(this.apiService.getInstance().nodes.copyNode(nodeId, { targetParentId }))
@@ -96,6 +98,7 @@ export class DocumentListService {
* *
* @param nodeId The id of the node to be moved * @param nodeId The id of the node to be moved
* @param targetParentId The id of the folder where the node will be moved * @param targetParentId The id of the folder where the node will be moved
* @returns NodeEntry for the moved node
*/ */
moveNode(nodeId: string, targetParentId: string) { moveNode(nodeId: string, targetParentId: string) {
return Observable.fromPromise(this.apiService.getInstance().nodes.moveNode(nodeId, { targetParentId })) return Observable.fromPromise(this.apiService.getInstance().nodes.moveNode(nodeId, { targetParentId }))
@@ -106,6 +109,7 @@ export class DocumentListService {
* Create a new folder in the path. * Create a new folder in the path.
* @param name Folder name * @param name Folder name
* @param parentId Parent folder ID * @param parentId Parent folder ID
* @returns Details of the created folder node
*/ */
createFolder(name: string, parentId: string): Observable<MinimalNodeEntity> { createFolder(name: string, parentId: string): Observable<MinimalNodeEntity> {
return Observable.fromPromise(this.apiService.getInstance().nodes.createFolder(name, '/', parentId)) return Observable.fromPromise(this.apiService.getInstance().nodes.createFolder(name, '/', parentId))
@@ -116,6 +120,8 @@ export class DocumentListService {
* Gets the folder node with the specified relative name path below the root node. * Gets the folder node with the specified relative name path below the root node.
* @param folder Path to folder. * @param folder Path to folder.
* @param opts Options. * @param opts Options.
* @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association")
* @returns Details of the folder
*/ */
getFolder(folder: string, opts?: any, includeFields: string[] = []): Observable<NodePaging> { getFolder(folder: string, opts?: any, includeFields: string[] = []): Observable<NodePaging> {
return Observable.fromPromise(this.getNodesPromise(folder, opts, includeFields)) return Observable.fromPromise(this.getNodesPromise(folder, opts, includeFields))
@@ -126,6 +132,8 @@ export class DocumentListService {
/** /**
* Gets a folder node via its node ID. * Gets a folder node via its node ID.
* @param nodeId ID of the folder node * @param nodeId ID of the folder node
* @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association")
* @returns Details of the folder
*/ */
getFolderNode(nodeId: string, includeFields: string[] = []): Promise<MinimalNodeEntryEntity> { getFolderNode(nodeId: string, includeFields: string[] = []): Promise<MinimalNodeEntryEntity> {
@@ -144,6 +152,7 @@ export class DocumentListService {
/** /**
* Get thumbnail URL for the given document node. * Get thumbnail URL for the given document node.
* @param node Node to get URL for. * @param node Node to get URL for.
* @returns Thumbnail URL string
*/ */
getDocumentThumbnailUrl(node: MinimalNodeEntity): string { getDocumentThumbnailUrl(node: MinimalNodeEntity): string {
return this.thumbnailService.getDocumentThumbnailUrl(node); return this.thumbnailService.getDocumentThumbnailUrl(node);
@@ -152,6 +161,7 @@ export class DocumentListService {
/** /**
* Gets the icon that represents a MIME type. * Gets the icon that represents a MIME type.
* @param mimeType MIME type to get the icon for * @param mimeType MIME type to get the icon for
* @returns Path to the icon file
*/ */
getMimeTypeIcon(mimeType: string): string { getMimeTypeIcon(mimeType: string): string {
return this.thumbnailService.getMimeTypeIcon(mimeType); return this.thumbnailService.getMimeTypeIcon(mimeType);
@@ -159,6 +169,7 @@ export class DocumentListService {
/** /**
* Gets a default icon for MIME types with no specific icon. * Gets a default icon for MIME types with no specific icon.
* @returns Path to the icon file
*/ */
getDefaultMimeTypeIcon(): string { getDefaultMimeTypeIcon(): string {
return this.thumbnailService.getDefaultMimeTypeIcon(); return this.thumbnailService.getDefaultMimeTypeIcon();
@@ -168,6 +179,7 @@ export class DocumentListService {
* Checks if a node has the specified permission. * Checks if a node has the specified permission.
* @param node Target node * @param node Target node
* @param permission Permission level to query * @param permission Permission level to query
* @returns True if the node has the permission, false otherwise
*/ */
hasPermission(node: any, permission: PermissionsEnum | string): boolean { hasPermission(node: any, permission: PermissionsEnum | string): boolean {
return this.contentService.hasPermission(node, permission); return this.contentService.hasPermission(node, permission);

View File

@@ -44,6 +44,7 @@ export class FolderActionsService {
/** /**
* Gets the handler function for an action. * Gets the handler function for an action.
* @param key Identifier for the action * @param key Identifier for the action
* @returns The handler function
*/ */
getHandler(key: string): ContentActionHandler { getHandler(key: string): ContentActionHandler {
if (key) { if (key) {
@@ -57,6 +58,7 @@ export class FolderActionsService {
* Sets a new handler function for an action. * Sets a new handler function for an action.
* @param key Identifier for the action * @param key Identifier for the action
* @param handler The new handler function * @param handler The new handler function
* @returns True if the key was a valid action identifier, false otherwise
*/ */
setHandler(key: string, handler: ContentActionHandler): boolean { setHandler(key: string, handler: ContentActionHandler): boolean {
if (key) { if (key) {
@@ -70,6 +72,7 @@ export class FolderActionsService {
/** /**
* Checks if an action is available for a particular item. * Checks if an action is available for a particular item.
* @param obj Item to check * @param obj Item to check
* @returns True if the action is available, false otherwise
*/ */
canExecuteAction(obj: any): boolean { canExecuteAction(obj: any): boolean {
return this.documentListService && obj && obj.entry.isFolder === true; return this.documentListService && obj && obj.entry.isFolder === true;

View File

@@ -33,13 +33,17 @@ export class TagService {
/** /**
* Gets a list of tags added to a node. * Gets a list of tags added to a node.
* @param nodeId ID of the target node * @param nodeId ID of the target node
* @returns TagPaging object (defined in JSAPI) containing the tags
*/ */
getTagsByNodeId(nodeId: string): any { getTagsByNodeId(nodeId: string): any {
return Observable.fromPromise(this.apiService.getInstance().core.tagsApi.getNodeTags(nodeId)) return Observable.fromPromise(this.apiService.getInstance().core.tagsApi.getNodeTags(nodeId))
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/** Gets a list of all the tags already defined in the repository. */ /**
* Gets a list of all the tags already defined in the repository.
* @returns TagPaging object (defined in JSAPI) containing the tags
*/
getAllTheTags() { getAllTheTags() {
return Observable.fromPromise(this.apiService.getInstance().core.tagsApi.getTags()) return Observable.fromPromise(this.apiService.getInstance().core.tagsApi.getTags())
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
@@ -49,6 +53,7 @@ export class TagService {
* Adds a tag to a node. * Adds a tag to a node.
* @param nodeId ID of the target node * @param nodeId ID of the target node
* @param tagName Name of the tag to add * @param tagName Name of the tag to add
* @returns TagEntry object (defined in JSAPI) with details of the new tag
*/ */
addTag(nodeId: string, tagName: string): any { addTag(nodeId: string, tagName: string): any {
let alfrescoApi: any = this.apiService.getInstance(); let alfrescoApi: any = this.apiService.getInstance();
@@ -70,6 +75,7 @@ export class TagService {
* Removes a tag from a node. * Removes a tag from a node.
* @param nodeId ID of the target node * @param nodeId ID of the target node
* @param tag Name of the tag to remove * @param tag Name of the tag to remove
* @returns Null object when the operation completes
*/ */
removeTag(nodeId: string, tag: string): any { removeTag(nodeId: string, tag: string): any {
let promiseRemove = Observable.fromPromise(this.apiService.getInstance().core.tagsApi.removeTag(nodeId, tag)); let promiseRemove = Observable.fromPromise(this.apiService.getInstance().core.tagsApi.removeTag(nodeId, tag));

View File

@@ -38,18 +38,38 @@ export class ProcessContentService {
return this.apiService.getInstance().activiti.contentApi; return this.apiService.getInstance().activiti.contentApi;
} }
/**
* Create temporary related content from an uploaded file.
* @param file File to use for content
* @returns The created content data
*/
createTemporaryRawRelatedContent(file: any): Observable<RelatedContentRepresentation> { createTemporaryRawRelatedContent(file: any): Observable<RelatedContentRepresentation> {
return Observable.fromPromise(this.contentApi.createTemporaryRawRelatedContent(file)).catch(err => this.handleError(err)); return Observable.fromPromise(this.contentApi.createTemporaryRawRelatedContent(file)).catch(err => this.handleError(err));
} }
/**
* Gets the metadata for a related content item.
* @param contentId ID of the content item
* @returns Metadata for the content
*/
getFileContent(contentId: number): Observable<RelatedContentRepresentation> { getFileContent(contentId: number): Observable<RelatedContentRepresentation> {
return Observable.fromPromise(this.contentApi.getContent(contentId)).catch(err => this.handleError(err)); return Observable.fromPromise(this.contentApi.getContent(contentId)).catch(err => this.handleError(err));
} }
/**
* Gets raw binary content data for a related content file.
* @param contentId ID of the related content
* @returns Binary data of the related content
*/
getFileRawContent(contentId: number): Observable<Blob> { getFileRawContent(contentId: number): Observable<Blob> {
return Observable.fromPromise(this.contentApi.getRawContent(contentId)).catch(err => this.handleError(err)); return Observable.fromPromise(this.contentApi.getRawContent(contentId)).catch(err => this.handleError(err));
} }
/**
* Gets the preview for a related content file.
* @param contentId ID of the related content
* @returns Binary data of the content preview
*/
getContentPreview(contentId: number): Observable<Blob> { getContentPreview(contentId: number): Observable<Blob> {
return new Observable(observer => { return new Observable(observer => {
this.contentApi.getContentPreview(contentId).then( this.contentApi.getContentPreview(contentId).then(
@@ -73,39 +93,83 @@ export class ProcessContentService {
}); });
} }
/**
* Gets a URL for direct access to a related content file.
* @param contentId ID of the related content
* @returns URL to access the content
*/
getFileRawContentUrl(contentId: number): string { getFileRawContentUrl(contentId: number): string {
return this.contentApi.getRawContentUrl(contentId); return this.contentApi.getRawContentUrl(contentId);
} }
/**
* Gets the thumbnail for a related content file.
* @param contentId ID of the related content
* @returns Binary data of the thumbnail image
*/
getContentThumbnail(contentId: number): Observable<Blob> { getContentThumbnail(contentId: number): Observable<Blob> {
return Observable.fromPromise(this.contentApi.getContentThumbnail(contentId)).catch(err => this.handleError(err)); return Observable.fromPromise(this.contentApi.getContentThumbnail(contentId)).catch(err => this.handleError(err));
} }
/**
* Gets related content items for a task instance.
* @param taskId ID of the target task
* @returns Metadata for the content
*/
getTaskRelatedContent(taskId: string): Observable<any> { getTaskRelatedContent(taskId: string): Observable<any> {
return Observable.fromPromise(this.contentApi.getRelatedContentForTask(taskId)) return Observable.fromPromise(this.contentApi.getRelatedContentForTask(taskId))
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/**
* Gets related content items for a process instance.
* @param processId ID of the target process
* @returns Metadata for the content
*/
getProcessRelatedContent(processId: string): Observable<any> { getProcessRelatedContent(processId: string): Observable<any> {
return Observable.fromPromise(this.contentApi.getRelatedContentForProcessInstance(processId)) return Observable.fromPromise(this.contentApi.getRelatedContentForProcessInstance(processId))
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/**
* Deletes related content.
* @param contentId Identifier of the content to delete
* @returns Null response that notifies when the deletion is complete
*/
deleteRelatedContent(contentId: number): Observable<any> { deleteRelatedContent(contentId: number): Observable<any> {
return Observable.fromPromise(this.contentApi.deleteContent(contentId)) return Observable.fromPromise(this.contentApi.deleteContent(contentId))
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/**
* Associates an uploaded file with a process instance.
* @param processInstanceId ID of the target process instance
* @param content File to associate
* @param opts Options supported by JSAPI
* @returns Details of created content
*/
createProcessRelatedContent(processInstanceId: string, content: any, opts?: any): Observable<any> { createProcessRelatedContent(processInstanceId: string, content: any, opts?: any): Observable<any> {
return Observable.fromPromise(this.contentApi.createRelatedContentOnProcessInstance(processInstanceId, content, opts)) return Observable.fromPromise(this.contentApi.createRelatedContentOnProcessInstance(processInstanceId, content, opts))
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/**
* Associates an uploaded file with a task instance.
* @param taskId ID of the target task
* @param file File to associate
* @param opts Options supported by JSAPI
* @returns Details of created content
*/
createTaskRelatedContent(taskId: string, file: any, opts?: any) { createTaskRelatedContent(taskId: string, file: any, opts?: any) {
return Observable.fromPromise(this.contentApi.createRelatedContentOnTask(taskId, file, opts)) return Observable.fromPromise(this.contentApi.createRelatedContentOnTask(taskId, file, opts))
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/**
* Creates a JSON representation of data.
* @param res Object representing data
* @returns JSON object
*/
toJson(res: any) { toJson(res: any) {
if (res) { if (res) {
return res || {}; return res || {};
@@ -113,6 +177,11 @@ export class ProcessContentService {
return {}; return {};
} }
/**
* Creates a JSON array representation of data.
* @param res Object representing data
* @returns JSON array object
*/
toJsonArray(res: any) { toJsonArray(res: any) {
if (res) { if (res) {
return res.data || []; return res.data || [];
@@ -120,6 +189,11 @@ export class ProcessContentService {
return []; return [];
} }
/**
* Reports an error message.
* @param error Data object with optional `message` and `status` fields for the error
* @returns Callback when an error occurs
*/
handleError(error: any): Observable<any> { handleError(error: any): Observable<any> {
let errMsg = ProcessContentService.UNKNOWN_ERROR_MESSAGE; let errMsg = ProcessContentService.UNKNOWN_ERROR_MESSAGE;
if (error) { if (error) {

View File

@@ -30,6 +30,10 @@ export class AppsProcessService {
private logService: LogService) { private logService: LogService) {
} }
/**
* Gets a list of deployed apps for this user.
* @returns The list of deployed apps
*/
getDeployedApplications(): Observable<AppDefinitionRepresentation[]> { getDeployedApplications(): Observable<AppDefinitionRepresentation[]> {
return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions()) return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
.map((response: any) => { .map((response: any) => {
@@ -38,6 +42,11 @@ export class AppsProcessService {
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/**
* Gets a list of deployed apps for this user, where the app name is `name`.
* @param name Name of the app
* @returns The list of deployed apps
*/
getDeployedApplicationsByName(name: string): Observable<AppDefinitionRepresentation> { getDeployedApplicationsByName(name: string): Observable<AppDefinitionRepresentation> {
return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions()) return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
.map((response: any) => { .map((response: any) => {
@@ -46,6 +55,11 @@ export class AppsProcessService {
.catch(err => this.handleError(err)); .catch(err => this.handleError(err));
} }
/**
* Gets the details for a specific app ID number.
* @param appId ID of the target app
* @returns Details of the app
*/
getApplicationDetailsById(appId: number): Observable<AppDefinitionRepresentation> { getApplicationDetailsById(appId: number): Observable<AppDefinitionRepresentation> {
return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions()) return Observable.fromPromise(this.apiService.getInstance().activiti.appsApi.getAppDefinitions())
.map((response: any) => { .map((response: any) => {

View File

@@ -32,6 +32,12 @@ export class CommentProcessService {
private logService: LogService) { private logService: LogService) {
} }
/**
* Adds a comment to a task.
* @param taskId ID of the target task
* @param message Text for the comment
* @returns Details about the comment
*/
addTaskComment(taskId: string, message: string): Observable<CommentModel> { addTaskComment(taskId: string, message: string): Observable<CommentModel> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.addTaskComment({message: message}, taskId)) return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.addTaskComment({message: message}, taskId))
.map(res => res) .map(res => res)
@@ -46,6 +52,11 @@ export class CommentProcessService {
} }
/**
* Gets all comments that have been added to a task.
* @param taskId ID of the target task
* @returns Details for each comment
*/
getTaskComments(taskId: string): Observable<CommentModel[]> { getTaskComments(taskId: string): Observable<CommentModel[]> {
return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.getTaskComments(taskId)) return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.getTaskComments(taskId))
.map(res => res) .map(res => res)
@@ -59,6 +70,11 @@ export class CommentProcessService {
}).catch(err => this.handleError(err)); }).catch(err => this.handleError(err));
} }
/**
* Gets all comments that have been added to a process instance.
* @param processInstanceId ID of the target process instance
* @returns Details for each comment
*/
getProcessInstanceComments(processInstanceId: string): Observable<CommentModel[]> { getProcessInstanceComments(processInstanceId: string): Observable<CommentModel[]> {
return Observable.fromPromise(this.apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId)) return Observable.fromPromise(this.apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId))
.map(res => res) .map(res => res)
@@ -72,6 +88,12 @@ export class CommentProcessService {
}).catch(err => this.handleError(err)); }).catch(err => this.handleError(err));
} }
/**
* Adds a comment to a process instance.
* @param processInstanceId ID of the target process instance
* @param message Text for the comment
* @returns Details of the comment added
*/
addProcessInstanceComment(processInstanceId: string, message: string): Observable<CommentModel> { addProcessInstanceComment(processInstanceId: string, message: string): Observable<CommentModel> {
return Observable.fromPromise( return Observable.fromPromise(
this.apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({message: message}, processInstanceId) this.apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({message: message}, processInstanceId)

View File

@@ -36,6 +36,7 @@ export class DeletedNodesApiService {
/** /**
* Gets a list of nodes in the trash. * Gets a list of nodes in the trash.
* @param options Options for JSAPI call * @param options Options for JSAPI call
* @returns List of nodes in the trash
*/ */
getDeletedNodes(options?: Object): Observable<NodePaging> { getDeletedNodes(options?: Object): Observable<NodePaging> {
const { nodesApi, handleError } = this; const { nodesApi, handleError } = this;

View File

@@ -30,6 +30,7 @@ export class DiscoveryApiService {
/** /**
* Gets product information for Content Services. * Gets product information for Content Services.
* @returns ProductVersionModel containing product details
*/ */
public getEcmProductInfo() { public getEcmProductInfo() {
return Observable.fromPromise( return Observable.fromPromise(
@@ -40,6 +41,7 @@ export class DiscoveryApiService {
/** /**
* Gets product information for Process Services. * Gets product information for Process Services.
* @returns ProductVersionModel containing product details
*/ */
public getBpmProductInfo() { public getBpmProductInfo() {
return Observable.fromPromise( return Observable.fromPromise(

View File

@@ -42,6 +42,7 @@ export class NodesApiService {
* Gets the stored information about a node. * Gets the stored information about a node.
* @param nodeId ID of the target node * @param nodeId ID of the target node
* @param options Optional parameters supported by JSAPI * @param options Optional parameters supported by JSAPI
* @returns Node information
*/ */
getNode(nodeId: string, options: any = {}): Observable<MinimalNodeEntryEntity> { getNode(nodeId: string, options: any = {}): Observable<MinimalNodeEntryEntity> {
const { nodesApi, handleError, getEntryFromEntity } = this; const { nodesApi, handleError, getEntryFromEntity } = this;
@@ -62,6 +63,7 @@ export class NodesApiService {
* Gets the items contained in a folder node. * Gets the items contained in a folder node.
* @param nodeId ID of the target node * @param nodeId ID of the target node
* @param options Optional parameters supported by JSAPI * @param options Optional parameters supported by JSAPI
* @returns List of child items from the folder
*/ */
getNodeChildren(nodeId: string, options: any = {}): Observable<NodePaging> { getNodeChildren(nodeId: string, options: any = {}): Observable<NodePaging> {
const { nodesApi, handleError } = this; const { nodesApi, handleError } = this;
@@ -84,6 +86,7 @@ export class NodesApiService {
* @param parentNodeId ID of the parent folder node * @param parentNodeId ID of the parent folder node
* @param nodeBody Data for the new node * @param nodeBody Data for the new node
* @param options Optional parameters supported by JSAPI * @param options Optional parameters supported by JSAPI
* @returns Details of the new node
*/ */
createNode(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> { createNode(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> {
const { nodesApi, handleError, getEntryFromEntity } = this; const { nodesApi, handleError, getEntryFromEntity } = this;
@@ -99,6 +102,7 @@ export class NodesApiService {
* @param parentNodeId ID of the parent folder node * @param parentNodeId ID of the parent folder node
* @param nodeBody Data for the new folder * @param nodeBody Data for the new folder
* @param options Optional parameters supported by JSAPI * @param options Optional parameters supported by JSAPI
* @returns Details of the new folder
*/ */
createFolder(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> { createFolder(parentNodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> {
const body = Object.assign({ nodeType: 'cm:folder' }, nodeBody); const body = Object.assign({ nodeType: 'cm:folder' }, nodeBody);
@@ -110,6 +114,7 @@ export class NodesApiService {
* @param nodeId ID of the target node * @param nodeId ID of the target node
* @param nodeBody New data for the node * @param nodeBody New data for the node
* @param options Optional parameters supported by JSAPI * @param options Optional parameters supported by JSAPI
* @returns Updated node information
*/ */
updateNode(nodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> { updateNode(nodeId: string, nodeBody: any, options: any = {}): Observable<MinimalNodeEntryEntity> {
const { nodesApi, handleError, getEntryFromEntity } = this; const { nodesApi, handleError, getEntryFromEntity } = this;
@@ -124,6 +129,7 @@ export class NodesApiService {
* Moves a node to the trashcan. * Moves a node to the trashcan.
* @param nodeId ID of the target node * @param nodeId ID of the target node
* @param options Optional parameters supported by JSAPI * @param options Optional parameters supported by JSAPI
* @returns Empty result that notifies when the deletion is complete
*/ */
deleteNode(nodeId: string, options: any = {}): Observable<void> { deleteNode(nodeId: string, options: any = {}): Observable<void> {
const { nodesApi, handleError } = this; const { nodesApi, handleError } = this;
@@ -138,6 +144,7 @@ export class NodesApiService {
/** /**
* Restores a node previously moved to the trashcan. * Restores a node previously moved to the trashcan.
* @param nodeId ID of the node to restore * @param nodeId ID of the node to restore
* @returns Details of the restored node
*/ */
restoreNode(nodeId: string): Observable<MinimalNodeEntryEntity> { restoreNode(nodeId: string): Observable<MinimalNodeEntryEntity> {
const { nodesApi, handleError, getEntryFromEntity } = this; const { nodesApi, handleError, getEntryFromEntity } = this;
@@ -153,6 +160,7 @@ export class NodesApiService {
/** /**
* Reports an error. * Reports an error.
* @param error Object representing the error * @param error Object representing the error
* @returns Error information
*/ */
handleError(error: any): Observable<any> { handleError(error: any): Observable<any> {
return Observable.throw(error); return Observable.throw(error);

View File

@@ -32,6 +32,7 @@ export class PeopleContentService {
/** /**
* Gets information about a user identified by their username. * Gets information about a user identified by their username.
* @param personId ID of the target user * @param personId ID of the target user
* @returns User information
*/ */
getPerson(personId: string): Observable<any> { getPerson(personId: string): Observable<any> {
const { peopleApi, handleError } = this; const { peopleApi, handleError } = this;
@@ -42,7 +43,10 @@ export class PeopleContentService {
.catch(handleError); .catch(handleError);
} }
/** Gets information about the user who is currently logged-in. */ /**
* Gets information about the user who is currently logged in.
* @returns User information
*/
getCurrentPerson(): Observable<any> { getCurrentPerson(): Observable<any> {
return this.getPerson('-me-'); return this.getPerson('-me-');
} }

View File

@@ -35,6 +35,7 @@ export class PeopleProcessService {
* Gets information about users across all tasks. * Gets information about users across all tasks.
* @param taskId ID of the task * @param taskId ID of the task
* @param searchWord Filter text to search for * @param searchWord Filter text to search for
* @returns Array of user information objects
*/ */
getWorkflowUsers(taskId?: string, searchWord?: string): Observable<UserProcessModel[]> { getWorkflowUsers(taskId?: string, searchWord?: string): Observable<UserProcessModel[]> {
let option = { excludeTaskId: taskId, filter: searchWord }; let option = { excludeTaskId: taskId, filter: searchWord };
@@ -46,6 +47,7 @@ export class PeopleProcessService {
/** /**
* Gets the profile picture URL for the specified user. * Gets the profile picture URL for the specified user.
* @param user The target user * @param user The target user
* @returns Profile picture URL
*/ */
getUserImage(user: UserProcessModel): string { getUserImage(user: UserProcessModel): string {
return this.getUserProfileImageApi(user.id); return this.getUserProfileImageApi(user.id);
@@ -55,6 +57,7 @@ export class PeopleProcessService {
* Sets a user to be involved with a task. * Sets a user to be involved with a task.
* @param taskId ID of the target task * @param taskId ID of the target task
* @param idToInvolve ID of the user to involve * @param idToInvolve ID of the user to involve
* @returns Empty response when the update completes
*/ */
involveUserWithTask(taskId: string, idToInvolve: string): Observable<UserProcessModel[]> { involveUserWithTask(taskId: string, idToInvolve: string): Observable<UserProcessModel[]> {
let node = {userId: idToInvolve}; let node = {userId: idToInvolve};
@@ -66,6 +69,7 @@ export class PeopleProcessService {
* Removes a user who is currently involved with a task. * Removes a user who is currently involved with a task.
* @param taskId ID of the target task * @param taskId ID of the target task
* @param idToRemove ID of the user to remove * @param idToRemove ID of the user to remove
* @returns Empty response when the update completes
*/ */
removeInvolvedUser(taskId: string, idToRemove: string): Observable<UserProcessModel[]> { removeInvolvedUser(taskId: string, idToRemove: string): Observable<UserProcessModel[]> {
let node = {userId: idToRemove}; let node = {userId: idToRemove};

View File

@@ -60,14 +60,15 @@ export class UploadService {
/** /**
* Checks whether the service is uploading a file. * Checks whether the service is uploading a file.
* @memberof UploadService * @returns True if a file is uploading, false otherwise
*/ */
isUploading(): boolean { isUploading(): boolean {
return this.activeTask ? true : false; return this.activeTask ? true : false;
} }
/** /**
* Returns the file Queue * Gets the file Queue
* @returns Array of files that form the queue
*/ */
getQueue(): FileModel[] { getQueue(): FileModel[] {
return this.queue; return this.queue;
@@ -76,6 +77,7 @@ export class UploadService {
/** /**
* Adds files to the uploading queue to be uploaded * Adds files to the uploading queue to be uploaded
* @param files One or more separate parameters or an array of files to queue * @param files One or more separate parameters or an array of files to queue
* @returns Array of files that were not blocked from upload by the ignore list
*/ */
addToQueue(...files: FileModel[]): FileModel[] { addToQueue(...files: FileModel[]): FileModel[] {
const allowedFiles = files.filter(f => this.filterElement(f)); const allowedFiles = files.filter(f => this.filterElement(f));
@@ -95,10 +97,7 @@ export class UploadService {
/** /**
* Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder. * Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder.
*
* @param emitter (Deprecated) Emitter to invoke on file status change * @param emitter (Deprecated) Emitter to invoke on file status change
*
* @memberof UploadService
*/ */
uploadFilesInTheQueue(emitter: EventEmitter<any>): void { uploadFilesInTheQueue(emitter: EventEmitter<any>): void {
if (!this.activeTask) { if (!this.activeTask) {
@@ -127,7 +126,7 @@ export class UploadService {
/** /**
* Cancels uploading of files. * Cancels uploading of files.
* @param files One or more separate parameters or an array of files * @param files One or more separate parameters or an array of files specifying uploads to cancel
*/ */
cancelUpload(...files: FileModel[]) { cancelUpload(...files: FileModel[]) {
files.forEach(file => { files.forEach(file => {
@@ -154,6 +153,7 @@ export class UploadService {
/** /**
* Gets an upload promise for a file. * Gets an upload promise for a file.
* @param file The target file * @param file The target file
* @returns Promise that is resolved if the upload is successful or error otherwise
*/ */
getUploadPromise(file: FileModel) { getUploadPromise(file: FileModel) {
let opts: any = { let opts: any = {

View File

@@ -35,6 +35,7 @@ export class EcmUserService {
/** /**
* Gets information about a user identified by their username. * Gets information about a user identified by their username.
* @param userName Target username * @param userName Target username
* @returns User information
*/ */
getUserInfo(userName: string): Observable<EcmUserModel> { getUserInfo(userName: string): Observable<EcmUserModel> {
return Observable.fromPromise(this.apiService.getInstance().core.peopleApi.getPerson(userName)) return Observable.fromPromise(this.apiService.getInstance().core.peopleApi.getPerson(userName))
@@ -44,6 +45,7 @@ export class EcmUserService {
/** /**
* Gets information about the user who is currently logged-in. * Gets information about the user who is currently logged-in.
* @returns User information as for getUserInfo
*/ */
getCurrentUserInfo() { getCurrentUserInfo() {
return this.getUserInfo('-me-'); return this.getUserInfo('-me-');
@@ -52,6 +54,7 @@ export class EcmUserService {
/** /**
* Returns a profile image as a URL. * Returns a profile image as a URL.
* @param avatarId Target avatar * @param avatarId Target avatar
* @returns Image URL
*/ */
getUserProfileImage(avatarId: string) { getUserProfileImage(avatarId: string) {
if (avatarId) { if (avatarId) {