Utils of landing pages moved to 'landing-utils' folder | errorMessages.component created to centralize errorMessages according to ErrorCodes in openaireProperties.ts file | http service returning errorCodes and proper display fixed in search and fetch subscriptions (claims, home component, html project report page, csv files, basic info in landing pages, helper component, staticAutocomplete do not return errorCodes yet) | simple searchPages: paging remains when page changes while results load, filters on the left do not change position according to paging
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@49174 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
40029fae3e
commit
4bb3dc98fb
|
@ -51,7 +51,7 @@ import {PiwikService} from '../utils/piwik/piwik.service';
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
||||||
<h2 *ngIf="organization != undefined">
|
<h2 *ngIf="organization">
|
||||||
<span>content providers for institution: </span>
|
<span>content providers for institution: </span>
|
||||||
<a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank">
|
<a *ngIf="organization['url']!=''" href="{{organization.url}}" target="_blank">
|
||||||
<span>{{organization['name']}} (<i class="custom-external"></i>)</span>
|
<span>{{organization['name']}} (<i class="custom-external"></i>)</span>
|
||||||
|
@ -86,8 +86,8 @@ import {PiwikService} from '../utils/piwik/piwik.service';
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="(fetchDataproviders.searchUtils.totalResults == 0 && status == errorCodes.DONE)
|
<div *ngIf="(fetchDataproviders.searchUtils.totalResults == 0 && status == errorCodes.DONE)
|
||||||
|| status == errorCodes.NONE || status == errorCodes.ERROR" class = "alert alert-warning">
|
|| status == errorCodes.NOT_FOUND || status == errorCodes.ERROR || status == errorCodes.NOT_AVAILABLE" class = "alert alert-warning">
|
||||||
<div *ngIf="organization != undefined">
|
<div *ngIf="organization">
|
||||||
<span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR">
|
<span *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR">
|
||||||
An error occured.
|
An error occured.
|
||||||
</span>
|
</span>
|
||||||
|
@ -98,12 +98,15 @@ import {PiwikService} from '../utils/piwik/piwik.service';
|
||||||
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
<span *ngIf="organization['url']==''">{{organization['name']}}</span>
|
||||||
.
|
.
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="status == errorCodes.NONE && organizationId != ''">
|
<div *ngIf="status == errorCodes.NOT_FOUND && organizationId != ''">
|
||||||
No organization with ID: {{organizationId}} found.
|
No organization with ID: {{organizationId}} found.
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="status == errorCodes.ERROR && organizationId != ''">
|
<div *ngIf="status == errorCodes.ERROR && organizationId != ''">
|
||||||
An error occured.
|
An error occured.
|
||||||
</div>
|
</div>
|
||||||
|
<span *ngIf="status == errorCodes.NOT_AVAILABLE && organizationId != ''">
|
||||||
|
Service temprorarily unavailable. Please try again later.
|
||||||
|
</span>
|
||||||
<div *ngIf="organizationId == ''">
|
<div *ngIf="organizationId == ''">
|
||||||
No ID for organization.
|
No ID for organization.
|
||||||
</div>
|
</div>
|
||||||
|
@ -123,6 +126,7 @@ import {PiwikService} from '../utils/piwik/piwik.service';
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -211,19 +215,26 @@ export class DepositResultComponent {
|
||||||
|
|
||||||
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
|
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.organization = (data && data.title)?data.title:"";
|
if(data == null) {
|
||||||
this.status = this.errorCodes.DONE;
|
this.status = this.errorCodes.NOT_FOUND;
|
||||||
this.searchDataproviders();
|
} else {
|
||||||
|
this.organization = data.title;
|
||||||
|
this.status = this.errorCodes.DONE;
|
||||||
|
this.searchDataproviders();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
//console.log(err)
|
//console.log(err)
|
||||||
|
|
||||||
if(err.status == '404') {
|
if(err.status == '404') {
|
||||||
this.status = this.errorCodes.NONE;
|
this.status = this.errorCodes.NOT_FOUND;
|
||||||
console.info("none");
|
console.info("not found");
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.status = this.errorCodes.ERROR;
|
||||||
|
console.info("error");
|
||||||
} else {
|
} else {
|
||||||
this.status = this.errorCodes.ERROR;
|
this.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
console.info("error");
|
console.info("not available");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -165,15 +165,16 @@
|
||||||
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
|
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
|
||||||
No statistics available
|
No statistics available
|
||||||
</div-->
|
</div-->
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
|
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
|
||||||
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
|
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR"
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR"
|
||||||
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
||||||
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING || fetchDatasets.searchUtils.status == errorCodes.LOADING"
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING || fetchDatasets.searchUtils.status == errorCodes.LOADING"
|
||||||
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
|
||||||
|
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
|
<div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
|
||||||
<p class="uk-text-bold">Latest Research Result Timeline</p>
|
<p class="uk-text-bold">Latest Research Result Timeline</p>
|
||||||
|
|
|
@ -160,7 +160,7 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err)
|
console.log(err);
|
||||||
// console.info("error");
|
// console.info("error");
|
||||||
this.errorMessage = 'No dataProvider found';
|
this.errorMessage = 'No dataProvider found';
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
|
@ -271,11 +271,9 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchPublications(page: number, size: number) {
|
private searchPublications(page: number, size: number) {
|
||||||
if(this.fetchPublications.searchUtils.status == this.errorCodes.NONE) {
|
if( this.reloadPublications &&
|
||||||
this.reloadPublications = false;
|
( this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
}
|
this.fetchPublications.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||||
|
|
||||||
if(this.reloadPublications) {
|
|
||||||
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
||||||
}
|
}
|
||||||
this.reloadPublications = false;
|
this.reloadPublications = false;
|
||||||
|
@ -286,11 +284,9 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchDatasets(page: number, size: number) {
|
private searchDatasets(page: number, size: number) {
|
||||||
if(this.fetchDatasets.searchUtils.status == this.errorCodes.NONE) {
|
if( this.reloadDatasets &&
|
||||||
this.reloadDatasets = false;
|
( this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
}
|
this.fetchDatasets.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||||
|
|
||||||
if(this.reloadDatasets) {
|
|
||||||
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
||||||
}
|
}
|
||||||
this.reloadDatasets = false;
|
this.reloadDatasets = false;
|
||||||
|
@ -301,11 +297,9 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchProjects(page: number, size: number) {
|
private searchProjects(page: number, size: number) {
|
||||||
if(this.fetchProjects.searchUtils.status == this.errorCodes.NONE) {
|
if( this.reloadProjects &&
|
||||||
this.reloadProjects = false;
|
( this.fetchProjects.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
}
|
this.fetchProjects.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||||
|
|
||||||
if(this.reloadProjects) {
|
|
||||||
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size);
|
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size);
|
||||||
}
|
}
|
||||||
this.reloadProjects = false;
|
this.reloadProjects = false;
|
||||||
|
@ -316,11 +310,9 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private searchDatasources(page: number, size: number) {
|
private searchDatasources(page: number, size: number) {
|
||||||
if(this.fetchDataproviders.searchUtils.status == this.errorCodes.NONE) {
|
if( this.reloadDataproviders &&
|
||||||
this.reloadDataproviders = false;
|
( this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
}
|
this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||||
|
|
||||||
if(this.reloadDataproviders) {
|
|
||||||
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size);
|
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size);
|
||||||
}
|
}
|
||||||
this.reloadDataproviders = false;
|
this.reloadDataproviders = false;
|
||||||
|
@ -332,13 +324,13 @@ export class DataProviderComponent {
|
||||||
|
|
||||||
private searchRelatedDatasources(page: number, size: number) {
|
private searchRelatedDatasources(page: number, size: number) {
|
||||||
// Currently no counting is done for this tab. Following condition is always false
|
// Currently no counting is done for this tab. Following condition is always false
|
||||||
if(this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.NONE
|
|
||||||
&& this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.NONE) {
|
|
||||||
this.reloadRelatedDatasources = false;
|
|
||||||
this.loadingRelatedDatasources = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.reloadRelatedDatasources) {
|
if( this.reloadRelatedDatasources &&
|
||||||
|
( this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
|
this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE )
|
||||||
|
&&
|
||||||
|
( this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
|
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||||
this.relatedDatasourcesSub = Observable.merge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete)
|
this.relatedDatasourcesSub = Observable.merge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {},
|
data => {},
|
||||||
|
@ -348,7 +340,9 @@ export class DataProviderComponent {
|
||||||
|
|
||||||
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size);
|
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size);
|
||||||
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size);
|
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size);
|
||||||
}
|
} else {
|
||||||
|
this.loadingRelatedDatasources = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.reloadRelatedDatasources = false;
|
this.reloadRelatedDatasources = false;
|
||||||
|
@ -361,7 +355,8 @@ export class DataProviderComponent {
|
||||||
|
|
||||||
|
|
||||||
private preprocessRelatedDatasources() {
|
private preprocessRelatedDatasources() {
|
||||||
if(this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE || this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE) {
|
if( this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
|
||||||
|
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ) {
|
||||||
this.dataProviderInfo.relatedDatasources = new Map<string, {"name": string, "countPublications": string, "countDatasets": string}>();
|
this.dataProviderInfo.relatedDatasources = new Map<string, {"name": string, "countPublications": string, "countDatasets": string}>();
|
||||||
}
|
}
|
||||||
for(let result of this.fetchAggregatorsPublications.results) {
|
for(let result of this.fetchAggregatorsPublications.results) {
|
||||||
|
@ -379,7 +374,6 @@ export class DataProviderComponent {
|
||||||
this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count)+"";
|
this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count)+"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loadingRelatedDatasources = false;
|
this.loadingRelatedDatasources = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,11 @@ import { FormsModule } from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import {IFrameModule} from '../../utils/iframe.module';
|
import {IFrameModule} from '../../utils/iframe.module';
|
||||||
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
// import { ResultLandingModule } from '../resultLanding.module';
|
// import { ResultLandingModule } from '../resultLanding.module';
|
||||||
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
||||||
import {MetricsModule} from '../metrics.module';
|
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||||
import { LandingModule } from '../landing.module';
|
import {LandingModule} from '../landing-utils/landing.module';
|
||||||
import {PagingModule} from '../../utils/paging.module';
|
import {PagingModule} from '../../utils/paging.module';
|
||||||
|
|
||||||
import {PublicationsTabComponent} from './publicationsTab.component';
|
import {PublicationsTabComponent} from './publicationsTab.component';
|
||||||
|
@ -20,7 +21,7 @@ import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component'
|
||||||
// import {TabsComponent} from './tabs.component';
|
// import {TabsComponent} from './tabs.component';
|
||||||
|
|
||||||
import {DataProviderComponent} from './dataProvider.component';
|
import {DataProviderComponent} from './dataProvider.component';
|
||||||
import { DataProviderService} from './dataProvider.service';
|
import {DataProviderService} from './dataProvider.service';
|
||||||
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
||||||
import {DatasetsServiceModule} from '../../services/datasetsService.module';
|
import {DatasetsServiceModule} from '../../services/datasetsService.module';
|
||||||
import {ProjectsServiceModule} from '../../services/projectsService.module';
|
import {ProjectsServiceModule} from '../../services/projectsService.module';
|
||||||
|
@ -32,7 +33,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports:
|
imports:
|
||||||
[CommonModule, FormsModule, RouterModule,DataProviderRoutingModule,
|
[CommonModule, FormsModule, RouterModule,DataProviderRoutingModule,
|
||||||
TabResultModule, IFrameModule, MetricsModule, LandingModule,
|
TabResultModule, IFrameModule, ErrorMessagesModule, MetricsModule, LandingModule,
|
||||||
DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule,
|
DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule, PublicationsServiceModule,
|
||||||
PagingModule],
|
PagingModule],
|
||||||
declarations:
|
declarations:
|
||||||
|
|
|
@ -17,7 +17,7 @@ export class DataProviderService {
|
||||||
|
|
||||||
getDataproviderInfo (id: string):any {
|
getDataproviderInfo (id: string):any {
|
||||||
console.info("getDataProviderInfo in service");
|
console.info("getDataProviderInfo in service");
|
||||||
let url = OpenaireProperties.getSearchAPIURLLast() + 'datasources/' +id +"?format=json";
|
let url = OpenaireProperties.getSearchAPIURLLast() + 'datasources/' +id +"?formatt=json";
|
||||||
let key = url;
|
let key = url;
|
||||||
if (this._cache.has(key)) {
|
if (this._cache.has(key)) {
|
||||||
return Observable.of(this._cache.get(key)).map(res => this.parseDataProviderInfo(res));
|
return Observable.of(this._cache.get(key)).map(res => this.parseDataProviderInfo(res));
|
||||||
|
|
|
@ -6,9 +6,12 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'datasetsTab',
|
selector: 'datasetsTab',
|
||||||
template: `
|
template: `
|
||||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div> <div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<!--div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
||||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div>
|
||||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service temprorarily unavailable. Please try again later.</div>
|
||||||
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">No research data found</div-->
|
||||||
|
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'research data'"></errorMessages>
|
||||||
|
|
||||||
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
|
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert">
|
||||||
No research data available
|
No research data available
|
||||||
|
|
|
@ -6,10 +6,12 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'datasourcesTab',
|
selector: 'datasourcesTab',
|
||||||
template: `
|
template: `
|
||||||
|
<!--div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No content providers available</div>
|
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No content providers available</div>
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service temprorarily unavailable. Please try again later.</div>
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">No content providers found</div-->
|
||||||
|
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'"></errorMessages>
|
||||||
|
|
||||||
<!--div *ngIf="fetchDataproviders.searchUtils.totalResults == 0" class = "uk-alert">
|
<!--div *ngIf="fetchDataproviders.searchUtils.totalResults == 0" class = "uk-alert">
|
||||||
No content providers available
|
No content providers available
|
||||||
|
|
|
@ -7,10 +7,11 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'projectsTab',
|
selector: 'projectsTab',
|
||||||
template: `
|
template: `
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No projects available</div>
|
<!--div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No projects available</div>
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[fetchProjects.searchUtils.status]" [type]="'projects'"></errorMessages>
|
||||||
|
|
||||||
<!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert">
|
<!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert">
|
||||||
No projects available
|
No projects available
|
||||||
|
|
|
@ -10,7 +10,8 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
||||||
|
<!--errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"></errorMessages>
|
||||||
|
{{fetchPublications.searchUtils.status}}-->
|
||||||
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert">
|
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert">
|
||||||
No publications available
|
No publications available
|
||||||
</div-->
|
</div-->
|
||||||
|
|
|
@ -10,21 +10,23 @@ import { Observable } from 'rxjs/Observable';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'relatedDatasourcesTab',
|
selector: 'relatedDatasourcesTab',
|
||||||
template: `
|
template: `
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
|
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
|
||||||
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">
|
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">
|
||||||
No related content providers available
|
No related content providers available
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR && fetchDatasets.searchUtils.status == errorCodes.ERROR"
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR && fetchDatasets.searchUtils.status == errorCodes.ERROR"
|
||||||
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">
|
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">
|
||||||
An Error Occured
|
An Error Occured
|
||||||
</div>
|
</div-->
|
||||||
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE && fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE && fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
||||||
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">
|
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">
|
||||||
Service not available
|
Service not available
|
||||||
</div-->
|
</div-->
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING || fetchDatasets.searchUtils.status == errorCodes.LOADING || loading"
|
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING || fetchDatasets.searchUtils.status == errorCodes.LOADING || loading"
|
||||||
class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading">
|
class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading">
|
||||||
</div>
|
</div-->
|
||||||
|
|
||||||
|
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'related content providers'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE) && !loading">
|
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE) && !loading">
|
||||||
<div *ngIf="results && results.size > pageSize" class="uk-margin">
|
<div *ngIf="results && results.size > pageSize" class="uk-margin">
|
||||||
|
|
|
@ -7,14 +7,15 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
|
||||||
selector: 'statisticsTab',
|
selector: 'statisticsTab',
|
||||||
template: `
|
template: `
|
||||||
<div *ngIf="show">
|
<div *ngIf="show">
|
||||||
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NONE && DatasetsComponent.searchUtils.status == errorCodes.NONE"
|
<!--div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NONE && DatasetsComponent.searchUtils.status == errorCodes.NONE"
|
||||||
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
|
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
|
||||||
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.ERROR || DatasetsComponent.searchUtils.status == errorCodes.ERROR"
|
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.ERROR || DatasetsComponent.searchUtils.status == errorCodes.ERROR"
|
||||||
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE || DatasetsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE || DatasetsComponent.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
||||||
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.LOADING || DatasetsComponent.searchUtils.status == errorCodes.LOADING"
|
<div *ngIf="searchPublicationsComponent.searchUtils.status == errorCodes.LOADING || DatasetsComponent.searchUtils.status == errorCodes.LOADING"
|
||||||
class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
class="uk-animation-fade uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[searchPublicationsComponent.searchUtils.status, DatasetsComponent.searchUtils.status]" [type]="'statistics'"></errorMessages>
|
||||||
|
|
||||||
<!--div *ngIf="searchPublicationsComponent.searchUtils.totalResults == 0 && searchDatasetsComponent.searchUtils.totalResults == 0" class = "uk-alert">
|
<!--div *ngIf="searchPublicationsComponent.searchUtils.totalResults == 0 && searchDatasetsComponent.searchUtils.totalResults == 0" class = "uk-alert">
|
||||||
No statistics available
|
No statistics available
|
||||||
|
|
|
@ -8,13 +8,13 @@ import { RouterModule } from '@angular/router';
|
||||||
import { DatasetService} from './dataset.service';
|
import { DatasetService} from './dataset.service';
|
||||||
import { DatasetComponent } from './dataset.component';
|
import { DatasetComponent } from './dataset.component';
|
||||||
import { DatasetRoutingModule } from './dataset-routing.module';
|
import { DatasetRoutingModule } from './dataset-routing.module';
|
||||||
import {MetricsModule} from '../metrics.module';
|
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||||
import {IFrameModule} from '../../utils/iframe.module';
|
import {IFrameModule} from '../../utils/iframe.module';
|
||||||
import {AltMetricsModule} from '../../utils/altmetrics.module';
|
import {AltMetricsModule} from '../../utils/altmetrics.module';
|
||||||
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
|
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
|
||||||
|
|
||||||
import { ResultLandingModule } from '../resultLanding.module';
|
import { ResultLandingModule } from '../landing-utils/resultLanding.module';
|
||||||
import { LandingModule } from '../landing.module';
|
import { LandingModule } from '../landing-utils/landing.module';
|
||||||
import {FreeGuard} from'../../login/freeGuard.guard';
|
import {FreeGuard} from'../../login/freeGuard.guard';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
|
@ -8,8 +8,8 @@ import { RouterModule } from '@angular/router';
|
||||||
import {TabPagingComponent} from './tabPaging.component';
|
import {TabPagingComponent} from './tabPaging.component';
|
||||||
import {ShowTitleComponent} from './showTitle.component';
|
import {ShowTitleComponent} from './showTitle.component';
|
||||||
import {AddThisComponent} from './addThis.component';
|
import {AddThisComponent} from './addThis.component';
|
||||||
import {PiwikServiceModule} from '../utils/piwik/piwikService.module';
|
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
|
||||||
import {PreviousRouteRecorder} from'../utils/piwik/previousRouteRecorder.guard';
|
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
|
@ -1,7 +1,7 @@
|
||||||
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
||||||
import {Metrics} from '../utils/entities/metrics';
|
import {Metrics} from '../../utils/entities/metrics';
|
||||||
import {MetricsService } from '../services/metrics.service';
|
import {MetricsService } from '../../services/metrics.service';
|
||||||
import {ErrorCodes} from '../utils/properties/openaireProperties';
|
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||||
|
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
|
|
||||||
|
@ -26,10 +26,12 @@ import { Subscription } from 'rxjs/Subscription';
|
||||||
Metrics are currently unavailable
|
Metrics are currently unavailable
|
||||||
</div-->
|
</div-->
|
||||||
|
|
||||||
<div *ngIf="status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<!--div *ngIf="status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
||||||
<div *ngIf="status == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
|
<div *ngIf="status == errorCodes.NONE" class="uk-alert uk-alert-primary" role="alert">No Results found</div>
|
||||||
<div *ngIf="status == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
|
<div *ngIf="status == errorCodes.ERROR" class="uk-alert uk-alert-warning" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service not available</div>
|
<div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger" role="alert">Service temprorarily unavailable. Please try again later.</div>
|
||||||
|
<div *ngIf="status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger" role="alert">No metrics found</div-->
|
||||||
|
<errorMessages [status]="[status]" [type]="'metrics'"></errorMessages>
|
||||||
<div *ngIf="metrics != undefined" class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-grid" uk-grid="">
|
<div *ngIf="metrics != undefined" class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-grid" uk-grid="">
|
||||||
<div *ngIf="entityType == 'projects'" class="uk-width-1-1 uk-text-center uk-text-meta uk-margin">Project metrics are derived from aggregating individual research results metrics.</div>
|
<div *ngIf="entityType == 'projects'" class="uk-width-1-1 uk-text-center uk-text-meta uk-margin">Project metrics are derived from aggregating individual research results metrics.</div>
|
||||||
<div class="metrics-openaire uk-first-column">
|
<div class="metrics-openaire uk-first-column">
|
||||||
|
@ -196,6 +198,7 @@ export class MetricsComponent {
|
||||||
data => {
|
data => {
|
||||||
this.metrics = data;
|
this.metrics = data;
|
||||||
this.status = this.errorCodes.DONE;
|
this.status = this.errorCodes.DONE;
|
||||||
|
|
||||||
this.metricsResults.emit({
|
this.metricsResults.emit({
|
||||||
totalViews: this.metrics.totalViews,
|
totalViews: this.metrics.totalViews,
|
||||||
totalDownloads: this.metrics.totalDownloads,
|
totalDownloads: this.metrics.totalDownloads,
|
||||||
|
@ -204,9 +207,12 @@ export class MetricsComponent {
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
this.status = this.errorCodes.ERROR;
|
|
||||||
if(err.status == '404') {
|
if(err.status == '404') {
|
||||||
this.status = this.errorCodes.NOT_AVAILABLE;
|
this.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
this.metricsResults.emit({
|
this.metricsResults.emit({
|
||||||
totalViews: 0,
|
totalViews: 0,
|
|
@ -5,22 +5,22 @@ import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
import {MetricsComponent} from './metrics.component';
|
import {MetricsComponent} from './metrics.component';
|
||||||
import { MetricsService } from '../services/metrics.service';
|
import { MetricsService } from '../../services/metrics.service';
|
||||||
|
|
||||||
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
CommonModule, FormsModule, ErrorMessagesModule
|
||||||
CommonModule, FormsModule
|
],
|
||||||
],
|
|
||||||
declarations: [
|
declarations: [
|
||||||
MetricsComponent
|
MetricsComponent
|
||||||
],
|
],
|
||||||
providers:[
|
providers:[
|
||||||
MetricsService
|
MetricsService
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
|
|
||||||
MetricsComponent
|
MetricsComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class MetricsModule { }
|
export class MetricsModule { }
|
|
@ -3,7 +3,7 @@ import { NgModule} from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import {PagingModule} from '../utils/paging.module';
|
import {PagingModule} from '../../utils/paging.module';
|
||||||
|
|
||||||
import {ShowAuthorsComponent} from './showAuthors.component';
|
import {ShowAuthorsComponent} from './showAuthors.component';
|
||||||
import {ShowIdentifiersComponent} from './showIdentifiers.component';
|
import {ShowIdentifiersComponent} from './showIdentifiers.component';
|
|
@ -1,12 +1,12 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
|
|
||||||
import { FetchProjects } from '../utils/fetchEntitiesClasses/fetchProjects.class';
|
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||||
import { SearchProjectsService } from '../services/searchProjects.service';
|
import { SearchProjectsService } from '../../services/searchProjects.service';
|
||||||
|
|
||||||
import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties';
|
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||||
import {StringUtils} from '../utils/string-utils.class';
|
import {StringUtils} from '../../utils/string-utils.class';
|
||||||
import {RouterHelper} from '../utils/routerHelper.class';
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'searchingProjectsTab',
|
selector: 'searchingProjectsTab',
|
||||||
|
@ -14,10 +14,11 @@ import {RouterHelper} from '../utils/routerHelper.class';
|
||||||
<!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert">
|
<!--div *ngIf="fetchProjects.searchUtils.totalResults == 0" class = "uk-alert">
|
||||||
No projects available
|
No projects available
|
||||||
</div-->
|
</div-->
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No projects available</div>
|
<!--div *ngIf="fetchProjects.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No projects available</div>
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[fetchProjects.searchUtils.status]" [type]="'projects'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="fetchProjects.searchUtils.totalResults > 0">
|
<div *ngIf="fetchProjects.searchUtils.totalResults > 0">
|
||||||
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResultsNoFilters > 10">
|
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResultsNoFilters > 10">
|
|
@ -5,17 +5,18 @@ import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import { ProjectsServiceModule} from '../services/projectsService.module';
|
import { ProjectsServiceModule} from '../../services/projectsService.module';
|
||||||
import { TabResultModule } from '../searchPages/searchUtils/tabResult.module';
|
import { TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
||||||
import { SearchingProjectsTabComponent} from './searchingProjectsInTab.component';
|
import { SearchingProjectsTabComponent} from './searchingProjectsInTab.component';
|
||||||
|
|
||||||
import {PagingModule } from '../utils/paging.module';
|
import {PagingModule } from '../../utils/paging.module';
|
||||||
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule, CommonModule, FormsModule,
|
RouterModule, CommonModule, FormsModule,
|
||||||
ProjectsServiceModule, TabResultModule, PagingModule
|
ProjectsServiceModule, TabResultModule,
|
||||||
|
PagingModule, ErrorMessagesModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
SearchingProjectsTabComponent
|
SearchingProjectsTabComponent
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, Input, ElementRef} from '@angular/core';
|
import {Component, Input, ElementRef} from '@angular/core';
|
||||||
import {RouterHelper} from '../utils/routerHelper.class';
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'showAuthors',
|
selector: 'showAuthors',
|
|
@ -1,5 +1,5 @@
|
||||||
import {Component, Input, ElementRef} from '@angular/core';
|
import {Component, Input, ElementRef} from '@angular/core';
|
||||||
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'showIdentifiers',
|
selector: 'showIdentifiers',
|
|
@ -1,6 +1,6 @@
|
||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {RouterHelper} from '../utils/routerHelper.class';
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||||
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||||
//import {PagingModule} from '../utils/paging.module';
|
//import {PagingModule} from '../utils/paging.module';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
|
@ -87,10 +87,11 @@
|
||||||
<div class="uk-margin custom-tab-content">
|
<div class="uk-margin custom-tab-content">
|
||||||
|
|
||||||
<div *ngIf="activeTab=='Publications'" class="uk-animation-fade">
|
<div *ngIf="activeTab=='Publications'" class="uk-animation-fade">
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No publications available</div>
|
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No publications available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
||||||
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10">
|
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10">
|
||||||
|
@ -115,10 +116,11 @@
|
||||||
No content providers available
|
No content providers available
|
||||||
</div-->
|
</div-->
|
||||||
|
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No content providers available</div>
|
<!--div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No content providers available</div>
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
<div *ngIf="fetchDataproviders.searchUtils.totalResults > 0">
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {SearchDataprovidersService} from '../../services/searchDataproviders.ser
|
||||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||||
import { Meta} from '../../../angular2-meta';
|
import { Meta} from '../../../angular2-meta';
|
||||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||||
import {SearchingProjectsTabComponent} from '../searchingProjectsInTab.component';
|
import {SearchingProjectsTabComponent} from '../landing-utils/searchingProjectsInTab.component';
|
||||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||||
|
|
||||||
import {ModalLoading} from '../../utils/modal/loading.component';
|
import {ModalLoading} from '../../utils/modal/loading.component';
|
||||||
|
@ -296,7 +296,7 @@ export class OrganizationComponent {
|
||||||
this.downloadFilePiwikSub = this._piwikService.trackDownload(url).subscribe();
|
this.downloadFilePiwikSub = this._piwikService.trackDownload(url).subscribe();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {
|
err => {
|
||||||
console.log("Error downloading the file.");
|
console.log("Error downloading the file.");
|
||||||
this.closeLoading();
|
this.closeLoading();
|
||||||
this.confirmOpenCsvError();
|
this.confirmOpenCsvError();
|
||||||
|
@ -369,7 +369,7 @@ export class OrganizationComponent {
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {
|
err => {
|
||||||
console.log("Error downloading the file.");
|
console.log("Error downloading the file.");
|
||||||
this.closeLoading();
|
this.closeLoading();
|
||||||
this.confirmOpenCsvError();
|
this.confirmOpenCsvError();
|
||||||
|
@ -378,11 +378,11 @@ export class OrganizationComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => console.log("Error getting number of publications for project."));
|
err => console.log("Error getting number of publications for project."));
|
||||||
}//);
|
}//);
|
||||||
|
|
||||||
},
|
},
|
||||||
error => {
|
err => {
|
||||||
console.log("Error getting projects project.");
|
console.log("Error getting projects project.");
|
||||||
this.closeLoading();
|
this.closeLoading();
|
||||||
this.confirmOpenCsvError();
|
this.confirmOpenCsvError();
|
||||||
|
|
|
@ -5,26 +5,27 @@ import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
|
import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
|
||||||
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
||||||
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
|
|
||||||
import { OrganizationServiceModule} from '../../services/organizationService.module';
|
import { OrganizationServiceModule} from '../../services/organizationService.module';
|
||||||
// import { ProjectsServiceModule} from '../../services/projectsService.module';
|
// import { ProjectsServiceModule} from '../../services/projectsService.module';
|
||||||
import { OrganizationComponent } from './organization.component';
|
import { OrganizationComponent } from './organization.component';
|
||||||
import { OrganizationRoutingModule } from './organization-routing.module';
|
import { OrganizationRoutingModule } from './organization-routing.module';
|
||||||
|
|
||||||
import { LandingModule } from '../landing.module';
|
import { LandingModule } from '../landing-utils/landing.module';
|
||||||
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
||||||
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
|
||||||
import {ReportsServiceModule} from '../../services/reportsService.module';
|
import {ReportsServiceModule} from '../../services/reportsService.module';
|
||||||
import {PublicationsServiceModule} from '../../services/publicationsService.module';
|
import {PublicationsServiceModule} from '../../services/publicationsService.module';
|
||||||
import {ProjectsServiceModule} from '../../services/projectsService.module';
|
import {ProjectsServiceModule} from '../../services/projectsService.module';
|
||||||
|
|
||||||
import { SearchingProjectsTabModule} from '../searchingProjectsInTab.module';
|
import { SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
|
||||||
import {FreeGuard} from'../../login/freeGuard.guard';
|
import {FreeGuard} from'../../login/freeGuard.guard';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, RouterModule,
|
CommonModule, FormsModule, RouterModule,
|
||||||
LoadingModalModule, AlertModalModule,
|
LoadingModalModule, AlertModalModule, ErrorMessagesModule,
|
||||||
LandingModule,
|
LandingModule,
|
||||||
OrganizationRoutingModule,
|
OrganizationRoutingModule,
|
||||||
TabResultModule,
|
TabResultModule,
|
||||||
|
|
|
@ -158,11 +158,11 @@
|
||||||
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary" >
|
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary" >
|
||||||
No publications available
|
No publications available
|
||||||
</div-->
|
</div-->
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No publications available</div>
|
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No publications available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div*ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
<div *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
||||||
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
|
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
|
||||||
|
@ -182,11 +182,11 @@
|
||||||
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
|
<!--div *ngIf="fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
|
||||||
No research data available
|
No research data available
|
||||||
</div-->
|
</div-->
|
||||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div>
|
<!--div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No research data available</div>
|
||||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'research data'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
|
<div *ngIf="fetchDatasets.searchUtils.totalResults > 0">
|
||||||
|
|
||||||
|
@ -206,14 +206,15 @@
|
||||||
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
|
<!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert uk-alert-primary">
|
||||||
No statistics available
|
No statistics available
|
||||||
</div-->
|
</div-->
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
|
<!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
|
||||||
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
|
class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR"
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR"
|
||||||
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
|
||||||
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
|
||||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING || fetchDatasets.searchUtils.status == errorCodes.LOADING"
|
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING || fetchDatasets.searchUtils.status == errorCodes.LOADING"
|
||||||
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'"></errorMessages>
|
||||||
|
|
||||||
<div *ngIf="statsClicked && (fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
|
<div *ngIf="statsClicked && (fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
|
||||||
|
|
||||||
|
|
|
@ -7,22 +7,23 @@ import { RouterModule } from '@angular/router';
|
||||||
import { ProjectServiceModule} from './projectService.module';
|
import { ProjectServiceModule} from './projectService.module';
|
||||||
// import {HtmlProgressReportService} from './htmlProgressReport.service';
|
// import {HtmlProgressReportService} from './htmlProgressReport.service';
|
||||||
import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
|
import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
|
||||||
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
|
|
||||||
import { ProjectComponent } from './project.component';
|
import { ProjectComponent } from './project.component';
|
||||||
import { ProjectRoutingModule } from './project-routing.module';
|
import { ProjectRoutingModule } from './project-routing.module';
|
||||||
import {IFrameModule} from '../../utils/iframe.module';
|
import {IFrameModule} from '../../utils/iframe.module';
|
||||||
import {MetricsModule} from '../metrics.module';
|
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||||
import {ReportsServiceModule} from '../../services/reportsService.module';
|
import {ReportsServiceModule} from '../../services/reportsService.module';
|
||||||
import {PublicationsServiceModule} from '../../services/publicationsService.module';
|
import {PublicationsServiceModule} from '../../services/publicationsService.module';
|
||||||
import {DatasetsServiceModule} from '../../services/datasetsService.module';
|
import {DatasetsServiceModule} from '../../services/datasetsService.module';
|
||||||
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
||||||
import { LandingModule } from '../landing.module';
|
import { LandingModule } from '../landing-utils/landing.module';
|
||||||
import {FreeGuard} from'../../login/freeGuard.guard';
|
import {FreeGuard} from'../../login/freeGuard.guard';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule, RouterModule, LandingModule,
|
CommonModule, FormsModule, RouterModule, LandingModule,
|
||||||
ProjectRoutingModule, LoadingModalModule,
|
ProjectRoutingModule, LoadingModalModule, ErrorMessagesModule,
|
||||||
TabResultModule, IFrameModule, MetricsModule, ReportsServiceModule,
|
TabResultModule, IFrameModule, MetricsModule, ReportsServiceModule,
|
||||||
PublicationsServiceModule, DatasetsServiceModule, ProjectServiceModule
|
PublicationsServiceModule, DatasetsServiceModule, ProjectServiceModule
|
||||||
],
|
],
|
||||||
|
|
|
@ -8,14 +8,14 @@ import { RouterModule } from '@angular/router';
|
||||||
import { PublicationService} from './publication.service';
|
import { PublicationService} from './publication.service';
|
||||||
import { PublicationComponent } from './publication.component';
|
import { PublicationComponent } from './publication.component';
|
||||||
import { PublicationRoutingModule } from './publication-routing.module';
|
import { PublicationRoutingModule } from './publication-routing.module';
|
||||||
import {MetricsModule} from '../metrics.module';
|
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||||
import {IFrameModule} from '../../utils/iframe.module';
|
import {IFrameModule} from '../../utils/iframe.module';
|
||||||
import {AltMetricsModule} from '../../utils/altmetrics.module';
|
import {AltMetricsModule} from '../../utils/altmetrics.module';
|
||||||
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
|
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
|
||||||
import {PagingModule} from '../../utils/paging.module';
|
import {PagingModule} from '../../utils/paging.module';
|
||||||
|
|
||||||
import { ResultLandingModule } from '../resultLanding.module';
|
import { ResultLandingModule } from '../landing-utils/resultLanding.module';
|
||||||
import { LandingModule } from '../landing.module';
|
import { LandingModule } from '../landing-utils/landing.module';
|
||||||
import {FreeGuard} from'../../login/freeGuard.guard';
|
import {FreeGuard} from'../../login/freeGuard.guard';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
|
@ -21,13 +21,17 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
[(searchUtils)] = "searchUtils"
|
[(searchUtils)] = "searchUtils"
|
||||||
(queryChange)="queryChanged($event)"
|
(queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/dataproviders"
|
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/dataproviders"
|
||||||
[disableForms]="disableForms">
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults">
|
||||||
</advanced-search-page>
|
</advanced-search-page>
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AdvancedSearchDataProvidersComponent {
|
export class AdvancedSearchDataProvidersComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
|
@ -41,27 +45,32 @@ export class AdvancedSearchDataProvidersComponent {
|
||||||
public resourcesQuery = "(oaftype exact datasource)";
|
public resourcesQuery = "(oaftype exact datasource)";
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
|
||||||
|
|
||||||
this.results =[];
|
this.results =[];
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedDataProviders;
|
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedDataProviders;
|
||||||
console.info("Con -base url:"+this.searchUtils.baseUrl );
|
console.info("Con -base url:"+this.searchUtils.baseUrl );
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
let page = (params['page']=== undefined)?0:+params['page'];
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
this.searchUtils.page = ( page < 1 ) ? 1 : page;
|
this.loadPaging = false;
|
||||||
this.searchPage.fieldIds = this.fieldIds;
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
this.selectedFields =[];
|
}
|
||||||
this.searchPage.selectedFields = this.selectedFields;
|
|
||||||
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
|
||||||
this.searchPage.getSelectedFiltersFromUrl(params);
|
|
||||||
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size);
|
|
||||||
|
|
||||||
|
let page = (params['page']=== undefined)?0:+params['page'];
|
||||||
|
this.searchUtils.page = ( page < 1 ) ? 1 : page;
|
||||||
|
this.searchPage.fieldIds = this.fieldIds;
|
||||||
|
this.selectedFields =[];
|
||||||
|
this.searchPage.selectedFields = this.selectedFields;
|
||||||
|
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
||||||
|
this.searchPage.getSelectedFiltersFromUrl(params);
|
||||||
|
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -75,37 +84,37 @@ export class AdvancedSearchDataProvidersComponent {
|
||||||
this.csvParams ="&type=datasources&query="+this.resourcesQuery;
|
this.csvParams ="&type=datasources&query="+this.resourcesQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
|
|
||||||
console.info("Advanced Search for Publications: Execute search query "+parameters);
|
console.info("Advanced Search for Content Providers: Execute search query "+parameters);
|
||||||
this._searchDataProvidersService.advancedSearchDataproviders(parameters, page, size).subscribe(
|
this._searchDataProvidersService.advancedSearchDataproviders(parameters, page, size).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data[0];
|
this.searchUtils.totalResults = data[0];
|
||||||
console.info("Adv Search Content Providers total="+this.searchUtils.totalResults);
|
console.info("Adv Search Content Providers total="+this.searchUtils.totalResults);
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.updateBaseUrlWithParameters();
|
this.searchPage.updateBaseUrlWithParameters();
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
totalPages = (parseInt(totalPages, 10) + 1);
|
totalPages = (parseInt(totalPages, 10) + 1);
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -116,8 +125,15 @@ export class AdvancedSearchDataProvidersComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = errorCodes.ERROR;
|
// this.searchUtils.status = errorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
//this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
|
@ -125,6 +141,8 @@ export class AdvancedSearchDataProvidersComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||||
console.info("queryChanged: Execute search query "+parameters);
|
console.info("queryChanged: Execute search query "+parameters);
|
||||||
|
|
|
@ -20,44 +20,52 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||||
(queryChange)="queryChanged($event)"
|
(queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/datasets"
|
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/datasets"
|
||||||
[disableForms]="disableForms">
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults">
|
||||||
</advanced-search-page>
|
</advanced-search-page>
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AdvancedSearchDatasetsComponent {
|
export class AdvancedSearchDatasetsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
|
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
|
|
||||||
public searchFields:SearchFields = new SearchFields();
|
public searchFields:SearchFields = new SearchFields();
|
||||||
|
|
||||||
|
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
|
||||||
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
|
public fieldIdsMap= this.searchFields.RESULT_FIELDS;
|
||||||
public fieldIdsMap= this.searchFields.RESULT_FIELDS;
|
public selectedFields:AdvancedField[] = [];
|
||||||
public selectedFields:AdvancedField[] = [];
|
|
||||||
|
|
||||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||||
public resourcesQuery = "( (oaftype exact result) and (resulttypeid exact dataset) )";
|
public resourcesQuery = "( (oaftype exact result) and (resulttypeid exact dataset) )";
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
|
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
|
||||||
|
|
||||||
this.results =[];
|
this.results =[];
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedDatasets;
|
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedDatasets;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
let page = (params['page']=== undefined)?1:+params['page'];
|
let page = (params['page']=== undefined)?1:+params['page'];
|
||||||
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
||||||
this.searchPage.fieldIds = this.fieldIds;
|
this.searchPage.fieldIds = this.fieldIds;
|
||||||
|
@ -80,8 +88,8 @@ export class AdvancedSearchDatasetsComponent {
|
||||||
this.csvParams ="&type=datasets&query="+this.resourcesQuery;
|
this.csvParams ="&type=datasets&query="+this.resourcesQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -94,15 +102,15 @@ export class AdvancedSearchDatasetsComponent {
|
||||||
console.info("search Research Data total="+this.searchUtils.totalResults);
|
console.info("search Research Data total="+this.searchUtils.totalResults);
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.updateBaseUrlWithParameters();
|
this.searchPage.updateBaseUrlWithParameters();
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -110,7 +118,7 @@ export class AdvancedSearchDatasetsComponent {
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -121,8 +129,16 @@ export class AdvancedSearchDatasetsComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = errorCodes.ERROR;
|
// this.searchUtils.status = errorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
//this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
|
@ -133,6 +149,8 @@ export class AdvancedSearchDatasetsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||||
console.info("queryChanged: Execute search query "+parameters);
|
console.info("queryChanged: Execute search query "+parameters);
|
||||||
|
|
|
@ -20,13 +20,17 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||||
(queryChange)="queryChanged($event)"
|
(queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/organizations"
|
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/organizations"
|
||||||
[disableForms]="disableForms">
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults">
|
||||||
</advanced-search-page>
|
</advanced-search-page>
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AdvancedSearchOrganizationsComponent {
|
export class AdvancedSearchOrganizationsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
|
@ -37,25 +41,31 @@ export class AdvancedSearchOrganizationsComponent {
|
||||||
public selectedFields:AdvancedField[] = [];
|
public selectedFields:AdvancedField[] = [];
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||||
|
|
||||||
public resourcesQuery = "(oaftype exact organization)";
|
public resourcesQuery = "(oaftype exact organization)";
|
||||||
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
|
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
|
||||||
|
|
||||||
this.results =[];
|
this.results =[];
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedOrganizations;
|
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedOrganizations;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
|
||||||
let page = (params['page']=== undefined)?1:+params['page'];
|
let page = (params['page']=== undefined)?1:+params['page'];
|
||||||
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
||||||
this.searchPage.fieldIds = this.fieldIds;
|
this.searchPage.fieldIds = this.fieldIds;
|
||||||
|
@ -78,8 +88,8 @@ public resourcesQuery = "(oaftype exact organization)";
|
||||||
this.csvParams ="&type=organizations&query="+this.resourcesQuery;
|
this.csvParams ="&type=organizations&query="+this.resourcesQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -92,15 +102,15 @@ public resourcesQuery = "(oaftype exact organization)";
|
||||||
console.info("search Organizations total="+this.searchUtils.totalResults);
|
console.info("search Organizations total="+this.searchUtils.totalResults);
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.updateBaseUrlWithParameters();
|
this.searchPage.updateBaseUrlWithParameters();
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -108,7 +118,7 @@ public resourcesQuery = "(oaftype exact organization)";
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -119,8 +129,16 @@ public resourcesQuery = "(oaftype exact organization)";
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = errorCodes.ERROR;
|
// this.searchUtils.status = errorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
//this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
|
@ -131,6 +149,8 @@ public resourcesQuery = "(oaftype exact organization)";
|
||||||
}
|
}
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||||
console.info("queryChanged: Execute search query "+parameters);
|
console.info("queryChanged: Execute search query "+parameters);
|
||||||
|
|
|
@ -19,19 +19,22 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||||
(queryChange)="queryChanged($event)"
|
(queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/projects"
|
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/projects"
|
||||||
[disableForms]="disableForms">
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults">
|
||||||
</advanced-search-page>
|
</advanced-search-page>
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AdvancedSearchProjectsComponent {
|
export class AdvancedSearchProjectsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
|
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
|
public searchFields:SearchFields = new SearchFields();
|
||||||
public searchFields:SearchFields = new SearchFields();
|
|
||||||
|
|
||||||
public fieldIds: string[] = this.searchFields.PROJECT_ADVANCED_FIELDS;
|
public fieldIds: string[] = this.searchFields.PROJECT_ADVANCED_FIELDS;
|
||||||
public fieldIdsMap = this.searchFields.PROJECT_FIELDS;
|
public fieldIdsMap = this.searchFields.PROJECT_FIELDS;
|
||||||
|
@ -41,21 +44,28 @@ export class AdvancedSearchProjectsComponent {
|
||||||
public resourcesQuery = "(oaftype exact project)";
|
public resourcesQuery = "(oaftype exact project)";
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) {
|
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) {
|
||||||
|
|
||||||
this.results =[];
|
this.results =[];
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedProjects;
|
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedProjects;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
let page = (params['page']=== undefined)?1:+params['page'];
|
let page = (params['page']=== undefined)?1:+params['page'];
|
||||||
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
||||||
this.searchPage.fieldIds = this.fieldIds;
|
this.searchPage.fieldIds = this.fieldIds;
|
||||||
|
@ -78,8 +88,8 @@ export class AdvancedSearchProjectsComponent {
|
||||||
this.csvParams ="&type=projects&query="+this.resourcesQuery;
|
this.csvParams ="&type=projects&query="+this.resourcesQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -92,15 +102,15 @@ export class AdvancedSearchProjectsComponent {
|
||||||
console.info("Advanced Search for Projects total="+this.searchUtils.totalResults);
|
console.info("Advanced Search for Projects total="+this.searchUtils.totalResults);
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.updateBaseUrlWithParameters();
|
this.searchPage.updateBaseUrlWithParameters();
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -108,7 +118,7 @@ export class AdvancedSearchProjectsComponent {
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -119,8 +129,16 @@ export class AdvancedSearchProjectsComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = errorCodes.ERROR;
|
// this.searchUtils.status = errorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
//this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
|
@ -132,6 +150,8 @@ export class AdvancedSearchProjectsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||||
console.info("queryChanged: Execute search query "+parameters);
|
console.info("queryChanged: Execute search query "+parameters);
|
||||||
|
|
|
@ -20,24 +20,30 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||||
(queryChange)="queryChanged($event)"
|
(queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/publications"
|
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/publications"
|
||||||
[disableForms]="disableForms">
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults">
|
||||||
</advanced-search-page>
|
</advanced-search-page>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AdvancedSearchPublicationsComponent {
|
export class AdvancedSearchPublicationsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
|
||||||
|
|
||||||
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
public searchFields:SearchFields = new SearchFields();
|
public searchFields:SearchFields = new SearchFields();
|
||||||
|
|
||||||
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
|
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
|
||||||
public fieldIdsMap= this.searchFields.RESULT_FIELDS;
|
public fieldIdsMap= this.searchFields.RESULT_FIELDS;
|
||||||
public selectedFields:AdvancedField[] = [];
|
public selectedFields:AdvancedField[] = [];
|
||||||
public resourcesQuery = "((oaftype exact result) and (resulttypeid exact publication))";
|
public resourcesQuery = "((oaftype exact result) and (resulttypeid exact publication))";
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||||
|
|
||||||
|
@ -45,17 +51,22 @@ export class AdvancedSearchPublicationsComponent {
|
||||||
constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) {
|
constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) {
|
||||||
|
|
||||||
this.results =[];
|
this.results =[];
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedPublications;
|
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedPublications;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
let page = (params['page']=== undefined)?1:+params['page'];
|
let page = (params['page']=== undefined)?1:+params['page'];
|
||||||
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
this.searchUtils.page = ( page <= 0 ) ? 1 : page;
|
||||||
this.searchPage.fieldIds = this.fieldIds;
|
this.searchPage.fieldIds = this.fieldIds;
|
||||||
|
@ -64,8 +75,7 @@ export class AdvancedSearchPublicationsComponent {
|
||||||
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
||||||
|
|
||||||
this.searchPage.getSelectedFiltersFromUrl(params);
|
this.searchPage.getSelectedFiltersFromUrl(params);
|
||||||
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size);
|
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -79,8 +89,8 @@ export class AdvancedSearchPublicationsComponent {
|
||||||
this.csvParams ="&type=publications&query="+this.resourcesQuery;
|
this.csvParams ="&type=publications&query="+this.resourcesQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -93,15 +103,15 @@ export class AdvancedSearchPublicationsComponent {
|
||||||
console.info("searchPubl total="+this.searchUtils.totalResults);
|
console.info("searchPubl total="+this.searchUtils.totalResults);
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.updateBaseUrlWithParameters();
|
this.searchPage.updateBaseUrlWithParameters();
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -109,7 +119,7 @@ export class AdvancedSearchPublicationsComponent {
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -120,8 +130,16 @@ export class AdvancedSearchPublicationsComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
//this.searchUtils.status = errorCodes.NOT_AVAILABLE;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
|
@ -130,6 +148,8 @@ export class AdvancedSearchPublicationsComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||||
console.info("queryChanged: Execute search query "+parameters);
|
console.info("queryChanged: Execute search query "+parameters);
|
||||||
|
|
|
@ -31,6 +31,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchCompatibleDataprovidersComponent {
|
export class SearchCompatibleDataprovidersComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -55,8 +56,8 @@ export class SearchCompatibleDataprovidersComponent {
|
||||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchCompatibleDataProviders();
|
this.baseUrl = OpenaireProperties.getLinkToSearchCompatibleDataProviders();
|
||||||
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
||||||
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
||||||
|
@ -91,8 +92,8 @@ export class SearchCompatibleDataprovidersComponent {
|
||||||
private _getResults(parameters:string,refine:boolean, page: number, size: number){
|
private _getResults(parameters:string,refine:boolean, page: number, size: number){
|
||||||
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
|
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -105,10 +106,10 @@ export class SearchCompatibleDataprovidersComponent {
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
@ -120,8 +121,16 @@ export class SearchCompatibleDataprovidersComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchCompatibleDataprovidersTableComponent {
|
export class SearchCompatibleDataprovidersTableComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -48,8 +50,8 @@ export class SearchCompatibleDataprovidersTableComponent {
|
||||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchCompatibleDataProvidersTable();
|
this.baseUrl = OpenaireProperties.getLinkToSearchCompatibleDataProvidersTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,8 +76,8 @@ export class SearchCompatibleDataprovidersTableComponent {
|
||||||
private _getResults(){
|
private _getResults(){
|
||||||
//this.csvParams = this.resourcesQuery+"&type=datasources";
|
//this.csvParams = this.resourcesQuery+"&type=datasources";
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
|
@ -93,10 +95,10 @@ export class SearchCompatibleDataprovidersTableComponent {
|
||||||
|
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
},
|
},
|
||||||
|
@ -106,8 +108,16 @@ export class SearchCompatibleDataprovidersTableComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -115,8 +125,8 @@ export class SearchCompatibleDataprovidersTableComponent {
|
||||||
} else {
|
} else {
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -126,8 +136,15 @@ export class SearchCompatibleDataprovidersTableComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchEntityRegistriesComponent {
|
export class SearchEntityRegistriesComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -55,8 +57,8 @@ export class SearchEntityRegistriesComponent {
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchEntityRegistries();
|
this.baseUrl = OpenaireProperties.getLinkToSearchEntityRegistries();
|
||||||
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
||||||
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
||||||
|
@ -91,8 +93,8 @@ export class SearchEntityRegistriesComponent {
|
||||||
private _getResults(parameters:string,refine:boolean, page: number, size: number){
|
private _getResults(parameters:string,refine:boolean, page: number, size: number){
|
||||||
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
|
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -105,10 +107,10 @@ export class SearchEntityRegistriesComponent {
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
@ -120,8 +122,16 @@ export class SearchEntityRegistriesComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchEntityRegistriesTableComponent {
|
export class SearchEntityRegistriesTableComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -41,8 +43,8 @@ export class SearchEntityRegistriesTableComponent {
|
||||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
|
@ -65,8 +67,8 @@ export class SearchEntityRegistriesTableComponent {
|
||||||
this.subResults.unsubscribe();
|
this.subResults.unsubscribe();
|
||||||
} }
|
} }
|
||||||
private _getResults(parameters:string,refine:boolean, page: number){
|
private _getResults(parameters:string,refine:boolean, page: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
|
@ -83,10 +85,10 @@ export class SearchEntityRegistriesTableComponent {
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
|
@ -97,8 +99,16 @@ export class SearchEntityRegistriesTableComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -106,8 +116,8 @@ export class SearchEntityRegistriesTableComponent {
|
||||||
} else {
|
} else {
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -117,8 +127,15 @@ export class SearchEntityRegistriesTableComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -29,6 +29,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchJournalsComponent {
|
export class SearchJournalsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -54,8 +56,8 @@ export class SearchJournalsComponent {
|
||||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchJournals();
|
this.baseUrl = OpenaireProperties.getLinkToSearchJournals();
|
||||||
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
||||||
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
||||||
|
@ -90,8 +92,8 @@ export class SearchJournalsComponent {
|
||||||
private _getResults(parameters:string,refine:boolean, page: number, size: number){
|
private _getResults(parameters:string,refine:boolean, page: number, size: number){
|
||||||
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
|
this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -104,10 +106,10 @@ export class SearchJournalsComponent {
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
@ -119,8 +121,16 @@ export class SearchJournalsComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchJournalsTableComponent {
|
export class SearchJournalsTableComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -48,8 +50,8 @@ export class SearchJournalsTableComponent {
|
||||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchJournalsTable();
|
this.baseUrl = OpenaireProperties.getLinkToSearchJournalsTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,8 +76,8 @@ export class SearchJournalsTableComponent {
|
||||||
private _getResults(){
|
private _getResults(){
|
||||||
//this.csvParams = this.resourcesQuery+"&type=datasources";
|
//this.csvParams = this.resourcesQuery+"&type=datasources";
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
|
@ -93,10 +95,10 @@ export class SearchJournalsTableComponent {
|
||||||
|
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
},
|
},
|
||||||
|
@ -106,8 +108,16 @@ export class SearchJournalsTableComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -115,8 +125,8 @@ export class SearchJournalsTableComponent {
|
||||||
} else {
|
} else {
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -126,8 +136,15 @@ export class SearchJournalsTableComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -142,8 +142,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
public searchPublications() {
|
public searchPublications() {
|
||||||
this.activeTab = "publications";
|
this.activeTab = "publications";
|
||||||
if( this.reloadPublications &&
|
if( this.reloadPublications &&
|
||||||
this.fetchPublications.searchUtils.status != this.errorCodes.NONE &&
|
( this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
this.fetchPublications.searchUtils.status != this.errorCodes.ERROR) {
|
this.fetchPublications.searchUtils.status == this.errorCodes.DONE )) {
|
||||||
this.reloadPublications = false;
|
this.reloadPublications = false;
|
||||||
this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10);
|
this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10);
|
||||||
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications();// + "?keyword=" + this.keyword;
|
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications();// + "?keyword=" + this.keyword;
|
||||||
|
@ -152,8 +152,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
public searchDatasets() {
|
public searchDatasets() {
|
||||||
this.activeTab = "research data";
|
this.activeTab = "research data";
|
||||||
if(this.reloadDatasets &&
|
if(this.reloadDatasets &&
|
||||||
this.fetchDatasets.searchUtils.status != this.errorCodes.NONE &&
|
( this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR) {
|
this.fetchDatasets.searchUtils.status == this.errorCodes.DONE )) {
|
||||||
this.reloadDatasets = false;
|
this.reloadDatasets = false;
|
||||||
this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10);
|
this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10);
|
||||||
this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets();// + "?keyword=" + this.keyword;
|
this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets();// + "?keyword=" + this.keyword;
|
||||||
|
@ -163,8 +163,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
this.activeTab = "projects";
|
this.activeTab = "projects";
|
||||||
console.log("searchProjects");
|
console.log("searchProjects");
|
||||||
if(this.reloadProjects &&
|
if(this.reloadProjects &&
|
||||||
this.fetchProjects.searchUtils.status != this.errorCodes.NONE &&
|
( this.fetchProjects.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
this.fetchProjects.searchUtils.status != this.errorCodes.ERROR) {
|
this.fetchProjects.searchUtils.status == this.errorCodes.DONE )) {
|
||||||
this.reloadProjects = false;
|
this.reloadProjects = false;
|
||||||
console.log("do the search searchProjects");
|
console.log("do the search searchProjects");
|
||||||
|
|
||||||
|
@ -175,8 +175,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
public searchDataProviders() {
|
public searchDataProviders() {
|
||||||
this.activeTab = "content providers";
|
this.activeTab = "content providers";
|
||||||
if( this.reloadDataproviders &&
|
if( this.reloadDataproviders &&
|
||||||
this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE &&
|
( this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
this.fetchDataproviders.searchUtils.status != this.errorCodes.ERROR) {
|
this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE )) {
|
||||||
this.reloadDataproviders = false;
|
this.reloadDataproviders = false;
|
||||||
this.fetchDataproviders.getResultsByKeyword(this.keyword, 1, 10);
|
this.fetchDataproviders.getResultsByKeyword(this.keyword, 1, 10);
|
||||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();// + "?keyword=" + this.keyword;
|
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();// + "?keyword=" + this.keyword;
|
||||||
|
@ -185,8 +185,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
public searchOrganizations() {
|
public searchOrganizations() {
|
||||||
this.activeTab = "organizations";
|
this.activeTab = "organizations";
|
||||||
if( this.reloadOrganizations &&
|
if( this.reloadOrganizations &&
|
||||||
this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE &&
|
( this.fetchOrganizations.searchUtils.status == this.errorCodes.LOADING ||
|
||||||
this.fetchOrganizations.searchUtils.status != this.errorCodes.ERROR) {
|
this.fetchOrganizations.searchUtils.status == this.errorCodes.DONE )) {
|
||||||
this.reloadOrganizations = false;
|
this.reloadOrganizations = false;
|
||||||
this.fetchOrganizations.getResultsByKeyword(this.keyword, 1, 10);
|
this.fetchOrganizations.getResultsByKeyword(this.keyword, 1, 10);
|
||||||
this.linkToSearchOrganizations = OpenaireProperties.getLinkToSearchOrganizations();// + "?keyword=" + this.keyword;
|
this.linkToSearchOrganizations = OpenaireProperties.getLinkToSearchOrganizations();// + "?keyword=" + this.keyword;
|
||||||
|
@ -234,7 +234,14 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
this.fetchPublications.searchUtils.status = this.errorCodes.ERROR;
|
if(err.status == '404') {
|
||||||
|
this.fetchPublications.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.fetchPublications.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.fetchPublications.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
//this.fetchPublications.searchUtils.status = this.errorCodes.ERROR;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -251,7 +258,14 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
this.fetchDatasets.searchUtils.status = this.errorCodes.ERROR;
|
if(err.status == '404') {
|
||||||
|
this.fetchDatasets.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.fetchDatasets.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.fetchDatasets.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
//this.fetchDatasets.searchUtils.status = this.errorCodes.ERROR;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -268,7 +282,14 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
this.fetchProjects.searchUtils.status = this.errorCodes.ERROR;
|
if(err.status == '404') {
|
||||||
|
this.fetchProjects.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.fetchProjects.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.fetchProjects.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
//this.fetchProjects.searchUtils.status = this.errorCodes.ERROR;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -289,7 +310,14 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
this.fetchOrganizations.searchUtils.status = this.errorCodes.ERROR;
|
if(err.status == '404') {
|
||||||
|
this.fetchOrganizations.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.fetchOrganizations.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.fetchOrganizations.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
//this.fetchOrganizations.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<helper position="top"></helper>
|
<helper position="top"></helper>
|
||||||
</div>
|
</div>
|
||||||
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
<search-paging [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(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 class="uk-width-1-1 uk-grid helper-grid" >
|
<div class="uk-width-1-1 uk-grid helper-grid" >
|
||||||
|
|
|
@ -31,6 +31,9 @@ export class AdvancedSearchPageComponent {
|
||||||
@Input() csvPath: string;
|
@Input() csvPath: string;
|
||||||
@Input() simpleSearchLink: string = "";
|
@Input() simpleSearchLink: string = "";
|
||||||
@Input() disableForms:boolean = false;
|
@Input() disableForms:boolean = false;
|
||||||
|
@Input() loadPaging: boolean = true;
|
||||||
|
@Input() oldTotalResults: number = 0;
|
||||||
|
|
||||||
piwiksub: any;
|
piwiksub: any;
|
||||||
public parameterNames:string[] =[];
|
public parameterNames:string[] =[];
|
||||||
public parameterValues:string[] =[];
|
public parameterValues:string[] =[];
|
||||||
|
|
|
@ -14,10 +14,12 @@ import {SearchUtilsClass} from '../searchUtils/searchUtils.class';
|
||||||
selector: 'browse-entities',
|
selector: 'browse-entities',
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<div *ngIf="status == errorCodes.LOADING" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<!--div *ngIf="status == errorCodes.LOADING" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></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.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" role="alert">Service temprorarily unavailable. Please try again later.</div>
|
||||||
|
<div *ngIf="status == errorCodes.NOT_FOUND" class="uk-alert uk-alert-danger" role="alert">No filters found</div-->
|
||||||
|
<errorMessages [status]="[status]" [type]="'results'"></errorMessages>
|
||||||
|
|
||||||
<div class ="uk-grid">
|
<div class ="uk-grid">
|
||||||
<div *ngFor= "let filter of filters" class = "uk-margin-bottom uk-width-1-4@l uk-width-1-3@m uk-width-1-2@s">
|
<div *ngFor= "let filter of filters" class = "uk-margin-bottom uk-width-1-4@l uk-width-1-3@m uk-width-1-2@s">
|
||||||
|
@ -81,7 +83,14 @@ private getStats(){
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
this.status = this.errorCodes.ERROR;
|
//this.status = this.errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,11 @@ import {RefineFieldResultsServiceModule} from '../../services/refineFieldResults
|
||||||
import {BrowseEntitiesComponent} from './browseEntities.component';
|
import {BrowseEntitiesComponent} from './browseEntities.component';
|
||||||
import {BrowseStatisticComponent} from './browseStatistic.component';
|
import {BrowseStatisticComponent} from './browseStatistic.component';
|
||||||
|
|
||||||
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule,
|
CommonModule, FormsModule, ErrorMessagesModule,
|
||||||
RefineFieldResultsServiceModule, RouterModule
|
RefineFieldResultsServiceModule, RouterModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'search-download',
|
selector: 'search-download',
|
||||||
template: `
|
template: `
|
||||||
<span class="uk-margin-large-right" *ngIf="totalResults <= 10000">
|
<span class="uk-margin-large-right" *ngIf="totalResults > 0 && totalResults <= 10000">
|
||||||
<span class="clickable" (click)="downloadfile(downloadURLAPI+type+'?format=csv&page=0&size='+totalResults+csvParams,type+'-report-'+totalResults)">
|
<span class="clickable" (click)="downloadfile(downloadURLAPI+type+'?format=csv&page=0&size='+totalResults+csvParams,type+'-report-'+totalResults)">
|
||||||
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
||||||
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> (CSV)
|
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> (CSV)
|
||||||
|
|
|
@ -1,66 +1,66 @@
|
||||||
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
||||||
<div uk-grid uk-grid>
|
<div uk-grid uk-grid>
|
||||||
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
||||||
<div class="">
|
<div class="">
|
||||||
|
|
||||||
<div [class]="'uk-background-norepeat uk-background-cover uk-section uk-flex uk-flex-middle uk- light '+searchFormClass" >
|
<div [class]="'uk-background-norepeat uk-background-cover uk-section uk-flex uk-flex-middle uk- light '+searchFormClass" >
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<search-form [isDisabled]="disableForms" [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)" [placeholderText]="formPlaceholderText"></search-form>
|
<search-form [isDisabled]="disableForms" [(keyword)]="searchUtils.keyword" (keywordChange)="keywordChanged($event)" [placeholderText]="formPlaceholderText"></search-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-1 ">
|
<div class="uk-width-1-1 ">
|
||||||
<!--link to advanced search -->
|
<!--link to advanced search -->
|
||||||
<a *ngIf = "advancedSearchLink && advancedSearchLink.length > 0" routerLinkActive="router-link-active" [class]="(disableForms)?'uk-float-right uk-disabled uk-link-muted uk-light ':'uk-float-right uk-light'" [routerLink]=advancedSearchLink >More search options <span class="uk-icon">
|
<a *ngIf = "advancedSearchLink && advancedSearchLink.length > 0" routerLinkActive="router-link-active" [class]="(disableForms)?'uk-float-right uk-disabled uk-link-muted uk-light ':'uk-float-right uk-light'" [routerLink]=advancedSearchLink >More search options <span class="uk-icon">
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-right" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-right" ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<div *ngIf="isFiltered()" class = "uk-container uk-width-1-2@m uk-width-1-2@s uk-align-center uk-text-center uk-text-small">
|
<div *ngIf="isFiltered()" class = "uk-container uk-width-1-2@m uk-width-1-2@s uk-align-center uk-text-center uk-text-small">
|
||||||
<span *ngIf = "searchUtils.keyword.length > 0">Keywords: <span [innerHtml]="searchUtils.keyword"></span><a (click) = "clearKeywords() " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable " aria-hidden="true"><span class="uk-icon">
|
<span *ngIf = "searchUtils.keyword.length > 0">Keywords: <span [innerHtml]="searchUtils.keyword"></span><a (click) = "clearKeywords() " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable " aria-hidden="true"><span class="uk-icon">
|
||||||
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
|
||||||
|
</span></span></a>
|
||||||
|
</span>
|
||||||
|
<span *ngFor="let filter of filters " >
|
||||||
|
<span *ngIf = "filter.countSelectedValues > 0"> {{filter.title}}:
|
||||||
|
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " ><span [innerHtml]="(value.name.length > 25)?value.name.substring(0,25)+'...':value.name" title="value.name"></span><a (click) = "removeFilter(value, filter) " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable" aria-hidden="true"><span class="uk-icon">
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
|
||||||
</span></span></a>
|
</span></span></a>
|
||||||
</span>
|
<span *ngIf="!end">, </span>
|
||||||
<span *ngFor="let filter of filters " >
|
|
||||||
<span *ngIf = "filter.countSelectedValues > 0"> {{filter.title}}:
|
|
||||||
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " ><span [innerHtml]="(value.name.length > 25)?value.name.substring(0,25)+'...':value.name" title="value.name"></span><a (click) = "removeFilter(value, filter) " [class]="(disableForms)?'uk-icon-button uk-disabled':'uk-icon-button'"><span class=" clickable" aria-hidden="true"><span class="uk-icon">
|
|
||||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="close" ratio="1"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>
|
|
||||||
</span></span></a>
|
|
||||||
<span *ngIf="!end">, </span>
|
|
||||||
</span>
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
<a (click)="clearFilters()" [class]="(disableForms)?'uk-disabled uk-link-muted':''">
|
<a (click)="clearFilters()" [class]="(disableForms)?'uk-disabled uk-link-muted':''">
|
||||||
Clear All
|
Clear All
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf= "showUnknownFilters" class = " uk-text-center ">
|
<div *ngIf= "showUnknownFilters" class = " uk-text-center ">
|
||||||
<a (click) = "clearFilters() " >Try new Query</a>
|
<a (click) = "clearFilters() " >Try new Query</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="uk-container">
|
||||||
|
<helper position="top"></helper>
|
||||||
|
<div [class]="(showRefine)?'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s uk-align-center uk-margin-remove-bottom':'uk-width-1-1'">
|
||||||
|
<div *ngIf="showRefine" class="uk-offcanvas-content uk-hidden@m">
|
||||||
|
|
||||||
|
<a href="#offcanvas-usage" uk-toggle><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect><rect x="6" y="14" width="12" height="1"></rect><rect x="2" y="4" width="2" height="1"></rect><rect x="2" y="9" width="2" height="1"></rect><rect x="2" y="14" width="2" height="1"></rect></svg></a>
|
||||||
|
|
||||||
|
<div id="offcanvas-usage" uk-offcanvas>
|
||||||
|
<div class="uk-offcanvas-bar">
|
||||||
|
<button class="uk-offcanvas-close" type="button" uk-close></button>
|
||||||
|
<div class="uk-text-large">Filter By:</div>
|
||||||
|
<search-filter *ngFor="let filter of filters " [addShowMore]=false [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="uk-container">
|
|
||||||
<helper position="top"></helper>
|
|
||||||
<div [class]="(showRefine)?'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s uk-align-center uk-margin-remove-bottom':'uk-width-1-1'">
|
|
||||||
<div *ngIf="showRefine" class="uk-offcanvas-content uk-hidden@m">
|
|
||||||
|
|
||||||
<a href="#offcanvas-usage" uk-toggle><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect><rect x="6" y="14" width="12" height="1"></rect><rect x="2" y="4" width="2" height="1"></rect><rect x="2" y="9" width="2" height="1"></rect><rect x="2" y="14" width="2" height="1"></rect></svg></a>
|
<search-paging [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
||||||
|
|
||||||
<div id="offcanvas-usage" uk-offcanvas>
|
</div>
|
||||||
<div class="uk-offcanvas-bar">
|
<div class="uk-grid uk-width-1-1 uk-margin">
|
||||||
<button class="uk-offcanvas-close" type="button" uk-close></button>
|
|
||||||
<div class="uk-text-large">Filter By:</div>
|
|
||||||
<search-filter *ngFor="let filter of filters " [addShowMore]=false [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="uk-grid uk-width-1-1 uk-margin">
|
|
||||||
<div *ngIf="showRefine" class=" search-filters uk-width-1-5@l uk-width-1-5@m uk-width-1-1@s uk-visible@m">
|
<div *ngIf="showRefine" class=" search-filters uk-width-1-5@l uk-width-1-5@m uk-width-1-1@s uk-visible@m">
|
||||||
<helper position="left"></helper>
|
<helper position="left"></helper>
|
||||||
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
||||||
|
@ -78,30 +78,30 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="tableViewLink || searchUtils.totalResults <=10000" class=" search-filters uk-width-1-5@l uk-width-1-5@m uk-width-1-1@s uk-visible@m">
|
<div *ngIf="tableViewLink || searchUtils.totalResults <=10000" class="uk-width-1-5@l uk-width-1-5@m uk-width-1-1@s uk-visible@m">
|
||||||
<span *ngIf="tableViewLink" class="uk-margin-medium-right">
|
<span *ngIf="tableViewLink" class="uk-margin-medium-right">
|
||||||
<a routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=tableViewLink >
|
<a routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=tableViewLink >
|
||||||
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg></span>
|
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
|
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
|
||||||
</span>
|
</span>
|
||||||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"></search-download>
|
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"></search-download>
|
||||||
<helper position="right"></helper>
|
<helper position="right"></helper>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!(tableViewLink || searchUtils.totalResults <=10000)" class=" search-filters uk-width-1-5@l uk-width-1-5@m uk-width-1-1@s uk-visible@m">
|
<div *ngIf="!(tableViewLink || searchUtils.totalResults <=10000)" class=" search-filters uk-width-1-5@l uk-width-1-5@m uk-width-1-1@s uk-visible@m">
|
||||||
<helper position="right"></helper>
|
<helper position="right"></helper>
|
||||||
</div>
|
</div>
|
||||||
<div [class]="(showRefine)?'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s uk-align-center uk-margin-remove-bottom':'uk-width-1-1'">
|
</div>
|
||||||
<search-paging [type]="type" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
<div [class]="(showRefine)?'uk-width-3-5@m uk-width-3-5@l uk-width-1-1@s uk-align-center uk-margin-remove-bottom':'uk-width-1-1'">
|
||||||
</div>
|
<search-paging [loadPaging]="loadPaging" [type]="type" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
||||||
<div class="uk-width-1-1">
|
</div>
|
||||||
<helper position="bottom"></helper>
|
<div class="uk-width-1-1">
|
||||||
</div>
|
<helper position="bottom"></helper>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -40,6 +40,8 @@ export class SearchPageComponent {
|
||||||
@Input() advancedSearchLink: string = "";
|
@Input() advancedSearchLink: string = "";
|
||||||
@Input() tableViewLink: string;
|
@Input() tableViewLink: string;
|
||||||
@Input() disableForms: boolean = false;
|
@Input() disableForms: boolean = false;
|
||||||
|
@Input() loadPaging: boolean = true;
|
||||||
|
@Input() oldTotalResults: number = 0;
|
||||||
@Input() tableView: boolean = false;
|
@Input() tableView: boolean = false;
|
||||||
@Input() searchFormClass: string = "searchForm";
|
@Input() searchFormClass: string = "searchForm";
|
||||||
@ViewChild (ModalLoading) loading : ModalLoading ;
|
@ViewChild (ModalLoading) loading : ModalLoading ;
|
||||||
|
@ -118,12 +120,15 @@ export class SearchPageComponent {
|
||||||
public getQueryParametersFromUrl(params){
|
public getQueryParametersFromUrl(params){
|
||||||
// var parameters = "";
|
// var parameters = "";
|
||||||
var allFqs = "";
|
var allFqs = "";
|
||||||
|
|
||||||
this.queryParameters = new Map<string,string>();
|
this.queryParameters = new Map<string,string>();
|
||||||
|
|
||||||
for(var i=0; i< this.refineFields.length ; i++){
|
for(var i=0; i< this.refineFields.length ; i++){
|
||||||
var filterId = this.refineFields[i];
|
var filterId = this.refineFields[i];
|
||||||
|
|
||||||
if(params[filterId] != undefined) {
|
if(params[filterId] != undefined) {
|
||||||
this.queryParameters[filterId]=StringUtils.URIDecode(params[filterId]);
|
this.queryParameters[filterId]=StringUtils.URIDecode(params[filterId]);
|
||||||
|
|
||||||
let values = (StringUtils.URIDecode(this.queryParameters[filterId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1);
|
let values = (StringUtils.URIDecode(this.queryParameters[filterId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1);
|
||||||
var countvalues = 0;
|
var countvalues = 0;
|
||||||
var fq = "";
|
var fq = "";
|
||||||
|
@ -138,8 +143,6 @@ export class SearchPageComponent {
|
||||||
}
|
}
|
||||||
allFqs += fq;
|
allFqs += fq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
var keyword = params['keyword'];
|
var keyword = params['keyword'];
|
||||||
var doiQuery = "";
|
var doiQuery = "";
|
||||||
|
|
|
@ -32,12 +32,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-container">
|
<div class="uk-container">
|
||||||
<div *ngIf="searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade uk-margin-top" role="alert">No Results found</div>
|
<!--div *ngIf="searchUtils.status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade uk-margin-top" role="alert">No Results found</div>
|
||||||
<div *ngIf="searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade uk-margin-top" role="alert">An Error Occured</div>
|
<div *ngIf="searchUtils.status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade uk-margin-top" role="alert">An Error Occured</div>
|
||||||
<div *ngIf="searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade uk-margin-top" role="alert">Service not available</div>
|
<div *ngIf="searchUtils.status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade uk-margin-top" role="alert">Service not available</div>
|
||||||
<div *ngIf="searchUtils.status == errorCodes.LOADING" class="uk-alert uk-alert-primary uk-animation-fade uk-margin-top" role="alert"
|
<div *ngIf="searchUtils.status == errorCodes.LOADING" class="uk-alert uk-alert-primary uk-animation-fade uk-margin-top" role="alert"
|
||||||
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading">
|
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading">
|
||||||
</div>
|
</div-->
|
||||||
|
<errorMessages [status]="[searchUtils.status]" [type]="'results'"></errorMessages>
|
||||||
|
|
||||||
<div class="uk-grid uk-width-1-1 uk-margin">
|
<div class="uk-grid uk-width-1-1 uk-margin">
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<helper position="top"></helper>
|
<helper position="top"></helper>
|
||||||
|
@ -55,18 +57,18 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="searchUtils.totalResults > 0" class=" search-filters uk-width-1-4@l uk-width-1-4@m uk-width-1-1@s uk-margin-large-top uk-visible@m">
|
<div *ngIf="searchUtils.totalResults > 0" class=" search-filters uk-width-1-5@l uk-width-1-5@m uk-width-1-1@s uk-margin-large-top uk-visible@m">
|
||||||
<helper position="left"></helper>
|
<helper position="left"></helper>
|
||||||
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (toggleModal)="toggleModal($event)"></search-filter>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="uk-width-3-4@m uk-width-3-4@l uk-width-1-1@s uk-first-column" >
|
<div class="uk-width-expand@m uk-width-1-1@s uk-first-column" >
|
||||||
<div class="uk-overflow-container custom-dataTable-content">
|
<div class="uk-overflow-container custom-dataTable-content">
|
||||||
<table class="uk-table uk-table-striped divider-table" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
|
<table class="uk-table uk-table-striped divider-table" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage"
|
||||||
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe]">
|
[mfData]="results | contentProvidersDatatable : [searchUtils, filters, triggerPipe]">
|
||||||
|
|
||||||
<thead *ngIf="searchUtils.totalResults > 0">
|
<thead *ngIf="searchUtils.totalResults > 0">
|
||||||
<tr><td colspan="5" class="uk-padding-remove-bottom uk-padding-remove-right">
|
<tr><td colspan="5" class="uk-padding-remove">
|
||||||
<span class="uk-h6">
|
<span class="uk-h6">
|
||||||
{{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
|
{{searchUtils.totalResults}} content providers, page {{searchUtils.page}} of {{(totalPages())}}
|
||||||
</span>
|
</span>
|
||||||
|
@ -75,16 +77,6 @@
|
||||||
<!--tr><td colspan="5" class="uk-padding-remove">
|
<!--tr><td colspan="5" class="uk-padding-remove">
|
||||||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
|
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" (downloadClick)="downloadClicked($event)"></search-download>
|
||||||
</td></tr-->
|
</td></tr-->
|
||||||
<tr *ngIf="searchViewLink"><td colspan="5" class="uk-padding-remove-top uk-padding-remove-right uk-text-right">
|
|
||||||
<p>
|
|
||||||
|
|
||||||
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg></span>
|
|
||||||
|
|
||||||
<a routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=searchViewLink >
|
|
||||||
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</td></tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<!-- Name Type Country Institution Compatibility -->
|
<!-- Name Type Country Institution Compatibility -->
|
||||||
|
@ -155,9 +147,17 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="searchViewLink" class="uk-margin-large-top uk-padding-remove-top uk-padding-remove-right uk-text-right">
|
||||||
|
<p>
|
||||||
|
|
||||||
|
<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg></span>
|
||||||
|
|
||||||
|
<a routerLinkActive="router-link-active" [class]="(disableForms)?'uk-disabled uk-link-muted':''" [routerLink]=searchViewLink >
|
||||||
|
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="table" ratio="1"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg></span>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<helper position="bottom"></helper>
|
<helper position="bottom"></helper>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,11 +23,13 @@ import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
|
||||||
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
|
import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard';
|
||||||
|
|
||||||
import {HelperModule} from '../../utils/helper/helper.module';
|
import {HelperModule} from '../../utils/helper/helper.module';
|
||||||
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule,
|
CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule,
|
||||||
ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule, DataTableModule, SearchFilterModule, PiwikServiceModule, HelperModule
|
ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule,
|
||||||
|
DataTableModule, SearchFilterModule, PiwikServiceModule, HelperModule, ErrorMessagesModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
SearchPageTableViewComponent//,
|
SearchPageTableViewComponent//,
|
||||||
|
|
|
@ -1,15 +1,22 @@
|
||||||
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
import {Component, Input, Output, EventEmitter} from '@angular/core';
|
||||||
import {Observable} from 'rxjs/Observable';
|
import {Observable} from 'rxjs/Observable';
|
||||||
|
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'search-paging',
|
selector: 'search-paging',
|
||||||
template: `
|
template: `
|
||||||
<div class= "searchPaging uk-panel uk-margin-top uk-grid">
|
<div class= "searchPaging uk-panel uk-margin-top uk-grid uk-margin-bottom uk-padding uk-padding-remove-vertical uk-padding-remove-left">
|
||||||
<div class="uk-h6 uk-margin-remove uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > 0">
|
<div class="uk-h6 uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > 0">
|
||||||
{{searchUtils.totalResults}} {{type}}, page {{searchUtils.page}} of {{(totalPages())}}
|
{{searchUtils.totalResults}} {{type}}, page {{searchUtils.page}} of {{(totalPages(searchUtils.totalResults))}}
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-1@s uk-width-1-2@m " *ngIf="results && searchUtils.totalResults > searchUtils.size">
|
<div class="uk-h6 uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
|
||||||
<paging [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl" [size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
|
{{oldTotalResults}} {{type}}, page {{searchUtils.page}} of {{(totalPages(oldTotalResults))}}
|
||||||
|
</div>
|
||||||
|
<div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="results && searchUtils.totalResults > searchUtils.size">
|
||||||
|
<paging class="uk-float-right" [currentPage]="searchUtils.page" [totalResults]="searchUtils.totalResults" [baseUrl]="baseUrl" [size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
|
||||||
|
</div>
|
||||||
|
<div class="uk-width-1-1@s uk-width-1-2@m" *ngIf="!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING">
|
||||||
|
<paging class="uk-float-right" [currentPage]="searchUtils.page" [totalResults]="oldTotalResults" [baseUrl]="baseUrl" [size]="searchUtils.size" [parameterNames] = "parameterNames" [parameterValues] = "parameterValues" > </paging>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -23,16 +30,24 @@ export class SearchPagingComponent {
|
||||||
@Input() parameterNames:string[];
|
@Input() parameterNames:string[];
|
||||||
@Input() parameterValues:string[];
|
@Input() parameterValues:string[];
|
||||||
|
|
||||||
|
@Input() loadPaging: boolean = true;
|
||||||
|
@Input() oldTotalResults: number = 0;
|
||||||
|
|
||||||
|
public totalResults: number = 0;
|
||||||
|
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
|
|
||||||
// @Input() totalResults:number = 0;
|
// @Input() totalResults:number = 0;
|
||||||
constructor () {
|
constructor () {}
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
// this.totalResults = this.searchUtils.totalResults;
|
||||||
|
// if(!this.loadPaging && this.totalResults == 0) {
|
||||||
|
// this.totalResults = this.oldTotalResults;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
totalPages(): number {
|
totalPages(totalResults: number): number {
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
totalPages = (parseInt(totalPages, 10) + 1);
|
totalPages = (parseInt(totalPages, 10) + 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
|
|
||||||
<ul [class]="'uk-list uk-list-divider uk-margin '+custom_class">
|
<ul [class]="'uk-list uk-list-divider uk-margin '+custom_class">
|
||||||
<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.OUT_OF_BOUND" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">Requested page out of bounds</div>
|
<div *ngIf="status == errorCodes.OUT_OF_BOUND" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">Requested page out of bounds</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-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
<div *ngIf="status == errorCodes.LOADING && showLoading" class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div-->
|
||||||
|
<errorMessages [status]="[status]" [type]="'results'"></errorMessages>
|
||||||
|
|
||||||
<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 >
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
import { NgModule} from '@angular/core';
|
import { NgModule} from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
import {SearchResult} from '../../utils/entities/searchResult';
|
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||||
import {SearchResultComponent} from './searchResult.component';
|
|
||||||
import { RouterModule } from '@angular/router';
|
import {SearchResult} from '../../utils/entities/searchResult';
|
||||||
|
import {SearchResultComponent} from './searchResult.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule, FormsModule,
|
CommonModule, FormsModule,
|
||||||
RouterModule
|
RouterModule, ErrorMessagesModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
SearchResultComponent,
|
SearchResultComponent,
|
||||||
|
|
|
@ -20,12 +20,16 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
(queryChange)="queryChanged($event)"
|
(queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="datasources" advancedSearchLink="/search/advanced/dataproviders"
|
[csvParams]="csvParams" csvPath="datasources" advancedSearchLink="/search/advanced/dataproviders"
|
||||||
[disableForms]="disableForms"
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults"
|
||||||
searchFormClass="datasourcesSearchForm">
|
searchFormClass="datasourcesSearchForm">
|
||||||
</search-page>
|
</search-page>
|
||||||
|
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class SearchDataprovidersComponent {
|
export class SearchDataprovidersComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public totalResults:number = 0 ;
|
public totalResults:number = 0 ;
|
||||||
|
@ -35,7 +39,7 @@ export class SearchDataprovidersComponent {
|
||||||
public _location:Location;
|
public _location:Location;
|
||||||
public searchFields:SearchFields = new SearchFields();
|
public searchFields:SearchFields = new SearchFields();
|
||||||
public refineFields: string[] = this.searchFields.DATASOURCE_REFINE_FIELDS;
|
public refineFields: string[] = this.searchFields.DATASOURCE_REFINE_FIELDS;
|
||||||
public fieldIdsMap= this.searchFields.DATASOURCE_FIELDS;
|
public fieldIdsMap= this.searchFields.DATASOURCE_FIELDS;
|
||||||
public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ],
|
public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ],
|
||||||
"export":[]
|
"export":[]
|
||||||
};
|
};
|
||||||
|
@ -43,12 +47,14 @@ export class SearchDataprovidersComponent {
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
|
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.page =1;
|
this.searchUtils.page =1;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchDataProviders();
|
this.baseUrl = OpenaireProperties.getLinkToSearchDataProviders();
|
||||||
}
|
}
|
||||||
|
@ -59,17 +65,22 @@ export class SearchDataprovidersComponent {
|
||||||
var firstLoad =true;
|
var firstLoad =true;
|
||||||
|
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
var refine = true;
|
this.loadPaging = false;
|
||||||
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
refine = false;
|
}
|
||||||
|
|
||||||
}
|
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||||
firstLoad = false;
|
var refine = true;
|
||||||
this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
|
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
||||||
|
refine = false;
|
||||||
|
|
||||||
var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
|
}
|
||||||
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
|
firstLoad = false;
|
||||||
|
this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
|
||||||
|
|
||||||
|
var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
|
||||||
|
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,8 +94,8 @@ export class SearchDataprovidersComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNumForEntity(entity: string, id:string) {
|
public getNumForEntity(entity: string, id:string) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
if(id != "" && entity != "") {
|
if(id != "" && entity != "") {
|
||||||
|
|
||||||
|
@ -92,10 +103,10 @@ export class SearchDataprovidersComponent {
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data;
|
this.searchUtils.totalResults = data;
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -104,25 +115,33 @@ export class SearchDataprovidersComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNumForSearch(keyword: string) {
|
public getNumForSearch(keyword: string) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this._searchDataprovidersService.numOfDataproviders(keyword).subscribe(
|
this._searchDataprovidersService.numOfDataproviders(keyword).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data;
|
this.searchUtils.totalResults = data;
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -131,8 +150,15 @@ export class SearchDataprovidersComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -148,10 +174,10 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
console.info("search Dataproviders forDeposit: [id:"+id+", type:"+type+" ] [total results:"+this.totalResults+"]");
|
console.info("search Dataproviders forDeposit: [id:"+id+", type:"+type+" ] [total results:"+this.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -160,8 +186,15 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -181,10 +214,10 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
console.info("search Dataproviders for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Dataproviders for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -193,8 +226,15 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -208,10 +248,10 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
console.info("search Dataproviders for Entity Registry: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Dataproviders for Entity Registry: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -220,8 +260,15 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -239,8 +286,8 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
// if(!refine && !this.searchPage){
|
// if(!refine && !this.searchPage){
|
||||||
// this.searchPage = new SearchPageComponent(this._location);
|
// this.searchPage = new SearchPageComponent(this._location);
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
|
@ -258,15 +305,15 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
// this.filters = this.searchPage.checkSelectedFilters(data[2]);
|
// this.filters = this.searchPage.checkSelectedFilters(data[2]);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -274,7 +321,7 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -284,8 +331,16 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
|
@ -297,6 +352,8 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
}
|
}
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,12 +22,16 @@ import {DOI} from '../../utils/string-utils.class';
|
||||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="datasets" advancedSearchLink="/search/advanced/datasets"
|
[csvParams]="csvParams" csvPath="datasets" advancedSearchLink="/search/advanced/datasets"
|
||||||
[disableForms]="disableForms"
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults"
|
||||||
searchFormClass="datasetsSearchForm">
|
searchFormClass="datasetsSearchForm">
|
||||||
</search-page>
|
</search-page>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
export class SearchDatasetsComponent {
|
export class SearchDatasetsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters: Filter[] =[];
|
public filters: Filter[] =[];
|
||||||
// public totalResults:number = 0 ;
|
// public totalResults:number = 0 ;
|
||||||
|
@ -43,12 +47,14 @@ export class SearchDatasetsComponent {
|
||||||
private _location:Location;
|
private _location:Location;
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||||
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
|
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.page =1;
|
this.searchUtils.page =1;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchDatasets();
|
this.baseUrl = OpenaireProperties.getLinkToSearchDatasets();
|
||||||
|
|
||||||
|
@ -60,6 +66,11 @@ export class SearchDatasetsComponent {
|
||||||
this.searchPage.type = "research data";
|
this.searchPage.type = "research data";
|
||||||
var firstLoad =true;
|
var firstLoad =true;
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||||
var refine = true;
|
var refine = true;
|
||||||
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
||||||
|
@ -99,10 +110,10 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
console.info("search Research Data for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Research Data for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -111,8 +122,15 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -134,10 +152,10 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
console.info("search Research Data for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Research Data for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -146,8 +164,15 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -175,8 +200,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
// if(!refine && !this.searchPage){
|
// if(!refine && !this.searchPage){
|
||||||
// this.searchPage = new SearchPageComponent(this._location);
|
// this.searchPage = new SearchPageComponent(this._location);
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -192,15 +217,15 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
}
|
}
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -208,7 +233,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -218,8 +243,16 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
|
@ -233,6 +266,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
}
|
}
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
//this.getResults(parameters, this.searchUtils.page, this.searchUtils.size, "searchPage");
|
//this.getResults(parameters, this.searchUtils.page, this.searchUtils.size, "searchPage");
|
||||||
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
||||||
|
|
|
@ -20,6 +20,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="organizations" advancedSearchLink="/search/advanced/organizations"
|
[csvParams]="csvParams" csvPath="organizations" advancedSearchLink="/search/advanced/organizations"
|
||||||
[disableForms]="disableForms"
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults"
|
||||||
searchFormClass="organizationsSearchForm">
|
searchFormClass="organizationsSearchForm">
|
||||||
</search-page>
|
</search-page>
|
||||||
|
|
||||||
|
@ -27,6 +29,8 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchOrganizationsComponent {
|
export class SearchOrganizationsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -40,13 +44,15 @@ export class SearchOrganizationsComponent {
|
||||||
public _location:Location;
|
public _location:Location;
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
|
constructor (private route: ActivatedRoute, private _searchOrganizationsService: SearchOrganizationsService ) {
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.page =1;
|
this.searchUtils.page =1;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchOrganizations();
|
this.baseUrl = OpenaireProperties.getLinkToSearchOrganizations();
|
||||||
|
|
||||||
|
@ -57,6 +63,11 @@ export class SearchOrganizationsComponent {
|
||||||
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
||||||
var firstLoad = true;
|
var firstLoad = true;
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||||
var refine = true;
|
var refine = true;
|
||||||
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
||||||
|
@ -94,8 +105,8 @@ export class SearchOrganizationsComponent {
|
||||||
// if(!refine && !this.searchPage){
|
// if(!refine && !this.searchPage){
|
||||||
// this.searchPage = new SearchPageComponent(this._location);
|
// this.searchPage = new SearchPageComponent(this._location);
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -111,15 +122,15 @@ export class SearchOrganizationsComponent {
|
||||||
}
|
}
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -127,7 +138,7 @@ export class SearchOrganizationsComponent {
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -137,8 +148,16 @@ export class SearchOrganizationsComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
|
@ -147,6 +166,8 @@ export class SearchOrganizationsComponent {
|
||||||
|
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
console.info("queryChanged: Execute search query "+parameters);
|
console.info("queryChanged: Execute search query "+parameters);
|
||||||
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
||||||
|
|
|
@ -20,12 +20,16 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||||
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
[baseUrl] = "baseUrl" (queryChange)="queryChanged($event)"
|
||||||
[csvParams]="csvParams" csvPath="projects" advancedSearchLink="/search/advanced/projects"
|
[csvParams]="csvParams" csvPath="projects" advancedSearchLink="/search/advanced/projects"
|
||||||
[disableForms]="disableForms"
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults"
|
||||||
searchFormClass="projectsSearchForm">
|
searchFormClass="projectsSearchForm">
|
||||||
</search-page>
|
</search-page>
|
||||||
`
|
`
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchProjectsComponent {
|
export class SearchProjectsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters: Filter[] =[];
|
public filters: Filter[] =[];
|
||||||
public baseUrl:string;
|
public baseUrl:string;
|
||||||
|
@ -39,14 +43,16 @@ export class SearchProjectsComponent {
|
||||||
public _location:Location;
|
public _location:Location;
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService) {
|
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService) {
|
||||||
console.info(" constructor SearchProjectsComponent "+this.refineFields.length);
|
console.info(" constructor SearchProjectsComponent "+this.refineFields.length);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.page =1;
|
this.searchUtils.page =1;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchProjects();
|
this.baseUrl = OpenaireProperties.getLinkToSearchProjects();
|
||||||
|
|
||||||
|
@ -59,19 +65,23 @@ export class SearchProjectsComponent {
|
||||||
//get refine field filters from url parameters
|
//get refine field filters from url parameters
|
||||||
var firstLoad = true;
|
var firstLoad = true;
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
//get keyword from url parameters
|
//get keyword from url parameters
|
||||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||||
var refine = true;
|
var refine = true;
|
||||||
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
||||||
refine = false;
|
refine = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
firstLoad = false;
|
firstLoad = false;
|
||||||
//get page from url parameters
|
//get page from url parameters
|
||||||
this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
|
this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
|
||||||
var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
|
var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
|
||||||
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
|
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,8 +108,8 @@ export class SearchProjectsComponent {
|
||||||
// this.searchPage = new SearchPageComponent(this._location);
|
// this.searchPage = new SearchPageComponent(this._location);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -116,15 +126,15 @@ export class SearchProjectsComponent {
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
// this.filters = this.searchPage.checkSelectedFilters(data[2]);
|
// this.filters = this.searchPage.checkSelectedFilters(data[2]);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -132,7 +142,7 @@ export class SearchProjectsComponent {
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -142,8 +152,16 @@ export class SearchProjectsComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
}
|
}
|
||||||
|
@ -158,10 +176,10 @@ export class SearchProjectsComponent {
|
||||||
console.info("search Projects for Dataproviders: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Projects for Dataproviders: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -170,14 +188,23 @@ export class SearchProjectsComponent {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
this.urlParams = undefined;
|
this.urlParams = undefined;
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size);
|
||||||
|
|
|
@ -25,6 +25,8 @@ import {DOI} from '../../utils/string-utils.class';
|
||||||
[csvParams]="csvParams" csvPath="publications"
|
[csvParams]="csvParams" csvPath="publications"
|
||||||
advancedSearchLink="/search/advanced/publications"
|
advancedSearchLink="/search/advanced/publications"
|
||||||
[disableForms]="disableForms"
|
[disableForms]="disableForms"
|
||||||
|
[loadPaging]="loadPaging"
|
||||||
|
[oldTotalResults]="oldTotalResults"
|
||||||
searchFormClass="publicationsSearchForm">
|
searchFormClass="publicationsSearchForm">
|
||||||
</search-page>
|
</search-page>
|
||||||
|
|
||||||
|
@ -32,6 +34,8 @@ import {DOI} from '../../utils/string-utils.class';
|
||||||
|
|
||||||
})
|
})
|
||||||
export class SearchPublicationsComponent {
|
export class SearchPublicationsComponent {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
|
@ -54,10 +58,12 @@ export class SearchPublicationsComponent {
|
||||||
public CSVDownloaded = false;
|
public CSVDownloaded = false;
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
public disableForms: boolean = false;
|
public disableForms: boolean = false;
|
||||||
|
public loadPaging: boolean = true;
|
||||||
|
public oldTotalResults: number = 0;
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) {
|
constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this.searchUtils.page =1;
|
this.searchUtils.page =1;
|
||||||
this.baseUrl = OpenaireProperties.getLinkToSearchPublications();
|
this.baseUrl = OpenaireProperties.getLinkToSearchPublications();
|
||||||
|
|
||||||
|
@ -69,6 +75,11 @@ export class SearchPublicationsComponent {
|
||||||
this.searchPage.type = "publications";
|
this.searchPage.type = "publications";
|
||||||
var firstLoad =true;
|
var firstLoad =true;
|
||||||
this.sub = this.route.queryParams.subscribe(params => {
|
this.sub = this.route.queryParams.subscribe(params => {
|
||||||
|
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||||
|
this.loadPaging = false;
|
||||||
|
this.oldTotalResults = this.searchUtils.totalResults;
|
||||||
|
}
|
||||||
|
|
||||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||||
var refine = true;
|
var refine = true;
|
||||||
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
if(this.searchUtils.page != ((params['page']=== undefined)?1:+params['page']) && this.filters && !firstLoad){
|
||||||
|
@ -106,10 +117,10 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -118,8 +129,15 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -141,10 +159,10 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
console.info("search Publications for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Publications for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -153,8 +171,15 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -185,8 +210,8 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
// this.searchPage = new SearchPageComponent(this._location);
|
// this.searchPage = new SearchPageComponent(this._location);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
//this.searchPage.openLoading();
|
//this.searchPage.openLoading();
|
||||||
this.disableForms = true;
|
this.disableForms = true;
|
||||||
this.results = [];
|
this.results = [];
|
||||||
|
@ -203,16 +228,16 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
this.searchPage.checkSelectedFilters(this.filters);
|
this.searchPage.checkSelectedFilters(this.filters);
|
||||||
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
this.searchPage.updateBaseUrlWithParameters(this.filters);
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
|
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
if(this.searchUtils.status == errorCodes.DONE) {
|
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||||
// Page out of limit!!!
|
// Page out of limit!!!
|
||||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||||
if(!(Number.isInteger(totalPages))) {
|
if(!(Number.isInteger(totalPages))) {
|
||||||
|
@ -220,7 +245,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
}
|
}
|
||||||
if(totalPages < page) {
|
if(totalPages < page) {
|
||||||
this.searchUtils.totalResults = 0;
|
this.searchUtils.totalResults = 0;
|
||||||
this.searchUtils.status = errorCodes.OUT_OF_BOUND;
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -230,8 +255,16 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
//this.searchPage.closeLoading();
|
//this.searchPage.closeLoading();
|
||||||
this.disableForms = false;
|
this.disableForms = false;
|
||||||
|
|
||||||
|
@ -263,6 +296,8 @@ public getAggregatorResults(id:string, page: number, size: number){
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public queryChanged($event) {
|
public queryChanged($event) {
|
||||||
|
this.loadPaging = true;
|
||||||
|
|
||||||
var parameters = $event.value;
|
var parameters = $event.value;
|
||||||
console.info("queryChanged: Execute search query "+parameters);
|
console.info("queryChanged: Execute search query "+parameters);
|
||||||
console.info("Search Pubs::page "+this.searchUtils.page);
|
console.info("Search Pubs::page "+this.searchUtils.page);
|
||||||
|
|
|
@ -78,7 +78,7 @@ export class SearchDatasetsService {
|
||||||
.do(res => {
|
.do(res => {
|
||||||
this._cache.set(key, res);
|
this._cache.set(key, res);
|
||||||
})
|
})
|
||||||
.map(res => this.parseRefineResults(id, res['refineResults']));
|
.map(res => this.parseRefineResults(id, res['refineResults']))
|
||||||
}
|
}
|
||||||
|
|
||||||
searchDatasetsByDois (DOIs: string[], refineParams:string, page: number, size: number, refineFields:string[] ):any {
|
searchDatasetsByDois (DOIs: string[], refineParams:string, page: number, size: number, refineFields:string[] ):any {
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
import {Component, Input} from '@angular/core';
|
||||||
|
import {ErrorCodes} from './properties/openaireProperties';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'errorMessages',
|
||||||
|
template: `
|
||||||
|
<div *ngIf="status.some(checkErroCode(errorCodes.LOADING))" class="uk-animation-fade uk-margin-top uk-width-1-1" role="alert"><img src="./assets/loading.gif" class="uk-align-center" alt="Loading"></div>
|
||||||
|
<div *ngIf="status.every(checkErroCode(errorCodes.NONE))" class="uk-animation-fade uk-alert uk-alert-primary" role="alert">No {{type}} available</div>
|
||||||
|
<div *ngIf="status.every(checkErroCode(errorCodes.ERROR)) ||
|
||||||
|
(status.some(checkErroCode(errorCodes.ERROR)) && (!status.every(checkErroCode(errorCodes.DONE)) || !status.every(checkErroCode(errorCodes.LOADING))))"
|
||||||
|
class="uk-animation-fade uk-alert uk-alert-warning" role="alert">
|
||||||
|
An Error Occured
|
||||||
|
</div>
|
||||||
|
<div *ngIf="status.every(checkErroCode(errorCodes.NOT_AVAILABLE)) ||
|
||||||
|
(status.some(checkErroCode(errorCodes.NOT_AVAILABLE)) && (!status.every(checkErroCode(errorCodes.DONE)) || !status.every(checkErroCode(errorCodes.LOADING))))"
|
||||||
|
class="uk-animation-fade uk-alert uk-alert-warning" role="alert">
|
||||||
|
Service temprorarily unavailable. Please try again later.
|
||||||
|
</div>
|
||||||
|
<div *ngIf="status.every(checkErroCode(errorCodes.NOT_FOUND)) ||
|
||||||
|
(status.some(checkErroCode(errorCodes.NOT_FOUND)) && (!status.every(checkErroCode(errorCodes.DONE)) || !status.every(checkErroCode(errorCodes.LOADING))))"
|
||||||
|
class="uk-animation-fade uk-alert uk-alert-warning" role="alert">
|
||||||
|
No {{type}} found
|
||||||
|
</div>
|
||||||
|
<div *ngIf="status.every(checkErroCode(errorCodes.OUT_OF_BOUND))" class="uk-animation-fade uk-alert uk-alert-warning" role="alert">Requested page out of bounds</div>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
export class ErrorMessagesComponent {
|
||||||
|
@Input() status: Array<number>;
|
||||||
|
@Input() type: string;
|
||||||
|
|
||||||
|
public errorCodes:ErrorCodes;
|
||||||
|
|
||||||
|
constructor () {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.errorCodes = new ErrorCodes();
|
||||||
|
console.info("ngOnInit");
|
||||||
|
if(!this.status) {
|
||||||
|
this.status = [this.errorCodes.LOADING];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {}
|
||||||
|
|
||||||
|
public checkErroCode(code: number) {
|
||||||
|
return function(status: number) {
|
||||||
|
return (status == code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import {ErrorMessagesComponent} from './errorMessages.component';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule, FormsModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
ErrorMessagesComponent
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
ErrorMessagesComponent
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class ErrorMessagesModule { }
|
|
@ -3,6 +3,8 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||||
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class';
|
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class';
|
||||||
|
|
||||||
export class FetchDataproviders {
|
export class FetchDataproviders {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
public sub: any; public subResults: any;
|
public sub: any; public subResults: any;
|
||||||
|
@ -14,8 +16,8 @@ export class FetchDataproviders {
|
||||||
|
|
||||||
|
|
||||||
constructor ( private _searchDataprovidersService: SearchDataprovidersService ) {
|
constructor ( private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,8 +36,8 @@ export class FetchDataproviders {
|
||||||
parameters = "q=" + keyword;
|
parameters = "q=" + keyword;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
|
|
||||||
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters,null, page, size,[]).subscribe(
|
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters,null, page, size,[]).subscribe(
|
||||||
|
@ -44,10 +46,10 @@ export class FetchDataproviders {
|
||||||
console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//ar errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -56,15 +58,22 @@ export class FetchDataproviders {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNumForEntity(entity: string, id:string) {
|
public getNumForEntity(entity: string, id:string) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
if(id != "" && entity != "") {
|
if(id != "" && entity != "") {
|
||||||
|
|
||||||
|
@ -72,10 +81,10 @@ export class FetchDataproviders {
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data;
|
this.searchUtils.totalResults = data;
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -84,24 +93,31 @@ export class FetchDataproviders {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNumForSearch(keyword: string) {
|
public getNumForSearch(keyword: string) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this._searchDataprovidersService.numOfSearchDataproviders(keyword).subscribe(
|
this._searchDataprovidersService.numOfSearchDataproviders(keyword).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data;
|
this.searchUtils.totalResults = data;
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
|
|
||||||
if(this.searchUtils.totalResults == 0) {
|
if(this.searchUtils.totalResults == 0) {
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -110,15 +126,22 @@ export class FetchDataproviders {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForDeposit(id:string, type:string, page: number, size: number){
|
public getResultsForDeposit(id:string, type:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
if(id != "") {
|
if(id != "") {
|
||||||
|
|
||||||
|
@ -128,10 +151,10 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
console.info("search Dataproviders forDeposit: [id:"+id+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Dataproviders forDeposit: [id:"+id+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -140,25 +163,32 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public getResultsBySubjectsForDeposit(subject:string, type:string, page: number, size: number){
|
public getResultsBySubjectsForDeposit(subject:string, type:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
this._searchDataprovidersService.searchDataProvidersBySubjects(subject,type, page, size).subscribe(
|
this._searchDataprovidersService.searchDataProvidersBySubjects(subject,type, page, size).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data[0];
|
this.searchUtils.totalResults = data[0];
|
||||||
console.info("search Dataproviders forDeposit: [subject:"+subject+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Dataproviders forDeposit: [subject:"+subject+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -167,15 +197,22 @@ public getResultsBySubjectsForDeposit(subject:string, type:string, page: number,
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
var parameters = "";
|
var parameters = "";
|
||||||
|
|
||||||
|
@ -191,10 +228,10 @@ public getResultsBySubjectsForDeposit(subject:string, type:string, page: number,
|
||||||
console.info("search Dataproviders for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Dataproviders for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -203,16 +240,23 @@ public getResultsBySubjectsForDeposit(subject:string, type:string, page: number,
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForDataproviders(id:string, page: number, size: number){
|
public getResultsForDataproviders(id:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this._searchDataprovidersService.getDataProvidersforEntityRegistry(id, page, size).subscribe(
|
this._searchDataprovidersService.getDataProvidersforEntityRegistry(id, page, size).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -220,10 +264,10 @@ public getResultsBySubjectsForDeposit(subject:string, type:string, page: number,
|
||||||
console.info("search Dataproviders for Entity Registry: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Dataproviders for Entity Registry: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -232,8 +276,15 @@ public getResultsBySubjectsForDeposit(subject:string, type:string, page: number,
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@ import {DOI} from '../../utils/string-utils.class';
|
||||||
import {Subject} from 'rxjs/Subject';
|
import {Subject} from 'rxjs/Subject';
|
||||||
|
|
||||||
export class FetchDatasets{
|
export class FetchDatasets{
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
public requestComplete: Subject<void>;
|
public requestComplete: Subject<void>;
|
||||||
|
|
||||||
|
@ -16,8 +18,8 @@ export class FetchDatasets{
|
||||||
|
|
||||||
constructor ( private _searchDatasetsService: SearchDatasetsService ) {
|
constructor ( private _searchDatasetsService: SearchDatasetsService ) {
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.requestComplete = new Subject<void>();
|
this.requestComplete = new Subject<void>();
|
||||||
}
|
}
|
||||||
|
@ -50,8 +52,8 @@ export class FetchDatasets{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.subResults = this._searchDatasetsService.searchDatasets(parameters,null, page, size, []).subscribe(
|
this.subResults = this._searchDatasetsService.searchDatasets(parameters,null, page, size, []).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -59,10 +61,10 @@ export class FetchDatasets{
|
||||||
console.info("search Research Data: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Research Data: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -71,15 +73,22 @@ export class FetchDatasets{
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNumForEntity(entity:string, id:string){
|
public getNumForEntity(entity:string, id:string){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
|
|
||||||
if(id != "" && entity != "") {
|
if(id != "" && entity != "") {
|
||||||
|
@ -87,10 +96,10 @@ public getNumForEntity(entity:string, id:string){
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data;
|
this.searchUtils.totalResults = data;
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -99,16 +108,23 @@ public getNumForEntity(entity:string, id:string){
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
var parameters = "";
|
var parameters = "";
|
||||||
|
|
||||||
|
@ -124,10 +140,10 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
console.info("search Research Data for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Research Data for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -136,16 +152,23 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForDataproviders(id:string, resultsFrom:string, page: number, size: number){
|
public getResultsForDataproviders(id:string, resultsFrom:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
var parameters;
|
var parameters;
|
||||||
if(resultsFrom == "collectedFrom") {
|
if(resultsFrom == "collectedFrom") {
|
||||||
|
@ -162,10 +185,10 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
console.info("search Research Data for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Research Data for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -174,39 +197,55 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getAggregatorResults(id:string, page: number, size: number){
|
public getAggregatorResults(id:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.subResults = this._searchDatasetsService.searchAggregators(id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
|
this.subResults = this._searchDatasetsService.searchAggregators(id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.results = data;
|
this.results = data;
|
||||||
this.searchUtils.totalResults = this.results.length;
|
this.searchUtils.totalResults = this.results.length;
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.requestComplete.complete();
|
this.requestComplete.complete();
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
this.requestComplete.complete();
|
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
console.info("status: "+err.status);
|
||||||
//TODO check erros (service not available, bad request)
|
//TODO check erros (service not available, bad request)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.requestComplete.complete();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class';
|
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class';
|
||||||
|
|
||||||
export class FetchOrganizations {
|
export class FetchOrganizations {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
|
|
||||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||||
|
@ -13,8 +15,8 @@ export class FetchOrganizations {
|
||||||
|
|
||||||
constructor ( private _searchOrganizationsService: SearchOrganizationsService ) {
|
constructor ( private _searchOrganizationsService: SearchOrganizationsService ) {
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,8 +37,8 @@ export class FetchOrganizations {
|
||||||
parameters = "q=" + keyword;
|
parameters = "q=" + keyword;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.subResults = this._searchOrganizationsService.searchOrganizations(parameters, null, page, size, []).subscribe(
|
this.subResults = this._searchOrganizationsService.searchOrganizations(parameters, null, page, size, []).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -44,10 +46,10 @@ export class FetchOrganizations {
|
||||||
console.info("search Organizations: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Organizations: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -56,8 +58,16 @@ export class FetchOrganizations {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@ import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||||
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class';
|
import {SearchUtilsClass } from '../../searchPages/searchUtils/searchUtils.class';
|
||||||
|
|
||||||
export class FetchProjects{
|
export class FetchProjects{
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
|
|
||||||
public filters; // for getResultsForOrganizations
|
public filters; // for getResultsForOrganizations
|
||||||
|
@ -14,8 +16,8 @@ export class FetchProjects{
|
||||||
|
|
||||||
|
|
||||||
constructor (private _searchProjectsService: SearchProjectsService) {
|
constructor (private _searchProjectsService: SearchProjectsService) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,8 +36,8 @@ export class FetchProjects{
|
||||||
parameters = "q=" + keyword;
|
parameters = "q=" + keyword;
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.subResults = this._searchProjectsService.searchProjects(parameters, null, page, size, []).subscribe(
|
this.subResults = this._searchProjectsService.searchProjects(parameters, null, page, size, []).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -43,10 +45,10 @@ export class FetchProjects{
|
||||||
console.info("search Projects: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Projects: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -55,15 +57,22 @@ export class FetchProjects{
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForDataproviders(id:string, page: number, size: number){
|
public getResultsForDataproviders(id:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this._searchProjectsService.getProjectsforDataProvider(id, page, size).subscribe(
|
this._searchProjectsService.getProjectsforDataProvider(id, page, size).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -71,10 +80,10 @@ export class FetchProjects{
|
||||||
console.info("search Projects for Dataproviders: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Projects for Dataproviders: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -83,15 +92,22 @@ export class FetchProjects{
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getNumForEntity(entity: string, id:string) {
|
public getNumForEntity(entity: string, id:string) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
if(id != "" && entity != "") {
|
if(id != "" && entity != "") {
|
||||||
|
|
||||||
|
@ -99,10 +115,10 @@ export class FetchProjects{
|
||||||
data => {
|
data => {
|
||||||
this.searchUtils.totalResults = data;
|
this.searchUtils.totalResults = data;
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -111,16 +127,24 @@ export class FetchProjects{
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForOrganizations(organizationId:string, filterquery:string, page: number, size: number, refineFields:string[]){
|
public getResultsForOrganizations(organizationId:string, filterquery:string, page: number, size: number, refineFields:string[]){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this._searchProjectsService.getProjectsForOrganizations(organizationId,filterquery, page, size,refineFields).subscribe(
|
this._searchProjectsService.getProjectsForOrganizations(organizationId,filterquery, page, size,refineFields).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -156,10 +180,10 @@ export class FetchProjects{
|
||||||
console.log(" this.funders:"+ this.funders);
|
console.log(" this.funders:"+ this.funders);
|
||||||
|
|
||||||
}
|
}
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -168,8 +192,15 @@ export class FetchProjects{
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import {DOI} from '../../utils/string-utils.class';
|
||||||
import {Subject} from 'rxjs/Subject';
|
import {Subject} from 'rxjs/Subject';
|
||||||
|
|
||||||
export class FetchPublications {
|
export class FetchPublications {
|
||||||
|
private errorCodes: ErrorCodes;
|
||||||
|
|
||||||
public results =[];
|
public results =[];
|
||||||
|
|
||||||
public requestComplete: Subject<void>;
|
public requestComplete: Subject<void>;
|
||||||
|
@ -30,8 +32,8 @@ export class FetchPublications {
|
||||||
public csvParams: string;
|
public csvParams: string;
|
||||||
|
|
||||||
constructor ( private _searchPublicationsService: SearchPublicationsService ) {
|
constructor ( private _searchPublicationsService: SearchPublicationsService ) {
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status =errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
// this.baseUrl = OpenaireProperties.getLinkToSearchPublications();
|
// this.baseUrl = OpenaireProperties.getLinkToSearchPublications();
|
||||||
|
|
||||||
this.requestComplete = new Subject<void>();
|
this.requestComplete = new Subject<void>();
|
||||||
|
@ -64,8 +66,8 @@ export class FetchPublications {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.subResults = this._searchPublicationsService.searchPublications(parameters,null, page, size, []).subscribe(
|
this.subResults = this._searchPublicationsService.searchPublications(parameters,null, page, size, []).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
@ -73,10 +75,10 @@ export class FetchPublications {
|
||||||
console.info("search Publications: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Publications: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -85,16 +87,22 @@ export class FetchPublications {
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
var parameters = "";
|
var parameters = "";
|
||||||
if(entity == "project") {
|
if(entity == "project") {
|
||||||
|
@ -111,10 +119,10 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -123,16 +131,24 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getResultsForDataproviders(id:string, resultsFrom:string, page: number, size: number){
|
public getResultsForDataproviders(id:string, resultsFrom:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
var parameters;
|
var parameters;
|
||||||
if(resultsFrom == "collectedFrom") {
|
if(resultsFrom == "collectedFrom") {
|
||||||
|
@ -149,10 +165,10 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
console.info("search Publications for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
console.info("search Publications for Dataproviders: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||||
this.results = data[1];
|
this.results = data[1];
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
|
@ -161,39 +177,54 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getAggregatorResults(id:string, page: number, size: number){
|
public getAggregatorResults(id:string, page: number, size: number){
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.LOADING;
|
this.searchUtils.status = this.errorCodes.LOADING;
|
||||||
|
|
||||||
this.subResults = this._searchPublicationsService.searchAggregators(id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
|
this.subResults = this._searchPublicationsService.searchAggregators(id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.results = data;
|
this.results = data;
|
||||||
this.searchUtils.totalResults = this.results.length;
|
this.searchUtils.totalResults = this.results.length;
|
||||||
|
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.DONE;
|
this.searchUtils.status = this.errorCodes.DONE;
|
||||||
if(this.searchUtils.totalResults == 0 ){
|
if(this.searchUtils.totalResults == 0 ){
|
||||||
this.searchUtils.status = errorCodes.NONE;
|
this.searchUtils.status = this.errorCodes.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.requestComplete.complete();
|
this.requestComplete.complete();
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
this.requestComplete.complete();
|
|
||||||
console.log(err);
|
console.log(err);
|
||||||
//TODO check erros (service not available, bad request)
|
//TODO check erros (service not available, bad request)
|
||||||
// if( ){
|
// if( ){
|
||||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||||
// }
|
// }
|
||||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||||
this.searchUtils.status = errorCodes.ERROR;
|
//this.searchUtils.status = errorCodes.ERROR;
|
||||||
|
if(err.status == '404') {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||||
|
} else if(err.status == '500') {
|
||||||
|
this.searchUtils.status = this.errorCodes.ERROR;
|
||||||
|
} else {
|
||||||
|
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.requestComplete.complete();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,4 +375,5 @@ export class ErrorCodes {
|
||||||
public ERROR = 3;
|
public ERROR = 3;
|
||||||
public NOT_AVAILABLE = 4;
|
public NOT_AVAILABLE = 4;
|
||||||
public OUT_OF_BOUND = 5;
|
public OUT_OF_BOUND = 5;
|
||||||
|
public NOT_FOUND = 6;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,9 @@ h2 .custom-external {
|
||||||
.search-results {
|
.search-results {
|
||||||
min-height: 1100px;
|
min-height: 1100px;
|
||||||
}
|
}
|
||||||
|
.searchPaging {
|
||||||
|
min-height: 46px;
|
||||||
|
}
|
||||||
.other-results {
|
.other-results {
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue