[ADF-2905] Updated JSDocs for core (#3271)

This commit is contained in:
Andy Stark
2018-05-04 19:03:13 +01:00
committed by Eugenio Romano
parent fe0ac0e474
commit c824e646de
18 changed files with 256 additions and 119 deletions

View File

@@ -2,10 +2,35 @@
Added: v2.0.0
Status: Active
---
# App Config service
Supports app configuration settings, stored server side.
## Class members
### Methods
- `get(key: string = null, defaultValue?: T = null): T`<br/>
Gets the value of a named property.
- `key: string = null` - Name of the property
- `defaultValue?: T = null` - (Optional) Value to return if the key is not found
- **Returns** `T` - Value of the property
- `getLocationHostname(): string`<br/>
Gets the location.hostname property.
- **Returns** `string` - Value of the property
- `getLocationPort(prefix: string = ""): string`<br/>
Gets the location.port property.
- `prefix: string = ""` - Text added before port value
- **Returns** `string` - Port with prefix
- `load(): Promise<any>`<br/>
Loads the config file.
- **Returns** `Promise<any>` - Notification when loading is complete
- `select(property: string = null): Observable<any>`<br/>
Requests notification of a property value when it is loaded.
- `property: string = null` - The desired property value
- **Returns** `Observable<any>` - Property value, when loaded
## Details
The `AppConfigService` service provides support for loading and accessing global application configuration settings that you store on the server side in the form of a JSON file.
@@ -100,10 +125,10 @@ The supported variables are:
| port | `location.port` |
## App Config onLoad Stream
When the app config is loaded correctly an onChange event is sent with the whole set app config properties. This comes in handy when a component wants to react to some property change or interact with the app config when it's correctly loaded.
```ts
appConfig.onLoad.subscribe((appConfig) => {
console.log(appConfig); //this is the representation of the app-config
});
@@ -122,4 +147,4 @@ We have added also the `select` method where the user can give the property name
appConfig.select('logLevel').subscribe((logLevelValue) => {
console.log(logLevelValue); //this will be 'trace';
});
```
```

View File

@@ -1,7 +1,9 @@
---
Added: v2.0.0
Status: Active
Last reviewed: 2018-05-04
---
# Bpm User service
Gets information about the current Process Services user.
@@ -10,11 +12,12 @@ Gets information about the current Process Services user.
### Methods
`getCurrentUserInfo(): Observable<BpmUserModel>`<br/>
Gets information about the current user.
`getCurrentUserProfileImage(): string`<br/>
Returns the current user's profile image as a URL.
- `getCurrentUserInfo(): Observable<BpmUserModel>`<br/>
Gets information about the current user.
- **Returns** `Observable<BpmUserModel>` - User information object
- `getCurrentUserProfileImage(): string`<br/>
Gets the current user's profile image as a URL.
- **Returns** `string` - URL string
## Details

View File

@@ -2,12 +2,29 @@
Added: v2.0.0
Status: Active
---
# Card View component
Displays a configurable property list renderer.
![adf-custom-view](../docassets/images/adf-custom-view.png)
## Contents
- [Basic Usage](#basic-usage)
- [Class members](#class-members)
- [Properties](#properties)
- [Details](#details)
- [Editing](#editing)
- [Defining properties](#defining-properties)
- [Defining your custom card Item](#defining-your-custom-card-item)
- [See also](#see-also)
## Basic Usage
```html
@@ -21,11 +38,11 @@ Displays a configurable property list renderer.
### Properties
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| properties | [CardViewItem](#defining-properties)\[] | - | (**required**) The custom view to render |
| editable | boolean | - | If the component editable or not |
| displayEmpty | boolean | true | Whether to show empty properties in non-editable mode |
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
| displayEmpty | `boolean` | true | Toggles whether or not to show empty items in non-editable mode. |
| editable | `boolean` | | Toggles whether or not the items can be edited. |
| properties | `CardViewItem[]` | | (**required**) Items to show in the card view. |
## Details
@@ -145,7 +162,7 @@ const textItemProperty = new CardViewTextItemModel(options);
| displayValue\* | string | --- | The value to render |
| editable | boolean | false | Whether the property editable or not |
| clickable | boolean | false | Whether the property clickable or not |
| icon | string | The material icon to show against the clickable property |
| icon | string | The material icon to show against the clickable property | |
| multiline | string | false | Single or multiline text |
| pipes | CardViewTextItemPipeProperty\[] | \[] | Pipes to be applied on the displayValue |

View File

@@ -12,12 +12,12 @@ Adds and retrieves comments for nodes in Content Services.
### Methods
- `addNodeComment(nodeId: string, message: string): Observable<CommentModel>`<br/>
- `addNodeComment(nodeId: string = null, message: string = null): Observable<CommentModel>`<br/>
Adds a comment to a node.
- `nodeId: string` - ID of the target node
- `message: string` - Text for the comment
- `nodeId: string = null` - ID of the target node
- `message: string = null` - Text for the comment
- **Returns** `Observable<CommentModel>` - Details of the comment added
- `getNodeComments(nodeId: string): Observable<CommentModel[]>`<br/>
- `getNodeComments(nodeId: string = null): Observable<CommentModel[]>`<br/>
Gets all comments that have been added to a node.
- `nodeId: string = null` - ID of the target node
- **Returns** `Observable<CommentModel[]>` - Details for each comment

View File

@@ -12,46 +12,58 @@ Accesses app-generated data objects via URLs and file downloads.
### Methods
- `downloadBlob(blob: Blob, fileName: string)`
Invokes content download for a Blob with a file name.
- `blob` - Content to download.
- `fileName` - Name of the resulting file.
- `downloadData(data: any, fileName: string)`
Invokes content download for a data array with a file name.
- `data` - Data to download.
- `fileName` - Name of the resulting file.
- `downloadJSON(json: any, fileName)`
Invokes content download for a JSON object with a file name.
- `json` - JSON object to download.
- `fileName` - Name of the resulting file.
- `createTrustedUrl(blob: Blob): string`
Creates a trusted object URL from the Blob. WARNING: calling this method with untrusted user data exposes your application to XSS security risks!
- `blob` - Data to wrap into object URL
- `getDocumentThumbnailUrl(node: any, attachment?: boolean, ticket?: string): string`
Get thumbnail URL for the given document node.
- `node` - Node to get URL for.
- `attachment` - (Optional) Retrieve content as an attachment for download
- `ticket` - (Optional) Custom ticket to use for authentication
- `getContentUrl(node: any, attachment?: boolean, ticket?: string): string`
Get content URL for the given node.
- `node` - nodeId or node to get URL for.
- `attachment` - (Optional) Retrieve content as an attachment for download
- `ticket` - (Optional) Custom ticket to use for authentication
- `getNodeContent(nodeId: string): Observable<any>`
Get content for the given node.
- `nodeId` - ID of the target node
- `createFolder(relativePath: string, name: string, parentId?: string): Observable<FolderCreatedEvent>`
Create a folder
- `relativePath` - Location to create the folder
- `name` - Folder name
- `parentId` - (Optional) Node ID of parent folder
- `hasPermission(node: any, permission: PermissionsEnum | string): boolean`
Check if the user has permissions on that node
- `node` - Node to check allowableOperations
- `permission` - Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
- `hasAllowableOperations(node: any): boolean`
Check if the node has the properties allowableOperations
- `node` - Node to check allowableOperations
- `createFolder(relativePath: string = null, name: string = null, parentId?: string = null): Observable<FolderCreatedEvent>`<br/>
Creates a folder.
- `relativePath: string = null` - Location to create the folder
- `name: string = null` - Folder name
- `parentId?: string = null` - (Optional) Node ID of parent folder
- **Returns** `Observable<FolderCreatedEvent>` - Information about the new folder
- `createTrustedUrl(blob: Blob = null): string`<br/>
Creates a trusted object URL from the Blob. WARNING: calling this method with untrusted user data exposes your application to XSS security risks!
- `blob: Blob = null` - Data to wrap into object URL
- **Returns** `string` - URL string
- `downloadBlob(blob: Blob = null, fileName: string = null)`<br/>
Invokes content download for a Blob with a file name.
- `blob: Blob = null` - Content to download.
- `fileName: string = null` - Name of the resulting file.
- `downloadData(data: any = null, fileName: string = null)`<br/>
Invokes content download for a data array with a file name.
- `data: any = null` - Data to download.
- `fileName: string = null` - Name of the resulting file.
- `downloadJSON(json: any = null, fileName: string = null)`<br/>
Invokes content download for a JSON object with a file name.
- `json: any = null` - JSON object to download.
- `fileName: string = null` - Name of the resulting file.
- `getContentUrl(node: any = null, attachment?: boolean = null, ticket?: string = null): string`<br/>
Gets a content URL for the given node.
- `node: any = null` - Node to get URL for.
- `attachment?: boolean = null` - (Optional) Toggles whether to retrieve content as an attachment for download
- `ticket?: string = null` - (Optional) Custom ticket to use for authentication
- **Returns** `string` - URL string
- `getDocumentThumbnailUrl(node: any = null, attachment?: boolean = null, ticket?: string = null): string`<br/>
Gets a thumbnail URL for the given document node.
- `node: any = null` - Node to get URL for.
- `attachment?: boolean = null` - (Optional) Toggles whether to retrieve content as an attachment for download
- `ticket?: string = null` - (Optional) Custom ticket to use for authentication
- **Returns** `string` - URL string
- `getNode(nodeId: string = null, opts?: any = null): Observable<NodeEntry>`<br/>
Gets a Node via its node ID.
- `nodeId: string = null` - ID of the target node
- `opts?: any = null` - (Optional) Options supported by JSAPI
- **Returns** `Observable<NodeEntry>` - Details of the folder
- `getNodeContent(nodeId: string = null): Observable<any>`<br/>
Gets content for the given node.
- `nodeId: string = null` - ID of the target node
- **Returns** `Observable<any>` - Content data
- `hasAllowableOperations(node: any = null): boolean`<br/>
Checks if the node has the properties allowableOperations
- `node: any = null` - Node to check allowableOperations
- **Returns** `boolean` - True if the node has the property, false otherwise
- `hasPermission(node: Node = null, permission: PermissionsEnum | string = null): boolean`<br/>
Checks if the user has permissions on that node
- `node: Node = null` - Node to check allowableOperations
- `permission: PermissionsEnum | string = null` - Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
- **Returns** `boolean` - True if the user has the required permissions, false otherwise
## Details

View File

@@ -48,8 +48,8 @@ export class MyComponent implements OnInit {
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
| context-menu-enabled | `boolean` | false | |
| context-menu | `any[]` | | |
| context-menu-enabled | `boolean` | false | Is the menu enabled? |
| context-menu | `any[]` | | Items for the menu. |
## Details

View File

@@ -1,7 +1,9 @@
---
Added: v2.0.0
Status: Active
Last reviewed: 2018-05-04
---
# Favorites Api service
Gets a list of items a user has marked as their favorites.
@@ -10,8 +12,11 @@ Gets a list of items a user has marked as their favorites.
### Methods
`getFavorites(personId: string, options?: any): Observable<NodePaging>`<br/>
Gets the favorites for a user.
- `getFavorites(personId: string = null, options?: any = null): Observable<NodePaging>`<br/>
Gets the favorites for a user.
- `personId: string = null` - ID of the user
- `options?: any = null` - (Optional) Options supported by JSAPI
- **Returns** `Observable<NodePaging>` - List of favorites
## Details

View File

@@ -2,6 +2,7 @@
Added: v2.0.0
Status: Active
---
# Form Rendering service
Maps an APS form field type string onto the corresponding form widget component type.
@@ -10,19 +11,21 @@ Maps an APS form field type string onto the corresponding form widget component
### Methods
- `getComponentTypeResolver(type: string, defaultValue: Type<{}> = this.defaultValue): DynamicComponentResolveFunction`
Gets the currently active ComponentTypeResolver function for a field type.
- `type` - The type whose resolver you want
- `defaultValue` - Default type returned for types that are not yet mapped
- `setComponentTypeResolver(type: string, resolver: DynamicComponentResolveFunction, override: boolean = false)`
Sets or optionally replaces a ComponentTypeResolver function for a field type.
- `type` - The type whose resolver you want to set
- `resolver` - The new resolver function
- `override` - The new resolver will only replace an existing one if this parameter is true
- `resolveComponentType(model: DynamicComponentModel, defaultValue: Type<{}> = this.defaultValue): Type<{}>`
Finds the component type that is needed to render a form field.
- `model` - [Form field model](form-field.model.md) for the field to render
- `defaultValue` - Default type returned for field types that are not yet mapped.
- `getComponentTypeResolver(type: string = null, defaultValue: Type<__type> = this.defaultValue): DynamicComponentResolveFunction`<br/>
Gets the currently active ComponentTypeResolver function for a field type.
- `type: string = null` - The type whose resolver you want
- `defaultValue: Type<__type> = this.defaultValue` - Default type returned for types that are not yet mapped
- **Returns** `DynamicComponentResolveFunction` - Resolver function
- `resolveComponentType(model: DynamicComponentModel = null, defaultValue: Type<__type> = this.defaultValue): Type<__type>`<br/>
Finds the component type that is needed to render a form field.
- `model: DynamicComponentModel = null` - (form-field.model.md) for the field to render
- `defaultValue: Type<__type> = this.defaultValue` - Default type returned for field types that are not yet mapped.
- **Returns** `Type<__type>` - Component type
- `setComponentTypeResolver(type: string = null, resolver: DynamicComponentResolveFunction = null, override: boolean = false)`<br/>
Sets or optionally replaces a ComponentTypeResolver function for a field type.
- `type: string = null` - The type whose resolver you want to set
- `resolver: DynamicComponentResolveFunction = null` - The new resolver function
- `override: boolean = false` - The new resolver will only replace an existing one if this parameter is true
## Details

View File

@@ -2,6 +2,7 @@
Added: v2.0.0
Status: Active
---
# Form service
Implements Process Services form methods
@@ -66,7 +67,6 @@ class MyComponent {
- `formId` - ID of the form to save
- `formModel` - Model data for the form
- `addFieldsToAForm(formId: string, formModel: FormDefinitionModel): Observable<any>`
- `formId` - ID of the form
- `formModel` - Form definition
- `searchFrom(name: string): Observable<any>`