altmetrics| mail for feedback | remove quotes from keyword queries q= | change doi queries in pubs , data use parameter doi| date range queries for advanced search of pubs, data, projects | change order of filters in pubs, data

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46163 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2017-03-06 17:20:06 +00:00
parent 94857a762a
commit b486713382
49 changed files with 388 additions and 204 deletions

View File

@ -64,6 +64,7 @@
"js.clone": "0.0.3", "js.clone": "0.0.3",
"methods": "~1.1.2", "methods": "~1.1.2",
"morgan": "^1.7.0", "morgan": "^1.7.0",
"mydatepicker": "^1.7.3",
"preboot": "~4.5.2", "preboot": "~4.5.2",
"rxjs": "5.0.0-beta.12", "rxjs": "5.0.0-beta.12",
"webfontloader": "^1.6.26", "webfontloader": "^1.6.26",

View File

@ -152,7 +152,7 @@ export class ClaimDatasetComponent {
} }
); );
}else{ }else{
this._searchDatasetsService.searchDatasets('q="'+term+'"', null, page, size, []).subscribe( this._searchDatasetsService.searchDatasets('q='+term+'', null, page, size, []).subscribe(
data => { data => {
if(data != null) { if(data != null) {
this.openairePage=page; this.openairePage=page;

View File

@ -184,7 +184,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
); );
}else{ }else{
this.openaireStatus = this.errorCodes.LOADING; this.openaireStatus = this.errorCodes.LOADING;
this._searchPublicationsService.searchPublications('q="'+term+'"', null, page, size, []).subscribe( this._searchPublicationsService.searchPublications('q='+term, null, page, size, []).subscribe(
data => { data => {
if(data != null) { if(data != null) {
this.openairePage=page; this.openairePage=page;

View File

@ -47,7 +47,13 @@
<div class="uk-width-3-10"> <div class="uk-width-3-10">
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
Share - Bookmark <dl class="uk-description-list-line">
<dt >Share - Bookmark
</dt>
<dd>
<div class="addthis_inline_share_toolbox"></div>
</dd>
</dl>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0"> <div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>

View File

@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0"> <div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>

View File

@ -10,7 +10,7 @@ import {Component, Input} from '@angular/core';
<div *ngIf=" organizations && organizations.length > 0"> <div *ngIf=" organizations && organizations.length > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div *ngFor="let item of organizations"> <div *ngFor="let item of organizations">

View File

@ -14,7 +14,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<div *ngIf="fetchProjects.searchUtils.totalResults > 0"> <div *ngIf="fetchProjects.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults > 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults > 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results</a></div>

View File

@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<div *ngIf="fetchPublications.searchUtils.totalResults > 0"> <div *ngIf="fetchPublications.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div>

View File

@ -16,7 +16,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<div *ngIf="fetchPublications.results.length > 0"> <div *ngIf="fetchPublications.results.length > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<table class="uk-table uk-table-striped"> <table class="uk-table uk-table-striped">

View File

@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<div *ngIf="(searchPublicationsComponent.searchUtils.totalResults != 0 || searchDatasetsComponent.searchUtils.totalResults != 0)"> <div *ngIf="(searchPublicationsComponent.searchUtils.totalResults != 0 || searchDatasetsComponent.searchUtils.totalResults != 0)">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<p class="uk-text-bold">Latest Documents Timeline</p> <p class="uk-text-bold">Latest Documents Timeline</p>
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame> <i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>

View File

@ -104,7 +104,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)"> <div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<p class="uk-text-bold">Latest Documents Timeline</p> <p class="uk-text-bold">Latest Documents Timeline</p>
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame> <i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>
@ -198,7 +198,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)"> <div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<p class="uk-text-bold">Latest Documents Timeline</p> <p class="uk-text-bold">Latest Documents Timeline</p>
<i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame> <i-frame [url]=docsTimelineUrl width="800" height="350"></i-frame>

View File

@ -74,7 +74,7 @@
<div *ngIf="datasetInfo.relatedResearchResults != undefined"> <div *ngIf="datasetInfo.relatedResearchResults != undefined">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<tabTable from="dataset" [info]="datasetInfo.relatedResearchResults"></tabTable> <tabTable from="dataset" [info]="datasetInfo.relatedResearchResults"></tabTable>
</div> </div>
@ -87,7 +87,7 @@
<div *ngIf="datasetInfo.similarResearchResults != undefined"> <div *ngIf="datasetInfo.similarResearchResults != undefined">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<tabTable from="dataset" [info]="datasetInfo.similarResearchResults"></tabTable> <tabTable from="dataset" [info]="datasetInfo.similarResearchResults"></tabTable>
@ -110,11 +110,13 @@
<div class="uk-width-3-10" *ngIf="datasetInfo != null"> <div class="uk-width-3-10" *ngIf="datasetInfo != null">
<ul class="uk-list uk-list-striped mainFunctionsBlock"> <ul class="uk-list uk-list-striped mainFunctionsBlock">
<li> <li>
<dl class="uk-description-list-line functionsSection"> <dl class="uk-description-list-line">
<dt>Share - Bookmark</dt> <dt >Share - Bookmark
<dd> </dt>
</dd> <dd>
</dl> <div class="addthis_inline_share_toolbox"></div>
</dd>
</dl>
</li> </li>
<li> <li>
<dl class="uk-description-list-line functionsSection"> <dl class="uk-description-list-line functionsSection">

View File

@ -66,7 +66,7 @@
<div *ngIf="organizationInfo.projects != undefined"> <div *ngIf="organizationInfo.projects != undefined">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div *ngIf="organizationInfo.projects.size == 1"> <div *ngIf="organizationInfo.projects.size == 1">
@ -124,7 +124,7 @@
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0"> <div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
@ -148,7 +148,13 @@
<div class="uk-width-3-10"> <div class="uk-width-3-10">
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
Share - Bookmark <dl class="uk-description-list-line">
<dt >Share - Bookmark
</dt>
<dd>
<div class="addthis_inline_share_toolbox"></div>
</dd>
</dl>
</li> </li>
</ul> </ul>
<ul *ngIf="organizationInfo.projects != undefined" class="uk-list uk-list-striped"> <ul *ngIf="organizationInfo.projects != undefined" class="uk-list uk-list-striped">

View File

@ -44,7 +44,7 @@
<div *ngIf="fetchPublications.searchUtils.totalResults > 0"> <div *ngIf="fetchPublications.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" > <div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
@ -68,7 +68,7 @@
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0"> <div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" > <div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" >
@ -89,7 +89,13 @@
<div class="uk-width-3-10"> <div class="uk-width-3-10">
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
Share - Bookmark <dl class="uk-description-list-line">
<dt >Share - Bookmark
</dt>
<dd>
<div class="addthis_inline_share_toolbox"></div>
</dd>
</dl>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -96,7 +96,7 @@
<div *ngIf="fetchPublications.searchUtils.totalResults > 0"> <div *ngIf="fetchPublications.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div>
@ -115,7 +115,7 @@
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0"> <div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>
@ -134,7 +134,7 @@
<div *ngIf="statsClicked && (fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)"> <div *ngIf="statsClicked && (fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
<p class="uk-text-bold"> <p class="uk-text-bold">
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div> <div>
<p class="uk-text-bold">Scientific Results</p> <p class="uk-text-bold">Scientific Results</p>
@ -164,7 +164,13 @@
<div class="uk-width-3-10"> <div class="uk-width-3-10">
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
Share - Bookmark <dl class="uk-description-list-line">
<dt >Share - Bookmark
</dt>
<dd>
<div class="addthis_inline_share_toolbox"></div>
</dd>
</dl>
</li> </li>
<li *ngIf="fetchPublications.searchUtils.totalResults > 10"> <li *ngIf="fetchPublications.searchUtils.totalResults > 10">
<a href="{{linkToSearchPublications}}"> <a href="{{linkToSearchPublications}}">

View File

@ -54,7 +54,12 @@
<blockquote *ngIf="publicationInfo.description != ''"> <blockquote *ngIf="publicationInfo.description != ''">
<div class="uk-text-justify">{{publicationInfo.description}}</div> <div class="uk-text-justify">{{publicationInfo.description}}</div>
</blockquote> </blockquote>
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','publication'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Links to research Results</a>
<!--div class="uk-clearfix uk-margin-top uk-margin-bottom">
<a class="uk-float-right uk-button" [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[articleId,'publication','publication'])" routerLinkActive="router-link-active" routerLink="/linking" > <i class="uk-icon-link"></i> Links to research Results</a>
</div-->
<ul class="uk-tab" data-uk-switcher="{connect: '#tab-content'}"> <ul class="uk-tab" data-uk-switcher="{connect: '#tab-content'}">
<li id="citationsTab" class="uk-active"> <li id="citationsTab" class="uk-active">
<a href="#citationsTab"> <a href="#citationsTab">
@ -113,7 +118,7 @@
<div *ngIf="publicationInfo.references != undefined"> <div *ngIf="publicationInfo.references != undefined">
<div> <div>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</div> </div>
<tabPaging [showAll]="showAllReferences" [length]="publicationInfo.references.length" (changeShowAll)="showChange($event)"></tabPaging> <tabPaging [showAll]="showAllReferences" [length]="publicationInfo.references.length" (changeShowAll)="showChange($event)"></tabPaging>
@ -154,7 +159,7 @@
<div *ngIf="publicationInfo.relatedResearchResults != undefined"> <div *ngIf="publicationInfo.relatedResearchResults != undefined">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<tabTable from="publication" [info]="publicationInfo.relatedResearchResults"></tabTable> <tabTable from="publication" [info]="publicationInfo.relatedResearchResults"></tabTable>
@ -169,7 +174,7 @@
<div *ngIf="publicationInfo.similarResearchResults != undefined"> <div *ngIf="publicationInfo.similarResearchResults != undefined">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<tabTable from="publication" [info]="publicationInfo.similarResearchResults"></tabTable> <tabTable from="publication" [info]="publicationInfo.similarResearchResults"></tabTable>
@ -178,7 +183,7 @@
<li *ngIf="publicationInfo.bioentities != undefined" id="bioentitiesTab"> <li *ngIf="publicationInfo.bioentities != undefined" id="bioentitiesTab">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<table id="bioentitiesTable" class="uk-table uk-table-striped"> <table id="bioentitiesTable" class="uk-table uk-table-striped">
<thead> <thead>
@ -205,7 +210,7 @@
<li *ngIf="publicationInfo.software != undefined" id="softwareTab"> <li *ngIf="publicationInfo.software != undefined" id="softwareTab">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<table id="softwareTable" class="uk-table uk-table-striped"> <table id="softwareTable" class="uk-table uk-table-striped">
<thead> <thead>
@ -243,8 +248,10 @@
<ul class="uk-list uk-list-striped"> <ul class="uk-list uk-list-striped">
<li> <li>
<dl class="uk-description-list-line"> <dl class="uk-description-list-line">
<dt >Share - Bookmark</dt> <dt >Share - Bookmark
</dt>
<dd> <dd>
<div class="addthis_inline_share_toolbox"></div>
</dd> </dd>
</dl> </dl>
</li> </li>

View File

@ -154,7 +154,7 @@ export class SearchCompatibleDataprovidersComponent {
var value:Value = {name: value_names[i][j], id: value_original_ids[i][j], number:j, selected:false} var value:Value = {name: value_names[i][j], id: value_original_ids[i][j], number:j, selected:false}
values.push(value); values.push(value);
} }
var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or'} var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or' };
filters.push(filter); filters.push(filter);
} }
return filters; return filters;

View File

@ -152,7 +152,7 @@ export class SearchEntityRegistriesComponent {
var value:Value = {name: value_names[i][j], id: value_original_ids[i][j], number:j, selected:false} var value:Value = {name: value_names[i][j], id: value_original_ids[i][j], number:j, selected:false}
values.push(value); values.push(value);
} }
var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or'} var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or' };
filters.push(filter); filters.push(filter);
} }
return filters; return filters;

View File

@ -20,6 +20,7 @@ import {SearchOrganizationsService} from '../../services/searchOrganizations.ser
import {OpenaireProperties} from '../../utils/properties/openaireProperties'; import {OpenaireProperties} from '../../utils/properties/openaireProperties';
import {SearchFields} from '../../utils/properties/searchFields'; import {SearchFields} from '../../utils/properties/searchFields';
import { ErrorCodes} from '../../utils/properties/openaireProperties';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.Default, changeDetection: ChangeDetectionStrategy.Default,
@ -40,32 +41,44 @@ import {SearchFields} from '../../utils/properties/searchFields';
<ul class="uk-tab uk-tab-left uk-width-large-1-5 uk-width-small-1-1 " data-uk-switcher="{connect:'#searchtabs'}"> <ul class="uk-tab uk-tab-left uk-width-large-1-5 uk-width-small-1-1 " data-uk-switcher="{connect:'#searchtabs'}">
<li (click)="searchPublications()" > <li (click)="searchPublications()" >
<a href="#pubsTab"> <a href="#pubsTab">
Publications {{((keyword.length > 0)?'('+fetchPublications.searchUtils.totalResults+')':'')}} Publications
<span *ngIf = "fetchPublications.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchPublications.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchPublications.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchDatasets()"> <li (click)="searchDatasets()">
<a href="#dataTab" (click)="searchDatasets()"> <a href="#dataTab" (click)="searchDatasets()">
Datasets {{((keyword.length > 0)?'('+fetchDatasets.searchUtils.totalResults+')':'')}} Datasets
<span *ngIf = "fetchDatasets.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchDatasets.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchDatasets.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchProjects()" > <li (click)="searchProjects()" >
<a href="#projectsTab"> <a href="#projectsTab">
Projects {{((keyword.length > 0)?'('+fetchProjects.searchUtils.totalResults+')':'')}} Projects
<span *ngIf = "fetchProjects.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchProjects.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchProjects.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchDataProviders()" > <li (click)="searchDataProviders()" >
<a href="#dataProviderTab"> <a href="#dataProviderTab">
Data Providers {{((keyword.length > 0)?'('+fetchDataproviders.searchUtils.totalResults+')':'')}} Data Providers
<span *ngIf = "fetchDataproviders.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchDataproviders.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchDataproviders.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchOrganizations()" > <li (click)="searchOrganizations()" >
<a href="#organizationsTab" > <a href="#organizationsTab" >
Organizations {{((keyword.length > 0)?'('+fetchOrganizations.searchUtils.totalResults+')':'')}} Organizations
<span *ngIf = "fetchOrganizations.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchOrganizations.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchOrganizations.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
<li (click)="searchPeople()" > <li (click)="searchPeople()" >
<a href="#peopleTab" > <a href="#peopleTab" >
People {{((keyword.length > 0)?'('+fetchPeople.searchUtils.totalResults+')':'')}} People
<span *ngIf = "fetchPeople.searchUtils.status == errorCodes.LOADING && keyword.length > 0" class="uk-icon-spinner uk-icon-spin"></span>
<span *ngIf = "fetchPeople.searchUtils.status != errorCodes.LOADING" >{{((keyword.length > 0)?'('+fetchPeople.searchUtils.totalResults+')':'')}}</span>
</a> </a>
</li> </li>
@ -78,7 +91,7 @@ import {SearchFields} from '../../utils/properties/searchFields';
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPublications" >View all {{fetchPublications.searchUtils.totalResults}} results</a></div>
<search-result [(results)]="fetchPublications.results" <search-result [(results)]="fetchPublications.results"
[(status)]= "fetchPublications.status" [(status)]= "fetchPublications.searchUtils.status" showLoading = true
type="publication" urlParam="articleId"> type="publication" urlParam="articleId">
</search-result> </search-result>
</div> </div>
@ -90,7 +103,7 @@ import {SearchFields} from '../../utils/properties/searchFields';
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDatasets" >View all {{fetchDatasets.searchUtils.totalResults}} results</a></div>
<search-result [(results)]="fetchDatasets.results" <search-result [(results)]="fetchDatasets.results"
[(status)]= "fetchDatasets.status" [(status)]= "fetchDatasets.searchUtils.status" showLoading = true
type="dataset" urlParam="datasetId"> type="dataset" urlParam="datasetId">
</search-result> </search-result>
</div> </div>
@ -102,7 +115,7 @@ import {SearchFields} from '../../utils/properties/searchFields';
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults> 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResults> 10" ><a [href] = "linkToSearchProjects" >View all {{fetchProjects.searchUtils.totalResults}} results</a></div>
<search-result [(results)]="fetchProjects.results" <search-result [(results)]="fetchProjects.results"
[(status)]= "fetchProjects.status" [(status)]= "fetchProjects.searchUtils.status" showLoading = true
type="project" urlParam="projectId"> type="project" urlParam="projectId">
</search-result> </search-result>
</div> </div>
@ -114,7 +127,7 @@ import {SearchFields} from '../../utils/properties/searchFields';
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults> 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
<search-result [(results)]="fetchDataproviders.results" <search-result [(results)]="fetchDataproviders.results"
[(status)]= "fetchDataproviders.status" [(status)]= "fetchDataproviders.searchUtils.status" showLoading = true
type="dataprovider" urlParam="datasourceId"> type="dataprovider" urlParam="datasourceId">
</search-result> </search-result>
</div> </div>
@ -126,7 +139,7 @@ import {SearchFields} from '../../utils/properties/searchFields';
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchOrganizations.searchUtils.totalResults> 10" ><a [href] = "linkToSearchOrganizations" >View all {{fetchOrganizations.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchOrganizations.searchUtils.totalResults> 10" ><a [href] = "linkToSearchOrganizations" >View all {{fetchOrganizations.searchUtils.totalResults}} results</a></div>
<search-result [(results)]="fetchOrganizations.results" <search-result [(results)]="fetchOrganizations.results"
[(status)]= "fetchOrganizations.status" [(status)]= "fetchOrganizations.searchUtils.status" showLoading = true
type="organization" urlParam="organizationId"> type="organization" urlParam="organizationId">
</search-result> </search-result>
</div> </div>
@ -138,7 +151,7 @@ import {SearchFields} from '../../utils/properties/searchFields';
<div *ngIf = "keyword.length > 0" class ="uk-animation-fade"> <div *ngIf = "keyword.length > 0" class ="uk-animation-fade">
<div class = "uk-text-right" *ngIf = "fetchPeople.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPeople" >View all {{fetchPeople.searchUtils.totalResults}} results</a></div> <div class = "uk-text-right" *ngIf = "fetchPeople.searchUtils.totalResults> 10" ><a [href] = "linkToSearchPeople" >View all {{fetchPeople.searchUtils.totalResults}} results</a></div>
<search-result [(results)]="fetchPeople.results" <search-result [(results)]="fetchPeople.results"
[(status)]= "fetchPeople.status" [(status)]= "fetchPeople.searchUtils.status" showLoading = true
type="person" urlParam="personId"> type="person" urlParam="personId">
</search-result> </search-result>
</div> </div>
@ -156,12 +169,6 @@ import {SearchFields} from '../../utils/properties/searchFields';
}) })
export class SearchComponent { export class SearchComponent {
public sub: any; public sub: any;
public subPublicationsCount: any;
public subDatasetsCount: any;
public subProjectsCount: any;
public subDataprovidersCount: any;
public subOrganizationsCount: any;
public subPeopleCount: any;
public reloadPublications: boolean; public reloadPublications: boolean;
public reloadDatasets: boolean; public reloadDatasets: boolean;
@ -195,6 +202,7 @@ export class SearchComponent {
public fetchOrganizations: FetchOrganizations; public fetchOrganizations: FetchOrganizations;
public fetchPeople: FetchPeople; public fetchPeople: FetchPeople;
public searchFields:SearchFields = new SearchFields(); public searchFields:SearchFields = new SearchFields();
public errorCodes:ErrorCodes = new ErrorCodes();
public subPub;public subData;public subProjects;public subOrg;public subPeople; public subDataPr; public subPub;public subData;public subProjects;public subOrg;public subPeople; public subDataPr;
constructor ( private route: ActivatedRoute, constructor ( private route: ActivatedRoute,
@ -244,12 +252,7 @@ public subPub;public subData;public subProjects;public subOrg;public subPeople;
if(this.subDataPr){ if(this.subDataPr){
this.subDataPr.unsubscribe(); this.subDataPr.unsubscribe();
} }
this.subPublicationsCount.unsubscribe();
this.subDatasetsCount.unsubscribe();
this.subProjectsCount.unsubscribe();
//this.subDataprovidersCount.unsubscribe();
this.subOrganizationsCount.unsubscribe();
this.subPeopleCount.unsubscribe();
} }
} }
public searchPublications() { public searchPublications() {
@ -328,62 +331,80 @@ public subPub;public subData;public subProjects;public subOrg;public subPeople;
} }
private count() { private count() {
this.subPublicationsCount = this.route.queryParams.subscribe(params => { if(this.activeTab != "publications"){
this.subPub = this._searchPublicationsService.numOfSearchPublications(this.keyword).subscribe( this.fetchPublications.searchUtils.status = this.errorCodes.LOADING;
this.subPub = this._searchPublicationsService.numOfSearchPublications(this.keyword).subscribe(
data => { data => {
this.fetchPublications.searchUtils.totalResults = data; console.log("Count results: "+data);
// this.fetchPublications.searchUtils.totalResults = data;
this.fetchPublications.searchUtils.status = this.errorCodes.DONE;
}, },
err => { err => {
console.log(err); console.log(err);
this.fetchPublications.searchUtils.status = this.errorCodes.ERROR;
} }
); );
}) }
if(this.activeTab != "datasets"){
this.subDatasetsCount = this.route.queryParams.subscribe(params => { this.fetchDatasets.searchUtils.status = this.errorCodes.LOADING;
this.subData = this._searchDatasetsService.numOfSearchDatasets(this.keyword).subscribe( this.subData = this._searchDatasetsService.numOfSearchDatasets(this.keyword).subscribe(
data => { data => {
this.fetchDatasets.searchUtils.totalResults = data; this.fetchDatasets.searchUtils.totalResults = data;
this.fetchDatasets.searchUtils.status = this.errorCodes.DONE;
}, },
err => { err => {
console.log(err); console.log(err);
this.fetchDatasets.searchUtils.status = this.errorCodes.ERROR;
} }
); );
}) }
if(this.activeTab != "projects"){
this.subProjectsCount = this.route.queryParams.subscribe(params => { this.fetchProjects.searchUtils.status = this.errorCodes.LOADING;
this.subProjects = this._searchProjectsService.numOfSearchProjects(this.keyword).subscribe( this.subProjects = this._searchProjectsService.numOfSearchProjects(this.keyword).subscribe(
data => { data => {
this.fetchProjects.searchUtils.totalResults = data; this.fetchProjects.searchUtils.totalResults = data;
this.fetchProjects.searchUtils.status = this.errorCodes.DONE;
}, },
err => { err => {
console.log(err); console.log(err);
this.fetchProjects.searchUtils.status = this.errorCodes.ERROR;
} }
); );
}) }
if(this.activeTab != "dataproviders"){
this.fetchDataproviders.getNumForSearch(this.keyword); this.fetchDataproviders.getNumForSearch(this.keyword);
}
this.subOrganizationsCount = this.route.queryParams.subscribe(params => { if(this.activeTab != "dataproviders"){
this.subOrg = this._searchOrganizationsService.numOfSearchOrganizations(this.keyword).subscribe( this.fetchOrganizations.searchUtils.status = this.errorCodes.LOADING;
this.subOrg = this._searchOrganizationsService.numOfSearchOrganizations(this.keyword).subscribe(
data => { data => {
this.fetchOrganizations.searchUtils.totalResults = data; this.fetchOrganizations.searchUtils.totalResults = data;
this.fetchOrganizations.searchUtils.status = this.errorCodes.DONE;
}, },
err => { err => {
console.log(err); console.log(err);
} this.fetchOrganizations.searchUtils.status = this.errorCodes.ERROR;
);
})
this.subPeopleCount = this.route.queryParams.subscribe(params => { }
this.subPeople = this._searchPeopleService.numOfSearchPeople(this.keyword).subscribe( );
}
if(this.activeTab != "people"){
this.fetchPeople.searchUtils.status = this.errorCodes.LOADING;
this.subPeople = this._searchPeopleService.numOfSearchPeople(this.keyword).subscribe(
data => { data => {
this.fetchPeople.searchUtils.totalResults = data; this.fetchPeople.searchUtils.totalResults = data;
this.fetchPeople.searchUtils.status = this.errorCodes.DONE;
}, },
err => { err => {
console.log(err); console.log(err);
this.fetchPeople.searchUtils.status = this.errorCodes.ERROR;
} }
); );
}) }
} }
private reloadTabs() { private reloadTabs() {

View File

@ -10,34 +10,38 @@ import {Dates} from '../../utils/string-utils.class';
selector: 'advanced-search-form', selector: 'advanced-search-form',
template: ` template: `
<form class="uk-form"> <form class="uk-form">
<table class="uk-text-center"> <table >
<tr *ngFor="let selectedField of selectedFields; let i = index" class="uk-form-row "> <tr *ngFor="let selectedField of selectedFields; let i = index" class="uk-form-row ">
<td *ngIf ="i==0 ">Search for:</td> <td *ngIf ="i==0 " class="">Search for:</td>
<td *ngIf = "i != 0" ><select [(ngModel)]="selectedField.operatorId" name="selectOp_{{i}}" > <td *ngIf = "i != 0" class=""><select [(ngModel)]="selectedField.operatorId" name="selectOp_{{i}}" >
<option *ngFor="let op of operators" (change)="fieldOperatorChanged(i, op.id, op.id)" (click)="fieldOperatorChanged(i, op.id, op.id)" [value]="op.id">{{op.id}}</option> <option *ngFor="let op of operators" (change)="fieldOperatorChanged(i, op.id, op.id)" (click)="fieldOperatorChanged(i, op.id, op.id)" [value]="op.id">{{op.id}}</option>
</select></td> </select></td>
<td><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" (click)="fieldIdsChanged(i)" > <td ><select [(ngModel)]="selectedField.id" name="selectField_{{i}}" (click)="fieldIdsChanged(i)" >
<option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}}</option> <option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}}</option>
</select> </td> </select> </td>
<td *ngIf = "selectedField.type == 'keyword'" class="uk-width-1-3" ><input type="text" class="form-control" placeholder="Type keywords..." <td *ngIf = "selectedField.type == 'keyword'" ><input type="text" class="form-control" placeholder="Type keywords..."
[(ngModel)]="selectedField.value" name="value[{{i}}]"></td> [(ngModel)]="selectedField.value" name="value[{{i}}]"></td>
<td *ngIf = "selectedField.type == 'year'" class="uk-width-1-3"><input type="text" class="form-control" placeholder="Type Year..." <td *ngIf = "selectedField.type == 'date'" >
[(ngModel)]="selectedField.value" name="value[{{i}}]" (keyup)=validateDate(i,selectedField.value)></td> <!--input type="text" class="form-control" placeholder="Type Year..."
<td *ngIf = "selectedField.type == 'vocabulary'" class="uk-width-1-3"> [(ngModel)]="selectedField.value" name="value[{{i}}]" (keyup)=validateDate(i,selectedField.value)-->
<date-filter [(dateValue)]=selectedField.dateValue ></date-filter>
</td>
<!--[(filterId)]=i -->
<td *ngIf = "selectedField.type == 'vocabulary'" >
<static-autocomplete [(vocabularyId)] = selectedField.param <static-autocomplete [(vocabularyId)] = selectedField.param
[(list)] = this.fieldList[selectedField.id] [entityName] = "entityType" [selectedValue]=selectedField.value [showSelected]=true [(list)] = this.fieldList[selectedField.id] [entityName] = "entityType" [selectedValue]=selectedField.value [showSelected]=true
[placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false [placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false
(selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete> (selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete>
</td> </td>
<td *ngIf = " selectedField.type == 'refine'" class="uk-width-1-3"> <td *ngIf = " selectedField.type == 'refine'" >
<static-autocomplete [(list)] = this.fieldList[selectedField.id] [entityName] = "entityType" [fieldName] = [selectedField.id] [selectedValue]=selectedField.value [showSelected]=true [placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete></td> <static-autocomplete [(list)] = this.fieldList[selectedField.id] [entityName] = "entityType" [fieldName] = [selectedField.id] [selectedValue]=selectedField.value [showSelected]=true [placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete></td>
<td *ngIf = "selectedField.type == 'entity'" class="uk-width-1-3"><entities-autocomplete [entityType]=selectedField.param [selectedValue]=selectedField.value [showSelected]=true <td *ngIf = "selectedField.type == 'entity'" ><entities-autocomplete [entityType]=selectedField.param [selectedValue]=selectedField.value [showSelected]=true
[placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false [placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false
(selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)" > (selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)" >
</entities-autocomplete></td> </entities-autocomplete></td>
<td *ngIf = "selectedField.type == 'boolean'" class="input-group"> <td *ngIf = "selectedField.type == 'boolean'" class="input-group" >
<span class="input-group-addon"> <span class="input-group-addon">
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param value="true">Yes<br> <input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param value="true">Yes<br>
</span> </span>
@ -45,7 +49,7 @@ import {Dates} from '../../utils/string-utils.class';
<input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param value="false">No<br> <input type="radio" [(ngModel)]="selectedField.value" [name]=selectedField.param value="false">No<br>
</span> </span>
</td> </td>
<td > <td class=" " >
<button *ngIf="selectedFields.length > 1" type="button" class="uk-button uk-button-danger" (click)="removeField(i)"> <button *ngIf="selectedFields.length > 1" type="button" class="uk-button uk-button-danger" (click)="removeField(i)">
<i class="uk-icon-minus"></i> <i class="uk-icon-minus"></i>
</button> </button>
@ -53,7 +57,7 @@ import {Dates} from '../../utils/string-utils.class';
<i class="uk-icon-minus" ></i> <i class="uk-icon-minus" ></i>
</button> </button>
</td> </td>
<td *ngIf="i == selectedFields.length-1 " ><button type="button" class="uk-button uk-button-success" (click)="addField()"> <td *ngIf="i == selectedFields.length-1 " class=" "><button type="button" class="uk-button uk-button-success" (click)="addField()">
<i class="uk-icon-plus"></i> <i class="uk-icon-plus"></i>
</button></td> </button></td>
</tr> </tr>
@ -79,11 +83,9 @@ export class AdvancedSearchFormComponent {
public operators: [{name:string, id:string}] = this.searchFields.ADVANCED_SEARCH_OPERATORS; public operators: [{name:string, id:string}] = this.searchFields.ADVANCED_SEARCH_OPERATORS;
constructor () { constructor () {
console.log("Constr: Advanced search form");
} }
ngOnInit() { ngOnInit() {
console.log("Init: Advanced search form");
for(var i = 0; i < this.fieldIds.length; i++){ for(var i = 0; i < this.fieldIds.length; i++){
this.fieldList[this.fieldIds[i]]=[]; this.fieldList[this.fieldIds[i]]=[];
} }
@ -100,7 +102,6 @@ export class AdvancedSearchFormComponent {
} }
addField() { addField() {
console.info("add filter"+this.fieldIds[0]+this.fieldIdsMap[this.fieldIds[0]].name+this.fieldIdsMap[this.fieldIds[0]].type);
this.newFieldId = this.fieldIds[0]; this.newFieldId = this.fieldIds[0];
var type = this.fieldIdsMap[this.newFieldId].type; var type = this.fieldIdsMap[this.newFieldId].type;
if(type == "boolean"){ if(type == "boolean"){
@ -112,7 +113,6 @@ export class AdvancedSearchFormComponent {
} }
removeField(index: number) { removeField(index: number) {
console.info("remove filter");
this.selectedFields.splice(index, 1); this.selectedFields.splice(index, 1);
} }

View File

@ -5,11 +5,12 @@ import { FormsModule } from '@angular/forms';
import{AdvancedSearchFormComponent} from './advancedSearchForm.component'; import{AdvancedSearchFormComponent} from './advancedSearchForm.component';
import {EntitiesAutocompleteModule} from '../../utils/entitiesAutoComplete/entitiesAutoComplete.module'; import {EntitiesAutocompleteModule} from '../../utils/entitiesAutoComplete/entitiesAutoComplete.module';
import {StaticAutocompleteModule} from '../../utils/staticAutoComplete/staticAutoComplete.module'; import {StaticAutocompleteModule} from '../../utils/staticAutoComplete/staticAutoComplete.module';
import {DateFilterModule} from './dateFilter.module';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, EntitiesAutocompleteModule, StaticAutocompleteModule CommonModule, FormsModule, EntitiesAutocompleteModule, StaticAutocompleteModule, DateFilterModule
], ],
declarations: [ declarations: [
AdvancedSearchFormComponent, AdvancedSearchFormComponent,

View File

@ -6,7 +6,8 @@ import {SearchResult} from '../../utils/entities/searchResult';
import {SearchFields} from '../../utils/properties/searchFields'; import {SearchFields} from '../../utils/properties/searchFields';
import {SearchUtilsClass} from './searchUtils.class'; import {SearchUtilsClass} from './searchUtils.class';
import {ModalLoading} from '../../utils/modal/loading.component'; import {ModalLoading} from '../../utils/modal/loading.component';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils, Dates} from '../../utils/string-utils.class';
@Component({ @Component({
selector: 'advanced-search-page', selector: 'advanced-search-page',
@ -17,19 +18,6 @@ import {StringUtils} from '../../utils/string-utils.class';
<h1>{{pageTitle}}</h1> <h1>{{pageTitle}}</h1>
</div> </div>
<div> <div>
<!--div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-12 col-sm-3">
<a *ngIf="isFiltered()" (click)="clearFilters()" > Clear Filters</a>
<p *ngFor="let filter of filters " >
<search-filter [filter]="filter" (change)="filterChanged($event)"></search-filter>
</p>
</div>
[(fields)]="fields"
[(selectedFields)]="selectedFields"
[(quantifiers)]="quantifiers"
[(selectedQuantifiers)]="selectedQuantifiers"
[(keywords)]="keywords"
<div class="col-xs-6 col-sm-9 sidebar-offcanvas" id="sidebar"-->
<advanced-search-form <advanced-search-form
[entityType] = "entityType" [entityType] = "entityType"
[(fieldIds)]="fieldIds" [(fieldIds)]="fieldIds"
@ -37,11 +25,9 @@ import {StringUtils} from '../../utils/string-utils.class';
[(selectedFields)]="selectedFields" [(selectedFields)]="selectedFields"
(queryChange)="queryChanged($event)"> (queryChange)="queryChanged($event)">
</advanced-search-form> </advanced-search-form>
<!--div class="uk-text-right" *ngIf="results && results.length>= size"-->
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging> <search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download> <search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download>
<!--/div-->
<div> <div>
<search-result [results]="results" <search-result [results]="results"
[status]=searchUtils.status [status]=searchUtils.status
@ -49,8 +35,7 @@ import {StringUtils} from '../../utils/string-utils.class';
[type]="entityType" [urlParam]="urlParam"> [type]="entityType" [urlParam]="urlParam">
</search-result> </search-result>
</div> </div>
<!--/div>
</div-->
</div> </div>
</div> </div>
<modal-loading [message]= "'Loading results...'"></modal-loading> <modal-loading [message]= "'Loading results...'"></modal-loading>
@ -82,11 +67,9 @@ export class AdvancedSearchPageComponent {
} }
ngOnInit() { ngOnInit() {
console.log("ASP init!"); this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
this.updateBaseUrlWithParameters(); this.updateBaseUrlWithParameters();
this.defineUrlParam(); this.defineUrlParam();
// this.searchUtils.totalResults = this.results.length;
} }
private defineUrlParam() { private defineUrlParam() {
@ -106,7 +89,6 @@ export class AdvancedSearchPageComponent {
} }
public getSelectedFiltersFromUrl(params){ public getSelectedFiltersFromUrl(params){
// this.selectedFields =[];
for(var i=0; i< this.fieldIds.length ; i++){ for(var i=0; i< this.fieldIds.length ; i++){
var fieldId = this.fieldIds[i]; var fieldId = this.fieldIds[i];
@ -122,7 +104,33 @@ export class AdvancedSearchPageComponent {
var operators:string [] = (StringUtils.URIDecode(params[operatorId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1); var operators:string [] = (StringUtils.URIDecode(params[operatorId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1);
if(values.length == operators.length){ if(values.length == operators.length){
for(var j=0; j< values.length ; j++){ for(var j=0; j< values.length ; j++){
this.selectedFields.push(new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,StringUtils.unquote(values[j]),operators[j]) ) if(this.fieldIdsMap[fieldId].type == "date"){
var value:string =StringUtils.unquote(values[j]);
var validDates:boolean = true;
var dateField:AdvancedField = new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,value,operators[j]) ;
if(value.indexOf("range") != -1){
dateField.dateValue.type="range";
if(value.length < 26 ){
validDates =false;
}else{
if(!Dates.isValidDate(value.substring(5,15)) || !Dates.isValidDate(value.substring(16,26))){
validDates =false;
}else {
dateField.dateValue.from = Dates.getDateFromString(value.substring(5,15));
dateField.dateValue.to = Dates.getDateFromString(value.substring(16,26));
}
}
// "rangeYYYY-MM-DD:YYYY-MM-DD"
}else{
dateField.dateValue.setDatesByType(value);
}
if(validDates){
this.selectedFields.push(dateField);
}
}else{
this.selectedFields.push(new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,StringUtils.unquote(values[j]),operators[j]) );
}
} }
} }
} }
@ -136,15 +144,22 @@ export class AdvancedSearchPageComponent {
this.parameterNames.splice(0,this.parameterNames.length); this.parameterNames.splice(0,this.parameterNames.length);
this.parameterValues.splice(0,this.parameterValues.length); this.parameterValues.splice(0,this.parameterValues.length);
var fields: { [key:string]:{ values:string[], operators:string[] }}={}; var fields: { [key:string]:{ values:string[], operators:string[] }}={};
console.log("In createUrlParameters :"+ this.selectedFields.length); for(var i = 0; i< this.selectedFields.length; i++){
for(var i = 0; i< this.selectedFields.length; i++){ if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && (this.selectedFields[i].value.length > 0 || this.selectedFields[i].type == "date" )){
if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && this.selectedFields[i].value.length > 0){
if(!fields[this.selectedFields[i].id]){ if(!fields[this.selectedFields[i].id]){
fields[this.selectedFields[i].id] = {values:[], operators:[]}; fields[this.selectedFields[i].id] = {values:[], operators:[]};
fields[this.selectedFields[i].id].values =[]; fields[this.selectedFields[i].id].values =[];
fields[this.selectedFields[i].id].operators =[]; fields[this.selectedFields[i].id].operators =[];
} }
fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode(this.selectedFields[i].value))); if(this.selectedFields[i].type == "date"){
if(this.selectedFields[i].dateValue.type == "range"){
fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode("range"+Dates.getDateToString(this.selectedFields[i].dateValue.from)+":"+Dates.getDateToString(this.selectedFields[i].dateValue.to))));
}else{
fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode(this.selectedFields[i].dateValue.type)));
}
}else{
fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode(this.selectedFields[i].value)));
}
fields[this.selectedFields[i].id].operators.push(this.selectedFields[i].operatorId); fields[this.selectedFields[i].id].operators.push(this.selectedFields[i].operatorId);
} }
@ -163,25 +178,31 @@ export class AdvancedSearchPageComponent {
if(includePage && this.searchUtils.page != 1){ if(includePage && this.searchUtils.page != 1){
params += "&page="+this.searchUtils.page; params += "&page="+this.searchUtils.page;
} }
console.log("In end of createUrlParameters :"+ this.selectedFields.length); return '?'+params;
return '?'+params;
} }
public createQueryParameters(){ public createQueryParameters(){
var params=""; var params="";
var countParams = 0; var countParams = 0;
for(var i = 0; i< this.selectedFields.length; i++){ for(var i = 0; i< this.selectedFields.length; i++){
if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && this.selectedFields[i].value != ""){ if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && (this.selectedFields[i].value != "" ||this.selectedFields[i].type == "date")){
if(this.selectedFields[i].id == "q"){ console.log("createQueryParameters::"+this.selectedFields[i].type);
var op = ""; if(this.selectedFields[i].type == "date"){
// if() if(this.selectedFields[i].dateValue.type != "any"){
params += (countParams == 0 ? "" : this.selectedFields[i].operatorId) + " " + '"' + StringUtils.URIEncode(this.selectedFields[i].value) + '"' + " "; params += (countParams == 0 ? "" : this.selectedFields[i].operatorId) + " " + this.selectedFields[i].id + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+ '"' + StringUtils.URIEncode(Dates.getDateToString(this.selectedFields[i].dateValue.from)) + " "
}else if(countParams == 0 && this.selectedFields[i].operatorId == "not"){ + StringUtils.URIEncode(Dates.getDateToString(this.selectedFields[i].dateValue.to)) + '"' + " ";
params += " "+ this.selectedFields[i].id + " <> "+'"' + StringUtils.URIEncode(this.selectedFields[i].value) +'"' + " "; }
}else{ }else{
params += (countParams == 0 ? "" : this.selectedFields[i].operatorId + " " ) + this.selectedFields[i].id + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+'"' + encodeURIComponent(this.selectedFields[i].value) +'"' + " "; if(this.selectedFields[i].id == "q"){
var op = "";
} // if()
params += (countParams == 0 ? "" : this.selectedFields[i].operatorId) + " " + '"' + StringUtils.URIEncode(this.selectedFields[i].value) + '"' + " ";
}else if(countParams == 0 && this.selectedFields[i].operatorId == "not"){
params += " "+ this.selectedFields[i].id + " <> "+'"' + StringUtils.URIEncode(this.selectedFields[i].value) +'"' + " ";
}else{
params += (countParams == 0 ? "" : this.selectedFields[i].operatorId + " " ) + this.selectedFields[i].id + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+'"' + encodeURIComponent(this.selectedFields[i].value) +'"' + " ";
}
}
countParams++; countParams++;
} }
} }

View File

@ -0,0 +1,20 @@
import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { MyDatePickerModule } from 'mydatepicker';
import {DateFilterComponent} from './dateFilter.component';
@NgModule({
imports: [
CommonModule, FormsModule, MyDatePickerModule
],
declarations: [
DateFilterComponent
],
providers:[
],
exports: [
DateFilterComponent
]
})
export class DateFilterModule { }

View File

@ -1,3 +1,4 @@
import {Dates} from '../../utils/string-utils.class';
export class Filter{ export class Filter{
public title: string; // eg Type public title: string; // eg Type
public filterId: string; // type (name in url parameter) public filterId: string; // type (name in url parameter)
@ -5,7 +6,10 @@ export class Filter{
public countSelectedValues: number = 0; public countSelectedValues: number = 0;
public values: Value[] = []; public values: Value[] = [];
public filterOperator: string ='or'; public filterOperator: string ='or';
} }
export class Value{ export class Value{
public name: string; //eg Article, Journal public name: string; //eg Article, Journal
public id: string; //0001 public id: string; //0001
@ -22,7 +26,7 @@ export class AdvancedField{
public operatorId: string; public operatorId: string;
public operatorName: string =""; public operatorName: string ="";
public valid: boolean = true; public valid: boolean = true;
public dateValue:DateValue = new DateValue("any");
constructor(id:string,param:string,name:string, type:string, value:string,operator:string){ constructor(id:string,param:string,name:string, type:string, value:string,operator:string){
this.id = id; this.id = id;
@ -35,7 +39,43 @@ export class AdvancedField{
} }
} }
export class DateValue{
public types = ["any","range","1mon","2mon","3mon","6mon","12mon","2year","5year","10year"];
public typesTitle = ["any","in the specified date range","in the last month","in the last 2 months","in the last 3 months","in the last 6 months","in the last year","in the last 2 years","in the last 5 years","in the last 10 years"];
public type: string ;
public from:Date = new Date();
public to:Date = new Date();
constructor(type:string = "any"){
this.setDatesByType(type);
}
public setDatesByType(type:string){
if(this.types.indexOf(type) == -1){
type=this.types[0];
}
this.type = type;
this.to = Dates.getDateToday();
if(this.type == "range" || this.type == "any"){ // for type "any" just to initiate with values
this.from = Dates.getDateXMonthsAgo(1);
}else if(this.type == "1mon"){
this.from = Dates.getDateXMonthsAgo(1);
}else if(this.type == "2mon"){
this.from = Dates.getDateXMonthsAgo(2);
}else if(this.type == "3mon"){
this.from = Dates.getDateXMonthsAgo(3);
}else if(this.type == "6mon"){
this.from = Dates.getDateXMonthsAgo(6);
}else if(this.type == "12mon"){
this.from = Dates.getDateXMonthsAgo(12);
}else if(this.type == "2year"){
this.from = Dates.getDateXYearsAgo(2);
}else if(this.type == "5year"){
this.from = Dates.getDateXYearsAgo(5);
}else if(this.type == "10year"){
this.from = Dates.getDateXYearsAgo(10);
}
}
}
export class OPERATOR{ export class OPERATOR{
public static AND: string ="and"; public static AND: string ="and";
public static OR: string ="or"; public static OR: string ="or";

View File

@ -164,13 +164,13 @@ export class SearchPageComponent {
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
doiQuery += "&q=("+doisParams+")" doiQuery += "&"+doisParams;
} }
}else{ }else{
keywordQuery += "&q=("+StringUtils.quote(StringUtils.URIEncode(keyword)) +")"; keywordQuery += "&q="+StringUtils.URIEncode(keyword);
} }
} }
@ -212,10 +212,10 @@ export class SearchPageComponent {
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
doiQuery += "and ("+doisParams+")" doiQuery += "&"+doisParams;
} }
}else{ }else{
keywordQuery += "and ("+StringUtils.quote(StringUtils.URIEncode(keyword)) +")"; keywordQuery += "and ("+StringUtils.quote(StringUtils.URIEncode(keyword)) +")";
@ -321,15 +321,15 @@ export class SearchPageComponent {
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
doiQuery += "&q=("+doisParams+")" doiQuery += "&"+doisParams;
}else{ }else{
keywordQuery += "&q=("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")" keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword);
} }
}else{ }else{
keywordQuery += "&q=("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")" keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword);
} }
} }
@ -361,10 +361,10 @@ export class SearchPageComponent {
var DOIs:string[] = DOI.getDOIsFromString(this.searchUtils.keyword); var DOIs:string[] = DOI.getDOIsFromString(this.searchUtils.keyword);
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
doiQuery += " and ("+doisParams+")" doiQuery += "&"+doisParams;
} }
}else{ }else{
keywordQuery += " and ("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")" keywordQuery += " and ("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")"

View File

@ -6,11 +6,11 @@ import {RouterHelper} from '../../utils/routerHelper.class';
@Component({ @Component({
selector: 'search-result', selector: 'search-result',
template: ` template: `
<ul class="uk-list uk-list-line uk-margin"> <ul class="uk-list uk-list-line uk-margin">
<div *ngIf="status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No Results found</div> <div *ngIf="status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No Results found</div>
<div *ngIf="status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div> <div *ngIf="status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div> <div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="status == errorCodes.LOADING && showLoading" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">Loading...</div>
<li *ngFor="let result of results" class="uk-animation-fade"> <li *ngFor="let result of results" class="uk-animation-fade">
<h4 class = "{{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode > <h4 class = "{{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode >
@ -134,6 +134,7 @@ export class SearchResultComponent {
@Input() status: number; @Input() status: number;
@Input() type: string; @Input() type: string;
@Input() urlParam: string; @Input() urlParam: string;
@Input() showLoading: boolean = false;
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes:ErrorCodes = new ErrorCodes();
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper:RouterHelper = new RouterHelper();

View File

@ -108,7 +108,7 @@ export class SearchDataprovidersComponent {
public getNumForSearch(keyword: string) { public getNumForSearch(keyword: string) {
var parameters="datasources/count"; var parameters="datasources/count";
if(keyword != "") { if(keyword != "") {
parameters += "?q="+'"'+keyword+'"'; parameters += "?q="+keyword;
} }
this._searchDataprovidersService.numOfDataproviders(parameters).subscribe( this._searchDataprovidersService.numOfDataproviders(parameters).subscribe(
data => { data => {
@ -218,7 +218,7 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
public getResults(keyword:string,refine:boolean, page: number, size: number){ public getResults(keyword:string,refine:boolean, page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q="+ keyword;
} }
this._getResults(parameters,refine,page,this.searchUtils.size); this._getResults(parameters,refine,page,this.searchUtils.size);
} }

View File

@ -155,14 +155,13 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
parameters += "q=("+doisParams+")" parameters += "&"+doisParams;
}else{ }else{
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
} }
this._getResults(parameters,refine,page,size); this._getResults(parameters,refine,page,size);

View File

@ -80,7 +80,7 @@ export class SearchOrganizationsComponent {
public getResults(keyword:string,refine:boolean, page: number, size: number){ public getResults(keyword:string,refine:boolean, page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
this._getResults(parameters,refine,page,this.searchUtils.size); this._getResults(parameters,refine,page,this.searchUtils.size);
} }

View File

@ -69,7 +69,7 @@ export class SearchPeopleComponent {
public getResults(keyword:string,refine:boolean, page: number, size: number){ public getResults(keyword:string,refine:boolean, page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q="+ keyword;
} }
this._getResults(parameters,refine,page,this.searchUtils.size); this._getResults(parameters,refine,page,this.searchUtils.size);
} }

View File

@ -84,7 +84,7 @@ export class SearchProjectsComponent {
public getResults(keyword:string,refine:boolean, page: number, size: number){ public getResults(keyword:string,refine:boolean, page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q="+keyword;
} }
this._getResults(parameters,refine,page,this.searchUtils.size); this._getResults(parameters,refine,page,this.searchUtils.size);
} }

View File

@ -190,12 +190,12 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
parameters += "q=("+doisParams+")" parameters += "&"+doisParams;
}else{ }else{
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
} }
this._getResults(parameters,refine,page,size); this._getResults(parameters,refine,page,size);

View File

@ -60,10 +60,11 @@ export class SearchDatasetsService {
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
url += "q=("+doisParams+")" url += "&"+doisParams;
} }
if(refineParams!= null && refineParams != '' ) { if(refineParams!= null && refineParams != '' ) {
url += refineParams; url += refineParams;
@ -267,7 +268,7 @@ export class SearchDatasetsService {
//OpenaireProperties.getSearchAPIURLLast() //OpenaireProperties.getSearchAPIURLLast()
//"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"
let url = OpenaireProperties.getSearchAPIURLLast()+"datasets/count?q="+'"' + params + '"'+"&format=json"; let url = OpenaireProperties.getSearchAPIURLLast()+"datasets/count?q=" + params + "&format=json";
let key = url; let key = url;
if (this._cache.has(key)) { if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)); return Observable.of(this._cache.get(key));

View File

@ -187,7 +187,7 @@ export class SearchOrganizationsService {
//OpenaireProperties.getSearchAPIURLLast() //OpenaireProperties.getSearchAPIURLLast()
//"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"
let url = OpenaireProperties.getSearchAPIURLLast()+"organizations/count?q="+'"' + params + '"'+ "&format=json"; let url = OpenaireProperties.getSearchAPIURLLast()+"organizations/count?q=" + params + "&format=json";
let key = url; let key = url;
if (this._cache.has(key)) { if (this._cache.has(key)) {

View File

@ -110,7 +110,7 @@ export class SearchPeopleService {
//OpenaireProperties.getSearchAPIURLLast() //OpenaireProperties.getSearchAPIURLLast()
//"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"
let url = OpenaireProperties.getSearchAPIURLLast()+"people/count?q="+'"' + params + '"'+ "&format=json"; let url = OpenaireProperties.getSearchAPIURLLast()+"people/count?q=" + params + "&format=json";
let key = url; let key = url;
if (this._cache.has(key)) { if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)); return Observable.of(this._cache.get(key));

View File

@ -235,7 +235,7 @@ export class SearchProjectsService {
//OpenaireProperties.getSearchAPIURLLast() //OpenaireProperties.getSearchAPIURLLast()
//"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"
let url = OpenaireProperties.getSearchAPIURLLast()+"projects/count?q="+'"' + params + '"'+ "&format=json"; let url = OpenaireProperties.getSearchAPIURLLast()+"projects/count?q=" + params + "&format=json";
let key = url; let key = url;
if (this._cache.has(key)) { if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)); return Observable.of(this._cache.get(key));

View File

@ -91,10 +91,11 @@ export class SearchPublicationsService {
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
url += "q=("+doisParams+")" url +="&"+doisParams;
} }
if(refineParams!= null && refineParams != '' ) { if(refineParams!= null && refineParams != '' ) {
url += refineParams; url += refineParams;
@ -434,7 +435,7 @@ export class SearchPublicationsService {
//OpenaireProperties.getSearchAPIURLLast() //OpenaireProperties.getSearchAPIURLLast()
//"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"
let url = OpenaireProperties.getSearchAPIURLLast()+"publications/count?q="+ '"' + params + '"' +"&format=json"; let url = OpenaireProperties.getSearchAPIURLLast()+"publications/count?q="+ params +"&format=json";
let key = url; let key = url;
if (this._cache.has(key)) { if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)); return Observable.of(this._cache.get(key));

View File

@ -32,7 +32,7 @@ export class FetchDataproviders {
public getResultsByKeyword(keyword:string, page: number, size: number){ public getResultsByKeyword(keyword:string, page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();
@ -91,13 +91,16 @@ export class FetchDataproviders {
} }
public getNumForSearch(keyword: string) { public getNumForSearch(keyword: string) {
var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = errorCodes.LOADING;
var parameters="datasources/count"; var parameters="datasources/count";
if(keyword != "") { if(keyword != "") {
parameters += "?q="+'"'+keyword+'"'; parameters += "?q=" +keyword ;
} }
this._searchDataprovidersService.numOfDataproviders(parameters).subscribe( this._searchDataprovidersService.numOfDataproviders(parameters).subscribe(
data => { data => {
this.searchUtils.totalResults = data; this.searchUtils.totalResults = data;
this.searchUtils.status = errorCodes.DONE;
}, },
err => { err => {
console.log(err); console.log(err);

View File

@ -38,12 +38,12 @@ export class FetchDatasets{
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
parameters += "q=("+doisParams+")" parameters += "&"+doisParams;
}else{ }else{
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
} }

View File

@ -32,7 +32,7 @@ export class FetchOrganizations {
public getResultsByKeyword(keyword:string , page: number, size: number){ public getResultsByKeyword(keyword:string , page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();

View File

@ -25,7 +25,7 @@ export class FetchPeople {
public getResultsByKeyword(keyword:string, page: number, size: number){ public getResultsByKeyword(keyword:string, page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();

View File

@ -27,7 +27,7 @@ export class FetchProjects{
public getResultsByKeyword(keyword:string, page: number, size: number){ public getResultsByKeyword(keyword:string, page: number, size: number){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
var errorCodes:ErrorCodes = new ErrorCodes(); var errorCodes:ErrorCodes = new ErrorCodes();

View File

@ -50,12 +50,12 @@ export class FetchPublications {
var doisParams = ""; var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){ for(var i =0 ;i < DOIs.length; i++){
doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
} }
if(doisParams.length > 0){ if(doisParams.length > 0){
parameters += "q=("+doisParams+")" parameters += "&"+doisParams;
}else{ }else{
parameters = "q="+'"' + keyword + '"'; parameters = "q=" + keyword;
} }
} }

View File

@ -3,14 +3,17 @@ export class SearchFields {
//RESULTS //RESULTS
//Used for datasets and publications //Used for datasets and publications
//In case Datasets should display different fields, use seperate tables for fields //In case Datasets should display different fields, use seperate tables for fields
public RESULT_REFINE_FIELDS = ["instancetypename", "resultlanguagename", "community","relproject", "relfunderid", public RESULT_REFINE_FIELDS = [
"relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", "relfunderid",
"resultacceptanceyear","resultbestlicense"];//,"collectedfrom"]; "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id",
"relproject","resultacceptanceyear",
"resultbestlicense", "instancetypename", "resultlanguagename", "community","collectedfrom"];
public RESULT_ADVANCED_FIELDS:string[] = ["q","resulttitle","relperson","resultpublisher","instancetypename", public RESULT_ADVANCED_FIELDS:string[] = ["q","resulttitle","relperson","resultpublisher","instancetypename",
"resultlanguagename", "community","relprojectid", "relfunderid", "resultlanguagename", "community","relprojectid", "relfunderid",
"relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id",
"resultacceptanceyear","resultbestlicense","pid","resulthostingdatasourceid","collectedfromdatasourceid","relpersonid"]; "resultdateofacceptance","resultbestlicense","pid","resulthostingdatasourceid","collectedfromdatasourceid","relpersonid"];
public RESULT_FIELDS: { [key:string]:FieldDetails}={ public RESULT_FIELDS: { [key:string]:FieldDetails}={
["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="}, ["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="},
["resulttitle"]:{name:"Title", type:"keyword", param:"title", equalityOperator: "="}, ["resulttitle"]:{name:"Title", type:"keyword", param:"title", equalityOperator: "="},
@ -30,7 +33,8 @@ export class SearchFields {
["relfundinglevel0_id"]:{name:"Funding Stream", type:"refine", param:"funderlv0", equalityOperator: " exact "}, ["relfundinglevel0_id"]:{name:"Funding Stream", type:"refine", param:"funderlv0", equalityOperator: " exact "},
["relfundinglevel1_id"]:{name:"Funding Substream level 1", type:"refine", param:"funderlv1", equalityOperator: " exact "}, ["relfundinglevel1_id"]:{name:"Funding Substream level 1", type:"refine", param:"funderlv1", equalityOperator: " exact "},
["relfundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "}, ["relfundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "},
["resultacceptanceyear"]:{name:"Year", type:"year", param:"year", equalityOperator: " exact "}, ["resultacceptanceyear"]:{name:"Publication Date", type:"keyword", param:"year", equalityOperator: " exact "},
["resultdateofacceptance"]:{name:"Publication Date", type:"date", param:"date", equalityOperator: " within "},
["resultbestlicense"]:{name:"Access Mode", type:"vocabulary", param:"access", equalityOperator: " exact "}, ["resultbestlicense"]:{name:"Access Mode", type:"vocabulary", param:"access", equalityOperator: " exact "},
// ["resultbestlicenseid"]:{name:"Access Mode", type:"refine", param:"access", equalityOperator: " exact "}, // ["resultbestlicenseid"]:{name:"Access Mode", type:"refine", param:"access", equalityOperator: " exact "},
["collectedfrom"]:{name:"Datasource", type:"refine", param:"datasource", equalityOperator: " exact "}, ["collectedfrom"]:{name:"Datasource", type:"refine", param:"datasource", equalityOperator: " exact "},
@ -43,7 +47,7 @@ export class SearchFields {
"fundinglevel2_id","projectstartyear","projectendyear","projectecsc39"]; "fundinglevel2_id","projectstartyear","projectendyear","projectecsc39"];
public PROJECT_ADVANCED_FIELDS:string[] = ["q","projectacronym","projecttitle","projectkeywords", public PROJECT_ADVANCED_FIELDS:string[] = ["q","projectacronym","projecttitle","projectkeywords",
"funderid", "fundinglevel0_id","fundinglevel1_id", "fundinglevel2_id", "funderid", "fundinglevel0_id","fundinglevel1_id", "fundinglevel2_id",
"projectstartyear","projectendyear","projectecsc39", "projectstartdate","projectenddate","projectecsc39",
"projectcode","relorganizationid", "collectedfromdatasourceid"]; "projectcode","relorganizationid", "collectedfromdatasourceid"];
public PROJECT_FIELDS: { [key:string]:FieldDetails}={ public PROJECT_FIELDS: { [key:string]:FieldDetails}={
["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="}, ["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="},
@ -57,7 +61,8 @@ export class SearchFields {
["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "}, ["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "},
["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", equalityOperator: " exact "}, ["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", equalityOperator: " exact "},
["projectendyear"]:{name:"End Year", type:"year", param:"endyear", equalityOperator: " exact "}, ["projectendyear"]:{name:"End Year", type:"year", param:"endyear", equalityOperator: " exact "},
["projectstartdate"]:{name:"Start Date", type:"date", param:"startdate", equalityOperator: " within "},
["projectenddate"]:{name:"End Date", type:"date", param:"enddate", equalityOperator: " within "},
["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", equalityOperator: " exact "}, ["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", equalityOperator: " exact "},
["projectcode"]:{name:"Project Code", type:"keyword", param:"code", equalityOperator: " exact "}, ["projectcode"]:{name:"Project Code", type:"keyword", param:"code", equalityOperator: " exact "},
["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", equalityOperator: " exact "}, ["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", equalityOperator: " exact "},

View File

@ -3,6 +3,7 @@
export class RouterHelper { export class RouterHelper {
//Use this class function to create queryParams Objects in format {key1:value1} or {key1:value1,key2:value2,key3:value3,...} for multiple parameters //Use this class function to create queryParams Objects in format {key1:value1} or {key1:value1,key2:value2,key3:value3,...} for multiple parameters
constructor(){}
// <a [queryParams]="RouterHelper.createQueryParam(filter.filterId,value.id)" routerLinkActive="router-link-active" [routerLink]=baseUrl>Link</a> // <a [queryParams]="RouterHelper.createQueryParam(filter.filterId,value.id)" routerLinkActive="router-link-active" [routerLink]=baseUrl>Link</a>
public createQueryParam(key:string,value:string){ public createQueryParam(key:string,value:string){
var obj ={}; var obj ={};
@ -10,9 +11,9 @@ export class RouterHelper {
return obj; return obj;
} }
public createQueryParamsPaging(keys:string[],values:string[],key:string,value:number){ public createQueryParamsPaging(keys:string[],values:string[],pageParameter:string,pageValue:number){
var obj = this.createQueryParams(keys, values); var obj = this.createQueryParams(keys, values);
obj[key] = ""+value; obj[pageParameter] = ""+pageValue;
return obj; return obj;
} }

View File

@ -10,7 +10,7 @@ import {Component, Input} from '@angular/core';
<div *ngIf="dataProviders != undefined"> <div *ngIf="dataProviders != undefined">
<p> <p>
The results below are discovered through our pilot algorithms. The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a> <a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
</p> </p>
<div role="separator" class="divider" *ngFor="let item of dataProviders"> <div role="separator" class="divider" *ngFor="let item of dataProviders">

View File

@ -11,7 +11,7 @@ export class Dates {
return true; return true;
} }
//format YYYY-MM-DD //format YYYY-MM-DD
public static isValidDate(dateString) public static isValidDate(dateString:string)
{ {
// First check for the pattern // First check for the pattern
if(!/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(dateString)) if(!/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(dateString))
@ -40,11 +40,41 @@ export class Dates {
return day > 0 && day <= monthLength[month - 1]; return day > 0 && day <= monthLength[month - 1];
} }
public static getDateToday(){ public static getDateToday():Date{
var myDate = new Date(); var myDate = new Date();
return myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ; return myDate;
} }
public static getDateToString(myDate:Date):string{
var date:string = myDate.getFullYear()+ "-" ;
date+=((myDate.getMonth() + 1)<10)?"0"+(myDate.getMonth() + 1):(myDate.getMonth() + 1) ;
date+="-";
date+= (myDate.getDate() <10 )? "0"+myDate.getDate():myDate.getDate() ;
return date;
}
public static getDateXMonthsAgo(x:number):Date{
var myDate = new Date();
myDate.setMonth(myDate.getMonth() - x);
return myDate;
}
public static getDateXYearsAgo(x:number):Date{
var myDate = new Date();
myDate.setFullYear(myDate.getFullYear() - x);
return myDate;
}
public static getDateFromString(date:string):Date{
var myDate = new Date();
myDate.setFullYear(+date.substring(0,4));
myDate.setMonth(+date.substring(5,7)-1);
myDate.setDate(+date.substring(8,11))
return myDate;
}
} }
export class DOI{ export class DOI{

View File

@ -1,7 +1,7 @@
<!doctype html> <!doctype html>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/"> <html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head> <head>
<link href="http://demo.openaire.eu" rel="canonical" /> <!--link href="http://demo.openaire.eu" rel="canonical" /-->
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
@ -127,6 +127,9 @@
display: inline-table; display: inline-table;
} }
.dateFilter .mydp{
margin-top:5px;
}
</style> </style>
</head> </head>
@ -155,6 +158,9 @@
</ul> </ul>
</div> </div>
</div--> </div-->
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-559d24521cd8c080"></script>
</body> </body>
</html> </html>