[ADF-2557] Updated docs with new props script (#3149)

* [ADF-2557] Updated docs for services with new props script

* [ADF-2557] Updated service docs with new props script
This commit is contained in:
Andy Stark
2018-04-08 16:23:04 +01:00
committed by Eugenio Romano
parent 8769c257f8
commit 1d517d3a8a
27 changed files with 612 additions and 299 deletions

View File

@@ -75,6 +75,7 @@ export class DocumentListService {
/**
* Deletes a node.
* @param nodeId ID of the node to delete
* @returns Empty response when the operation is complete
*/
deleteNode(nodeId: string): Observable<any> {
return Observable.fromPromise(this.apiService.getInstance().nodes.deleteNode(nodeId));
@@ -85,6 +86,7 @@ export class DocumentListService {
*
* @param nodeId The id of the node to be copied
* @param targetParentId The id of the folder where the node will be copied
* @returns NodeEntry for the copied node
*/
copyNode(nodeId: string, targetParentId: string) {
return Observable.fromPromise(this.apiService.getInstance().nodes.copyNode(nodeId, { targetParentId }))
@@ -96,6 +98,7 @@ export class DocumentListService {
*
* @param nodeId The id of the node to be moved
* @param targetParentId The id of the folder where the node will be moved
* @returns NodeEntry for the moved node
*/
moveNode(nodeId: string, targetParentId: string) {
return Observable.fromPromise(this.apiService.getInstance().nodes.moveNode(nodeId, { targetParentId }))
@@ -106,6 +109,7 @@ export class DocumentListService {
* Create a new folder in the path.
* @param name Folder name
* @param parentId Parent folder ID
* @returns Details of the created folder node
*/
createFolder(name: string, parentId: string): Observable<MinimalNodeEntity> {
return Observable.fromPromise(this.apiService.getInstance().nodes.createFolder(name, '/', parentId))
@@ -116,6 +120,8 @@ export class DocumentListService {
* Gets the folder node with the specified relative name path below the root node.
* @param folder Path to folder.
* @param opts Options.
* @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association")
* @returns Details of the folder
*/
getFolder(folder: string, opts?: any, includeFields: string[] = []): Observable<NodePaging> {
return Observable.fromPromise(this.getNodesPromise(folder, opts, includeFields))
@@ -126,6 +132,8 @@ export class DocumentListService {
/**
* Gets a folder node via its node ID.
* @param nodeId ID of the folder node
* @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association")
* @returns Details of the folder
*/
getFolderNode(nodeId: string, includeFields: string[] = []): Promise<MinimalNodeEntryEntity> {
@@ -144,6 +152,7 @@ export class DocumentListService {
/**
* Get thumbnail URL for the given document node.
* @param node Node to get URL for.
* @returns Thumbnail URL string
*/
getDocumentThumbnailUrl(node: MinimalNodeEntity): string {
return this.thumbnailService.getDocumentThumbnailUrl(node);
@@ -152,6 +161,7 @@ export class DocumentListService {
/**
* Gets the icon that represents a MIME type.
* @param mimeType MIME type to get the icon for
* @returns Path to the icon file
*/
getMimeTypeIcon(mimeType: string): string {
return this.thumbnailService.getMimeTypeIcon(mimeType);
@@ -159,6 +169,7 @@ export class DocumentListService {
/**
* Gets a default icon for MIME types with no specific icon.
* @returns Path to the icon file
*/
getDefaultMimeTypeIcon(): string {
return this.thumbnailService.getDefaultMimeTypeIcon();
@@ -168,6 +179,7 @@ export class DocumentListService {
* Checks if a node has the specified permission.
* @param node Target node
* @param permission Permission level to query
* @returns True if the node has the permission, false otherwise
*/
hasPermission(node: any, permission: PermissionsEnum | string): boolean {
return this.contentService.hasPermission(node, permission);

View File

@@ -44,6 +44,7 @@ export class FolderActionsService {
/**
* Gets the handler function for an action.
* @param key Identifier for the action
* @returns The handler function
*/
getHandler(key: string): ContentActionHandler {
if (key) {
@@ -57,6 +58,7 @@ export class FolderActionsService {
* Sets a new handler function for an action.
* @param key Identifier for the action
* @param handler The new handler function
* @returns True if the key was a valid action identifier, false otherwise
*/
setHandler(key: string, handler: ContentActionHandler): boolean {
if (key) {
@@ -70,6 +72,7 @@ export class FolderActionsService {
/**
* Checks if an action is available for a particular item.
* @param obj Item to check
* @returns True if the action is available, false otherwise
*/
canExecuteAction(obj: any): boolean {
return this.documentListService && obj && obj.entry.isFolder === true;