diff --git a/searchPages/find/search.component.html b/searchPages/find/search.component.html index 92a9cec0..9b6a52a8 100644 --- a/searchPages/find/search.component.html +++ b/searchPages/find/search.component.html @@ -155,7 +155,7 @@
- +
@@ -175,7 +175,7 @@
- +
@@ -194,7 +194,7 @@
- +
@@ -213,7 +213,7 @@
- +
diff --git a/searchPages/find/search.component.ts b/searchPages/find/search.component.ts index 2263b83a..613f0086 100644 --- a/searchPages/find/search.component.ts +++ b/searchPages/find/search.component.ts @@ -32,6 +32,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service'; import {ConfigurationService} from '../../utils/configuration/configuration.service'; import {EnvProperties} from '../../utils/properties/env-properties'; import { SEOService } from '../../sharedComponents/SEO/SEO.service'; +import {StringUtils} from '../../utils/string-utils.class'; @Component({ changeDetection: ChangeDetectionStrategy.Default, @@ -99,6 +100,8 @@ export class SearchComponent { properties: EnvProperties; @Input() logoURL; @Input() name; + @Input() connectCommunityId =null; + @Input() piwikSiteId = null; public subPub;public subData; public subSoftware; public subOrps; public subProjects;public subOrg; public subDataPr; constructor ( private route: ActivatedRoute, @@ -142,13 +145,13 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this._meta.updateTag({content:url},"property='og:url'"); this.seoService.createLinkForCanonicalURL(false); if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ - this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE |Search publications, research data, projects...").subscribe(); + this.piwiksub = this._piwikService.trackView(this.properties, "OpenAIRE |Search publications, research data, projects...", this.piwikSiteId).subscribe(); } - this.config.getCommunityInformation(this.properties.adminToolsAPIURL, this.properties.adminToolsCommunity ).subscribe(data => { + this.config.getCommunityInformation(this.properties.adminToolsAPIURL, (this.connectCommunityId)?this.connectCommunityId:this.properties.adminToolsCommunity ).subscribe(data => { var showEntity = {}; for(var i=0; i< data.entities.length; i++){ @@ -161,12 +164,17 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.showDataProviders = showEntity["datasource"]; this.showSoftware = showEntity["software"]; this.showOrps = showEntity["orp"]; + if(this.connectCommunityId){ + this.showProjects = false; + this.showOrganizations = false; + this.showDataProviders = false; + } this.sub = this.route.queryParams.subscribe(params => { + this.reloadTabs(); this.keyword = (params['keyword'])?params['keyword']:""; if(this.keyword !=null && this.keyword.length > 0){ - this.reloadTabs(); //if showPublications == false will set another entity as the first if(this.showPublications){ this.activeTab = "publications"; @@ -236,10 +244,10 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.activeTab = "publications"; this.advancedSearchLink ="/search/advanced/publications"; if( this.reloadPublications && - this.fetchPublications.searchUtils.status != this.errorCodes.NONE && - this.fetchPublications.searchUtils.status != this.errorCodes.ERROR) { + this.fetchPublications.searchUtils.status != this.errorCodes.NONE /*&& + this.fetchPublications.searchUtils.status != this.errorCodes.ERROR*/) { this.reloadPublications = false; - this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10,this.properties); + this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.linkToSearchPublications = this.properties.searchLinkToPublications;// + "?keyword=" + this.keyword; } } @@ -247,10 +255,10 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.activeTab = "research data"; this.advancedSearchLink ="/search/advanced/datasets"; if(this.reloadDatasets && - this.fetchDatasets.searchUtils.status != this.errorCodes.NONE && - this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR) { + this.fetchDatasets.searchUtils.status != this.errorCodes.NONE /*&& + this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR*/) { this.reloadDatasets = false; - this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10,this.properties); + this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.linkToSearchDatasets =this.properties.searchLinkToDatasets;// + "?keyword=" + this.keyword; } } @@ -259,11 +267,12 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.activeTab = "software"; this.advancedSearchLink ="/search/advanced/software"; - if(this.reloadSoftware && + if(this.reloadSoftware + && this.fetchSoftware.searchUtils.status != this.errorCodes.NONE/* && ( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING || - this.fetchSoftware.searchUtils.status == this.errorCodes.DONE )) { + this.fetchSoftware.searchUtils.status == this.errorCodes.DONE )*/) { this.reloadSoftware = false; - this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10,this.properties); + this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.linkToSearchSoftware = this.properties.searchLinkToSoftware;// + "?keyword=" + this.keyword; } } @@ -272,10 +281,10 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.activeTab = "other research products"; this.advancedSearchLink ="/search/advanced/other"; if(this.reloadOrps && - this.fetchOrps.searchUtils.status != this.errorCodes.NONE && - this.fetchOrps.searchUtils.status != this.errorCodes.ERROR) { + this.fetchOrps.searchUtils.status != this.errorCodes.NONE /*&& + this.fetchOrps.searchUtils.status != this.errorCodes.ERROR*/) { this.reloadOrps = false; - this.fetchOrps.getResultsByKeyword(this.keyword, 1, 10,this.properties); + this.fetchOrps.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId); this.linkToSearchOrps =this.properties.searchLinkToOrps; } } @@ -283,8 +292,8 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.activeTab = "projects"; this.advancedSearchLink ="/search/advanced/projects"; if(this.reloadProjects && - this.fetchProjects.searchUtils.status != this.errorCodes.NONE && - this.fetchProjects.searchUtils.status != this.errorCodes.ERROR) { + this.fetchProjects.searchUtils.status != this.errorCodes.NONE /*&& + this.fetchProjects.searchUtils.status != this.errorCodes.ERROR*/) { this.reloadProjects = false; this.fetchProjects.getResultsByKeyword(this.keyword, 1, 10,this.properties); this.linkToSearchProjects = this.properties.searchLinkToProjects;// + "?keyword=" + this.keyword; @@ -294,8 +303,8 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.activeTab = "content providers"; this.advancedSearchLink ="/search/advanced/dataproviders"; if( this.reloadDataproviders && - this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE && - this.fetchDataproviders.searchUtils.status != this.errorCodes.ERROR) { + this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE /*&& + this.fetchDataproviders.searchUtils.status != this.errorCodes.ERROR*/) { this.reloadDataproviders = false; this.fetchDataproviders.getResultsByKeyword(this.keyword, 1, 10,this.properties); this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;// + "?keyword=" + this.keyword; @@ -305,8 +314,8 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.activeTab = "organizations"; this.advancedSearchLink ="/search/advanced/organizations"; if( this.reloadOrganizations && - this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE && - this.fetchOrganizations.searchUtils.status != this.errorCodes.ERROR) { + this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE /*&& + this.fetchOrganizations.searchUtils.status != this.errorCodes.ERROR*/) { this.reloadOrganizations = false; this.fetchOrganizations.getResultsByKeyword(this.keyword, 1, 10,this.properties); this.linkToSearchOrganizations = this.properties.searchLinkToOrganizations;// + "?keyword=" + this.keyword; @@ -346,10 +355,12 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj } private count() { + var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null; if(this.activeTab != "publications" && this.showPublications){ this.fetchPublications.searchUtils.status = this.errorCodes.LOADING; this.fetchPublications.results = []; - this.subPub = this._searchPublicationsService.numOfSearchPublications(this.keyword,this.properties).subscribe( + + this.subPub = this._searchPublicationsService.numOfSearchPublications(this.keyword,this.properties, refineParams).subscribe( data => { console.log("Count results: "+data); this.fetchPublications.searchUtils.totalResults = data; @@ -367,7 +378,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj if(this.activeTab != "research data" && this.showDatasets){ this.fetchDatasets.searchUtils.status = this.errorCodes.LOADING; this.fetchDatasets.results = []; - this.subData = this._searchDatasetsService.numOfSearchDatasets(this.keyword,this.properties).subscribe( + this.subData = this._searchDatasetsService.numOfSearchDatasets(this.keyword,this.properties, refineParams).subscribe( data => { this.fetchDatasets.searchUtils.totalResults = data; this.fetchDatasets.searchUtils.status = this.errorCodes.DONE; @@ -384,7 +395,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj if(this.activeTab != "software" && this.showSoftware){ this.fetchSoftware.searchUtils.status = this.errorCodes.LOADING; this.fetchSoftware.results = []; - this.subSoftware = this._searchSoftwareService.numOfSearchSoftware(this.keyword,this.properties).subscribe( + this.subSoftware = this._searchSoftwareService.numOfSearchSoftware(this.keyword,this.properties, refineParams).subscribe( data => { this.fetchSoftware.searchUtils.totalResults = data; this.fetchSoftware.searchUtils.status = this.errorCodes.DONE; @@ -408,7 +419,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj if(this.activeTab != "other research products" && this.showOrps){ this.fetchOrps.searchUtils.status = this.errorCodes.LOADING; this.fetchOrps.results = []; - this.subOrps = this._searchOrpsService.numOfSearchOrps(this.keyword,this.properties).subscribe( + this.subOrps = this._searchOrpsService.numOfSearchOrps(this.keyword,this.properties, refineParams).subscribe( data => { this.fetchOrps.searchUtils.totalResults = data; this.fetchOrps.searchUtils.status = this.errorCodes.DONE; @@ -473,6 +484,13 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj this.reloadProjects = true; this.reloadDataproviders = true; this.reloadOrganizations = true; + this.fetchOrganizations.searchUtils.status = null; + this.fetchDataproviders.searchUtils.status = null; + this.fetchProjects.searchUtils.status = null; + this.fetchPublications.searchUtils.status = null; + this.fetchDatasets.searchUtils.status = null; + this.fetchSoftware.searchUtils.status = null; + this.fetchOrps.searchUtils.status = null; } diff --git a/searchPages/searchUtils/browseEntities.component.ts b/searchPages/searchUtils/browseEntities.component.ts index 069714e8..132f9724 100644 --- a/searchPages/searchUtils/browseEntities.component.ts +++ b/searchPages/searchUtils/browseEntities.component.ts @@ -10,6 +10,7 @@ import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchPageComponent } from '../searchUtils/searchPage.component'; import {SearchUtilsClass} from '../searchUtils/searchUtils.class'; import{EnvProperties} from '../../utils/properties/env-properties'; +import {StringUtils} from '../../utils/string-utils.class'; @Component({ selector: 'browse-entities', @@ -38,6 +39,8 @@ export class BrowseEntitiesComponent { @Input() public entityName:string = ""; @Input() public refineFields: string[] ;//= this.searchFields.RESULT_REFINE_FIELDS; @Input() properties:EnvProperties; + @Input() connectCommunityId =null; + public sub: any; public errorCodes:ErrorCodes = new ErrorCodes(); public status = this.errorCodes.LOADING; @@ -68,7 +71,9 @@ export class BrowseEntitiesComponent { private getStats(){ this.status = this.errorCodes.LOADING; - this.sub = this._refineFieldsService.getRefineFieldsResultsByEntityName(this.refineFields,this.entityName, this.properties).subscribe( + var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null; + + this.sub = this._refineFieldsService.getRefineFieldsResultsByEntityName(this.refineFields,this.entityName, this.properties,refineParams).subscribe( data => { console.info("Get Stats for "+this.entityName+ ": [Total:"+data[0]+" ] [fields: "+data[1].length+"]"); this.filters = data[1]; diff --git a/services/refineFieldResults.service.ts b/services/refineFieldResults.service.ts index 1e5ea16c..598d8282 100644 --- a/services/refineFieldResults.service.ts +++ b/services/refineFieldResults.service.ts @@ -11,11 +11,14 @@ import{EnvProperties} from '../utils/properties/env-properties'; @Injectable() export class RefineFieldResultsService { constructor(private http: Http ) {} - getRefineFieldsResultsByEntityName(fields:string[], entityName:string, properties:EnvProperties):any{ + getRefineFieldsResultsByEntityName(fields:string[], entityName:string, properties:EnvProperties, communityQuery=null):any{ let url = properties.searchAPIURLLAst + this.getSearchAPIURLForEntity(entityName)+"?format=json&refine=true&page=1&size=0"; for(var i=0; i < fields.length; i++){ url += "&fields="+fields[i]; } + if(communityQuery!= null && communityQuery != '' ) { + url += communityQuery; + } return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) diff --git a/services/searchDatasets.service.ts b/services/searchDatasets.service.ts index b185361c..6be7fe0c 100644 --- a/services/searchDatasets.service.ts +++ b/services/searchDatasets.service.ts @@ -351,11 +351,14 @@ export class SearchDatasetsService { return this.numOfDatasets(url, properties); } - numOfSearchDatasets(params: string, properties:EnvProperties):any { + numOfSearchDatasets(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"datasets/count?format=json"; if(params != "") { url += "&q=" + StringUtils.URIEncode(params); } + if(refineParams!= null && refineParams != '' ) { + url += refineParams; + } return this.numOfDatasets(url, properties); } } diff --git a/services/searchOrps.service.ts b/services/searchOrps.service.ts index 67b5d118..80876b7d 100644 --- a/services/searchOrps.service.ts +++ b/services/searchOrps.service.ts @@ -355,12 +355,15 @@ export class SearchOrpsService { return this.numOfOrps(url, properties); } - numOfSearchOrps(params: string, properties:EnvProperties):any { + numOfSearchOrps(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"other/count?format=json"; if(params != "") { url += "&q=" + StringUtils.URIEncode(params); } + if(refineParams!= null && refineParams != '' ) { + url += refineParams; + } return this.numOfOrps(url, properties); } } diff --git a/services/searchPublications.service.ts b/services/searchPublications.service.ts index 8eaa5b54..c1cf0b32 100644 --- a/services/searchPublications.service.ts +++ b/services/searchPublications.service.ts @@ -465,11 +465,14 @@ export class SearchPublicationsService { return this.numOfPublications(url, properties); } - numOfSearchPublications(params: string, properties:EnvProperties):any { + numOfSearchPublications(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"publications/count?format=json"; if(params != "") { url += "&q=" + StringUtils.URIEncode(params); } + if(refineParams!= null && refineParams != '' ) { + url += refineParams; + } return this.numOfPublications(url, properties); } /* diff --git a/services/searchSoftware.service.ts b/services/searchSoftware.service.ts index bc3b4d97..c585a329 100644 --- a/services/searchSoftware.service.ts +++ b/services/searchSoftware.service.ts @@ -366,11 +366,14 @@ export class SearchSoftwareService { return this.numOfSoftware(url, properties); } - numOfSearchSoftware(params: string, properties:EnvProperties):any { + numOfSearchSoftware(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"software/count?format=json"; if(params != "") { url += "&q=" + StringUtils.URIEncode(params); } + if(refineParams!= null && refineParams != '' ) { + url += refineParams; + } return this.numOfSoftware(url, properties); } } diff --git a/sharedComponents/schema2jsonld/schema2jsonld.component.ts b/sharedComponents/schema2jsonld/schema2jsonld.component.ts index 3fcbbd3c..e78547b3 100644 --- a/sharedComponents/schema2jsonld/schema2jsonld.component.ts +++ b/sharedComponents/schema2jsonld/schema2jsonld.component.ts @@ -5,7 +5,6 @@ import { JsonldDocumentSerializerService } from './service/jsonld-document-seria selector: 'schema2jsonld', template: ` -{{json|json}} ` }) export class Schema2jsonldComponent { diff --git a/utils/entitiesAutoComplete/entitiesAutoComplete.component.ts b/utils/entitiesAutoComplete/entitiesAutoComplete.component.ts index 9ddb8f7f..da5fb21e 100644 --- a/utils/entitiesAutoComplete/entitiesAutoComplete.component.ts +++ b/utils/entitiesAutoComplete/entitiesAutoComplete.component.ts @@ -235,8 +235,10 @@ export class EntitiesAutocompleteComponent { } showItem(item:any):string{ - - if (item.name){ //search + console.log(item); + if (item.projectName || item.projectAcronym || item.code){ //project + return ((item.projectAcronym)?"["+item.projectAcronym+"] ":"")+item.projectName+((item.code)?" ("+item.code+")":""); + }else if (item.name){ //search return item.name; }else if( item.concept && item.concept.label){ //context return item.concept.label; diff --git a/utils/fetchEntitiesClasses/fetchDatasets.class.ts b/utils/fetchEntitiesClasses/fetchDatasets.class.ts index 4e1bc4b2..70c47bf2 100644 --- a/utils/fetchEntitiesClasses/fetchDatasets.class.ts +++ b/utils/fetchEntitiesClasses/fetchDatasets.class.ts @@ -37,7 +37,7 @@ export class FetchDatasets{ } - public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties){ + public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ var parameters = ""; if(keyword.length > 0){ var DOIs:string[] = DOI.getDOIsFromString(keyword); @@ -55,8 +55,9 @@ export class FetchDatasets{ //var errorCodes:ErrorCodes = new ErrorCodes(); this.searchUtils.status = this.errorCodes.LOADING; + var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; - this.subResults = this._searchDatasetsService.searchDatasets(parameters,null, page, size, [], properties).subscribe( + this.subResults = this._searchDatasetsService.searchDatasets(parameters,refineParams, page, size, [], properties).subscribe( data => { this.searchUtils.totalResults = data[0]; console.info("search Research Data: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); diff --git a/utils/fetchEntitiesClasses/fetchOrps.class.ts b/utils/fetchEntitiesClasses/fetchOrps.class.ts index e5f46850..d41eb5d8 100644 --- a/utils/fetchEntitiesClasses/fetchOrps.class.ts +++ b/utils/fetchEntitiesClasses/fetchOrps.class.ts @@ -38,7 +38,7 @@ export class FetchOrps{ } - public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties){ + public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ console.info("orps: getResultsByKeyword"); var parameters = ""; if(keyword.length > 0){ @@ -56,8 +56,8 @@ export class FetchOrps{ } this.searchUtils.status = this.errorCodes.LOADING; - - this.subResults = this._searchOrpsService.searchOrps(parameters,null, page, size, [], properties).subscribe( + var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; + this.subResults = this._searchOrpsService.searchOrps(parameters,refineParams, page, size, [], properties).subscribe( data => { this.searchUtils.totalResults = data[0]; console.info("search Other Research Products: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); diff --git a/utils/fetchEntitiesClasses/fetchPublications.class.ts b/utils/fetchEntitiesClasses/fetchPublications.class.ts index 479e8a32..47b4f793 100644 --- a/utils/fetchEntitiesClasses/fetchPublications.class.ts +++ b/utils/fetchEntitiesClasses/fetchPublications.class.ts @@ -49,7 +49,7 @@ export class FetchPublications { } } - public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties){ + public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ var parameters = ""; if(keyword.length > 0){ var DOIs:string[] = DOI.getDOIsFromString(keyword); @@ -68,8 +68,8 @@ export class FetchPublications { //var errorCodes:ErrorCodes = new ErrorCodes(); this.searchUtils.status = this.errorCodes.LOADING; - - this.subResults = this._searchPublicationsService.searchPublications(parameters,null, page, size, [], properties).subscribe( + var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; + this.subResults = this._searchPublicationsService.searchPublications(parameters,refineParams, page, size, [], properties).subscribe( data => { this.searchUtils.totalResults = data[0]; console.info("search Publications: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); diff --git a/utils/fetchEntitiesClasses/fetchSoftware.class.ts b/utils/fetchEntitiesClasses/fetchSoftware.class.ts index 8a5adc9b..8165e894 100644 --- a/utils/fetchEntitiesClasses/fetchSoftware.class.ts +++ b/utils/fetchEntitiesClasses/fetchSoftware.class.ts @@ -38,7 +38,7 @@ export class FetchSoftware{ } - public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties){ + public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null){ var parameters = ""; if(keyword.length > 0){ var DOIs:string[] = DOI.getDOIsFromString(keyword); @@ -56,8 +56,9 @@ export class FetchSoftware{ //var errorCodes:ErrorCodes = new ErrorCodes(); this.searchUtils.status = this.errorCodes.LOADING; + var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; - this.subResults = this._searchSoftwareService.searchSoftware(parameters,null, page, size, [], properties).subscribe( + this.subResults = this._searchSoftwareService.searchSoftware(parameters,refineParams, page, size, [], properties).subscribe( data => { this.searchUtils.totalResults = data[0]; console.info("search Software: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); diff --git a/utils/piwik/piwik.service.ts b/utils/piwik/piwik.service.ts index 589c53ef..6aeb8b49 100644 --- a/utils/piwik/piwik.service.ts +++ b/utils/piwik/piwik.service.ts @@ -19,6 +19,8 @@ export class PiwikService { var ua = this.getUserAgent(); var referrer = this.getReferrer(); + console.log("Piwik - id: " + siteId); + if(typeof location !== 'undefined'){ var url = properties.piwikBaseUrl+((siteId!=null)?siteId:properties.piwikSiteId)+"&rec=1&url="+StringUtils.URIEncode(location.href)+"&action_name="+StringUtils.URIEncode(title)+ ((ua != null && ua.length > 0)?('&ua='+StringUtils.URIEncode(ua)):'')+