[ADF-1586] Added Content Services doc files (#2683)

This commit is contained in:
Andy Stark 2017-11-21 11:52:12 +00:00 committed by Eugenio Romano
parent dae7cbfc90
commit a2ee8dbfcf
10 changed files with 277 additions and 12 deletions

View File

@ -93,6 +93,7 @@ for more information about installing and using the source code.
### Services
- [App config service](app-config.service.md)
- [Activiti alfresco service](activiti-alfresco.service.md)
- [Form rendering service](form-rendering.service.md)
- [Form service](form.service.md)
- [Node service](node.service.md)
@ -128,7 +129,6 @@ for more information about installing and using the source code.
- [User preferences service](user-preferences.service.md)
- [Bpm user service](bpm-user.service.md)
- [Ecm user service](ecm-user.service.md)
- [*Activiti alfresco service](../lib/core/form/services/activiti-alfresco.service.ts)
### Widgets
@ -154,6 +154,7 @@ for more information about installing and using the source code.
- [Breadcrumb component](breadcrumb.component.md)
- [Dropdown breadcrumb component](dropdown-breadcrumb.component.md)
- [Content node selector component](content-node-selector.component.md)
- [Content action component](content-action.component.md)
- [Document list component](document-list.component.md)
- [Search control component](search-control.component.md)
@ -172,17 +173,12 @@ for more information about installing and using the source code.
- [Webscript component](webscript.component.md)
- [*Content metadata card component](../lib/content-services/content-metadata/content-metadata-card.component.ts)
- [*Content metadata component](../lib/content-services/content-metadata/content-metadata.component.ts)
- [*Content node selector component](../lib/content-services/content-node-selector/content-node-selector.component.ts)
- [*File uploading list row component](../lib/content-services/upload/components/file-uploading-list-row.component.ts)
- [*File uploading list component](../lib/content-services/upload/components/file-uploading-list.component.ts)
- [*Version upload component](../lib/content-services/version-manager/version-upload.component.ts)
### Directives
- [Folder create directive](folder-create.directive.md)
- [Folder edit directive](folder-edit.directive.md)
- [File draggable directive](file-draggable.directive.md)
- [*Search trigger directive](../lib/content-services/search/components/search-trigger.directive.ts)
### Models
@ -192,13 +188,11 @@ for more information about installing and using the source code.
### Services
- [Document actions service](document-actions.service.md)
- [Document list service](document-list.service.md)
- [Folder actions service](folder-actions.service.md)
- [Rating service](rating.service.md)
- [Tag service](tag.service.md)
- [*Content metadata service](../lib/content-services/content-metadata/content-metadata.service.ts)
- [*Content node selector service](../lib/content-services/content-node-selector/content-node-selector.service.ts)
- [*Document list service](../lib/content-services/document-list/services/document-list.service.ts)
- [*Node actions service](../lib/content-services/document-list/services/node-actions.service.ts)
- [*Rating service](../lib/content-services/social/services/rating.service.ts)
- [*Tag service](../lib/content-services/tag/services/tag.service.ts)
<!-- content-services end -->
[(Back to Contents)](#contents)

View File

@ -0,0 +1,96 @@
# Content Node Selector component
Allows a user to select items from a Content Services repository.
![Content Node Selector screenshot](docassets/images/ContentNodeSelector.png)
## Basic Usage
```ts
import { MatDialog } from '@angular/material';
...
constructor(dialog: MatDialog ... ) {}
openSelectorDialog() {
data: ContentNodeSelectorComponentData = {
title: "Choose an item",
currentFolderId: someFolderId,
select: new EventEmitter<MinimalNodeEntryEntity[]>()
};
this.dialog.open(
ContentNodeSelectorComponent,
{
data, panelClass: 'adf-content-node-selector-dialog',
width: '630px'
}
);
data.select.subscribe((selections: MinimalNodeEntryEntity[]) => {
// Use or store selection...
this.dialog.closeAll();
});
}
```
### Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| title | string | "" | Text shown at the top of the selector |
| currentFolderId | string | null | Node ID of the folder currently listed |
| rowFilter | RowFilter | null | Custom row filter function |
| imageResolver | ImageResolver | null | Custom image resolver function |
| pageSize | number | 10 | Number of items shown per page in the list |
### Events
| Name | Description |
| --- | --- |
| select | Emitted when the user has selected an item |
## Details
The Content Node Selector component works a lot like the standard File Open/Save
dialog used by desktop applications except that it chooses items from a Content Services
repository rather than the filesystem. For example, the
[Document List component](document-list.component.md) uses a selector to choose the targets
of Copy/Move actions (see the [Content Action component](content-action.component.md) for
more information).
Unlike most components, the Content Node Selector is typically shown in a dialog box
rather than the main page. You can use the
[Angular Material Dialog](https://material.angular.io/components/dialog/overview) for this,
as shown in the usage example. ADF provides the `ContentNodeSelectorComponentData` interface
to work with the Dialog's
[data option](https://material.angular.io/components/dialog/overview#sharing-data-with-the-dialog-component-):
```ts
interface ContentNodeSelectorComponentData {
title: string;
currentFolderId?: string;
rowFilter?: RowFilter;
imageResolver?: ImageResolver;
select: EventEmitter<MinimalNodeEntryEntity[]>;
}
```
### RowFilter and ImageResolver
The Content Node Selector uses a [Document List](document-list.component.md) to display the
items that the user can choose. As with the standard Document List, you can supply a custom
**row filter** function (to hide items that can't be chosen) and a custom **image resolver**
function (to select an image to show in a particular list cell). For example, you could use
a row filter to hide document nodes in a folder selector. See the
[Advanced Usage and Customization](document-list.component.md#advanced-usage-and-customization)
section of the Document List page to learn how these functions are implemented.
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
<!-- seealso start -->
## See also
- [Document list component](document-list.component.md)
<!-- seealso end -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -768,6 +768,8 @@ That will give the following output:
- [Nodes api service](nodes-api.service.md)
- [Breadcrumb component](breadcrumb.component.md)
- [Content action component](content-action.component.md)
- [Content node selector component](content-node-selector.component.md)
- [Document list service](document-list.service.md)
- [Dropdown breadcrumb component](dropdown-breadcrumb.component.md)
- [Permissions style model](permissions-style.model.md)
- [Version manager component](version-manager.component.md)

View File

@ -0,0 +1,84 @@
# Document List service
Implements node operations used by the Document List component.
## Methods
`deleteNode(nodeId: string): Observable<any>`<br/>
Deletes a node.
`copyNode(nodeId: string, targetParentId: string)`<br/>
Places a copy of an existing node under a new parent node.
`moveNode(nodeId: string, targetParentId: string)`<br/>
hasPermission(node: any, permission: PermissionsEnum|string): boolean.
`createFolder(name: string, parentId: string): Observable<MinimalNodeEntity>`<br/>
Creates a folder.
`getFolder(folder: string, opts?: any): Observable<NodePaging>`<br/>
Gets a folder node via its pathname from root.
`getFolderNode(nodeId: string): Promise<MinimalNodeEntryEntity>`<br/>
Gets a folder node via its node ID.
`getDocumentThumbnailUrl(node: MinimalNodeEntity): string`<br/>
Gets the thumbnail URL for a document node.
`getMimeTypeIcon(mimeType: string): string`<br/>
Gets the icon that represents a MIME type.
`getDefaultMimeTypeIcon(): string`<br/>
Gets a default icon for MIME types with no specific icon.
`hasPermission(node: any, permission: PermissionsEnum|string): boolean`<br/>
Gets a folder node via its pathname from root.
## Details
This service makes extensive use of the Alfresco JS API. In particular,
see the
[Nodes API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodesApi.md#getNodeChildren)
for further details of the types, options and the underlying REST architecture.
Also, the [Document Library model](document-library.model.md) in the ADF docs has
more information about related classes.
### Moving, copying and deleting nodes
Both `moveNode` and `copyNode` create a copy of the existing node under a new
parent, but `moveNode` also deletes the original. The new node has the same
name as the original and if it is a folder then all its contents will be copied
in-place.
Use `deleteNode` to move a node from its original location into the trash (from
where it can be restored if necessary). If the deleted node is a folder then its
child items will also be moved to the trash.
### Folder operations
Use `getFolderNode` to get a folder node by its node ID and `getFolder` to access
the folder via its pathname from the root folder. Also, `getFolder` allows you to
specify extra options in the `opts` parameter; see the
[getNodeChildren](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodesApi.md#getNodeChildren)
method in the Alfresco JS API for more information about the available options.
Use `createFolder` to add a new folder in a given parent folder node. You can
specify the well-known names "-my-" , "-shared-" and "-root-" as shortcuts for
the `parentId`.
### Permissions
The `hasPermission` method reports whether or not the user has the specified permission for the
node. The Permissions enum contains the values DELETE, UPDATE, CREATE, UPDATEPERMISSIONS, NOT_DELETE, NOT_UPDATE, NOT_CREATE and NOT_UPDATEPERMISSIONS but you can also supply these
values via their string equivalents.
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
<!-- seealso start -->
## See also
- [Document list component](document-list.component.md)
<!-- seealso end -->

34
docs/rating.service.md Normal file
View File

@ -0,0 +1,34 @@
# Rating service
Manages ratings for items in Content Services.
## Methods
`getRating(nodeId: string, ratingType: any): any`<br/>
Gets the current user's rating for a node.
`postRating(nodeId: string, ratingType: any, vote: any): any`<br/>
Adds the current user's rating for a node.
`deleteRating(nodeId: string, ratingType: any): any`<br/>
Removes the current user's rating for a node.
## Details
The `ratingType` string currently has two possible options, "likes"
and "fiveStar". When the "likes" scheme is used, the result of
`getRating` and the `vote` parameter of `postRating` are boolean
values. When "fiveStar" is used, the value is an integer representing
the number of stars out of five.
See the [Ratings API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/RatingsApi.md)
in the Alfresco JS API for more information about the returned data and the
REST API that this service is based on.
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
<!-- seealso start -->
## See also
- [Like component](like.component.md)
- [Rating component](rating.component.md)
<!-- seealso end -->

View File

@ -23,6 +23,7 @@
"comment-process.model": [],
"comment-process.service": ["comment-process.model"],
"content-action.component": ["document-list.component", "document-actions.service", "folder-actions.service"],
"content-node-selector.component": ["document-list.component"],
"content.service": ["cookie.service", "storage.service"],
"context-menu.directive": [],
"cookie.service": ["content.service"],
@ -49,6 +50,7 @@
"document-library.model",
"nodes-api.service"
],
"document-list.service": ["document-list.component"],
"dropdown-breadcrumb.component": ["document-list.component", "breadcrumb.component"],
"ecm-user.model": ["ecm-user.service", "people-content.service"],
"ecm-user.service": [],
@ -99,6 +101,7 @@
"process-list.component": [],
"product-version.model": [],
"rating.component": ["like.component"],
"rating.service": ["like.component", "rating.component"],
"renditions.service": [],
"search-control.component": ["search.component"],
"search.component": [],
@ -111,6 +114,7 @@
"storage.service": ["cookie.service"],
"tag-actions.component": [],
"tag-list.component": [],
"tag.service": ["tag-list.component"],
"tag-node-list.component": [],
"task-attachment-list.component": [],
"task-audit.directive": [],

46
docs/tag.service.md Normal file
View File

@ -0,0 +1,46 @@
# Tag service
Manages tags in Content Services.
## Methods
`getTagsByNodeId(nodeId: string): any`<br/>
Gets a list of tags added to a node.
`getAllTheTags()`<br/>
Gets a list of all the tags already defined in the repository.
`addTag(nodeId: string, tagName: string): any`<br/>
Adds a tag to a node.
`removeTag(nodeId: string, tag: string): any`<br/>
Removes a tag from a node.
## Details
Content Services supports
[tagging](http://docs.alfresco.com/5.2/tasks/site-content-tag.html)
of file and folder nodes to assist with searches. A tag is a short
text string added to an item, rather like a hashtag in social media.
Usually, it is wise to let the user see a list of existing tags and let
them choose one by clicking. If they type a tag name with incorrect spelling
then it will be treated as a new tag, even though that was not intended.
Use `getAllTheTags` to find all tags in the repository when you need to
construct a list like this.
See the
[Tags API](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/TagsApi.md)
in the Alfresco JS API for more information about the types returned by Tag
service methods and for the implementation of the REST API the service is
based on.
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
<!-- seealso start -->
## See also
- [Tag list component](tag-list.component.md)
<!-- seealso end -->

View File

@ -31,5 +31,10 @@
"widget-visibility",
"card-item-types",
"dynamic-component",
"settings"
"settings",
"file-uploading",
"version-upload",
"search-trigger",
"node-actions",
"content-node-selector.service"
]