migration document list step 2

This commit is contained in:
Eugenio Romano
2016-07-04 12:01:14 +01:00
parent 7396a57e5c
commit 6284f3195c
10 changed files with 13 additions and 19 deletions

View File

@@ -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}

View File

@@ -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},

View File

@@ -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>

View File

@@ -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",

View File

@@ -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},
@@ -74,7 +74,7 @@ module.exports = function (config) {
// Coverage reporter generates the coverage // Coverage reporter generates the coverage
reporters: ['mocha', 'coverage', 'coveralls', 'kjhtml'], reporters: ['mocha', 'coverage', 'coveralls', 'kjhtml'],
// Source files that you wanna generate coverage for. // Source files that you wanna generate coverage for.
// Do not include tests or libraries (these files will be instrumented by Istanbul) // Do not include tests or libraries (these files will be instrumented by Istanbul)
preprocessors: { preprocessors: {

View File

@@ -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) {

View File

@@ -26,6 +26,6 @@ describe('AlfrescoSearchService', () => {
let service: AlfrescoSearchService; let service: AlfrescoSearchService;
beforeEach(() => { beforeEach(() => {
service = new AlfrescoSearchService(null, null); service = new AlfrescoSearchService(null);
}); });
}); });

View File

@@ -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);
} }
/** /**

View File

@@ -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 {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB