csv in search pages added (simple, advanced, data providers) | html tags not considered in description (search pages, publication landing, dataset landing)

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45484 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-01-19 13:47:21 +00:00
parent f035292eb3
commit c1af4972d8
24 changed files with 140 additions and 73 deletions

View File

@ -18,7 +18,7 @@ import {OrganizationService} from '../services/organization.service';
</div>
<div *ngIf="status == errorCodes.LOADING || (status == errorCodes.LOADING && searchDataprovidersComponent.searchUtils.status == errorCodes.LOADING)"
class="alert alert-info" role="alert">
class="uk-alert uk-alert-primary" role="alert">
Loading...
</div>

View File

@ -34,7 +34,7 @@
</dl>
<blockquote *ngIf="datasetInfo.description != ''">
<div class="uk-text-justify" [innerHTML]="datasetInfo.description"></div>
<div class="uk-text-justify">{{datasetInfo.description}}</div>
</blockquote>
<!--div class="uk-text-right">

View File

@ -52,7 +52,7 @@
</dl>
<blockquote *ngIf="publicationInfo.description != ''">
<div class="uk-text-justify" [innerHTML]="publicationInfo.description"></div>
<div class="uk-text-justify">{{publicationInfo.description}}</div>
</blockquote>
<!--div class="uk-text-right">
<button (click)=" toggleClaimResult()" class = "uk-button uk-button-primary uk-button-mini" >Add Research Results</button>

View File

@ -15,11 +15,12 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'advanced-search-dataprovider',
template: `
<advanced-search-page pageTitle="Advanced Search Data Providers" entityType="dataprovider"
type = "datasources"
type = "data providers"
[(results)] = "results"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
[(searchUtils)] = "searchUtils"
(queryChange)="queryChanged($event)" [resourcesQuery]="resourcesQuery">
(queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources">
</advanced-search-page>
`
@ -36,8 +37,8 @@ export class AdvancedSearchDataProvidersComponent {
public selectedFields:AdvancedField[] = [];
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
public resourcesQuery = "query=(oaftype exact datasource)";
public resourcesQuery = "(oaftype exact datasource)";
public csvParams: string;
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
@ -65,6 +66,12 @@ export class AdvancedSearchDataProvidersComponent {
}
sub: any;
public getResults(parameters:string, page: number, size: number){
if(parameters!= null && parameters != '' ) {
this.csvParams ="&type=datasources&query=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{
this.csvParams ="&type=datasources&query="+this.resourcesQuery;
}
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -18,7 +18,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" [resourcesQuery]="resourcesQuery">
(queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources">
</advanced-search-page>
`
@ -38,8 +39,8 @@ export class AdvancedSearchDatasetsComponent {
public selectedFields:AdvancedField[] = [];
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
public resourcesQuery = "query= ( (oaftype exact result) and (resulttypeid exact dataset) )";
public resourcesQuery = "( (oaftype exact result) and (resulttypeid exact dataset) )";
public csvParams: string;
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
@ -70,6 +71,12 @@ export class AdvancedSearchDatasetsComponent {
}
sub: any;
public getResults(parameters:string, page: number, size: number){
if(parameters!= null && parameters != '' ) {
this.csvParams ="&type=datasets&query=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{
this.csvParams ="&type=datasets&query="+this.resourcesQuery;
}
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -18,7 +18,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" [resourcesQuery]="resourcesQuery">
(queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources">
</advanced-search-page>
`
@ -33,10 +34,11 @@ export class AdvancedSearchOrganizationsComponent {
public fieldIds: string[] = this.searchFields.ORGANIZATION_ADVANCED_FIELDS;
public fieldIdsMap = this.searchFields.ORGANIZATION_FIELDS;
public selectedFields:AdvancedField[] = [];
public csvParams: string;
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
public resourcesQuery = "query=(oaftype exact organization)";
public resourcesQuery = "(oaftype exact organization)";
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
this.results =[];
@ -67,6 +69,12 @@ public resourcesQuery = "query=(oaftype exact organization)";
}
sub: any;
public getResults(parameters:string, page: number, size: number){
if(parameters!= null && parameters != '' ) {
this.csvParams ="&type=organizations&query=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{
this.csvParams ="&type=organizations&query="+this.resourcesQuery;
}
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -18,7 +18,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" [resourcesQuery]="resourcesQuery">
(queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources">
</advanced-search-page>
`
@ -37,8 +38,8 @@ export class AdvancedSearchPeopleComponent {
public selectedFields:AdvancedField[] = [];
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
public resourcesQuery = "query=(oaftype exact person)";
public resourcesQuery = "(oaftype exact person)";
public csvParams: string;
constructor (private route: ActivatedRoute, private _searchPeopleService: SearchPeopleService ) {
@ -69,6 +70,12 @@ export class AdvancedSearchPeopleComponent {
}
sub: any;
public getResults(parameters:string, page: number, size: number){
if(parameters!= null && parameters != '' ) {
this.csvParams ="&type=people&query=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{
this.csvParams ="&type=people&query="+this.resourcesQuery;
}
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -17,7 +17,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" [resourcesQuery]="resourcesQuery">
(queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources">
</advanced-search-page>
`
@ -36,8 +37,8 @@ export class AdvancedSearchProjectsComponent {
public selectedFields:AdvancedField[] = [];
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
public resourcesQuery = "query=(oaftype exact project)";
public resourcesQuery = "(oaftype exact project)";
public csvParams: string;
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) {
@ -68,6 +69,12 @@ export class AdvancedSearchProjectsComponent {
}
sub: any;
public getResults(parameters:string, page: number, size: number){
if(parameters!= null && parameters != '' ) {
this.csvParams ="&type=projects&query=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{
this.csvParams ="&type=projects&query="+this.resourcesQuery;
}
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -18,7 +18,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)" [resourcesQuery]="resourcesQuery">
(queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="resources">
</advanced-search-page>
`
@ -34,7 +35,8 @@ export class AdvancedSearchPublicationsComponent {
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
public fieldIdsMap= this.searchFields.RESULT_FIELDS;
public selectedFields:AdvancedField[] = [];
public resourcesQuery = "query=((oaftype exact result) and (resulttypeid exact publication))";
public resourcesQuery = "((oaftype exact result) and (resulttypeid exact publication))";
public csvParams: string;
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
@ -69,6 +71,12 @@ export class AdvancedSearchPublicationsComponent {
}
sub: any;
public getResults(parameters:string, page: number, size: number){
if(parameters!= null && parameters != '' ) {
this.csvParams ="&type=publications&query=("+this.resourcesQuery +" and (" + parameters + "))";
}else{
this.csvParams ="&type=publications&query="+this.resourcesQuery;
}
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -18,7 +18,8 @@ import {ExportCSVComponent} from '../../utils/exportCSV.component';
<search-page pageTitle="Compatible Dataproviders" type="datasources" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" [showResultCount]=false (queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)" [resourcesQuery]="resourcesQuery" >
(downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="resources">
</search-page>
<!--table-view [(datasources)] = results></table-view-->
@ -43,7 +44,8 @@ export class SearchCompatibleDataprovidersComponent {
"export":[]
};
public CSVDownloaded = false;
public resourcesQuery = "query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = hostedBy) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))";
public resourcesQuery = "&query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = hostedBy) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))";
public csvParams: string;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
@ -81,6 +83,8 @@ export class SearchCompatibleDataprovidersComponent {
this.subResults.unsubscribe();
} }
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -18,7 +18,8 @@ import {ExportCSVComponent} from '../../utils/exportCSV.component';
<search-page pageTitle="Entity Registries" type="datasources" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" [showResultCount]=false (queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)" [resourcesQuery]="resourcesQuery" >
(downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="resources">
</search-page>
`
@ -45,7 +46,8 @@ export class SearchEntityRegistriesComponent {
public CSVDownloaded = false;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
public resourcesQuery = "query=((oaftype exact datasource) and(datasourcetypeuiid = other))";
public resourcesQuery = "&query=((oaftype exact datasource) and(datasourcetypeuiid = other))";
public csvParams: string;
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
var errorCodes:ErrorCodes = new ErrorCodes();
@ -82,6 +84,8 @@ export class SearchEntityRegistriesComponent {
this.subResults.unsubscribe();
} }
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -38,6 +38,7 @@ import {ModalLoading} from '../../utils/modal/loading.component';
</advanced-search-form>
<!--div class="uk-text-right" *ngIf="results && results.length>= size"-->
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters" ></search-paging>
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
<!--/div-->
<div>
@ -62,7 +63,8 @@ export class AdvancedSearchPageComponent {
@Input() selectedFields:AdvancedField[];
@Input() simpleSearchUrl: string;
@ViewChild (ModalLoading) loading : ModalLoading ;
@Input() resourcesQuery = "";
@Input() csvParams: string;
@Input() csvPath: string;
public baseURLWithParameters:string = '';

View File

@ -7,34 +7,28 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
selector: 'search-download',
template: `
<div class= "searchDownload" *ngIf="totalResults > 0">
<div class="uk-text-right" *ngIf="totalResults <= 10000">
<p class="uk-text-right" *ngIf="totalResults <= 10000">
<!--a (click)="download()"-->
<a href="{{downloadURLAPI}}publications?format=csv">
<a href="{{downloadURLAPI}}{{type}}?format=csv&page=0&size={{totalResults}}{{csvParams}}">
<span class="glyphicon glyphicon-download" aria-hidden="true"></span>
Download report (CSV)
CSV Download
</a>
</div>
<!--div class="uk-text-right" *ngIf="totalResults > 100000">
<a (click)="denialOfDownload()">
<span class="glyphicon glyphicon-download" aria-hidden="true"></span>
Download report (CSV)
</a>
</div-->
</p>
</div>
<modal-alert></modal-alert>
<!--modal-alert></modal-alert-->
`
})
export class SearchDownloadComponent {
@Input() totalResults:number = 0;
@Input() csvParams: string;
@Input() type: string;
@ViewChild(AlertModal) alertApplyAll;
@Output() downloadClick = new EventEmitter();
private downloadURLAPI: string;
constructor () {
}
constructor () {}
ngOnInit() {
this.downloadURLAPI = OpenaireProperties.getCsvAPIURL();

View File

@ -39,8 +39,8 @@ import {ModalLoading} from '../../utils/modal/loading.component';
</div>
<div class="uk-width-large-3-4 uk-width-medium-3-4 uk-width-small-1-1" >
<search-download [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters"></search-paging>
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
<search-result [results]="results" [totalResults]="searchUtils.totalResults" [status]=searchUtils.status [page]="searchUtils.page"></search-result>
</div>
</div>
@ -48,11 +48,10 @@ import {ModalLoading} from '../../utils/modal/loading.component';
<div *ngIf="!showRefine" >
<search-form [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters"></search-paging>
<search-result [results]="results" [totalResults]="searchUtils.totalResults" [status]=searchUtils.status [page]="searchUtils.page"></search-result>
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
<search-result [results]="results" [totalResults]="searchUtils.totalResults" [status]=searchUtils.status [page]="searchUtils.page"></search-result>
</div>
</div>
</div>
@ -73,7 +72,8 @@ export class SearchPageComponent {
@Input() showResultCount:boolean = true;
@Input() showRefine:boolean = true;
@Input() refineFields = [];
@Input() resourcesQuery = "";
@Input() csvParams: string;
@Input() csvPath: string;
@ViewChild (ModalLoading) loading : ModalLoading ;
public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }};
private searchFieldsHelper:SearchFields = new SearchFields();

View File

@ -58,7 +58,9 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
</div>
<blockquote *ngIf="result.description != undefined && result.description != ''">
<div class="text-justify" [innerHTML]="result.description"></div>
<div class="text-justify">
{{result.description}}
</div>
</blockquote>
<mark *ngIf="result.embargoEndDate != undefined && result.embargoEndDate != ''">Embargo End Date: {{result.embargoEndDate}}</mark>

View File

@ -14,9 +14,10 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'search-dataproviders',
template: `
<search-page pageTitle="Search Dataproviders" type="datasources" [(filters)] = "filters"
<search-page pageTitle="Search Dataproviders" type="data providers" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)">
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="datasources">
</search-page>
`
@ -36,6 +37,7 @@ export class SearchDataprovidersComponent {
"export":[]
};
public CSVDownloaded = false;
public csvParams: string;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
@ -212,6 +214,8 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
this._getResults(parameters,refine,page,this.searchUtils.size);
}
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters;
if(!refine && !this.searchPage){
this.searchPage = new SearchPageComponent(this._location);
}

View File

@ -17,12 +17,12 @@ import {DOI} from '../../utils/string-utils.class';
<search-page pageTitle="Search Datasets" type="datasets" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" >
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="datasets">
</search-page>
`
})
export class SearchDatasetsComponent {
public results =[];
public filters: Filter[] =[];
@ -37,7 +37,7 @@ export class SearchDatasetsComponent {
public fieldIdsMap=this.searchFields.RESULT_FIELDS;
private urlParams : Map<string, string>;
private _location:Location;
public csvParams: string;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
@ -162,6 +162,8 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){
this._getResults(parameters,refine,page,size);
}
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters;
if(!refine && !this.searchPage){
this.searchPage = new SearchPageComponent(this._location);
}

View File

@ -15,7 +15,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
<search-page pageTitle="Search Organizations" type="organizations" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" >
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="organizations">
</search-page>
`
@ -33,6 +34,7 @@ export class SearchOrganizationsComponent {
public fieldIdsMap = this.searchFields.ORGANIZATION_FIELDS;
public urlParams : Map<string, string>;
public _location:Location;
public csvParams: string;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
@ -75,6 +77,7 @@ export class SearchOrganizationsComponent {
this._getResults(parameters,refine,page,this.searchUtils.size);
}
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters;
if(!refine && !this.searchPage){
this.searchPage = new SearchPageComponent(this._location);

View File

@ -16,8 +16,9 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
template: `
<search-page pageTitle="Search People" type="people" [(filters)] = "filters"
[(results)] = "results"
[(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false >
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false
[csvParams]="csvParams" csvPath="people">
</search-page>
`
@ -32,6 +33,7 @@ export class SearchPeopleComponent {
public _location:Location;
public searchFields:SearchFields = new SearchFields();
public refineFields = this.searchFields.PERSON_REFINE_FIELDS;
public csvParams: string;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
@ -152,6 +154,8 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){
this._getResults(parameters,refine,page,this.searchUtils.size);
}
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters;
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();

View File

@ -14,9 +14,9 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
template: `
<search-page pageTitle="Search Projects" type="projects" [(filters)] = "filters"
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" >
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
[csvParams]="csvParams" csvPath="projects">
</search-page>
`
@ -33,6 +33,7 @@ export class SearchProjectsComponent {
public fieldIdsMap = this.searchFields.PROJECT_FIELDS;
public urlParams : Map<string, string>;
public _location:Location;
public csvParams: string;
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
@ -81,6 +82,8 @@ export class SearchProjectsComponent {
this._getResults(parameters,refine,page,this.searchUtils.size);
}
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters;
if(!refine && !this.searchPage){
this.searchPage = new SearchPageComponent(this._location);
}

View File

@ -17,10 +17,11 @@ import {DOI} from '../../utils/string-utils.class';
selector: 'search-publications',
template: `
<search-page pageTitle="Search Publications" type="publications" [(filters)] = "filters"
[(results)] = "results"
<search-page pageTitle="Search Publications" type="publications"
[(filters)] = "filters" [(results)] = "results"
[(searchUtils)] = "searchUtils" [(baseUrl)] = baseUrl
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)">
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="publications">
</search-page>
`
@ -47,6 +48,7 @@ export class SearchPublicationsComponent {
"export":[]
};
public CSVDownloaded = false;
public csvParams: string;
constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) {
var errorCodes:ErrorCodes = new ErrorCodes();
@ -61,12 +63,11 @@ export class SearchPublicationsComponent {
this.searchPage.type = "publication";
this.sub = this.route.queryParams.subscribe(params => {
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, true, this.searchUtils.page, this.searchUtils.size);
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, true, this.searchUtils.page, this.searchUtils.size);
});
}
@ -190,13 +191,18 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){
}
this._getResults(parameters,refine,page,size);
}
private _getResults(parameters:string,refine:boolean, page: number, size: number){
this.csvParams = parameters;
if(!refine && !this.searchPage){
this.searchPage = new SearchPageComponent(this._location);
}
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
this.searchPage.openLoading();
this.subResults = this._searchPublicationsService.searchPublications(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, this.searchPage.getFields()).subscribe(
data => {
this.searchUtils.totalResults = data[0];

View File

@ -49,7 +49,6 @@ export class SearchDataprovidersService {
}
url += "&page="+(page-1)+"&size="+size+"&format=json";
url += "&format=json";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => [res['meta'].total, this.parseResults(res['results'])])
@ -72,7 +71,6 @@ export class SearchDataprovidersService {
url += refineParams;
}
url += "&page="+(page-1)+"&size="+size+"&format=json";
url += "&format=json";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")]);
@ -95,7 +93,6 @@ export class SearchDataprovidersService {
url += refineParams;
}
url += "&page="+(page-1)+"&size="+size+"&format=json";
url += "&format=json";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")]);
@ -119,7 +116,6 @@ export class SearchDataprovidersService {
}
let url = link+"?query=(((deletedbyinference = false) AND (oaftype exact datasource)) "+((compatibilities && compatibilities.length > 0)?" "+compatibilities+" ":"")+") and (relorganizationid exact "+id+")";
url += "&page="+(page-1)+"&size="+size+"&format=json";
url += "&format=json";
let key = url;
if (this._cache.has(key)) {
@ -143,7 +139,6 @@ export class SearchDataprovidersService {
}
url += "&page="+(page-1)+"&size="+size+"&format=json";
url += "&format=json";
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => [res['meta'].total, this.parseResults(res['results'])]);

View File

@ -20,7 +20,7 @@ export class SearchPublicationsService {
let link = OpenaireProperties.getSearchAPIURLLast()+"publications";
let url = link+"?"+"&format=json&";
let url = link+"?"+"&format=json";
if(params!= null && params != '' ) {
url += params;
}
@ -47,7 +47,7 @@ export class SearchPublicationsService {
let link = OpenaireProperties.getSearchAPIURLLast()+"publications";
let url = link+"?"+"&format=json&";
let url = link+"?"+"&format=json";
if(params!= null && params != '' ) {
url += params;
}

View File

@ -50,7 +50,7 @@ export class OpenaireProperties {
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/";
// private static searchServiveURL = "http://services.openaire.eu:8380/search/";
//private static searchServiveURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
private static searchServiveURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
private static csvAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";//publications?format=csv