mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1769] Added JSDocs and methods and updated script (#2927)
This commit is contained in:
committed by
Eugenio Romano
parent
2bfed5818f
commit
76ad797488
@@ -4,17 +4,46 @@ Accesses app-generated data objects via URLs and file downloads.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
`downloadBlob(blob: Blob, fileName: string): void`<br/>
|
- `downloadBlob(blob: Blob, fileName: string)`
|
||||||
Starts downloading the data in `blob` to a named file.
|
Invokes content download for a Blob with a file name.
|
||||||
|
- `blob` - Content to download.
|
||||||
`downloadData(data: any, fileName: string): void`<br/>
|
- `fileName` - Name of the resulting file.
|
||||||
Starts downloading a data object to a named file.
|
- `downloadData(data: any, fileName: string)`
|
||||||
|
Invokes content download for a data array with a file name.
|
||||||
`downloadJSON(json: any, fileName): void`<br/>
|
- `data` - Data to download.
|
||||||
Starts downloading of JSON data to a named file.
|
- `fileName` - Name of the resulting file.
|
||||||
|
- `downloadJSON(json: any, fileName)`
|
||||||
`createTrustedUrl(blob: Blob): string`<br/>
|
Invokes content download for a JSON object with a file name.
|
||||||
Creates a trusted URL to access the data in `blob`.
|
- `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
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@@ -4,11 +4,18 @@ Stores key-value data items as browser cookies.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
`getItem(key: string): string | null` <br/>
|
- `isEnabled(): boolean`
|
||||||
Gets an item identified by `key`.
|
Checks if cookies are enabled.
|
||||||
|
|
||||||
` setItem(key: string, data: string, expiration: Date | null, path: string | null): void ` <br/>
|
- `getItem(key: string): string`
|
||||||
Stores an item under `key`.
|
Retrieves a cookie by its key.
|
||||||
|
- `key` - Key to identify the cookie
|
||||||
|
- `setItem(key: string, data: string, expiration: Date | null, path: string | null)`
|
||||||
|
Set a cookie.
|
||||||
|
- `key` - Key to identify the cookie
|
||||||
|
- `data` - Data value to set for the cookie
|
||||||
|
- `expiration` - Expiration date of the data
|
||||||
|
- `path` - "Pathname" to store the cookie
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
@@ -21,10 +28,7 @@ Cookies have a storage size limit that varies between browsers but is often arou
|
|||||||
4KB. Consider using [web storage](storage.service.md) if you need to store data
|
4KB. Consider using [web storage](storage.service.md) if you need to store data
|
||||||
beyond this size.
|
beyond this size.
|
||||||
|
|
||||||
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
|
|
||||||
<!-- seealso start -->
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- [Content service](content.service.md)
|
- [Content service](content.service.md)
|
||||||
- [Storage service](storage.service.md)
|
- [Storage service](storage.service.md)
|
||||||
<!-- seealso end -->
|
|
||||||
|
@@ -4,8 +4,9 @@ Gets a list of Content Services nodes currently in the trash.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
`getDeletedNodes(options?: Object): Observable<NodePaging>`<br/>
|
- `getDeletedNodes(options?: Object): Observable<NodePaging>`
|
||||||
Gets a list of nodes in the trash.
|
Gets a list of nodes in the trash.
|
||||||
|
- `options` - (Optional) Options for JSAPI call
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
@@ -15,13 +16,7 @@ more information about this class). The format of the `options` parameter is
|
|||||||
described in the [getDeletedNodes](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodesApi.md#getDeletedNodes)
|
described in the [getDeletedNodes](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodesApi.md#getDeletedNodes)
|
||||||
page of the Alfresco JS API docs.
|
page of the Alfresco JS API docs.
|
||||||
|
|
||||||
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
|
|
||||||
<!-- seealso start -->
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- [Nodes api service](nodes-api.service.md)
|
- [Nodes api service](nodes-api.service.md)
|
||||||
- [Node service](node.service.md)
|
- [Node service](node.service.md)
|
||||||
<!-- seealso end -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -4,11 +4,11 @@ Gets version and license information for Process Services and Content Services.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
`public getEcmProductInfo(): Observable<EcmProductVersionModel>`<br/>
|
- `getEcmProductInfo(): any`
|
||||||
Gets product information for Content Services.
|
Gets product information for Content Services.
|
||||||
|
|
||||||
`public getBpmProductInfo(): Observable<BpmProductVersionModel>`<br/>
|
- `getBpmProductInfo(): any`
|
||||||
Gets product information for Process Services.
|
Gets product information for Process Services.
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
@@ -18,12 +18,6 @@ See the
|
|||||||
[Alfresco JS API docs](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-discovery-rest-api)
|
[Alfresco JS API docs](https://github.com/Alfresco/alfresco-js-api/tree/master/src/alfresco-discovery-rest-api)
|
||||||
to learn more about the REST API used by this service.
|
to learn more about the REST API used by this service.
|
||||||
|
|
||||||
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
|
|
||||||
<!-- seealso start -->
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- [Product version model](product-version.model.md)
|
- [Product version model](product-version.model.md)
|
||||||
<!-- seealso end -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -2,6 +2,19 @@
|
|||||||
|
|
||||||
Implements the document menu actions for the Document List component.
|
Implements the document menu actions for the Document List component.
|
||||||
|
|
||||||
|
## Methods
|
||||||
|
|
||||||
|
- `getHandler(key: string): ContentActionHandler`
|
||||||
|
Gets the handler for an action.
|
||||||
|
- `key` - Identifier of the action
|
||||||
|
- `setHandler(key: string, handler: ContentActionHandler): boolean`
|
||||||
|
Sets a new handler for an action.
|
||||||
|
- `key` - Identifier of the action
|
||||||
|
- `handler` - Handler for the action
|
||||||
|
- `canExecuteAction(obj: any): boolean`
|
||||||
|
Checks if actions can be executed for an item.
|
||||||
|
- `obj` - Item to receive an action
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
This service implements the built-in actions that can be applied to a document
|
This service implements the built-in actions that can be applied to a document
|
||||||
@@ -72,10 +85,7 @@ export class MyView {
|
|||||||
You will probably want to set up all your custom actions at the application root level or
|
You will probably want to set up all your custom actions at the application root level or
|
||||||
with a custom application service.
|
with a custom application service.
|
||||||
|
|
||||||
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
|
|
||||||
<!-- seealso start -->
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- [Content action component](content-action.component.md)
|
- [Content action component](content-action.component.md)
|
||||||
- [Folder actions service](folder-actions.service.md)
|
- [Folder actions service](folder-actions.service.md)
|
||||||
<!-- seealso end -->
|
|
||||||
|
@@ -4,35 +4,41 @@ Implements node operations used by the Document List component.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
`deleteNode(nodeId: string): Observable<any>`<br/>
|
- `deleteNode(nodeId: string): Observable<any>`
|
||||||
Deletes a node.
|
Deletes a node.
|
||||||
|
- `nodeId` - ID of the node to delete
|
||||||
|
- `copyNode(nodeId: string, targetParentId: string): any`
|
||||||
|
Copy a node to destination node
|
||||||
|
- `nodeId` - The id of the node to be copied
|
||||||
|
- `targetParentId` - The id of the folder where the node will be copied
|
||||||
|
- `moveNode(nodeId: string, targetParentId: string): any`
|
||||||
|
Move a node to destination node
|
||||||
|
- `nodeId` - The id of the node to be moved
|
||||||
|
- `targetParentId` - The id of the folder where the node will be moved
|
||||||
|
- `createFolder(name: string, parentId: string): Observable<MinimalNodeEntity>`
|
||||||
|
Create a new folder in the path.
|
||||||
|
- `name` - Folder name
|
||||||
|
- `parentId` - Parent folder ID
|
||||||
|
- `getFolder(folder: string, opts?: any): any`
|
||||||
|
Gets the folder node with the specified relative name path below the root node.
|
||||||
|
- `folder` - Path to folder.
|
||||||
|
- `opts` - (Optional) Options.
|
||||||
|
- `getFolderNode(nodeId: string): Promise<MinimalNodeEntryEntity>`
|
||||||
|
Gets a folder node via its node ID.
|
||||||
|
- `nodeId` - ID of the folder node
|
||||||
|
- `getDocumentThumbnailUrl(node: MinimalNodeEntity): any`
|
||||||
|
Get thumbnail URL for the given document node.
|
||||||
|
- `node` - Node to get URL for.
|
||||||
|
- `getMimeTypeIcon(mimeType: string): string`
|
||||||
|
Gets the icon that represents a MIME type.
|
||||||
|
- `mimeType` - MIME type to get the icon for
|
||||||
|
- `getDefaultMimeTypeIcon(): string`
|
||||||
|
Gets a default icon for MIME types with no specific icon.
|
||||||
|
|
||||||
`copyNode(nodeId: string, targetParentId: string)`<br/>
|
- `hasPermission(node: any, permission: PermissionsEnum|string): boolean`
|
||||||
Places a copy of an existing node under a new parent node.
|
Checks if a node has the specified permission.
|
||||||
|
- `node` - Target node
|
||||||
`moveNode(nodeId: string, targetParentId: string)`<br/>
|
- `permission` - Permission level to query
|
||||||
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
|
## Details
|
||||||
|
|
||||||
@@ -73,12 +79,6 @@ The `hasPermission` method reports whether or not the user has the specified per
|
|||||||
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
|
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.
|
values via their string equivalents.
|
||||||
|
|
||||||
<!-- Don't edit the See also section. Edit seeAlsoGraph.json and run config/generateSeeAlso.js -->
|
|
||||||
<!-- seealso start -->
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- [Document list component](document-list.component.md)
|
- [Document list component](document-list.component.md)
|
||||||
<!-- seealso end -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -4,14 +4,15 @@ Gets information about a Content Services user.
|
|||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
`getUserInfo(userName: string): Observable<EcmUserModel>`<br/>
|
- `getUserInfo(userName: string): Observable<EcmUserModel>`
|
||||||
Gets information about a user identified by their username.
|
Gets information about a user identified by their username.
|
||||||
|
- `userName` - Target username
|
||||||
|
- `getCurrentUserInfo(): Observable<EcmUserModel>`
|
||||||
|
Gets information about the user who is currently logged-in.
|
||||||
|
|
||||||
`getCurrentUserInfo(): Observable<EcmUserModel>`<br/>
|
- `getUserProfileImage(avatarId: string): string`
|
||||||
Gets information about the user who is currently logged-in.
|
Returns a profile image as a URL.
|
||||||
|
- `avatarId` - Target avatar
|
||||||
`getUserProfileImage(avatarId: string)`<br/>
|
|
||||||
Returns a profile image as a URL.
|
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@@ -27,7 +27,8 @@ var ParamData = /** @class */ (function () {
|
|||||||
var sig = this.name;
|
var sig = this.name;
|
||||||
if (this.optional)
|
if (this.optional)
|
||||||
sig += "?";
|
sig += "?";
|
||||||
sig += ": " + this.type;
|
if (this.type)
|
||||||
|
sig += ": " + this.type;
|
||||||
if (this.initializer)
|
if (this.initializer)
|
||||||
sig += " = " + this.initializer;
|
sig += " = " + this.initializer;
|
||||||
return sig;
|
return sig;
|
||||||
@@ -134,6 +135,8 @@ var ServiceDocAutoContent = /** @class */ (function () {
|
|||||||
var methData = new MethodData();
|
var methData = new MethodData();
|
||||||
methData.name = memSymbol.getName();
|
methData.name = memSymbol.getName();
|
||||||
var doc = ts.displayPartsToString(memSymbol.getDocumentationComment());
|
var doc = ts.displayPartsToString(memSymbol.getDocumentationComment());
|
||||||
|
if (!doc)
|
||||||
|
console.log("Warning: Method " + classDec.name.escapedText + "." + methData.name + " is not documented");
|
||||||
methData.docText = doc.replace(/\r\n/g, " ");
|
methData.docText = doc.replace(/\r\n/g, " ");
|
||||||
var sig = checker.getSignatureFromDeclaration(method);
|
var sig = checker.getSignatureFromDeclaration(method);
|
||||||
var returnType = sig.getReturnType();
|
var returnType = sig.getReturnType();
|
||||||
@@ -143,9 +146,14 @@ var ServiceDocAutoContent = /** @class */ (function () {
|
|||||||
for (var p = 0; p < params.length; p++) {
|
for (var p = 0; p < params.length; p++) {
|
||||||
var pData = new ParamData();
|
var pData = new ParamData();
|
||||||
pData.name = params[p].name.getText();
|
pData.name = params[p].name.getText();
|
||||||
pData.type = params[p].type.getText();
|
if (params[p].type)
|
||||||
|
pData.type = params[p].type.getText();
|
||||||
|
else
|
||||||
|
pData.type = "";
|
||||||
var paramSymbol = checker.getSymbolAtLocation(params[p].name);
|
var paramSymbol = checker.getSymbolAtLocation(params[p].name);
|
||||||
pData.docText = ts.displayPartsToString(paramSymbol.getDocumentationComment());
|
pData.docText = ts.displayPartsToString(paramSymbol.getDocumentationComment());
|
||||||
|
if (!pData.docText)
|
||||||
|
console.log("Warning: Parameter \"" + pData.name + "\" of " + classDec.name.escapedText + "." + methData.name + " is not documented");
|
||||||
pData.optional = params[p].questionToken ? true : false;
|
pData.optional = params[p].questionToken ? true : false;
|
||||||
if (params[p].initializer) {
|
if (params[p].initializer) {
|
||||||
var initText = params[p].initializer.getText();
|
var initText = params[p].initializer.getText();
|
||||||
|
@@ -39,12 +39,13 @@ class ParamData {
|
|||||||
optional: boolean;
|
optional: boolean;
|
||||||
|
|
||||||
getSignature() {
|
getSignature() {
|
||||||
let sig =this.name;
|
let sig = this.name;
|
||||||
|
|
||||||
if (this.optional)
|
if (this.optional)
|
||||||
sig += "?";
|
sig += "?";
|
||||||
|
|
||||||
sig += ": " + this.type;
|
if (this.type)
|
||||||
|
sig += ": " + this.type;
|
||||||
|
|
||||||
if (this.initializer)
|
if (this.initializer)
|
||||||
sig += " = " + this.initializer;
|
sig += " = " + this.initializer;
|
||||||
@@ -192,6 +193,10 @@ class ServiceDocAutoContent implements NgDocAutoContent {
|
|||||||
|
|
||||||
methData.name = memSymbol.getName();
|
methData.name = memSymbol.getName();
|
||||||
let doc = ts.displayPartsToString(memSymbol.getDocumentationComment());
|
let doc = ts.displayPartsToString(memSymbol.getDocumentationComment());
|
||||||
|
|
||||||
|
if (!doc)
|
||||||
|
console.log(`Warning: Method ${classDec.name.escapedText}.${methData.name} is not documented`);
|
||||||
|
|
||||||
methData.docText = doc.replace(/\r\n/g, " ");
|
methData.docText = doc.replace(/\r\n/g, " ");
|
||||||
let sig = checker.getSignatureFromDeclaration(method);
|
let sig = checker.getSignatureFromDeclaration(method);
|
||||||
let returnType = sig.getReturnType();
|
let returnType = sig.getReturnType();
|
||||||
@@ -203,9 +208,18 @@ class ServiceDocAutoContent implements NgDocAutoContent {
|
|||||||
for (let p = 0; p < params.length; p++){
|
for (let p = 0; p < params.length; p++){
|
||||||
let pData = new ParamData();
|
let pData = new ParamData();
|
||||||
pData.name = params[p].name.getText();
|
pData.name = params[p].name.getText();
|
||||||
pData.type = params[p].type.getText();
|
|
||||||
|
if (params[p].type)
|
||||||
|
pData.type = params[p].type.getText();
|
||||||
|
else
|
||||||
|
pData.type = "";
|
||||||
|
|
||||||
let paramSymbol = checker.getSymbolAtLocation(params[p].name);
|
let paramSymbol = checker.getSymbolAtLocation(params[p].name);
|
||||||
pData.docText = ts.displayPartsToString(paramSymbol.getDocumentationComment());
|
pData.docText = ts.displayPartsToString(paramSymbol.getDocumentationComment());
|
||||||
|
|
||||||
|
if (!pData.docText)
|
||||||
|
console.log(`Warning: Parameter "${pData.name}" of ${classDec.name.escapedText}.${methData.name} is not documented`);
|
||||||
|
|
||||||
pData.optional = params[p].questionToken ? true : false;
|
pData.optional = params[p].questionToken ? true : false;
|
||||||
|
|
||||||
if (params[p].initializer) {
|
if (params[p].initializer) {
|
||||||
|
@@ -41,6 +41,10 @@ export class DocumentActionsService {
|
|||||||
this.setupActionHandlers();
|
this.setupActionHandlers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the handler for an action.
|
||||||
|
* @param key Identifier of the action
|
||||||
|
*/
|
||||||
getHandler(key: string): ContentActionHandler {
|
getHandler(key: string): ContentActionHandler {
|
||||||
if (key) {
|
if (key) {
|
||||||
let lkey = key.toLowerCase();
|
let lkey = key.toLowerCase();
|
||||||
@@ -49,6 +53,11 @@ export class DocumentActionsService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a new handler for an action.
|
||||||
|
* @param key Identifier of the action
|
||||||
|
* @param handler Handler for the action
|
||||||
|
*/
|
||||||
setHandler(key: string, handler: ContentActionHandler): boolean {
|
setHandler(key: string, handler: ContentActionHandler): boolean {
|
||||||
if (key) {
|
if (key) {
|
||||||
let lkey = key.toLowerCase();
|
let lkey = key.toLowerCase();
|
||||||
@@ -58,6 +67,10 @@ export class DocumentActionsService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if actions can be executed for an item.
|
||||||
|
* @param obj Item to receive an action
|
||||||
|
*/
|
||||||
canExecuteAction(obj: any): boolean {
|
canExecuteAction(obj: any): boolean {
|
||||||
return this.documentListService && obj && obj.entry.isFile === true;
|
return this.documentListService && obj && obj.entry.isFile === true;
|
||||||
}
|
}
|
||||||
|
@@ -62,6 +62,10 @@ export class DocumentListService {
|
|||||||
return this.apiService.getInstance().nodes.getNodeChildren(rootNodeId, params);
|
return this.apiService.getInstance().nodes.getNodeChildren(rootNodeId, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a node.
|
||||||
|
* @param nodeId ID of the node to delete
|
||||||
|
*/
|
||||||
deleteNode(nodeId: string): Observable<any> {
|
deleteNode(nodeId: string): Observable<any> {
|
||||||
return Observable.fromPromise(this.apiService.getInstance().nodes.deleteNode(nodeId));
|
return Observable.fromPromise(this.apiService.getInstance().nodes.deleteNode(nodeId));
|
||||||
}
|
}
|
||||||
@@ -70,7 +74,7 @@ export class DocumentListService {
|
|||||||
* Copy a node to destination node
|
* Copy a node to destination node
|
||||||
*
|
*
|
||||||
* @param nodeId The id of the node to be copied
|
* @param nodeId The id of the node to be copied
|
||||||
* @param targetParentId The id of the folder-node where the node have to be copied to
|
* @param targetParentId The id of the folder where the node will be copied
|
||||||
*/
|
*/
|
||||||
copyNode(nodeId: string, targetParentId: string) {
|
copyNode(nodeId: string, targetParentId: string) {
|
||||||
return Observable.fromPromise(this.apiService.getInstance().nodes.copyNode(nodeId, { targetParentId }))
|
return Observable.fromPromise(this.apiService.getInstance().nodes.copyNode(nodeId, { targetParentId }))
|
||||||
@@ -81,7 +85,7 @@ export class DocumentListService {
|
|||||||
* Move a node to destination node
|
* Move a node to destination node
|
||||||
*
|
*
|
||||||
* @param nodeId The id of the node to be moved
|
* @param nodeId The id of the node to be moved
|
||||||
* @param targetParentId The id of the folder-node where the node have to be moved to
|
* @param targetParentId The id of the folder where the node will be moved
|
||||||
*/
|
*/
|
||||||
moveNode(nodeId: string, targetParentId: string) {
|
moveNode(nodeId: string, targetParentId: string) {
|
||||||
return Observable.fromPromise(this.apiService.getInstance().nodes.moveNode(nodeId, { targetParentId }))
|
return Observable.fromPromise(this.apiService.getInstance().nodes.moveNode(nodeId, { targetParentId }))
|
||||||
@@ -111,6 +115,10 @@ export class DocumentListService {
|
|||||||
.catch(err => this.handleError(err));
|
.catch(err => this.handleError(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a folder node via its node ID.
|
||||||
|
* @param nodeId ID of the folder node
|
||||||
|
*/
|
||||||
getFolderNode(nodeId: string): Promise<MinimalNodeEntryEntity> {
|
getFolderNode(nodeId: string): Promise<MinimalNodeEntryEntity> {
|
||||||
let opts: any = {
|
let opts: any = {
|
||||||
includeSource: true,
|
includeSource: true,
|
||||||
@@ -130,14 +138,26 @@ export class DocumentListService {
|
|||||||
return this.thumbnailService.getDocumentThumbnailUrl(node);
|
return this.thumbnailService.getDocumentThumbnailUrl(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the icon that represents a MIME type.
|
||||||
|
* @param mimeType MIME type to get the icon for
|
||||||
|
*/
|
||||||
getMimeTypeIcon(mimeType: string): string {
|
getMimeTypeIcon(mimeType: string): string {
|
||||||
return this.thumbnailService.getMimeTypeIcon(mimeType);
|
return this.thumbnailService.getMimeTypeIcon(mimeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a default icon for MIME types with no specific icon.
|
||||||
|
*/
|
||||||
getDefaultMimeTypeIcon(): string {
|
getDefaultMimeTypeIcon(): string {
|
||||||
return this.thumbnailService.getDefaultMimeTypeIcon();
|
return this.thumbnailService.getDefaultMimeTypeIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a node has the specified permission.
|
||||||
|
* @param node Target node
|
||||||
|
* @param permission Permission level to query
|
||||||
|
*/
|
||||||
hasPermission(node: any, permission: PermissionsEnum|string): boolean {
|
hasPermission(node: any, permission: PermissionsEnum|string): boolean {
|
||||||
return this.contentService.hasPermission(node, permission);
|
return this.contentService.hasPermission(node, permission);
|
||||||
}
|
}
|
||||||
|
@@ -133,7 +133,7 @@ export class ContentService {
|
|||||||
/**
|
/**
|
||||||
* Get thumbnail URL for the given document node.
|
* Get thumbnail URL for the given document node.
|
||||||
*
|
*
|
||||||
* @param {string|MinimalNodeEntity} nodeId or node to get URL for.
|
* @param {string|MinimalNodeEntity} node Node to get URL for.
|
||||||
* @param {boolean} [attachment] Retrieve content as an attachment for download
|
* @param {boolean} [attachment] Retrieve content as an attachment for download
|
||||||
* @param {string} [ticket] Custom ticket to use for authentication
|
* @param {string} [ticket] Custom ticket to use for authentication
|
||||||
* @returns {string} The URL address pointing to the content.
|
* @returns {string} The URL address pointing to the content.
|
||||||
@@ -166,7 +166,7 @@ export class ContentService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get content for the given node.
|
* Get content for the given node.
|
||||||
* @param nodeId {string}.
|
* @param nodeId ID of the target node
|
||||||
*
|
*
|
||||||
* @returns {Observable<any>} URL address.
|
* @returns {Observable<any>} URL address.
|
||||||
*/
|
*/
|
||||||
@@ -178,7 +178,9 @@ export class ContentService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a folder
|
* Create a folder
|
||||||
* @param name - the folder name
|
* @param relativePath Location to create the folder
|
||||||
|
* @param name Folder name
|
||||||
|
* @param parentId Node ID of parent folder
|
||||||
*/
|
*/
|
||||||
createFolder(relativePath: string, name: string, parentId?: string): Observable<FolderCreatedEvent> {
|
createFolder(relativePath: string, name: string, parentId?: string): Observable<FolderCreatedEvent> {
|
||||||
return Observable.fromPromise(this.apiService.getInstance().nodes.createFolder(name, relativePath, parentId))
|
return Observable.fromPromise(this.apiService.getInstance().nodes.createFolder(name, relativePath, parentId))
|
||||||
@@ -195,8 +197,8 @@ export class ContentService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the user has permissions on that node
|
* Check if the user has permissions on that node
|
||||||
* @param MinimalNode - node to check allowableOperations
|
* @param node Node to check allowableOperations
|
||||||
* @param PermissionsEnum - create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
|
* @param permission Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
|
||||||
*
|
*
|
||||||
* @returns {boolean} has permission
|
* @returns {boolean} has permission
|
||||||
*/
|
*/
|
||||||
@@ -221,7 +223,7 @@ export class ContentService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the node has the properties allowableOperations
|
* Check if the node has the properties allowableOperations
|
||||||
* @param MinimalNode - node to check allowableOperations
|
* @param node Node to check allowableOperations
|
||||||
*
|
*
|
||||||
* @returns {boolean} has AllowableOperations
|
* @returns {boolean} has AllowableOperations
|
||||||
*/
|
*/
|
||||||
|
@@ -20,6 +20,9 @@ import { Injectable } from '@angular/core';
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class CookieService {
|
export class CookieService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if cookies are enabled.
|
||||||
|
*/
|
||||||
isEnabled(): boolean {
|
isEnabled(): boolean {
|
||||||
// for certain scenarios Chrome may say 'true' but have cookies still disabled
|
// for certain scenarios Chrome may say 'true' but have cookies still disabled
|
||||||
if (navigator.cookieEnabled === false) {
|
if (navigator.cookieEnabled === false) {
|
||||||
@@ -31,8 +34,8 @@ export class CookieService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve cookie by key.
|
* Retrieves a cookie by its key.
|
||||||
*
|
* @param key Key to identify the cookie
|
||||||
* @returns {string | null}
|
* @returns {string | null}
|
||||||
*/
|
*/
|
||||||
getItem(key: string): string | null {
|
getItem(key: string): string | null {
|
||||||
@@ -43,10 +46,10 @@ export class CookieService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a cookie.
|
* Set a cookie.
|
||||||
* @param key
|
* @param key Key to identify the cookie
|
||||||
* @param data
|
* @param data Data value to set for the cookie
|
||||||
* @param expiration
|
* @param expiration Expiration date of the data
|
||||||
* @param path
|
* @param path "Pathname" to store the cookie
|
||||||
*
|
*
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
|
@@ -33,6 +33,10 @@ export class DeletedNodesApiService {
|
|||||||
return this.apiService.getInstance().core.nodesApi;
|
return this.apiService.getInstance().core.nodesApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a list of nodes in the trash.
|
||||||
|
* @param options Options for JSAPI call
|
||||||
|
*/
|
||||||
getDeletedNodes(options?: Object): Observable<NodePaging> {
|
getDeletedNodes(options?: Object): Observable<NodePaging> {
|
||||||
const { nodesApi, handleError } = this;
|
const { nodesApi, handleError } = this;
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
|
@@ -28,6 +28,9 @@ export class DiscoveryApiService {
|
|||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService) { }
|
constructor(private apiService: AlfrescoApiService) { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets product information for Content Services.
|
||||||
|
*/
|
||||||
public getEcmProductInfo() {
|
public getEcmProductInfo() {
|
||||||
return Observable.fromPromise(
|
return Observable.fromPromise(
|
||||||
this.apiService.getInstance().discovery.discoveryApi.getRepositoryInformation())
|
this.apiService.getInstance().discovery.discoveryApi.getRepositoryInformation())
|
||||||
@@ -35,6 +38,9 @@ export class DiscoveryApiService {
|
|||||||
.catch(this.handleError);
|
.catch(this.handleError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets product information for Process Services.
|
||||||
|
*/
|
||||||
public getBpmProductInfo() {
|
public getBpmProductInfo() {
|
||||||
return Observable.fromPromise(
|
return Observable.fromPromise(
|
||||||
this.apiService.getInstance().activiti.aboutApi.getAppVersion())
|
this.apiService.getInstance().activiti.aboutApi.getAppVersion())
|
||||||
|
@@ -33,8 +33,8 @@ export class EcmUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get User Information via ECM
|
* Gets information about a user identified by their username.
|
||||||
* @param userName - the user name
|
* @param userName Target username
|
||||||
*/
|
*/
|
||||||
getUserInfo(userName: string): Observable<EcmUserModel> {
|
getUserInfo(userName: string): Observable<EcmUserModel> {
|
||||||
return Observable.fromPromise(this.apiService.getInstance().core.peopleApi.getPerson(userName))
|
return Observable.fromPromise(this.apiService.getInstance().core.peopleApi.getPerson(userName))
|
||||||
@@ -42,10 +42,17 @@ export class EcmUserService {
|
|||||||
.catch(err => this.handleError(err));
|
.catch(err => this.handleError(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets information about the user who is currently logged-in.
|
||||||
|
*/
|
||||||
getCurrentUserInfo() {
|
getCurrentUserInfo() {
|
||||||
return this.getUserInfo('-me-');
|
return this.getUserInfo('-me-');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a profile image as a URL.
|
||||||
|
* @param avatarId Target avatar
|
||||||
|
*/
|
||||||
getUserProfileImage(avatarId: string) {
|
getUserProfileImage(avatarId: string) {
|
||||||
if (avatarId) {
|
if (avatarId) {
|
||||||
let nodeObj = {entry: {id: avatarId}};
|
let nodeObj = {entry: {id: avatarId}};
|
||||||
|
Reference in New Issue
Block a user