mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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
This commit is contained in:
committed by
Eugenio Romano
parent
7f020348ad
commit
b393708514
@@ -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
|
||||
|
||||
|
@@ -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()`<br/>
|
||||
Closes the currently open dialog.
|
||||
|
||||
- `getTitleTranslation(action: string = null, name: string = null): string`<br/>
|
||||
|
||||
- `action: string = null` -
|
||||
- `getTitleTranslation(action: string = null, name: string = null): string`<br/>
|
||||
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<MinimalNodeEntryEntity[]>`<br/>
|
||||
|
||||
- `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<MinimalNodeEntryEntity[]>` -
|
||||
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` - Information about files that were copied/moved
|
||||
- `openFileBrowseDialogByFolderId(folderNodeId: string = null): Observable<MinimalNodeEntryEntity[]>`<br/>
|
||||
|
||||
Opens a file browser at a chosen folder location.
|
||||
- `folderNodeId: string = null` - ID of the folder to use
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` -
|
||||
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` - Information about the selected file(s)
|
||||
- `openFileBrowseDialogBySite(): Observable<MinimalNodeEntryEntity[]>`<br/>
|
||||
Opens a file browser at a chosen site location.
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` -
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` - Information about the selected file(s)
|
||||
- `openFolderBrowseDialogByFolderId(folderNodeId: string = null): Observable<MinimalNodeEntryEntity[]>`<br/>
|
||||
|
||||
Opens a folder browser at a chosen folder location.
|
||||
- `folderNodeId: string = null` - ID of the folder to use
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` -
|
||||
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` - Information about the selected folder(s)
|
||||
- `openFolderBrowseDialogBySite(): Observable<MinimalNodeEntryEntity[]>`<br/>
|
||||
Opens a folder browser at a chosen site location.
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` -
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` - Information about the selected folder(s)
|
||||
- `openLockNodeDialog(contentEntry: MinimalNodeEntryEntity = null): Subject<string>`<br/>
|
||||
Opens a lock node dialog
|
||||
Opens a lock node dialog.
|
||||
- `contentEntry: MinimalNodeEntryEntity = null` - Node to lock
|
||||
- **Returns** `Subject<string>` -
|
||||
- **Returns** `Subject<string>` - Error/status message (if any)
|
||||
- `openUploadFileDialog(action: string = null, contentEntry: MinimalNodeEntryEntity = null): Observable<MinimalNodeEntryEntity[]>`<br/>
|
||||
|
||||
- `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<MinimalNodeEntryEntity[]>` -
|
||||
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` - Information about the chosen file(s)
|
||||
- `openUploadFolderDialog(action: string = null, contentEntry: MinimalNodeEntryEntity = null): Observable<MinimalNodeEntryEntity[]>`<br/>
|
||||
|
||||
- `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<MinimalNodeEntryEntity[]>` -
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity[]>` - 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)
|
||||
|
@@ -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<string[]>`<br/>
|
||||
|
||||
- `nodeId: string = null` -
|
||||
- `pagination: PaginationModel = null` -
|
||||
- **Returns** `Observable<string[]>` -
|
||||
|
||||
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<string[]>` - List of node IDs
|
||||
- `getRecentFiles(personId: string = null, pagination: PaginationModel = null): Observable<NodePaging>`<br/>
|
||||
|
||||
- `personId: string = null` -
|
||||
- `pagination: PaginationModel = null` -
|
||||
- **Returns** `Observable<NodePaging>` -
|
||||
|
||||
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<NodePaging>` - List of nodes for the recently used files
|
||||
- `isCustomSource(folderId: string = null): boolean`<br/>
|
||||
|
||||
- `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<NodePaging>`<br/>
|
||||
|
||||
- `pagination: PaginationModel = null` -
|
||||
- `includeFields: string[] = []` -
|
||||
- **Returns** `Observable<NodePaging>` -
|
||||
|
||||
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<NodePaging>` - List of favorite files
|
||||
- `loadFolderByNodeId(nodeId: string = null, pagination: PaginationModel = null, includeFields: string[] = null): Observable<NodePaging>`<br/>
|
||||
|
||||
- `nodeId: string = null` -
|
||||
- `pagination: PaginationModel = null` -
|
||||
- `includeFields: string[] = null` -
|
||||
- **Returns** `Observable<NodePaging>` -
|
||||
|
||||
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<NodePaging>` - List of items contained in the folder
|
||||
- `loadMemberSites(pagination: PaginationModel = null): Observable<NodePaging>`<br/>
|
||||
|
||||
- `pagination: PaginationModel = null` -
|
||||
- **Returns** `Observable<NodePaging>` -
|
||||
|
||||
Gets sites that the current user is a member of.
|
||||
- `pagination: PaginationModel = null` - Specifies how to paginate the results
|
||||
- **Returns** `Observable<NodePaging>` - List of sites
|
||||
- `loadSharedLinks(pagination: PaginationModel = null, includeFields: string[] = []): Observable<NodePaging>`<br/>
|
||||
|
||||
- `pagination: PaginationModel = null` -
|
||||
- `includeFields: string[] = []` -
|
||||
- **Returns** `Observable<NodePaging>` -
|
||||
|
||||
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<NodePaging>` - List of shared links
|
||||
- `loadSites(pagination: PaginationModel = null): Observable<NodePaging>`<br/>
|
||||
|
||||
- `pagination: PaginationModel = null` -
|
||||
- **Returns** `Observable<NodePaging>` -
|
||||
|
||||
Gets all sites in the respository.
|
||||
- `pagination: PaginationModel = null` - Specifies how to paginate the results
|
||||
- **Returns** `Observable<NodePaging>` - List of sites
|
||||
- `loadTrashcan(pagination: PaginationModel = null, includeFields: string[] = []): Observable<DeletedNodesPaging>`<br/>
|
||||
|
||||
- `pagination: PaginationModel = null` -
|
||||
- `includeFields: string[] = []` -
|
||||
- **Returns** `Observable<DeletedNodesPaging>` -
|
||||
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<DeletedNodesPaging>` - List of deleted items
|
||||
|
||||
## Details
|
||||
|
||||
|
@@ -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<any>` | Emitted when the create folder give error for example a folder with same name already exist |
|
||||
| success | `EventEmitter<MinimalNodeEntryEntity>` | |
|
||||
| error | `EventEmitter<any>` | Emitted when an error occurs (eg, a folder with same name already exists). |
|
||||
| success | `EventEmitter<MinimalNodeEntryEntity>` | 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)
|
||||
|
@@ -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<any>` | Emitted when the edit/create folder give error for example a folder with same name already exist |
|
||||
| success | `EventEmitter<MinimalNodeEntryEntity>` | |
|
||||
| error | `EventEmitter<any>` | Emitted when an error occurs (eg, a folder with same name already exists). |
|
||||
| success | `EventEmitter<MinimalNodeEntryEntity>` | Emitted when the folder has been edited successfully. |
|
||||
|
||||
## Details
|
||||
|
||||
|
@@ -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
|
||||

|
||||
|
@@ -12,25 +12,22 @@ Manages the role permissions for the content nodes
|
||||
### Methods
|
||||
|
||||
- `getGroupMemeberByGroupName(groupName: string = null, opts?: any = null): Observable<GroupMemberPaging>`<br/>
|
||||
|
||||
- `groupName: string = null` -
|
||||
- `opts?: any = null` - (Optional)
|
||||
- **Returns** `Observable<GroupMemberPaging>` -
|
||||
|
||||
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<GroupMemberPaging>` - List of members
|
||||
- `getNodeRoles(node: MinimalNodeEntryEntity = null): Observable<string[]>`<br/>
|
||||
|
||||
- `node: MinimalNodeEntryEntity = null` -
|
||||
- **Returns** `Observable<string[]>` -
|
||||
|
||||
Gets a list of roles for the current node.
|
||||
- `node: MinimalNodeEntryEntity = null` - The target node
|
||||
- **Returns** `Observable<string[]>` - Array of strings representing the roles
|
||||
- `updatePermissionRoles(node: MinimalNodeEntryEntity = null, updatedPermissionRole: PermissionElement = null): Observable<MinimalNodeEntryEntity>`<br/>
|
||||
|
||||
- `node: MinimalNodeEntryEntity = null` -
|
||||
- `updatedPermissionRole: PermissionElement = null` -
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity>` -
|
||||
Updates the permission for a node.
|
||||
- `node: MinimalNodeEntryEntity = null` - Target node
|
||||
- `updatedPermissionRole: PermissionElement = null` - Permission role to update or add
|
||||
- **Returns** `Observable<MinimalNodeEntryEntity>` - 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
|
||||
|
@@ -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<PermissionElement>` | |
|
||||
| update | `EventEmitter<PermissionElement>` | 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.
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -32,6 +32,7 @@ import 'rxjs/operator/switchMap';
|
||||
@Injectable()
|
||||
export class ContentNodeDialogService {
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
@Output()
|
||||
error: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@@ -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<MinimalNodeEntryEntity[]> {
|
||||
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<string> {
|
||||
const observable: Subject<string> = new Subject<string>();
|
||||
@@ -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<MinimalNodeEntryEntity[]> {
|
||||
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<MinimalNodeEntryEntity[]> {
|
||||
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<MinimalNodeEntryEntity[]> {
|
||||
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<MinimalNodeEntryEntity[]> {
|
||||
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<MinimalNodeEntryEntity[]> {
|
||||
const select = new Subject<MinimalNodeEntryEntity[]>();
|
||||
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<MinimalNodeEntryEntity[]> {
|
||||
const select = new Subject<MinimalNodeEntryEntity[]>();
|
||||
select.subscribe({
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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<NodePaging> {
|
||||
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<NodePaging> {
|
||||
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<NodePaging> {
|
||||
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<NodePaging> {
|
||||
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<DeletedNodesPaging> {
|
||||
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<NodePaging> {
|
||||
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<NodePaging> {
|
||||
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<string[]> {
|
||||
if (nodeId === '-trashcan-') {
|
||||
return Observable.fromPromise(this.apiService.nodesApi.getDeletedNodes()
|
||||
|
@@ -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<any> = new EventEmitter<any>();
|
||||
|
||||
/** Emitted when the folder is created successfully. */
|
||||
@Output()
|
||||
success: EventEmitter<MinimalNodeEntryEntity> = new EventEmitter<MinimalNodeEntryEntity>();
|
||||
|
||||
|
@@ -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<any> = new EventEmitter<any>();
|
||||
|
||||
/** Title of folder edit dialog. */
|
||||
@Input()
|
||||
title: string = null;
|
||||
|
||||
/** Emitted when the folder has been edited successfully. */
|
||||
@Output()
|
||||
success: EventEmitter<MinimalNodeEntryEntity> = new EventEmitter<MinimalNodeEntryEntity>();
|
||||
|
||||
|
@@ -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<PermissionElement> = new EventEmitter();
|
||||
|
||||
|
@@ -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<string[]> {
|
||||
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<MinimalNodeEntryEntity> {
|
||||
|
||||
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<GroupMemberPaging> {
|
||||
return Observable.fromPromise(this.apiService.groupsApi.getGroupMembers(groupName, opts));
|
||||
}
|
||||
|
Reference in New Issue
Block a user