From 2f840c2ee306c4d37faaae103cedc629b3362a3d Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Wed, 11 May 2016 11:02:43 +0100 Subject: [PATCH] #9 jsdoc comments for document list and related components --- .../src/components/content-action-list.d.ts | 4 + .../src/components/content-action-list.js | 6 +- .../src/components/content-action-list.js.map | 2 +- .../src/components/content-action-list.ts | 12 ++- .../src/components/content-action.js.map | 2 +- .../src/components/content-action.ts | 3 +- .../src/components/content-column-list.d.ts | 4 + .../src/components/content-column-list.js | 6 +- .../src/components/content-column-list.js.map | 2 +- .../src/components/content-column-list.ts | 12 ++- .../src/components/document-list.d.ts | 57 +++++++++++++- .../src/components/document-list.js | 71 ++++++++++++++--- .../src/components/document-list.js.map | 2 +- .../src/components/document-list.ts | 78 +++++++++++++++---- .../src/services/alfresco.service.d.ts | 18 +++++ .../src/services/alfresco.service.js | 18 +++++ .../src/services/alfresco.service.js.map | 2 +- .../src/services/alfresco.service.ts | 23 +++++- 18 files changed, 276 insertions(+), 46 deletions(-) diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.d.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.d.ts index 1702e2bef4..64ef51d777 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.d.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.d.ts @@ -3,5 +3,9 @@ import { ContentActionModel } from './../models/content-action.model'; export declare class ContentActionList { private documentList; constructor(documentList: DocumentList); + /** + * Registers action handler within the parent document list component. + * @param action Action model to register. + */ registerAction(action: ContentActionModel): void; } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js index 5e675d5d0b..c550bf6762 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js @@ -40,9 +40,11 @@ System.register(['angular2/core', './document-list'], function(exports_1, contex ContentActionList = (function () { function ContentActionList(documentList) { this.documentList = documentList; - // saves reference to parent container - // so that content children can access it } + /** + * Registers action handler within the parent document list component. + * @param action Action model to register. + */ ContentActionList.prototype.registerAction = function (action) { if (this.documentList && action) { this.documentList.actions.push(action); diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js.map b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js.map index 227c459bfc..df62b03d69 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.js.map @@ -1 +1 @@ -{"version":3,"file":"content-action-list.js","sourceRoot":"","sources":["content-action-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBACI,2BAAoB,YAA0B;oBAA1B,iBAAY,GAAZ,YAAY,CAAc;oBAC1C,sCAAsC;oBACtC,yCAAyC;gBAC7C,CAAC;gBAED,0CAAc,GAAd,UAAe,MAA0B;oBACrC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC;wBAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAC3C,CAAC;gBACL,CAAC;gBAdL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,iBAAiB;wBAC3B,QAAQ,EAAE,EAAE;qBACf,CAAC;;qCAAA;gBAYF,wBAAC;YAAD,CAAC,AAXD,IAWC;YAXD,iDAWC,CAAA"} \ No newline at end of file +{"version":3,"file":"content-action-list.js","sourceRoot":"","sources":["content-action-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBAEI,2BACY,YAA0B;oBAA1B,iBAAY,GAAZ,YAAY,CAAc;gBACtC,CAAC;gBAED;;;mBAGG;gBACH,0CAAc,GAAd,UAAe,MAA0B;oBACrC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC;wBAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAC3C,CAAC;gBACL,CAAC;gBAlBL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,iBAAiB;wBAC3B,QAAQ,EAAE,EAAE;qBACf,CAAC;;qCAAA;gBAgBF,wBAAC;YAAD,CAAC,AAfD,IAeC;YAfD,iDAeC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.ts index 169e2183ac..0be88481b8 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action-list.ts @@ -24,12 +24,16 @@ import {ContentActionModel} from './../models/content-action.model'; template: '' }) export class ContentActionList { - constructor(private documentList: DocumentList) { - // saves reference to parent container - // so that content children can access it + + constructor( + private documentList: DocumentList) { } - registerAction(action: ContentActionModel) { + /** + * Registers action handler within the parent document list component. + * @param action Action model to register. + */ + registerAction(action: ContentActionModel): void { if (this.documentList && action) { this.documentList.actions.push(action); } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action.js.map b/ng2-components/ng2-alfresco-documentlist/src/components/content-action.js.map index 538cc3cdc4..b18caaa2f3 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action.js.map @@ -1 +1 @@ -{"version":3,"file":"content-action.js","sourceRoot":"","sources":["content-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAYH;gBAoBI,uBACY,IAAuB,EACvB,eAAuC,EACvC,aAAmC;oBAFnC,SAAI,GAAJ,IAAI,CAAmB;oBACvB,oBAAe,GAAf,eAAe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B,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;gCACrB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;4BAC/C,CAAC;4BACD,MAAM,CAAC,IAAI,CAAC;wBAChB,CAAC;oBACL,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC;gBAChB,CAAC;gBA/DD;oBAAC,YAAK,EAAE;;4DAAA;gBAGR;oBAAC,YAAK,EAAE;;2DAAA;gBAGR;oBAAC,YAAK,EAAE;;8DAAA;gBAGR;oBAAC,YAAK,EAAE;;2DAAA;gBAGR;oBAAC,YAAK,EAAE;;6DAAA;gBAGR;oBAAC,aAAM,EAAE;;8DAAA;gBArBb;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,gBAAgB;wBAC1B,QAAQ,EAAE,EAAE;qBACf,CAAC;;iCAAA;gBAmEF,oBAAC;YAAD,CAAC,AAlED,IAkEC;YAlED,yCAkEC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-action.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-action.ts index 3eb70f8485..9b14628c56 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-action.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-action.ts @@ -20,6 +20,7 @@ import {ContentActionModel} from './../models/content-action.model'; import {ContentActionList} from './content-action-list'; import {DocumentActionsService} from '../services/document-actions.service'; import {FolderActionsService} from '../services/folder-actions.service'; +import {ContentActionHandler} from '../models/content-action.model'; @Component({ selector: 'content-action', @@ -71,7 +72,7 @@ export class ContentAction implements OnInit { this.list.registerAction(model); } - private getSystemHandler(target: string, name: string) { + private getSystemHandler(target: string, name: string): ContentActionHandler { if (target) { let ltarget = target.toLowerCase(); diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.d.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.d.ts index 8a757b5c32..2a4647642d 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.d.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.d.ts @@ -3,5 +3,9 @@ import { ContentColumnModel } from './../models/content-column.model'; export declare class ContentColumnList { private documentList; constructor(documentList: DocumentList); + /** + * Registers column model within the parent document list component. + * @param column Column definition model to register. + */ registerColumn(column: ContentColumnModel): void; } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js index 96d6fee1fa..e04b3c08ef 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js @@ -40,9 +40,11 @@ System.register(['angular2/core', './document-list'], function(exports_1, contex ContentColumnList = (function () { function ContentColumnList(documentList) { this.documentList = documentList; - // saves reference to parent container - // so that content children can access it } + /** + * Registers column model within the parent document list component. + * @param column Column definition model to register. + */ ContentColumnList.prototype.registerColumn = function (column) { if (this.documentList && column) { this.documentList.columns.push(column); diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map index c00bd59f55..ec327aea97 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.js.map @@ -1 +1 @@ -{"version":3,"file":"content-column-list.js","sourceRoot":"","sources":["content-column-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBACI,2BAAoB,YAA0B;oBAA1B,iBAAY,GAAZ,YAAY,CAAc;oBAC1C,sCAAsC;oBACtC,yCAAyC;gBAC7C,CAAC;gBAED,0CAAc,GAAd,UAAe,MAA0B;oBACrC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC;wBAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAC3C,CAAC;gBACL,CAAC;gBAdL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,iBAAiB;wBAC3B,QAAQ,EAAE,EAAE;qBACf,CAAC;;qCAAA;gBAYF,wBAAC;YAAD,CAAC,AAXD,IAWC;YAXD,iDAWC,CAAA"} \ No newline at end of file +{"version":3,"file":"content-column-list.js","sourceRoot":"","sources":["content-column-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAUH;gBAEI,2BACY,YAA0B;oBAA1B,iBAAY,GAAZ,YAAY,CAAc;gBACtC,CAAC;gBAED;;;mBAGG;gBACH,0CAAc,GAAd,UAAe,MAA0B;oBACrC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC;wBAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBAC3C,CAAC;gBACL,CAAC;gBAlBL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,iBAAiB;wBAC3B,QAAQ,EAAE,EAAE;qBACf,CAAC;;qCAAA;gBAgBF,wBAAC;YAAD,CAAC,AAfD,IAeC;YAfD,iDAeC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts index ad48474c11..d25efb8995 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/content-column-list.ts @@ -24,12 +24,16 @@ import {ContentColumnModel} from './../models/content-column.model'; template: '' }) export class ContentColumnList { - constructor(private documentList: DocumentList) { - // saves reference to parent container - // so that content children can access it + + constructor( + private documentList: DocumentList) { } - registerColumn(column: ContentColumnModel) { + /** + * Registers column model within the parent document list component. + * @param column Column definition model to register. + */ + registerColumn(column: ContentColumnModel): void { if (this.documentList && column) { this.documentList.columns.push(column); } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.d.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.d.ts index f378b552c8..b7bff7adf8 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.d.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.d.ts @@ -35,19 +35,67 @@ export declare class DocumentList implements OnInit, AfterViewChecked, AfterCont route: any[]; actions: ContentActionModel[]; columns: ContentColumnModel[]; + /** + * Determines whether navigation to parent folder is available. + * @returns {boolean} + */ canNavigateParent(): boolean; constructor(_alfrescoService: AlfrescoService); ngOnInit(): void; ngAfterContentInit(): void; ngAfterViewChecked(): void; + /** + * Get a list of content actions based on target and type. + * @param target Target to filter actions by. + * @param type Type to filter actions by. + * @returns {ContentActionModel[]} List of actions filtered by target and type. + */ getContentActions(target: string, type: string): ContentActionModel[]; - onNavigateParentClick($event: any): void; - onItemClick(item: DocumentEntity, $event?: any): void; - goToRoute(r: any, $event: any): void; + /** + * Invoked when 'parent folder' element is clicked. + * @param e DOM event + */ + onNavigateParentClick(e: any): void; + /** + * Invoked when list row is clicked. + * @param item Underlying node item + * @param e DOM event (optional) + */ + onItemClick(item: DocumentEntity, e?: any): void; + /** + * Invoked when a breadcrumb route is clicked. + * @param r Route to navigate to + * @param e DOM event + */ + goToRoute(r: any, e: any): void; + /** + * Gets content URL for the given node. + * @param node Node to get URL for. + * @returns {string} URL address. + */ getContentUrl(node: DocumentEntity): string; + /** + * Gets thumbnail URL for the given document node. + * @param node Node to get URL for. + * @returns {string} URL address. + */ getDocumentThumbnailUrl(node: DocumentEntity): string; + /** + * Invoked when executing content action for a document or folder. + * @param node Node to be the context of the execution. + * @param action Action to be executed against the context. + */ executeContentAction(node: DocumentEntity, action: ContentActionModel): void; + /** + * Loads and displays folder content + * @param path Node path + */ displayFolderContent(path: any): void; + /** + * Gets a path for a given node. + * @param node + * @returns {string} + */ getNodePath(node: DocumentEntity): string; /** * Gets a value from an object by composed key @@ -57,5 +105,8 @@ export declare class DocumentList implements OnInit, AfterViewChecked, AfterCont * @returns {string} */ getObjectValue(target: any, key: string): any; + /** + * Creates a set of predefined columns. + */ setupDefaultColumns(): void; } diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js index 0d912bb308..dbbfe3a2f7 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js @@ -55,6 +55,10 @@ System.register(['angular2/core', './../services/alfresco.service', './../models this.actions = []; this.columns = []; } + /** + * Determines whether navigation to parent folder is available. + * @returns {boolean} + */ DocumentList.prototype.canNavigateParent = function () { return this.navigate && !this.breadcrumb && this.currentFolderPath !== this.rootFolder.path; @@ -74,6 +78,12 @@ System.register(['angular2/core', './../services/alfresco.service', './../models componentHandler.upgradeAllRegistered(); } }; + /** + * Get a list of content actions based on target and type. + * @param target Target to filter actions by. + * @param type Type to filter actions by. + * @returns {ContentActionModel[]} List of actions filtered by target and type. + */ DocumentList.prototype.getContentActions = function (target, type) { if (target && type) { var ltarget_1 = target.toLowerCase(); @@ -85,9 +95,13 @@ System.register(['angular2/core', './../services/alfresco.service', './../models } return []; }; - DocumentList.prototype.onNavigateParentClick = function ($event) { - if ($event) { - $event.preventDefault(); + /** + * Invoked when 'parent folder' element is clicked. + * @param e DOM event + */ + DocumentList.prototype.onNavigateParentClick = function (e) { + if (e) { + e.preventDefault(); } if (this.navigate) { this.route.pop(); @@ -97,10 +111,15 @@ System.register(['angular2/core', './../services/alfresco.service', './../models } } }; - DocumentList.prototype.onItemClick = function (item, $event) { - if ($event === void 0) { $event = null; } - if ($event) { - $event.preventDefault(); + /** + * Invoked when list row is clicked. + * @param item Underlying node item + * @param e DOM event (optional) + */ + DocumentList.prototype.onItemClick = function (item, e) { + if (e === void 0) { e = null; } + if (e) { + e.preventDefault(); } this.itemClick.emit({ value: item @@ -116,9 +135,14 @@ System.register(['angular2/core', './../services/alfresco.service', './../models } } }; - DocumentList.prototype.goToRoute = function (r, $event) { - if ($event) { - $event.preventDefault(); + /** + * Invoked when a breadcrumb route is clicked. + * @param r Route to navigate to + * @param e DOM event + */ + DocumentList.prototype.goToRoute = function (r, e) { + if (e) { + e.preventDefault(); } if (this.navigate) { var idx = this.route.indexOf(r); @@ -128,23 +152,42 @@ System.register(['angular2/core', './../services/alfresco.service', './../models } } }; + /** + * Gets content URL for the given node. + * @param node Node to get URL for. + * @returns {string} URL address. + */ DocumentList.prototype.getContentUrl = function (node) { if (this._alfrescoService) { return this._alfrescoService.getContentUrl(node); } return null; }; + /** + * Gets thumbnail URL for the given document node. + * @param node Node to get URL for. + * @returns {string} URL address. + */ DocumentList.prototype.getDocumentThumbnailUrl = function (node) { if (this._alfrescoService) { return this._alfrescoService.getDocumentThumbnailUrl(node); } return null; }; + /** + * Invoked when executing content action for a document or folder. + * @param node Node to be the context of the execution. + * @param action Action to be executed against the context. + */ DocumentList.prototype.executeContentAction = function (node, action) { if (action) { action.handler(node); } }; + /** + * Loads and displays folder content + * @param path Node path + */ DocumentList.prototype.displayFolderContent = function (path) { var _this = this; if (path) { @@ -154,6 +197,11 @@ System.register(['angular2/core', './../services/alfresco.service', './../models .subscribe(function (folder) { return _this.folder = folder; }, function (error) { return _this.errorMessage = error; }); } }; + /** + * Gets a path for a given node. + * @param node + * @returns {string} + */ DocumentList.prototype.getNodePath = function (node) { if (node) { var container = node.location.container; @@ -189,6 +237,9 @@ System.register(['angular2/core', './../services/alfresco.service', './../models } while (keys.length); return target; }; + /** + * Creates a set of predefined columns. + */ DocumentList.prototype.setupDefaultColumns = function () { var thumbnailCol = new content_column_model_1.ContentColumnModel(); thumbnailCol.source = '$thumbnail'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map index f0008ca109..b60486c2c1 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map @@ -1 +1 @@ -{"version":3,"file":"document-list.js","sourceRoot":"","sources":["document-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YA0BH;gBAgCI,sBAAoB,gBAAiC;oBAAjC,qBAAgB,GAAhB,gBAAgB,CAAiB;oBA7BrD,aAAQ,GAAY,IAAI,CAAC;oBAGzB,eAAU,GAAY,KAAK,CAAC;oBAM5B,cAAS,GAAsB,IAAI,mBAAY,EAAE,CAAC;oBAElD,eAAU,GAAG;wBACT,IAAI,EAAE,kBAAkB;wBACxB,IAAI,EAAE,uBAAuB;qBAChC,CAAC;oBACF,sBAAiB,GAAW,uBAAuB,CAAC;oBAIpD,UAAK,GAAU,EAAE,CAAC;oBAElB,YAAO,GAAyB,EAAE,CAAC;oBACnC,YAAO,GAAyB,EAAE,CAAC;gBAQnC,CAAC;gBAND,wCAAiB,GAAjB;oBACI,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU;wBACpC,IAAI,CAAC,iBAAiB,KAAK,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;gBACxD,CAAC;gBAKD,+BAAQ,GAAR;oBACI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;oBACjC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACpD,CAAC;gBAED,yCAAkB,GAAlB;oBACI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;wBAC7C,IAAI,CAAC,mBAAmB,EAAE,CAAC;oBAC/B,CAAC;gBACL,CAAC;gBAED,yCAAkB,GAA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;gBA4PF,mBAAC;YAAD,CAAC,AA3PD,IA2PC;YA3PD,uCA2PC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts index ece9bcee73..a2760566bf 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts @@ -66,12 +66,17 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit actions: ContentActionModel[] = []; columns: ContentColumnModel[] = []; + /** + * Determines whether navigation to parent folder is available. + * @returns {boolean} + */ canNavigateParent(): boolean { return this.navigate && !this.breadcrumb && this.currentFolderPath !== this.rootFolder.path; } - constructor(private _alfrescoService: AlfrescoService) { + constructor( + private _alfrescoService: AlfrescoService) { } ngOnInit() { @@ -92,7 +97,13 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } - getContentActions(target: string, type: string) { + /** + * Get a list of content actions based on target and type. + * @param target Target to filter actions by. + * @param type Type to filter actions by. + * @returns {ContentActionModel[]} List of actions filtered by target and type. + */ + getContentActions(target: string, type: string): ContentActionModel[] { if (target && type) { let ltarget = target.toLowerCase(); @@ -106,9 +117,13 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit return []; } - onNavigateParentClick($event) { - if ($event) { - $event.preventDefault(); + /** + * Invoked when 'parent folder' element is clicked. + * @param e DOM event + */ + onNavigateParentClick(e) { + if (e) { + e.preventDefault(); } if (this.navigate) { @@ -120,9 +135,14 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } - onItemClick(item: DocumentEntity, $event = null) { - if ($event) { - $event.preventDefault(); + /** + * Invoked when list row is clicked. + * @param item Underlying node item + * @param e DOM event (optional) + */ + onItemClick(item: DocumentEntity, e = null) { + if (e) { + e.preventDefault(); } this.itemClick.emit({ @@ -141,9 +161,14 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } - goToRoute(r, $event) { - if ($event) { - $event.preventDefault(); + /** + * Invoked when a breadcrumb route is clicked. + * @param r Route to navigate to + * @param e DOM event + */ + goToRoute(r, e) { + if (e) { + e.preventDefault(); } if (this.navigate) { @@ -155,26 +180,45 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } - getContentUrl(node: DocumentEntity) { + /** + * Gets content URL for the given node. + * @param node Node to get URL for. + * @returns {string} URL address. + */ + getContentUrl(node: DocumentEntity): string { if (this._alfrescoService) { return this._alfrescoService.getContentUrl(node); } return null; } - getDocumentThumbnailUrl(node: DocumentEntity) { + /** + * Gets thumbnail URL for the given document node. + * @param node Node to get URL for. + * @returns {string} URL address. + */ + getDocumentThumbnailUrl(node: DocumentEntity): string { if (this._alfrescoService) { return this._alfrescoService.getDocumentThumbnailUrl(node); } return null; } + /** + * Invoked when executing content action for a document or folder. + * @param node Node to be the context of the execution. + * @param action Action to be executed against the context. + */ executeContentAction(node: DocumentEntity, action: ContentActionModel) { if (action) { action.handler(node); } } + /** + * Loads and displays folder content + * @param path Node path + */ displayFolderContent(path) { if (path) { this.currentFolderPath = path; @@ -187,6 +231,11 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } + /** + * Gets a path for a given node. + * @param node + * @returns {string} + */ getNodePath(node: DocumentEntity): string { if (node) { let container = node.location.container; @@ -224,6 +273,9 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit return target; } + /** + * Creates a set of predefined columns. + */ setupDefaultColumns(): void { let thumbnailCol = new ContentColumnModel(); thumbnailCol.source = '$thumbnail'; diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.d.ts b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.d.ts index 63b2ed160b..879785e118 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.d.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.d.ts @@ -2,6 +2,9 @@ import { Http } from 'angular2/http'; import { Observable } from 'rxjs/Observable'; import { FolderEntity, DocumentEntity } from './../models/document-library.model'; import { AlfrescoSettingsService } from '../../../ng2-alfresco-core/services'; +/** + * Internal service used by Document List component. + */ export declare class AlfrescoService { private http; private settings; @@ -10,8 +13,23 @@ export declare class AlfrescoService { private _baseUrlPath; host: string; private getBaseUrl(); + /** + * Gets the folder node with the content. + * @param folder Path to folder. + * @returns {Observable} Folder entity. + */ getFolder(folder: string): Observable; + /** + * Get thumbnail URL for the given document node. + * @param document Node to get URL for. + * @returns {string} URL address. + */ getDocumentThumbnailUrl(document: DocumentEntity): string; + /** + * Get content URL for the given node. + * @param document Node to get URL for. + * @returns {string} URL address. + */ getContentUrl(document: DocumentEntity): string; private handleError(error); } diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js index 797e2d3581..94e52d773f 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js +++ b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js @@ -43,6 +43,9 @@ System.register(['angular2/core', 'angular2/http', 'rxjs/Observable', '../../../ services_1 = services_1_1; }], execute: function() { + /** + * Internal service used by Document List component. + */ AlfrescoService = (function () { function AlfrescoService(http, settings) { this.http = http; @@ -66,6 +69,11 @@ System.register(['angular2/core', 'angular2/http', 'rxjs/Observable', '../../../ AlfrescoService.prototype.getBaseUrl = function () { return this.host + this._baseUrlPath; }; + /** + * Gets the folder node with the content. + * @param folder Path to folder. + * @returns {Observable} Folder entity. + */ AlfrescoService.prototype.getFolder = function (folder) { var headers = new http_1.Headers({ 'Content-Type': 'application/json', @@ -78,11 +86,21 @@ System.register(['angular2/core', 'angular2/http', 'rxjs/Observable', '../../../ .do(function (data) { return console.log(data); }) // eyeball results in the console .catch(this.handleError); }; + /** + * Get thumbnail URL for the given document node. + * @param document Node to get URL for. + * @returns {string} URL address. + */ AlfrescoService.prototype.getDocumentThumbnailUrl = function (document) { return this._host + '/alfresco/service/api/node/' + document.nodeRef.replace('://', '/') + '/content/thumbnails/doclib?c=queue&ph=true&lastModified=1'; }; + /** + * Get content URL for the given node. + * @param document Node to get URL for. + * @returns {string} URL address. + */ AlfrescoService.prototype.getContentUrl = function (document) { return this._host + '/alfresco/service/' + document.contentUrl; }; diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map index 48027f259e..2bb375a435 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map @@ -1 +1 @@ -{"version":3,"file":"alfresco.service.js","sourceRoot":"","sources":["alfresco.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YASH;gBACI,yBACY,IAAU,EACV,QAAiC;oBADjC,SAAI,GAAJ,IAAI,CAAM;oBACV,aAAQ,GAAR,QAAQ,CAAyB;oBAOrC,UAAK,GAAW,uBAAuB,CAAC;oBACxC,iBAAY,GAAW,sDAAsD,CAAC;oBANlF,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACX,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC;oBAC/B,CAAC;gBACL,CAAC;gBAKD,sBAAW,iCAAI;yBAAf;wBACI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;oBACtB,CAAC;yBAED,UAAgB,KAAY;wBACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;oBACvB,CAAC;;;mBAJA;gBAMO,oCAAU,GAAlB;oBACI,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC;gBACzC,CAAC;gBAED,mCAAS,GAAT,UAAU,MAAc;oBACpB,IAAI,OAAO,GAAG,IAAI,cAAO,CAAC;wBACtB,cAAc,EAAE,kBAAkB;wBAClC,eAAe,EAAE,IAAI,CAAC,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,CAAC,CAAC,iCAAiC;yBAC/D,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACjC,CAAC;gBAED;;;;mBAIG;gBACH,iDAAuB,GAAvB,UAAwB,QAAwB;oBAC5C,MAAM,CAAC,IAAI,CAAC,KAAK;wBACb,6BAA6B;wBAC7B,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,mEAAmE,CAAC;gBACnH,CAAC;gBAED;;;;mBAIG;gBACH,uCAAa,GAAb,UAAc,QAAwB;oBAClC,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,oBAAoB,GAAG,QAAQ,CAAC,UAAU,CAAC;gBACnE,CAAC;gBAEO,qCAAW,GAAnB,UAAqB,KAAe;oBAChC,mFAAmF;oBACnF,4CAA4C;oBAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrB,MAAM,CAAC,uBAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC;gBAClE,CAAC;gBAtEL;oBAAC,iBAAU,EAAE;;mCAAA;gBAuEb,sBAAC;YAAD,CAAC,AAtED,IAsEC;YAtED,6CAsEC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts index 5639e3a5ba..019a52203e 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.ts @@ -21,8 +21,12 @@ import {Observable} from 'rxjs/Observable'; import {FolderEntity, DocumentEntity} from './../models/document-library.model'; import {AlfrescoSettingsService} from '../../../ng2-alfresco-core/services'; +/** + * Internal service used by Document List component. + */ @Injectable() export class AlfrescoService { + constructor( private http: Http, private settings: AlfrescoSettingsService @@ -47,6 +51,11 @@ export class AlfrescoService { return this.host + this._baseUrlPath; } + /** + * Gets the folder node with the content. + * @param folder Path to folder. + * @returns {Observable} Folder entity. + */ getFolder(folder: string) { let headers = new Headers({ 'Content-Type': 'application/json', @@ -60,13 +69,23 @@ export class AlfrescoService { .catch(this.handleError); } - getDocumentThumbnailUrl(document: DocumentEntity) { + /** + * Get thumbnail URL for the given document node. + * @param document Node to get URL for. + * @returns {string} URL address. + */ + getDocumentThumbnailUrl(document: DocumentEntity): string { return this._host + '/alfresco/service/api/node/' + document.nodeRef.replace('://', '/') + '/content/thumbnails/doclib?c=queue&ph=true&lastModified=1'; } - getContentUrl(document: DocumentEntity) { + /** + * Get content URL for the given node. + * @param document Node to get URL for. + * @returns {string} URL address. + */ + getContentUrl(document: DocumentEntity): string { return this._host + '/alfresco/service/' + document.contentUrl; }