mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
migration document list step 2
This commit is contained in:
@@ -94,6 +94,10 @@ export class AlfrescoAuthenticationService extends AlfrescoAuthenticationBase {
|
|||||||
return this.alfrescoApi;
|
return this.alfrescoApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getToken(): any {
|
||||||
|
return this.alfrescoApi.getToeken();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The method return tru if the user is logged in
|
* The method return tru if the user is logged in
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
|
@@ -18,6 +18,7 @@ module.exports = function (config) {
|
|||||||
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
|
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
|
||||||
{pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false},
|
{pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false},
|
||||||
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, served: true, watched: false},
|
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, served: true, watched: false},
|
||||||
|
{pattern: 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', included: true, watched: false},
|
||||||
|
|
||||||
{pattern: 'karma-test-shim.js', included: true, watched: true},
|
{pattern: 'karma-test-shim.js', included: true, watched: true},
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
|
||||||
<!-- Additional Alfresco libraries -->
|
<!-- Additional Alfresco libraries -->
|
||||||
<script src="node_modules/alfresco-js-api/bundle.js"></script>
|
<script src="node_modules/alfresco-js-api/dist/alfresco-js-api.js"></script>
|
||||||
|
|
||||||
<script src="systemjs.config.js"></script>
|
<script src="systemjs.config.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
"alfresco-js-api": "^0.1.0",
|
"alfresco-js-api": "^0.1.0",
|
||||||
"ng2-alfresco-core": "^0.1.36",
|
"ng2-alfresco-core": "^0.1.36",
|
||||||
"ng2-alfresco-search": "^0.1.21"
|
"ng2-alfresco-search": "file:../"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "2.0.0",
|
"concurrently": "2.0.0",
|
||||||
|
@@ -16,7 +16,7 @@ module.exports = function (config) {
|
|||||||
{pattern: 'node_modules/@angular/**/*.map', included: false, watched: false},
|
{pattern: 'node_modules/@angular/**/*.map', included: false, watched: false},
|
||||||
|
|
||||||
{pattern: 'node_modules/material-design-lite/material.min.js', included: true, watched: false},
|
{pattern: 'node_modules/material-design-lite/material.min.js', included: true, watched: false},
|
||||||
{pattern: 'node_modules/alfresco-js-api/bundle.js', included: true, watched: false},
|
{pattern: 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', included: true, watched: false},
|
||||||
|
|
||||||
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
|
{pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false},
|
||||||
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, served: true, watched: false},
|
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, served: true, watched: false},
|
||||||
|
@@ -18,7 +18,6 @@
|
|||||||
import {Observable} from 'rxjs/Rx';
|
import {Observable} from 'rxjs/Rx';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AlfrescoSettingsService,
|
|
||||||
AlfrescoAuthenticationService
|
AlfrescoAuthenticationService
|
||||||
} from 'ng2-alfresco-core';
|
} from 'ng2-alfresco-core';
|
||||||
import {AlfrescoSearchService} from './../../src/services/alfresco-search.service';
|
import {AlfrescoSearchService} from './../../src/services/alfresco-search.service';
|
||||||
@@ -28,10 +27,9 @@ export class AlfrescoServiceMock extends AlfrescoSearchService {
|
|||||||
_folderToReturn: any = {};
|
_folderToReturn: any = {};
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
settings: AlfrescoSettingsService = null,
|
|
||||||
authService: AlfrescoAuthenticationService = null
|
authService: AlfrescoAuthenticationService = null
|
||||||
) {
|
) {
|
||||||
super(settings, authService);
|
super(authService);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFolder(folder: string) {
|
getFolder(folder: string) {
|
||||||
|
@@ -26,6 +26,6 @@ describe('AlfrescoSearchService', () => {
|
|||||||
let service: AlfrescoSearchService;
|
let service: AlfrescoSearchService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
service = new AlfrescoSearchService(null, null);
|
service = new AlfrescoSearchService(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -19,7 +19,6 @@ import { Injectable } from '@angular/core';
|
|||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Rx';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AlfrescoSettingsService,
|
|
||||||
AlfrescoAuthenticationService
|
AlfrescoAuthenticationService
|
||||||
} from 'ng2-alfresco-core';
|
} from 'ng2-alfresco-core';
|
||||||
|
|
||||||
@@ -31,23 +30,17 @@ declare let AlfrescoApi: any;
|
|||||||
@Injectable()
|
@Injectable()
|
||||||
export class AlfrescoSearchService {
|
export class AlfrescoSearchService {
|
||||||
|
|
||||||
constructor(private settings: AlfrescoSettingsService,
|
constructor(private authService: AlfrescoAuthenticationService) {
|
||||||
private authService: AlfrescoAuthenticationService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private getAlfrescoClient() {
|
|
||||||
return AlfrescoApi.getClientWithTicket(this.settings.getApiBaseUrl(), this.authService.getToken());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getSearchNodesPromise(term: string) {
|
private getSearchNodesPromise(term: string) {
|
||||||
let apiInstance = new AlfrescoApi.Core.SearchApi(this.getAlfrescoClient());
|
|
||||||
let nodeId = '-root-';
|
let nodeId = '-root-';
|
||||||
let opts = {
|
let opts = {
|
||||||
include: ['path'],
|
include: ['path'],
|
||||||
rootNodeId: nodeId,
|
rootNodeId: nodeId,
|
||||||
nodeType: 'cm:content'
|
nodeType: 'cm:content'
|
||||||
};
|
};
|
||||||
return apiInstance.liveSearchNodes(term, opts);
|
return this.authService.alfrescoApi.search.liveSearchNodes(term, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -20,8 +20,6 @@ import {
|
|||||||
AlfrescoContentService
|
AlfrescoContentService
|
||||||
} from 'ng2-alfresco-core';
|
} from 'ng2-alfresco-core';
|
||||||
|
|
||||||
declare let AlfrescoApi: any;
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AlfrescoThumbnailService {
|
export class AlfrescoThumbnailService {
|
||||||
|
|
||||||
|
BIN
ng2-components/ng2-alfresco-viewer/demo/localImg.jpg
Normal file
BIN
ng2-components/ng2-alfresco-viewer/demo/localImg.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 MiB |
Reference in New Issue
Block a user