[ADF-1769] Added JSDocs for services (#2961)

This commit is contained in:
Andy Stark
2018-02-19 17:28:44 +00:00
committed by Eugenio Romano
parent 6d0bab9278
commit de575fd47b
10 changed files with 178 additions and 54 deletions

View File

@@ -4,17 +4,20 @@ Manages tags in Content Services.
## Methods
`getTagsByNodeId(nodeId: string): any`<br/>
Gets a list of tags added to a node.
- `getTagsByNodeId(nodeId: string): any`
Gets a list of tags added to a node.
- `nodeId` - ID of the target node
- `getAllTheTags(): any`
Gets a list of all the tags already defined in the repository.
`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.
- `addTag(nodeId: string, tagName: string): any`
Adds a tag to a node.
- `nodeId` - ID of the target node
- `tagName` - Name of the tag to add
- `removeTag(nodeId: string, tag: string): any`
Removes a tag from a node.
- `nodeId` - ID of the target node
- `tag` - Name of the tag to remove
## Details

View File

@@ -4,14 +4,15 @@ Retrieves an SVG thumbnail image to represent a document type.
## Methods
`public getDocumentThumbnailUrl(document: any): string`<br/>
Gets a thumbnail URL for a document node.
- `getDocumentThumbnailUrl(node: any): string`
Gets a thumbnail URL for the given document node.
- `node` - Node to get URL for.
- `getMimeTypeIcon(mimeType: string): string`
Gets a thumbnail URL for a MIME type.
- `mimeType` - MIME type for the thumbnail
- `getDefaultMimeTypeIcon(): string`
Gets a "miscellaneous" thumbnail URL for types with no other icon defined.
`public getMimeTypeIcon(mimeType: string): string`<br/>
Gets a thumbnail URL for a MIME type.
`public getDefaultMimeTypeIcon(): string`<br/>
Gets a "miscellaneous" thumbnail URL for types with no other icon defined.
## Details

View File

@@ -4,17 +4,21 @@ Supports localisation.
## Methods
`addTranslationFolder(name: string = '', path: string = '')`<br/>
Adds a new folder of translation source files.
`use(lang: string): Observable<any>`<br/>
Sets the target language for translations.
`get(key: string|Array<string>, interpolateParams?: Object): Observable<string|any>`<br/>
Gets the translation for the supplied key.
`instant(key: string | Array<string>, interpolateParams?: Object): string | any`<br/>
Directly returns the translation for the supplied key.
- `addTranslationFolder(name: string = '', path: string = '')`
Adds a new folder of translation source files.
- `name` - Name for the translation provider
- `path` - Path to the folder
- `use(lang: string): Observable<any>`
Sets the target language for translations.
- `lang` - Code name for the language
- `get(key: string|Array<string>, interpolateParams?: Object): Observable<any>`
Gets the translation for the supplied key.
- `key` - Key to translate
- `interpolateParams` - (Optional) String(s) to be interpolated into the main message
- `instant(key: string | Array<string>, interpolateParams?: Object): any`
Directly returns the translation for the supplied key.
- `key` - Key to translate
- `interpolateParams` - (Optional) String(s) to be interpolated into the main message
## Details

View File

@@ -2,16 +2,38 @@
Provides access to various APIs related to file upload features.
## Basic Usage
## Methods
### Events
- `isUploading(): boolean`
Checks whether the service is uploading a file.
- `getQueue(): FileModel[]`
Returns the file Queue
- `addToQueue(files: FileModel[]): FileModel[]`
Adds files to the uploading queue to be uploaded
- `files` - One or more separate parameters or an array of files to queue
- `uploadFilesInTheQueue(emitter: EventEmitter<any>)`
Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder.
- `emitter` - (Deprecated) Emitter to invoke on file status change
- `cancelUpload(files: FileModel[])`
Cancels uploading of files.
- `files` - One or more separate parameters or an array of files
- `clearQueue()`
Clears the upload queue
- `getUploadPromise(file: FileModel): any`
Gets an upload promise for a file.
- `file` - The target file
## Events
| Name | Type | Description |
| --- | --- | --- |
| queueChanged | FileModel[] | Raised every time the file queue changes. |
| ---- | ---- | ----------- |
| queueChanged | FileModel\[] | Raised every time the file queue changes. |
| fileUpload | FileUploadEvent | Raised every time a File model changes its state. |
| fileUploadStarting | FileUploadEvent | Raised when upload starts. |
| fileUploadCancelled | FileUploadEvent | Raised when upload gets cancelled by user. |
| fileUploadCancelled | FileUploadEvent | Raised when upload gets cancelled by user. |
| fileUploadProgress | FileUploadEvent | Raised during file upload process and contains the current progress for the particular File model. |
| fileUploadAborted | FileUploadEvent | Raised when file upload gets aborted by the server. |
| fileUploadError | FileUploadEvent | Raised when an error occurs to file upload. |
@@ -24,8 +46,8 @@ Provides access to various APIs related to file upload features.
### Ignore list configuration
Is possible add an ignore list for files that you don't want to allow upload on your CS.
The configuration of this service is saved in the ***app.config.json file***.If you want more details about the configuration service follow this [link](https://github.com/Alfresco/alfresco-ng2-components/tree/master/ng2-components/ng2-alfresco-core#appconfigservice).
In the example below you can see how filtered out the : '.git', '.DS_Store' and 'desktop.ini'. **Every element is a glob pattern string.** So, if you want to exclude all the txt files, you can add the "*.txt". (notice the asterisk at the beginning of the pattern!)
The configuration of this service is saved in the **_app.config.json file_**.If you want more details about the configuration service follow this [link](https://github.com/Alfresco/alfresco-ng2-components/tree/master/ng2-components/ng2-alfresco-core#appconfigservice).
In the example below you can see how filtered out the : '.git', '.DS_Store' and 'desktop.ini'. **Every element is a glob pattern string.** So, if you want to exclude all the txt files, you can add the "\*.txt". (notice the asterisk at the beginning of the pattern!)
**app.config.json**
@@ -43,5 +65,6 @@ In the example below you can see how filtered out the : '.git', '.DS_Store' and
```
Note:
- Standard glob patterns work.
- You can end patterns with a forward slash / to specify a directory.
- Standard glob patterns work.
- You can end patterns with a forward slash / to specify a directory.

View File

@@ -2,6 +2,32 @@
Stores preferences for components.
## Methods
- `get(property: string, defaultValue?: string): string`
Gets a preference property.
- `property` - Name of the property
- `defaultValue` - (Optional) Default to return if the property is not found
- `set(property: string, value: any)`
Sets a preference property.
- `property` - Name of the property
- `value` - New value for the property
- `getStoragePrefix(): string`
Gets the active storage prefix for preferences.
- `setStoragePrefix(value: string)`
Sets the active storage prefix for preferences.
- `value` - Name of the prefix
- `getPropertyKey(property: string): string`
Gets the full property key with prefix.
- `property` - The property name
- `getDifferentPageSizes(): number[]`
Gets an array containing the available page sizes.
- `getDefaultLocale(): string`
Gets the default locale.
## Details
The preferences are bound to a particular `prefix` so the application can switch between different profiles on demand.
@@ -44,8 +70,11 @@ class AppComponent {
}
```
The service also provides quick access to a set of the "known" properties used across ADF components.
The service also provides quick access to a set of the "known" properties used across ADF components:
Known properties:
- paginationSize (number) - gets or sets the preferred pagination size
| Name | Type | Description |
| ---- | ---- | ----------- |
| authType | `string` | Authorization type (can be "ECM", "BPM" or "ALL"). |
| disableCSRF | `boolean` | Prevents the CSRF Token from being submitted if true. Only valid for Process Services. |
| paginationSize | `number` | Pagination size. |
| locale | `string` | Current locale setting. |