mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-04-23 22:30:37 +00:00
Document list uses new alfresco-js-api package
This commit is contained in:
@@ -21,7 +21,7 @@ npm install --save ng2-alfresco-documentlist
|
||||
Add the following dependency to your index.html:
|
||||
|
||||
```html
|
||||
<script src="node_modules/alfresco-core-rest-api/bundle.js"></script>
|
||||
<script src="node_modules/alfresco-js-api/bundle.js"></script>
|
||||
```
|
||||
|
||||
Also make sure you include these dependencies in your .html page:
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<script src="node_modules/angular2/bundles/http.dev.js"></script>
|
||||
|
||||
<!-- Additional Alfresco libraries -->
|
||||
<script src="node_modules/alfresco-core-rest-api/bundle.js"></script>
|
||||
<script src="node_modules/alfresco-js-api/bundle.js"></script>
|
||||
|
||||
<script src="systemjs.config.js"></script>
|
||||
<script>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
"rxjs": "5.0.0-beta.2",
|
||||
"systemjs": "0.19.26",
|
||||
"zone.js": "^0.6.12",
|
||||
"alfresco-core-rest-api": "^0.1.0"
|
||||
"alfresco-js-api": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"copyfiles": "^0.2.1",
|
||||
|
||||
@@ -48,20 +48,12 @@ export class AlfrescoService {
|
||||
}
|
||||
|
||||
private getAlfrescoClient() {
|
||||
let defaultClient = new AlfrescoApi.ApiClient();
|
||||
defaultClient.basePath = this.getBaseUrl();
|
||||
|
||||
// Configure HTTP basic authorization: basicAuth
|
||||
let basicAuth = defaultClient.authentications['basicAuth'];
|
||||
basicAuth.username = 'ROLE_TICKET';
|
||||
basicAuth.password = this.getAlfrescoTicket();
|
||||
|
||||
return defaultClient;
|
||||
return AlfrescoApi.getClientWithTicket(this.getBaseUrl(), this.getAlfrescoTicket());
|
||||
}
|
||||
|
||||
private getNodesPromise(folder: string) {
|
||||
let alfrescoClient = this.getAlfrescoClient();
|
||||
let apiInstance = new AlfrescoApi.NodesApi(alfrescoClient);
|
||||
let apiInstance = new AlfrescoApi.Core.NodesApi(alfrescoClient);
|
||||
let nodeId = '-root-';
|
||||
let opts = {
|
||||
relativePath: folder,
|
||||
@@ -72,7 +64,7 @@ export class AlfrescoService {
|
||||
|
||||
deleteNode(nodeId: string) {
|
||||
let client = this.getAlfrescoClient();
|
||||
let nodesApi = new AlfrescoApi.NodesApi(client);
|
||||
let nodesApi = new AlfrescoApi.Core.NodesApi(client);
|
||||
let opts = {};
|
||||
return Observable.fromPromise(nodesApi.deleteNode(nodeId, opts));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user