From b393708514f402da6174d3a157591adc57822bfa Mon Sep 17 00:00:00 2001
From: Andy Stark <30621568+therealandeeee@users.noreply.github.com>
Date: Fri, 4 May 2018 11:11:11 +0100
Subject: [PATCH] [ADF-2905] Updated JSDocs for content services (#3262)
* [ADF-2905] Updated JSDocs for content services
* [ADF-2905] Updated JSDocs for content services
* [ADF-2911] Improved error message handling in doc tools (#3267)
* [ADF-2772] Sidenav Layout - UX review (#3264)
* Add border-right in mat-sidenav
* workaround for enum issue in js-api
* fix the AoT buid error
* fix AoT build error
* fix export problem for AoT
* [ADF-2905] Updated JSDocs for content services
* [ADF-2905] Updated JSDocs for content services
---
.../content-metadata.component.md | 12 +--
.../content-node-dialog.service.md | 60 ++++++--------
.../custom-resources.service.md | 78 +++++++++----------
.../folder-create.directive.md | 16 ++--
.../content-services/folder-edit.directive.md | 6 +-
docs/content-services/node-lock.directive.md | 8 +-
.../node-permission.service.md | 25 +++---
.../permission-list.component.md | 10 +--
.../content-metadata.component.ts | 8 ++
.../content-node-dialog.service.ts | 71 +++++++++++------
.../directives/node-lock.directive.ts | 1 +
.../services/custom-resources.service.ts | 53 +++++++++++++
.../folder-create.directive.ts | 5 +-
.../folder-directive/folder-edit.directive.ts | 4 +-
.../permission-list.component.ts | 2 +
.../services/node-permission.service.ts | 18 +++++
16 files changed, 233 insertions(+), 144 deletions(-)
diff --git a/docs/content-services/content-metadata.component.md b/docs/content-services/content-metadata.component.md
index 4613099eaf..44e4a3d903 100644
--- a/docs/content-services/content-metadata.component.md
+++ b/docs/content-services/content-metadata.component.md
@@ -26,12 +26,12 @@ Displays and edits metadata related to a node.
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
-| displayEmpty | `boolean` | false | |
-| editable | `boolean` | false | |
-| expanded | `boolean` | false | |
-| multi | `boolean` | false | |
-| node | `MinimalNodeEntryEntity` | | |
-| preset | `string` | | |
+| displayEmpty | `boolean` | false | Toggles whether to display empty values in the card view |
+| editable | `boolean` | false | Toggles whether the edit button should be shown |
+| expanded | `boolean` | false | Toggles between expanded (ie, full information) and collapsed (ie, reduced information) in the display |
+| multi | `boolean` | false | The multi parameter of the underlying material expansion panel |
+| node | `MinimalNodeEntryEntity` | | (required) The node entity to fetch metadata about |
+| preset | `string` | | Name of the metadata preset, which defines aspects and their properties |
## Details
diff --git a/docs/content-services/content-node-dialog.service.md b/docs/content-services/content-node-dialog.service.md
index 5aba53b76a..90b5e733b9 100644
--- a/docs/content-services/content-node-dialog.service.md
+++ b/docs/content-services/content-node-dialog.service.md
@@ -1,7 +1,7 @@
---
Added: v2.1.0
Status: Active
-Last reviewed: 2018-03-13
+Last reviewed: 2018-05-03
---
# Content Node Dialog service
@@ -14,51 +14,45 @@ Displays and manages dialogs for selecting content to open, copy or upload.
- `close()`
Closes the currently open dialog.
-
- - `getTitleTranslation(action: string = null, name: string = null): string`
-
- - `action: string = null` -
+- `getTitleTranslation(action: string = null, name: string = null): string`
+ Gets the translation of the dialog title.
+ - `action: string = null` - Name of the action to display in the dialog title
- `name: string = null` - Name of the item on which the action is being performed
- - **Returns** `string` -
-
+ - **Returns** `string` - Translated version of the title
- `openCopyMoveDialog(action: string = null, contentEntry: MinimalNodeEntryEntity = null, permission?: string = null): Observable`
-
- - `action: string = null` -
- - `contentEntry: MinimalNodeEntryEntity = null` -
+ Opens a dialog to copy or move an item to a new location.
+ - `action: string = null` - Name of the action (eg, "Copy" or "Move") to show in the title
+ - `contentEntry: MinimalNodeEntryEntity = null` - Item to be copied or moved
- `permission?: string = null` - (Optional) Permission for the operation
- - **Returns** `Observable` -
-
+ - **Returns** `Observable` - Information about files that were copied/moved
- `openFileBrowseDialogByFolderId(folderNodeId: string = null): Observable`
-
+ Opens a file browser at a chosen folder location.
- `folderNodeId: string = null` - ID of the folder to use
- - **Returns** `Observable` -
-
+ - **Returns** `Observable` - Information about the selected file(s)
- `openFileBrowseDialogBySite(): Observable`
Opens a file browser at a chosen site location.
- - **Returns** `Observable` -
+ - **Returns** `Observable` - Information about the selected file(s)
- `openFolderBrowseDialogByFolderId(folderNodeId: string = null): Observable`
-
+ Opens a folder browser at a chosen folder location.
- `folderNodeId: string = null` - ID of the folder to use
- - **Returns** `Observable` -
-
+ - **Returns** `Observable` - Information about the selected folder(s)
- `openFolderBrowseDialogBySite(): Observable`
Opens a folder browser at a chosen site location.
- - **Returns** `Observable` -
+ - **Returns** `Observable` - Information about the selected folder(s)
- `openLockNodeDialog(contentEntry: MinimalNodeEntryEntity = null): Subject`
- Opens a lock node dialog
+ Opens a lock node dialog.
- `contentEntry: MinimalNodeEntryEntity = null` - Node to lock
- - **Returns** `Subject` -
+ - **Returns** `Subject` - Error/status message (if any)
- `openUploadFileDialog(action: string = null, contentEntry: MinimalNodeEntryEntity = null): Observable`
-
- - `action: string = null` -
+ Opens a dialog to choose a file to upload.
+ - `action: string = null` - Name of the action to show in the title
- `contentEntry: MinimalNodeEntryEntity = null` - Item to upload
- - **Returns** `Observable` -
-
+ - **Returns** `Observable` - Information about the chosen file(s)
- `openUploadFolderDialog(action: string = null, contentEntry: MinimalNodeEntryEntity = null): Observable`
-
- - `action: string = null` -
+ Opens a dialog to choose folders to upload.
+ - `action: string = null` - Name of the action to show in the title
- `contentEntry: MinimalNodeEntryEntity = null` - Item to upload
- - **Returns** `Observable` -
+ - **Returns** `Observable` - Information about the chosed folder(s)
## Details
@@ -87,14 +81,6 @@ using a folder ID string. This can be obtained from the `id` property of a
dialog operation, say) or be set to one of the well-known names "-my-" , "-shared-" or
"-root-".
-The `openCopyMoveDialog` and `openUploadXXX` methods require the following parameters:
-
-| Name | Type | Description |
-| ---- | ---- | ----------- |
-| action | string | The label for the confirm button of the dialog. |
-| contentEntry | [MinimalNodeEntryEntity](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/MinimalNode.md) | The node we want to be copied/moved or uploaded. |
-| neededPermissionForAction | string | (`openCopyMoveDialog` only) Permission required to perform the relative action (eg: copy will need the 'update' permission ). |
-
## See Also
- [Content node selector panel component](content-node-selector-panel.component.md)
diff --git a/docs/content-services/custom-resources.service.md b/docs/content-services/custom-resources.service.md
index b81f47a005..4eb567b204 100644
--- a/docs/content-services/custom-resources.service.md
+++ b/docs/content-services/custom-resources.service.md
@@ -1,7 +1,7 @@
---
Added: v2.3.0
Status: Active
-Last reviewed: 2018-04-12
+Last reviewed: 2018-05-03
---
# Custom Resources service
@@ -13,56 +13,48 @@ Manages Document List information that is specific to a user.
### Methods
- `getCorrespondingNodeIds(nodeId: string = null, pagination: PaginationModel = null): Observable`
-
- - `nodeId: string = null` -
- - `pagination: PaginationModel = null` -
- - **Returns** `Observable` -
-
+ Gets the contents of one of the well-known aliases in the form of node ID strings.
+ - `nodeId: string = null` - ID of the target folder node
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - **Returns** `Observable` - List of node IDs
- `getRecentFiles(personId: string = null, pagination: PaginationModel = null): Observable`
-
- - `personId: string = null` -
- - `pagination: PaginationModel = null` -
- - **Returns** `Observable` -
-
+ Gets files recently accessed by a user.
+ - `personId: string = null` - ID of the user
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - **Returns** `Observable` - List of nodes for the recently used files
- `isCustomSource(folderId: string = null): boolean`
-
- - `folderId: string = null` -
- - **Returns** `boolean` -
-
+ Is the folder ID one of the well-known aliases?
+ - `folderId: string = null` - Folder ID name to check
+ - **Returns** `boolean` - True if the ID is a well-known name, false otherwise
- `loadFavorites(pagination: PaginationModel = null, includeFields: string[] = []): Observable`
-
- - `pagination: PaginationModel = null` -
- - `includeFields: string[] = []` -
- - **Returns** `Observable` -
-
+ Gets favorite files for the current user.
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - `includeFields: string[] = []` - List of data field names to include in the results
+ - **Returns** `Observable` - List of favorite files
- `loadFolderByNodeId(nodeId: string = null, pagination: PaginationModel = null, includeFields: string[] = null): Observable`
-
- - `nodeId: string = null` -
- - `pagination: PaginationModel = null` -
- - `includeFields: string[] = null` -
- - **Returns** `Observable` -
-
+ Gets a folder's contents.
+ - `nodeId: string = null` - ID of the target folder node
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - `includeFields: string[] = null` - List of data field names to include in the results
+ - **Returns** `Observable` - List of items contained in the folder
- `loadMemberSites(pagination: PaginationModel = null): Observable`
-
- - `pagination: PaginationModel = null` -
- - **Returns** `Observable` -
-
+ Gets sites that the current user is a member of.
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - **Returns** `Observable` - List of sites
- `loadSharedLinks(pagination: PaginationModel = null, includeFields: string[] = []): Observable`
-
- - `pagination: PaginationModel = null` -
- - `includeFields: string[] = []` -
- - **Returns** `Observable` -
-
+ Gets shared links for the current user.
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - `includeFields: string[] = []` - List of data field names to include in the results
+ - **Returns** `Observable` - List of shared links
- `loadSites(pagination: PaginationModel = null): Observable`
-
- - `pagination: PaginationModel = null` -
- - **Returns** `Observable` -
-
+ Gets all sites in the respository.
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - **Returns** `Observable` - List of sites
- `loadTrashcan(pagination: PaginationModel = null, includeFields: string[] = []): Observable`
-
- - `pagination: PaginationModel = null` -
- - `includeFields: string[] = []` -
- - **Returns** `Observable` -
+ Gets all items currently in the trash.
+ - `pagination: PaginationModel = null` - Specifies how to paginate the results
+ - `includeFields: string[] = []` - List of data field names to include in the results
+ - **Returns** `Observable` - List of deleted items
## Details
diff --git a/docs/content-services/folder-create.directive.md b/docs/content-services/folder-create.directive.md
index f09b6a2da4..35c398b059 100644
--- a/docs/content-services/folder-create.directive.md
+++ b/docs/content-services/folder-create.directive.md
@@ -1,7 +1,7 @@
---
Added: v2.0.0
Status: Active
-Last reviewed: 2018-04-10
+Last reviewed: 2018-05-03
---
# Folder Create directive
@@ -31,20 +31,24 @@ Creates folders.
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
-| nodeType | `string` | "cm:folder" | |
+| nodeType | `string` | "cm:folder" | Type of node to create. |
| adf-create-folder | `string` | DEFAULT_FOLDER_PARENT_ID | Parent folder where the new folder will be located after creation. |
-| title | `string` | null | |
+| title | `string` | null | Title of folder creation dialog. |
### Events
| Name | Type | Description |
| -- | -- | -- |
-| error | `EventEmitter` | Emitted when the create folder give error for example a folder with same name already exist |
-| success | `EventEmitter` | |
+| error | `EventEmitter` | Emitted when an error occurs (eg, a folder with same name already exists). |
+| success | `EventEmitter` | Emitted when the folder is created successfully. |
## Details
Pass this directive the id of the parent folder where you want the new folder node to be created.
If no value is provided, the '-my-' alias is used.
This will open a Folder Dialog component to receive data for the new folder. If the data is valid
-then the dialog will emit a `folderCreate` event when it closes.
+then the dialog will emit a `success` event when it closes.
+
+## See also
+
+- [Folder Edit directive](folder-edit.directive.md)
diff --git a/docs/content-services/folder-edit.directive.md b/docs/content-services/folder-edit.directive.md
index b4597a0aaa..33d7cc45d1 100644
--- a/docs/content-services/folder-edit.directive.md
+++ b/docs/content-services/folder-edit.directive.md
@@ -32,14 +32,14 @@ Allows folders to be edited.
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
| adf-edit-folder | `MinimalNodeEntryEntity` | | Folder node to edit. |
-| title | `string` | null | |
+| title | `string` | null | Title of folder edit dialog. |
### Events
| Name | Type | Description |
| -- | -- | -- |
-| error | `EventEmitter` | Emitted when the edit/create folder give error for example a folder with same name already exist |
-| success | `EventEmitter` | |
+| error | `EventEmitter` | Emitted when an error occurs (eg, a folder with same name already exists). |
+| success | `EventEmitter` | Emitted when the folder has been edited successfully. |
## Details
diff --git a/docs/content-services/node-lock.directive.md b/docs/content-services/node-lock.directive.md
index 7aa56d713e..6c1d26dc41 100644
--- a/docs/content-services/node-lock.directive.md
+++ b/docs/content-services/node-lock.directive.md
@@ -22,12 +22,14 @@ Locks a node.
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
-| adf-node-lock | `MinimalNodeEntryEntity` | | |
+| adf-node-lock | `MinimalNodeEntryEntity` | | Node to lock/unlock. |
## Details
-When the directive is clicked a dialog is shown and you can lock or unlock a file (folder cannot be locked)
-there are two types of lock: indefinite lock and time lock.
+When the decorated element (eg, div) is clicked, a dialog is shown to let you lock
+or unlock a file (a folder cannot be locked).
+
+There are two types of lock: indefinite lock and time lock.
If the time is not selected the user will lock the file it until will not unlock it
When a file is locked it can be locked and unlocked by default only by the user that creates the lock but you can also allow the other file owners to modify it

diff --git a/docs/content-services/node-permission.service.md b/docs/content-services/node-permission.service.md
index 1ac71aac8d..6cf4458eee 100644
--- a/docs/content-services/node-permission.service.md
+++ b/docs/content-services/node-permission.service.md
@@ -12,25 +12,22 @@ Manages the role permissions for the content nodes
### Methods
- `getGroupMemeberByGroupName(groupName: string = null, opts?: any = null): Observable`
-
- - `groupName: string = null` -
- - `opts?: any = null` - (Optional)
- - **Returns** `Observable` -
-
+ Gets all members related to a group name.
+ - `groupName: string = null` - Name of group to look for members
+ - `opts?: any = null` - (Optional) Extra options supported by JSAPI
+ - **Returns** `Observable` - List of members
- `getNodeRoles(node: MinimalNodeEntryEntity = null): Observable`
-
- - `node: MinimalNodeEntryEntity = null` -
- - **Returns** `Observable` -
-
+ Gets a list of roles for the current node.
+ - `node: MinimalNodeEntryEntity = null` - The target node
+ - **Returns** `Observable` - Array of strings representing the roles
- `updatePermissionRoles(node: MinimalNodeEntryEntity = null, updatedPermissionRole: PermissionElement = null): Observable`
-
- - `node: MinimalNodeEntryEntity = null` -
- - `updatedPermissionRole: PermissionElement = null` -
- - **Returns** `Observable` -
+ Updates the permission for a node.
+ - `node: MinimalNodeEntryEntity = null` - Target node
+ - `updatedPermissionRole: PermissionElement = null` - Permission role to update or add
+ - **Returns** `Observable` - Node with updated permission
## Details
-Content Services supports
This service needs the support for the groups api fo content services that is available from version 5.2.1
See the
diff --git a/docs/content-services/permission-list.component.md b/docs/content-services/permission-list.component.md
index 9a8d45eccc..26f7e2907b 100644
--- a/docs/content-services/permission-list.component.md
+++ b/docs/content-services/permission-list.component.md
@@ -1,7 +1,7 @@
---
Added: v2.3.0
Status: Active
-Last reviewed: 2018-03-23
+Last reviewed: 2018-05-03
---
# Permission List Component
@@ -34,17 +34,17 @@ or custom template can be added:
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
-| nodeId | `string` | "" | |
+| nodeId | `string` | "" | ID of the node whose permissions you want to show. |
### Events
| Name | Type | Description |
| -- | -- | -- |
-| update | `EventEmitter` | |
+| update | `EventEmitter` | Emitted when the permission is updated. |
## Details
This component uses a [Datatable component](../core/datatable.component.md) to show the
permissions retrieved from the [Node service](../core/node.service.md).
-For the locallyset permissions a role dropdown will be showed allowing the user to change it.
-When user select a new value, the permission role is automatically updated and the `update` event is thrown.
+For the locally set permissions a role dropdown will be shown to let the user select a new role.
+When the user selects a new value, the permission role is automatically updated and the `update` event is emitted.
diff --git a/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts
index 0e1e7a95bb..109f2e99ef 100644
--- a/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts
+++ b/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.ts
@@ -31,21 +31,29 @@ import { CardViewGroup } from '../../interfaces/content-metadata.interfaces';
})
export class ContentMetadataComponent implements OnChanges, OnInit {
+ /** (required) The node entity to fetch metadata about */
@Input()
node: MinimalNodeEntryEntity;
+ /** Toggles whether the edit button should be shown */
@Input()
editable: boolean = false;
+ /** Toggles whether to display empty values in the card view */
@Input()
displayEmpty: boolean = false;
+ /** Toggles between expanded (ie, full information) and collapsed
+ * (ie, reduced information) in the display
+ */
@Input()
expanded: boolean = false;
+ /** The multi parameter of the underlying material expansion panel */
@Input()
multi = false;
+ /** Name of the metadata preset, which defines aspects and their properties */
@Input()
preset: string;
diff --git a/lib/content-services/content-node-selector/content-node-dialog.service.ts b/lib/content-services/content-node-selector/content-node-dialog.service.ts
index ed6895daab..0105869c40 100644
--- a/lib/content-services/content-node-selector/content-node-dialog.service.ts
+++ b/lib/content-services/content-node-selector/content-node-dialog.service.ts
@@ -32,6 +32,7 @@ import 'rxjs/operator/switchMap';
@Injectable()
export class ContentNodeDialogService {
+ /** Emitted when an error occurs. */
@Output()
error: EventEmitter = new EventEmitter();
@@ -42,8 +43,11 @@ export class ContentNodeDialogService {
private translation: TranslationService) {
}
- /** Opens a file browser at a chosen folder location. */
- /** @param folderNodeId ID of the folder to use */
+ /**
+ * Opens a file browser at a chosen folder location.
+ * @param folderNodeId ID of the folder to use
+ * @returns Information about the selected file(s)
+ */
openFileBrowseDialogByFolderId(folderNodeId: string): Observable {
return this.documentListService.getFolderNode(folderNodeId).switchMap((node: MinimalNodeEntryEntity) => {
return this.openUploadFileDialog('Choose', node);
@@ -51,9 +55,9 @@ export class ContentNodeDialogService {
}
/**
- * Opens a lock node dialog
- *
+ * Opens a lock node dialog.
* @param contentEntry Node to lock
+ * @returns Error/status message (if any)
*/
public openLockNodeDialog(contentEntry: MinimalNodeEntryEntity): Subject {
const observable: Subject = new Subject();
@@ -76,33 +80,44 @@ export class ContentNodeDialogService {
return observable;
}
- /** Opens a file browser at a chosen site location. */
+ /**
+ * Opens a file browser at a chosen site location.
+ * @returns Information about the selected file(s)
+ */
openFileBrowseDialogBySite(): Observable {
return this.siteService.getSites().switchMap((response: SitePaging) => {
return this.openFileBrowseDialogByFolderId(response.list.entries[0].entry.guid);
});
}
- /** Opens a folder browser at a chosen site location. */
+ /**
+ * Opens a folder browser at a chosen site location.
+ * @returns Information about the selected folder(s)
+ */
openFolderBrowseDialogBySite(): Observable {
return this.siteService.getSites().switchMap((response: SitePaging) => {
return this.openFolderBrowseDialogByFolderId(response.list.entries[0].entry.guid);
});
}
- /** Opens a folder browser at a chosen folder location. */
- /** @param folderNodeId ID of the folder to use */
+ /**
+ * Opens a folder browser at a chosen folder location.
+ * @param folderNodeId ID of the folder to use
+ * @returns Information about the selected folder(s)
+ */
openFolderBrowseDialogByFolderId(folderNodeId: string): Observable {
return this.documentListService.getFolderNode(folderNodeId).switchMap((node: MinimalNodeEntryEntity) => {
return this.openUploadFolderDialog('Choose', node);
});
}
- /** Opens a dialog to copy or move an item to a new location. */
- /** @param action Name of the action (eg, "Copy" or "Move") to show in the title */
-
- /** @param contentEntry Item to be copied or moved */
- /** @param permission Permission for the operation */
+ /**
+ * Opens a dialog to copy or move an item to a new location.
+ * @param action Name of the action (eg, "Copy" or "Move") to show in the title
+ * @param contentEntry Item to be copied or moved
+ * @param permission Permission for the operation
+ * @returns Information about files that were copied/moved
+ */
openCopyMoveDialog(action: string, contentEntry: MinimalNodeEntryEntity, permission?: string): Observable {
if (this.contentService.hasPermission(contentEntry, permission)) {
@@ -132,18 +147,22 @@ export class ContentNodeDialogService {
}
}
- /** Gets the translation of the dialog title. */
-
- /** @param action Name of the action to display in the dialog title */
- /** @param name Name of the item on which the action is being performed */
+ /**
+ * Gets the translation of the dialog title.
+ * @param action Name of the action to display in the dialog title
+ * @param name Name of the item on which the action is being performed
+ * @returns Translated version of the title
+ */
getTitleTranslation(action: string, name: string): string {
return this.translation.instant(`NODE_SELECTOR.${action.toUpperCase()}_ITEM`, { name });
}
- /** Opens a dialog to choose a folder to upload. */
-
- /** @param action Name of the action to show in the title */
- /** @param contentEntry Item to upload */
+ /**
+ * Opens a dialog to choose folders to upload.
+ * @param action Name of the action to show in the title
+ * @param contentEntry Item to upload
+ * @returns Information about the chosed folder(s)
+ */
openUploadFolderDialog(action: string, contentEntry: MinimalNodeEntryEntity): Observable {
const select = new Subject();
select.subscribe({
@@ -164,10 +183,12 @@ export class ContentNodeDialogService {
return select;
}
- /** Opens a dialog to choose a file to upload. */
-
- /** @param action Name of the action to show in the title */
- /** @param contentEntry Item to upload */
+ /**
+ * Opens a dialog to choose a file to upload.
+ * @param action Name of the action to show in the title
+ * @param contentEntry Item to upload
+ * @returns Information about the chosen file(s)
+ */
openUploadFileDialog(action: string, contentEntry: MinimalNodeEntryEntity): Observable {
const select = new Subject();
select.subscribe({
diff --git a/lib/content-services/directives/node-lock.directive.ts b/lib/content-services/directives/node-lock.directive.ts
index 96b33c4c56..70fb10d134 100644
--- a/lib/content-services/directives/node-lock.directive.ts
+++ b/lib/content-services/directives/node-lock.directive.ts
@@ -27,6 +27,7 @@ import { ContentNodeDialogService } from '../content-node-selector/content-node-
})
export class NodeLockDirective implements AfterViewInit {
+ /** Node to lock/unlock. */
@Input('adf-node-lock')
node: MinimalNodeEntryEntity;
diff --git a/lib/content-services/document-list/services/custom-resources.service.ts b/lib/content-services/document-list/services/custom-resources.service.ts
index 9e890862be..fe5d870c8d 100644
--- a/lib/content-services/document-list/services/custom-resources.service.ts
+++ b/lib/content-services/document-list/services/custom-resources.service.ts
@@ -40,6 +40,12 @@ export class CustomResourcesService {
private logService: LogService) {
}
+ /**
+ * Gets files recently accessed by a user.
+ * @param personId ID of the user
+ * @param pagination Specifies how to paginate the results
+ * @returns List of nodes for the recently used files
+ */
getRecentFiles(personId: string, pagination: PaginationModel): Observable {
return new Observable(observer => {
this.apiService.peopleApi.getPerson(personId)
@@ -83,6 +89,12 @@ export class CustomResourcesService {
}).catch(err => this.handleError(err));
}
+ /**
+ * Gets favorite files for the current user.
+ * @param pagination Specifies how to paginate the results
+ * @param includeFields List of data field names to include in the results
+ * @returns List of favorite files
+ */
loadFavorites(pagination: PaginationModel, includeFields: string[] = []): Observable {
let includeFieldsRequest = this.getIncludesFields(includeFields);
@@ -123,6 +135,11 @@ export class CustomResourcesService {
}).catch(err => this.handleError(err));
}
+ /**
+ * Gets sites that the current user is a member of.
+ * @param pagination Specifies how to paginate the results
+ * @returns List of sites
+ */
loadMemberSites(pagination: PaginationModel): Observable {
const options = {
include: ['properties'],
@@ -157,6 +174,11 @@ export class CustomResourcesService {
}).catch(err => this.handleError(err));
}
+ /**
+ * Gets all sites in the respository.
+ * @param pagination Specifies how to paginate the results
+ * @returns List of sites
+ */
loadSites(pagination: PaginationModel): Observable {
const options = {
include: ['properties'],
@@ -183,6 +205,12 @@ export class CustomResourcesService {
}).catch(err => this.handleError(err));
}
+ /**
+ * Gets all items currently in the trash.
+ * @param pagination Specifies how to paginate the results
+ * @param includeFields List of data field names to include in the results
+ * @returns List of deleted items
+ */
loadTrashcan(pagination: PaginationModel, includeFields: string[] = []): Observable {
let includeFieldsRequest = this.getIncludesFields(includeFields);
@@ -196,6 +224,12 @@ export class CustomResourcesService {
}
+ /**
+ * Gets shared links for the current user.
+ * @param pagination Specifies how to paginate the results
+ * @param includeFields List of data field names to include in the results
+ * @returns List of shared links
+ */
loadSharedLinks(pagination: PaginationModel, includeFields: string[] = []): Observable {
let includeFieldsRequest = this.getIncludesFields(includeFields);
@@ -208,6 +242,11 @@ export class CustomResourcesService {
return Observable.fromPromise(this.apiService.sharedLinksApi.findSharedLinks(options)).catch(err => this.handleError(err));
}
+ /**
+ * Is the folder ID one of the well-known aliases?
+ * @param folderId Folder ID name to check
+ * @returns True if the ID is a well-known name, false otherwise
+ */
isCustomSource(folderId: string): boolean {
let isCustomSources = false;
const sources = ['-trashcan-', '-sharedlinks-', '-sites-', '-mysites-', '-favorites-', '-recent-'];
@@ -219,6 +258,13 @@ export class CustomResourcesService {
return isCustomSources;
}
+ /**
+ * Gets a folder's contents.
+ * @param nodeId ID of the target folder node
+ * @param pagination Specifies how to paginate the results
+ * @param includeFields List of data field names to include in the results
+ * @returns List of items contained in the folder
+ */
loadFolderByNodeId(nodeId: string, pagination: PaginationModel, includeFields: string[]): Observable {
if (nodeId === '-trashcan-') {
return this.loadTrashcan(pagination, includeFields);
@@ -236,6 +282,13 @@ export class CustomResourcesService {
}
// TODO: remove it from here
+
+ /**
+ * Gets the contents of one of the well-known aliases in the form of node ID strings.
+ * @param nodeId ID of the target folder node
+ * @param pagination Specifies how to paginate the results
+ * @returns List of node IDs
+ */
getCorrespondingNodeIds(nodeId: string, pagination: PaginationModel): Observable {
if (nodeId === '-trashcan-') {
return Observable.fromPromise(this.apiService.nodesApi.getDeletedNodes()
diff --git a/lib/content-services/folder-directive/folder-create.directive.ts b/lib/content-services/folder-directive/folder-create.directive.ts
index 0f298fb191..de4ef33a02 100644
--- a/lib/content-services/folder-directive/folder-create.directive.ts
+++ b/lib/content-services/folder-directive/folder-create.directive.ts
@@ -35,16 +35,19 @@ export class FolderCreateDirective {
@Input('adf-create-folder')
parentNodeId: string = DEFAULT_FOLDER_PARENT_ID;
+ /** Title of folder creation dialog. */
@Input()
title: string = null;
+ /** Type of node to create. */
@Input()
nodeType = 'cm:folder';
- /** Emitted when the create folder give error for example a folder with same name already exist */
+ /** Emitted when an error occurs (eg, a folder with same name already exists). */
@Output()
error: EventEmitter = new EventEmitter();
+ /** Emitted when the folder is created successfully. */
@Output()
success: EventEmitter = new EventEmitter();
diff --git a/lib/content-services/folder-directive/folder-edit.directive.ts b/lib/content-services/folder-directive/folder-edit.directive.ts
index b54bf23363..8bfd82faa5 100644
--- a/lib/content-services/folder-directive/folder-edit.directive.ts
+++ b/lib/content-services/folder-directive/folder-edit.directive.ts
@@ -35,13 +35,15 @@ export class FolderEditDirective {
@Input('adf-edit-folder')
folder: MinimalNodeEntryEntity;
- /** Emitted when the edit/create folder give error for example a folder with same name already exist */
+ /** Emitted when an error occurs (eg, a folder with same name already exists). */
@Output()
error: EventEmitter = new EventEmitter();
+ /** Title of folder edit dialog. */
@Input()
title: string = null;
+ /** Emitted when the folder has been edited successfully. */
@Output()
success: EventEmitter = new EventEmitter();
diff --git a/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts b/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts
index 0a49a03841..2facc2869e 100644
--- a/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts
+++ b/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts
@@ -29,9 +29,11 @@ import { NodePermissionService } from '../../services/node-permission.service';
})
export class PermissionListComponent implements OnInit {
+ /** ID of the node whose permissions you want to show. */
@Input()
nodeId: string = '';
+ /** Emitted when the permission is updated. */
@Output()
update: EventEmitter = new EventEmitter();
diff --git a/lib/content-services/permission-manager/services/node-permission.service.ts b/lib/content-services/permission-manager/services/node-permission.service.ts
index 63d74e73fa..357b5e6202 100644
--- a/lib/content-services/permission-manager/services/node-permission.service.ts
+++ b/lib/content-services/permission-manager/services/node-permission.service.ts
@@ -31,6 +31,11 @@ export class NodePermissionService {
private nodeService: NodesApiService) {
}
+ /**
+ * Gets a list of roles for the current node.
+ * @param node The target node
+ * @returns Array of strings representing the roles
+ */
getNodeRoles(node: MinimalNodeEntryEntity): Observable {
const retrieveSiteQueryBody: QueryBody = this.buildRetrieveSiteQueryBody(node.path.elements);
return this.searchApiService.searchByQueryBody(retrieveSiteQueryBody)
@@ -44,7 +49,14 @@ export class NodePermissionService {
});
}
+ /**
+ * Updates the permission for a node.
+ * @param node Target node
+ * @param updatedPermissionRole Permission role to update or add
+ * @returns Node with updated permission
+ */
updatePermissionRole(node: MinimalNodeEntryEntity, updatedPermissionRole: PermissionElement): Observable {
+
let permissionBody = { permissions: { locallySet: []} };
const index = node.permissions.locallySet.map((permission) => permission.authorityId).indexOf(updatedPermissionRole.authorityId);
permissionBody.permissions.locallySet = permissionBody.permissions.locallySet.concat(node.permissions.locallySet);
@@ -109,6 +121,12 @@ export class NodePermissionService {
});
}
+ /**
+ * Gets all members related to a group name.
+ * @param groupName Name of group to look for members
+ * @param opts Extra options supported by JSAPI
+ * @returns List of members
+ */
getGroupMemeberByGroupName(groupName: string, opts?: any): Observable {
return Observable.fromPromise(this.apiService.groupsApi.getGroupMembers(groupName, opts));
}