Fix search demo for non-default repo hostnames

This commit is contained in:
Will Abson 2016-06-06 15:58:42 +01:00
parent f2275ebdcb
commit 532dd2a244

View File

@ -30,11 +30,9 @@ declare let AlfrescoApi: any;
export class AlfrescoService { export class AlfrescoService {
private _baseUrlPath: string = '/alfresco/api/-default-/public/alfresco/versions/1'; private _baseUrlPath: string = '/alfresco/api/-default-/public/alfresco/versions/1';
private _alfrescoClient;
constructor(private http: Http, constructor(private http: Http,
private settings: AlfrescoSettingsService) { private settings: AlfrescoSettingsService) {
this._alfrescoClient = AlfrescoApi.getClientWithTicket(this.getBaseUrl(), this.getAlfrescoTicket());
} }
public getHost(): string { public getHost(): string {
@ -49,8 +47,12 @@ export class AlfrescoService {
return localStorage.getItem('token'); return localStorage.getItem('token');
} }
private getAlfrescoClient() {
return AlfrescoApi.getClientWithTicket(this.getBaseUrl(), this.getAlfrescoTicket());
}
private getSearchNodesPromise(term: string) { private getSearchNodesPromise(term: string) {
let apiInstance = new AlfrescoApi.Core.SearchApi(this._alfrescoClient); let apiInstance = new AlfrescoApi.Core.SearchApi(this.getAlfrescoClient());
let nodeId = '-root-'; let nodeId = '-root-';
let opts = { let opts = {
include: ['path'], include: ['path'],