mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4152] Restructured Content Services docs (#4429)
* [ADF-4152] Moved content services docs to subfolders * [ADF-4152] Manual URL fixes for cont services docs * [ADF-4152] Moved content services docs to subfolders * [ADF-4152] Manual URL fixes for cont services docs * [ADF-4152] Updated doc index pages for content services
This commit is contained in:
committed by
Eugenio Romano
parent
bc5208b767
commit
dfea5c2f04
@@ -0,0 +1,69 @@
|
||||
---
|
||||
Title: Node Public File Share Directive
|
||||
Added: v2.3.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-09-13
|
||||
---
|
||||
|
||||
# [Node Public File Share Directive](../../../lib/content-services/content-node-share/content-node-share.directive.ts "Defined in content-node-share.directive.ts")
|
||||
|
||||
Creates and manages public shared links for files.
|
||||
|
||||

|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<adf-toolbar>
|
||||
<button mat-icon-button
|
||||
#shared="adfShare"
|
||||
[disabled]="!shared.isFile"
|
||||
[baseShareUrl]="http://localhost:8080/myrouteForShareFile/"
|
||||
[adf-share]="documentList.selection[0]">
|
||||
<mat-icon>share</mat-icon>
|
||||
</button>
|
||||
</adf-toolbar>
|
||||
|
||||
<adf-document-list #documentList ...>
|
||||
...
|
||||
</adf-document-list>
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| baseShareUrl | `string` | | Prefix to add to the generated link. |
|
||||
| node | [`NodeEntry`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeEntry.md) | | [Node](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) to share. |
|
||||
|
||||
## Details
|
||||
|
||||
This dialog will generate a link with the form "baseShareUrl + sharedId".
|
||||
For example, if you set the input parameter as follows:
|
||||
|
||||
[baseShareUrl]="http://localhost:8080/myrouteForShareFile/"
|
||||
|
||||
...or through `app.config.json`:
|
||||
|
||||
{
|
||||
...
|
||||
"baseShareUrl": 'http://external/url',
|
||||
...
|
||||
}
|
||||
|
||||
...then the directive will ask the [Content service](../../core/services/content.service.md) to generate
|
||||
a `sharedId` for the file. This will create a URL like the following:
|
||||
|
||||
http://localhost:8080/myrouteForShareFile/NEW_GENERATED_SHAREID
|
||||
|
||||
To use this, you will need to implement some code that gets the `NEW_GENERATED_SHAREID` with the router
|
||||
and passes it to a [Viewer component](../../core/components/viewer.component.md):
|
||||
|
||||
```html
|
||||
<adf-viewer
|
||||
[sharedLinkId]="NEW_GENERATED_SHAREID"
|
||||
[allowGoBack]="false">
|
||||
</adf-viewer>
|
||||
```
|
78
docs/content-services/directives/file-draggable.directive.md
Normal file
78
docs/content-services/directives/file-draggable.directive.md
Normal file
@@ -0,0 +1,78 @@
|
||||
---
|
||||
Title: File Draggable directive
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-04-10
|
||||
---
|
||||
|
||||
# [File Draggable directive](../../../lib/content-services/upload/directives/file-draggable.directive.ts "Defined in file-draggable.directive.ts")
|
||||
|
||||
Provides drag-and-drop features for an element such as a `div`.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<div [adf-file-draggable]="true" id="DragAndDropBorder" class="drag-and-drop-border"
|
||||
(filesDropped)="onFilesDropped($event)"
|
||||
(folderEntityDropped)="onFolderEntityDropped($event)"
|
||||
dropzone="" webkitdropzone="*" #dragAndDropArea>
|
||||
<ng-content></ng-content>
|
||||
Drag and Drop files here!
|
||||
</div>
|
||||
```
|
||||
|
||||
Some sample CSS to show the drag and drop area:
|
||||
|
||||
```css
|
||||
.drag-and-drop-border {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
border: double;
|
||||
background-color: lightblue;
|
||||
width: 400px;
|
||||
height: 100px;
|
||||
}
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| enabled | `boolean` | true | Enables/disables drag-and-drop functionality. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| filesDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<File[]>` | Emitted when one or more files are dragged and dropped onto the draggable element. |
|
||||
| folderEntityDropped | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when a directory is dragged and dropped onto the draggable element. |
|
||||
|
||||
## Details
|
||||
|
||||
Typically you would use the [Upload Drag Area component](../components/upload-drag-area.component.md) instead of this directive.
|
||||
|
||||
### Event handler implementations
|
||||
|
||||
```ts
|
||||
export class SomeComponent implements OnInit {
|
||||
|
||||
onFilesDropped(files: File[]): void {
|
||||
if (files.length) {
|
||||
// Use for example the uploadService to upload files to ACS
|
||||
console.log('# of files dropped: ', files.length);
|
||||
}
|
||||
}
|
||||
|
||||
onFolderEntityDropped(folder: any): void {
|
||||
if (folder.isDirectory) {
|
||||
// Use for example the uploadService to upload folder content to ACS
|
||||
console.log('Folder dropped: ', folder);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Upload Drag Area component](../components/upload-drag-area.component.md)
|
55
docs/content-services/directives/folder-create.directive.md
Normal file
55
docs/content-services/directives/folder-create.directive.md
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
Title: Folder Create directive
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
---
|
||||
|
||||
# [Folder Create directive](../../../lib/content-services/folder-directive/folder-create.directive.ts "Defined in folder-create.directive.ts")
|
||||
|
||||
Creates folders.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<adf-toolbar>
|
||||
<button mat-icon-button
|
||||
[adf-create-folder]="documentList.currentFolderId"
|
||||
title="Title of the dialog"
|
||||
(success)="doSomething($event)">
|
||||
<mat-icon>create_new_folder</mat-icon>
|
||||
</button>
|
||||
</adf-toolbar>
|
||||
|
||||
<adf-document-list #documentList ...>
|
||||
...
|
||||
</adf-document-list>
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeType | `string` | "cm:folder" | Type of node to create. |
|
||||
| parentNodeId | `string` | | Parent folder where the new folder will be located after creation. |
|
||||
| title | `string` | null | Title of folder creation dialog. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs (eg, a folder with same name already exists). |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md)`>` | 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](../../../lib/content-services/dialogs/folder.dialog.ts) to receive data for the new folder. If the data is valid
|
||||
then the dialog will emit a `success` event when it closes.
|
||||
|
||||
## See also
|
||||
|
||||
- [Folder Edit directive](folder-edit.directive.md)
|
48
docs/content-services/directives/folder-edit.directive.md
Normal file
48
docs/content-services/directives/folder-edit.directive.md
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
Title: Folder Edit directive
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
---
|
||||
|
||||
# [Folder Edit directive](../../../lib/content-services/folder-directive/folder-edit.directive.ts "Defined in folder-edit.directive.ts")
|
||||
|
||||
Allows folders to be edited.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<adf-toolbar title="toolbar example">
|
||||
<button mat-icon-button
|
||||
[adf-edit-folder]="documentList.selection[0]?.entry"
|
||||
title="Title of the dialog"
|
||||
(success)="doSomething($event)">
|
||||
<mat-icon>create</mat-icon>
|
||||
</button>
|
||||
</adf-toolbar>
|
||||
|
||||
<adf-document-list #documentList ...>
|
||||
...
|
||||
</adf-document-list>
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| folder | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) | | Folder node to edit. |
|
||||
| title | `string` | null | Title of folder edit dialog. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs (eg, a folder with same name already exists). |
|
||||
| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md)`>` | Emitted when the folder has been edited successfully. |
|
||||
|
||||
## Details
|
||||
|
||||
Pass this directive a folder to edit its name and description using a [Folder Dialog component](../../../lib/content-services/dialogs/folder.dialog.ts).
|
||||
If the data is valid then the dialog emits a `folderEdit` event when it closes.
|
@@ -0,0 +1,40 @@
|
||||
---
|
||||
Title: Inherit Permission directive
|
||||
Added: v2.3.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-16
|
||||
---
|
||||
|
||||
# [Inherit Permission directive](../../../lib/content-services/permission-manager/components/inherited-button.directive.ts "Defined in inherited-button.directive.ts")
|
||||
|
||||
Update the current node by adding/removing the inherited permissions.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<button mat-raised-button
|
||||
color="primary"
|
||||
adf-inherit-permission [nodeId]="nodeId"
|
||||
(updated)="onUpdatedPermissions($node)">PERMISSION</button>
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| nodeId | `string` | | ID of the node to add/remove inherited permissions. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<any>` | Emitted when an error occurs. |
|
||||
| updated | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md)`>` | Emitted when the node is updated. |
|
||||
|
||||
## Details
|
||||
|
||||
This directive switches inheritance of permissions on or off depending on what is set in
|
||||
the node entity. So if the node has inherited permissions, this will remove them and
|
||||
vice versa. If the node does not have inherited permissions then this will add them.
|
44
docs/content-services/directives/node-lock.directive.md
Normal file
44
docs/content-services/directives/node-lock.directive.md
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
Title: Node Lock directive
|
||||
Added: v2.2.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-01-17
|
||||
---
|
||||
|
||||
# [Node Lock directive](../../../lib/content-services/directives/node-lock.directive.ts "Defined in node-lock.directive.ts")
|
||||
|
||||
Locks or unlocks a node.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
```html
|
||||
<button mat-icon-button [adf-node-lock]="node.entry">
|
||||
<mat-icon>lock</mat-icon> Lock file
|
||||
</button>
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| node | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) | | [Node](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) to lock/unlock. |
|
||||
|
||||
## Details
|
||||
|
||||
When the user clicks the decorated element (eg, div), a dialog is shown to let them lock
|
||||
or unlock a file (a folder cannot be locked).
|
||||
|
||||
There are two types of lock that the user can choose from the dialog: indefinite lock and time lock. The time lock will expire at the specified time
|
||||
but the indefinite lock remains in place until the user cancels 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:
|
||||
|
||||

|
||||
|
||||
This directive calls the `openLockNodeDialog` method from the
|
||||
[Content Node Dialog service](../services/content-node-dialog.service.md)
|
||||
when clicked.
|
||||
It disables the target button if the provided node is not a file or the user doesn't
|
||||
have permissions.
|
Reference in New Issue
Block a user