Search Results: show specific entity type in paging (e.g.: 19 publications, page 1 of 2) | Search Results: Incomplete CSV download functionality

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45408 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-01-16 16:57:56 +00:00
parent 67e88eaa45
commit 026c64900f
19 changed files with 43 additions and 28 deletions

View File

@ -15,6 +15,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'advanced-search-dataprovider',
template: `
<advanced-search-page pageTitle="Advanced Search Data Providers" entityType="dataprovider"
type = "datasources"
[(results)] = "results"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
[(searchUtils)] = "searchUtils"

View File

@ -14,6 +14,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'advanced-search-datasets',
template: `
<advanced-search-page pageTitle="Advanced Search Datasets" entityType="dataset"
type = "datasets"
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"

View File

@ -13,7 +13,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
@Component({
selector: 'advanced-search-organizations',
template: `
<advanced-search-page pageTitle="Advanced Search Organizations" entityType="dataset"
<advanced-search-page pageTitle="Advanced Search Organizations" entityType="organization"
type = "organizations"
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"

View File

@ -13,7 +13,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
@Component({
selector: 'advanced-search-organizations',
template: `
<advanced-search-page pageTitle="Advanced Search People" entityType="dataset"
<advanced-search-page pageTitle="Advanced Search People" entityType="person"
type = "people"
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"

View File

@ -13,6 +13,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'advanced-search-projects',
template: `
<advanced-search-page pageTitle="Advanced Search Projects" entityType="project"
type = "projects"
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"

View File

@ -14,6 +14,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'advanced-search-publications',
template: `
<advanced-search-page pageTitle="Advanced Search Publications" entityType="publication"
type="publications"
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"

View File

@ -15,7 +15,7 @@ import {ExportCSVComponent} from '../../utils/exportCSV.component';
selector: 'search-dataproviders',
template: `
<search-page pageTitle="Compatible Dataproviders" type="datasource" [(filters)] = "filters"
<search-page pageTitle="Compatible Dataproviders" type="datasources" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" [showResultCount]=false (queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)">

View File

@ -15,7 +15,7 @@ import {ExportCSVComponent} from '../../utils/exportCSV.component';
selector: 'search-entity-registries',
template: `
<search-page pageTitle="Entity Registries" type="datasource" [(filters)] = "filters"
<search-page pageTitle="Entity Registries" type="datasources" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" [showResultCount]=false (queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)">

View File

@ -36,7 +36,7 @@ import {SearchUtilsClass} from './searchUtils.class';
(queryChange)="queryChanged($event)">
</advanced-search-form>
<!--div class="uk-text-right" *ngIf="results && results.length>= size"-->
<search-paging [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters" ></search-paging>
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters" ></search-paging>
<!--/div-->
<div>
@ -52,6 +52,7 @@ import {SearchUtilsClass} from './searchUtils.class';
export class AdvancedSearchPageComponent {
@Input() pageTitle = "";
@Input() results = [];
@Input() type;
@Input() entityType;
@Input() searchUtils:SearchUtilsClass = new SearchUtilsClass();
@Input() fieldIds: string[];

View File

@ -1,23 +1,25 @@
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {AlertModal} from '../../utils/modal/alert';
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
@Component({
selector: 'search-download',
template: `
<div class= "searchDownload" *ngIf="totalResults > 0">
<div class="uk-text-right" *ngIf="totalResults <= 100000">
<a (click)="download()">
<div class="uk-text-right" *ngIf="totalResults <= 10000">
<!--a (click)="download()"-->
<a href="{{downloadURLAPI}}publications?format=csv">
<span class="glyphicon glyphicon-download" aria-hidden="true"></span>
Download report (CSV)
</a>
</div>
<div class="uk-text-right" *ngIf="totalResults > 100000">
<!--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>
</div-->
</div>
<modal-alert></modal-alert>
@ -28,12 +30,14 @@ export class SearchDownloadComponent {
@Input() totalResults:number = 0;
@ViewChild(AlertModal) alertApplyAll;
@Output() downloadClick = new EventEmitter();
private downloadURLAPI: string;
constructor () {
}
}
ngOnInit() {
this.downloadURLAPI = OpenaireProperties.getCsvApi();
}
confirmClose(data){

View File

@ -41,7 +41,7 @@ import {DOI} from '../../utils/string-utils.class';
<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 [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters"></search-paging>
<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>
</div>
</div>
@ -51,7 +51,7 @@ import {DOI} from '../../utils/string-utils.class';
<div *ngIf="!showRefine" >
<search-form [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)"></search-form>
<search-paging [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseURLWithParameters"></search-paging>
<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>
</div>
@ -125,7 +125,7 @@ export class SearchPageComponent {
var doiQuery = "";
var keywordQuery = "";
if((keyword && keyword.length > 0)){
if((this.type == 'publication' ||this.type == 'dataset')){
if((this.type == 'publications' ||this.type == 'datasets')){
var DOIs:string[] = DOI.getDOIsFromString(keyword);
var doisParams = "";
@ -173,7 +173,7 @@ export class SearchPageComponent {
var doiQuery = "";
var keywordQuery = "";
if((keyword && keyword.length > 0)){
if((this.type == 'publication' ||this.type == 'dataset')){
if((this.type == 'publications' ||this.type == 'datasets')){
var DOIs:string[] = DOI.getDOIsFromString(keyword);
var doisParams = "";
@ -273,7 +273,7 @@ export class SearchPageComponent {
var keywordQuery = "";
console.info("keyyyyword::::"+ this.searchUtils.keyword )
if((this.searchUtils.keyword && this.searchUtils.keyword.length > 0)){
if((this.type == 'publication' ||this.type == 'dataset')){
if((this.type == 'publications' ||this.type == 'datasets')){
var DOIs:string[] = DOI.getDOIsFromString(this.searchUtils.keyword);
var doisParams = "";
@ -315,7 +315,7 @@ export class SearchPageComponent {
var doiQuery = "";
var keywordQuery = "";
if((this.searchUtils.keyword && this.searchUtils.keyword.length > 0)){
if((this.type == 'publication' ||this.type == 'dataset')){
if((this.type == 'publications' ||this.type == 'datasets')){
var DOIs:string[] = DOI.getDOIsFromString(this.searchUtils.keyword);
var doisParams = "";
for(var i =0 ;i < DOIs.length; i++){

View File

@ -9,7 +9,7 @@ import {Observable} from 'rxjs/Observable';
<paging [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl" [size]="searchUtils.size"> </paging>
</div>
<div class="" *ngIf="results && searchUtils.totalResults > 0">
{{searchUtils.totalResults}} documents, page {{searchUtils.page}} of {{(totalPages())}}
{{searchUtils.totalResults}} {{type}}, page {{searchUtils.page}} of {{(totalPages())}}
</div>
</div>
`
@ -19,6 +19,7 @@ export class SearchPagingComponent {
@Input() searchUtils;
@Input() results;
@Input() baseUrl;
@Input() type;
// @Input() totalResults:number = 0;
constructor () {

View File

@ -14,7 +14,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'search-dataproviders',
template: `
<search-page pageTitle="Search Dataproviders" type="datasource" [(filters)] = "filters"
<search-page pageTitle="Search Dataproviders" type="datasources" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl"
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)">
</search-page>

View File

@ -15,7 +15,7 @@ import {DOI} from '../../utils/string-utils.class';
selector: 'search-datasets',
template: `
<search-page pageTitle="Search Datasets" type="dataset" [(filters)] = "filters"
<search-page pageTitle="Search Datasets" type="datasets" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" >
</search-page>

View File

@ -13,7 +13,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'search-organizations',
template: `
<search-page pageTitle="Search Organizations" type="organization" [(filters)] = "filters"
<search-page pageTitle="Search Organizations" type="organizations" [(filters)] = "filters"
[(results)] = "results" [(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" >
</search-page>

View File

@ -15,7 +15,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'search-people',
template: `
<search-page pageTitle="Search People" type="person" [(filters)] = "filters"
<search-page pageTitle="Search People" type="people" [(filters)] = "filters"
[(results)] = "results"
[(searchUtils)] = "searchUtils" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" [showRefine]=false >
</search-page>

View File

@ -13,7 +13,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
selector: 'search-projects',
template: `
<search-page pageTitle="Search Projects" type="project" [(filters)] = "filters"
<search-page pageTitle="Search Projects" type="projects" [(filters)] = "filters"
[(results)] = "results"
[(searchUtils)] = "searchUtils"
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" >

View File

@ -17,7 +17,7 @@ import {DOI} from '../../utils/string-utils.class';
selector: 'search-publications',
template: `
<search-page pageTitle="Search Publications" type="publication" [(filters)] = "filters"
<search-page pageTitle="Search Publications" type="publications" [(filters)] = "filters"
[(results)] = "results"
[(searchUtils)] = "searchUtils" [(baseUrl)] = baseUrl
(queryChange)="queryChanged($event)" (downloadClick)="downloadClicked($event)">

View File

@ -35,24 +35,23 @@ export class OpenaireProperties {
private static claimsAPIURL = "http://scoobydoo.di.uoa.gr:8080/dnet-openaire-connector-service-1.0.0-SNAPSHOT/rest/claimsService/";
// private static searchAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
// private static searchAPIURLLAst = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
// private searchAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2.0/api/";
private static searchAPIURL = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
// private static searchAPIURLLAst = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
//private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
// private static searchResourcesAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources";
private static searchResourcesAPIURL = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources";
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
private static searchServiveURL = "http://scoobydoo.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
// 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 csvServiceAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";//publications?format=csv
private static searchCrossrefAPIURL = "http://api.crossref.org/works";
private static searchDataciteAPIURL = "http://search.datacite.org/api";
private static searchOrcidURL = "https://pub.orcid.org/";
@ -234,6 +233,10 @@ export class OpenaireProperties {
public static getHelpdesk():string{
return this.helpdesk;
}
public static getCsvApi(): string {
return this.csvServiceAPIURL;
}
}
export class ErrorCodes {
public LOADING = 0;