USe a json file to read properties | replace openaire Properties | parameterize menu (use params, community, ) | parameterize search pages (hide community information)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@50586 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
01472f0ce0
commit
91b7c11f0a
|
@ -0,0 +1,109 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import {IsRouteEnabled} from './error/isRouteEnabled.guard';
|
||||
|
||||
import {EnvironmentSpecificResolver} from './utils/properties/environmentSpecificResolver';
|
||||
import { EnvironmentSpecificService } from './utils/properties/environment-specific.service';
|
||||
|
||||
import { ErrorPageComponent } from './error/errorPage.component';
|
||||
import {SearchComponent} from './searchPages/find/search.component';
|
||||
|
||||
import {PublicationComponent} from './landingPages/publication/publication.component';
|
||||
import {DatasetComponent} from './landingPages/dataset/dataset.component';
|
||||
import {SoftwareComponent} from './landingPages/software/software.component';
|
||||
import {DataProviderComponent} from './landingPages/dataProvider/dataProvider.component';
|
||||
import {ProjectComponent} from './landingPages/project/project.component';
|
||||
import {OrganizationComponent} from './landingPages/organization/organization.component';
|
||||
|
||||
|
||||
import {DepositDatasetsComponent} from './deposit/datasets/depositDatasets.component';
|
||||
import {DepositDatasetsResultComponent} from './deposit/datasets/depositDatasetsResult.component';
|
||||
import {DepositBySubjectResultComponent} from './deposit/datasets/depositBySubjectResult.component';
|
||||
import {DepositPublicationsComponent} from './deposit/publications/depositPublications.component';
|
||||
import {DepositPublicationsResultComponent} from './deposit/publications/depositPublicationsResult.component';
|
||||
|
||||
import {SearchDatasetsComponent} from './searchPages/simple/searchDatasets.component';
|
||||
import {SearchPublicationsComponent} from './searchPages/simple/searchPublications.component';
|
||||
import {SearchSoftwareComponent} from './searchPages/simple/searchSoftware.component';
|
||||
import {SearchDataprovidersComponent} from './searchPages/simple/searchDataproviders.component';
|
||||
import {SearchProjectsComponent} from './searchPages/simple/searchProjects.component';
|
||||
import {SearchOrganizationsComponent} from './searchPages/simple/searchOrganizations.component';
|
||||
|
||||
import {AdvancedSearchPublicationsComponent} from './searchPages/advanced/advancedSearchPublications.component';
|
||||
import {AdvancedSearchDatasetsComponent} from './searchPages/advanced/advancedSearchDatasets.component';
|
||||
import {AdvancedSearchSoftwareComponent} from './searchPages/advanced/advancedSearchSoftware.component';
|
||||
import {AdvancedSearchDataProvidersComponent} from './searchPages/advanced/advancedSearchDataProviders.component';
|
||||
import {AdvancedSearchProjectsComponent} from './searchPages/advanced/advancedSearchProjects.component';
|
||||
import {AdvancedSearchOrganizationsComponent} from './searchPages/advanced/advancedSearchOrganizations.component';
|
||||
|
||||
import {SearchEntityRegistriesComponent} from './searchPages/dataProviders/entityRegistries.component';
|
||||
import {SearchEntityRegistriesTableComponent} from './searchPages/dataProviders/entityRegistriesTable.component';
|
||||
import {SearchJournalsTableComponent} from './searchPages/dataProviders/journalsTable.component';
|
||||
import {SearchJournalsComponent} from './searchPages/dataProviders/journals.component';
|
||||
import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProviders/compatibleDataProviders.component';
|
||||
import {SearchCompatibleDataprovidersTableComponent} from './searchPages/dataProviders/compatibleDataProvidersTable.component';
|
||||
|
||||
import {ClaimsAdminComponent} from './claims/claimsAdmin/claimsAdmin.component';
|
||||
import {MyClaimsComponent} from './claims/myClaims/myClaims.component';
|
||||
|
||||
import {ClaimsByTokenComponent} from './claims/claimsByToken/claimsByToken.component';
|
||||
import {DirectLinkingComponent} from './claims/directLinking/directLinking.component';
|
||||
import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component';
|
||||
|
||||
import{ HtmlProjectReportComponent} from './landingPages/htmlProjectReport/htmlProjectReport.component';
|
||||
|
||||
const routes: Routes = [
|
||||
|
||||
{ path: '', component: SearchComponent, resolve: { envSpecific: EnvironmentSpecificResolver }, canActivate: [ IsRouteEnabled], data: {
|
||||
redirect: '/error',api: "http://duffy.di.uoa.gr:8080/uoa-admin-tools", community :"openaire"}},
|
||||
{ path: 'home', component: SearchComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/publication', component: PublicationComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/dataset', component: DatasetComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/software', component: SoftwareComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/project', component: ProjectComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/dataprovider', component: DataProviderComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/organization', component: OrganizationComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'participate/deposit-datasets', component: DepositDatasetsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'participate/deposit-datasets-result', component: DepositDatasetsResultComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'participate/deposit-subject-result', component: DepositBySubjectResultComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'participate/deposit-publications', component: DepositPublicationsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'participate/deposit-publications-result', component: DepositPublicationsResultComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/find', component: SearchComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/find/publications', component: SearchPublicationsComponent , resolve: { envSpecific: EnvironmentSpecificResolver }, canActivate: [ IsRouteEnabled], data: {
|
||||
redirect: '/error',api: "http://duffy.di.uoa.gr:8080/uoa-admin-tools", community :"openaire"} },
|
||||
{ path: 'search/find/datasets', component:SearchDatasetsComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/find/software', component:SearchSoftwareComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/find/projects', component:SearchProjectsComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/find/dataproviders', component:SearchDataprovidersComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/find/organizations', component:SearchOrganizationsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/content-providers', component: SearchCompatibleDataprovidersComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/content-providers-table', component: SearchCompatibleDataprovidersTableComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/entity-registries',component: SearchEntityRegistriesComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/entity-registries-table', component: SearchEntityRegistriesTableComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/journals', component: SearchJournalsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/journals-table', component: SearchJournalsTableComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/advanced/publications', component: AdvancedSearchPublicationsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/advanced/datasets', component: AdvancedSearchDatasetsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/advanced/software', component: AdvancedSearchSoftwareComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/advanced/organizations',component: AdvancedSearchOrganizationsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/advanced/dataproviders', component: AdvancedSearchDataProvidersComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'search/advanced/projects', component: AdvancedSearchProjectsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'project-report', component: HtmlProjectReportComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'myclaims',component: MyClaimsComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'claims', component: ClaimsAdminComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'participate/claim', component: LinkingGenericComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'participate/direct-claim',component: DirectLinkingComponent, resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'claims-project-manager', component: ClaimsByTokenComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'reload', loadChildren: './reload/reload.module#ReloadModule' , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'user-info', loadChildren: './login/user.module#UserModule' , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: 'error', component: ErrorPageComponent , resolve: { envSpecific: EnvironmentSpecificResolver } },
|
||||
{ path: '**',pathMatch: 'full',component: ErrorPageComponent }
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
exports: [RouterModule],
|
||||
providers: [EnvironmentSpecificResolver, EnvironmentSpecificService, IsRouteEnabled]
|
||||
})
|
||||
export class AppRoutingModule { }
|
|
@ -1,6 +1,10 @@
|
|||
import { Component, Directive, ElementRef, Renderer, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
||||
import { ConfigurationService } from './utils/configuration/configuration.service';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { EnvProperties } from './utils/properties/env-properties';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import{EnvironmentSpecificService} from './utils/properties/environment-specific.service';
|
||||
import{MenuItem,RootMenuItem} from './sharedComponents/menu';
|
||||
|
||||
@Component({
|
||||
//changeDetection: ChangeDetectionStrategy.Default,
|
||||
|
@ -9,7 +13,9 @@ import {Observable} from 'rxjs/Observable';
|
|||
styles: [`
|
||||
`],
|
||||
template: `
|
||||
<navbar portal="explore" onlyTop=false userMenu=true></navbar>
|
||||
|
||||
<navbar *ngIf= "properties" portal="explore" onlyTop=false userMenu=true [(communityId)]="properties.adminToolsCommunity" [userMenuItems]=userMenuItems [menuItems]=menuItems
|
||||
[(APIUrl)]="properties.adminToolsAPIURL" [(logInUrl)]="properties.loginUrl" [(logOutUrl)]="properties.logoutUrl" [(cookieDomain)]="properties.cookieDomain"></navbar>
|
||||
<h1>Openaire Lib Component</h1>
|
||||
|
||||
|
||||
|
@ -42,10 +48,55 @@ import {Observable} from 'rxjs/Observable';
|
|||
})
|
||||
export class AppComponent {
|
||||
isClient:boolean = false;
|
||||
constructor(private config: ConfigurationService) {}
|
||||
public properties:EnvProperties = null;
|
||||
|
||||
constructor(private config: ConfigurationService, private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService) {
|
||||
}
|
||||
|
||||
|
||||
userMenuItems:MenuItem[] = [ new MenuItem("","My profile","","",false,[],[],{}),
|
||||
new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
|
||||
new MenuItem("","Manage all claims","","/claims",true,[],["/claims"],{})]
|
||||
|
||||
|
||||
menuItems:RootMenuItem [] = [
|
||||
{rootItem: new MenuItem("search","Search","","/search/find",false,[],["/search/find"],{}),
|
||||
items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{}),
|
||||
new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{}),
|
||||
new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{}),
|
||||
new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{}),
|
||||
new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{}),
|
||||
new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{})
|
||||
]},
|
||||
{
|
||||
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets"],{}),
|
||||
items: [new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{}),
|
||||
new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],{})]
|
||||
},
|
||||
{
|
||||
rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],{}),
|
||||
items: []
|
||||
},
|
||||
{
|
||||
rootItem: new MenuItem("datasources","Content Providers","","",false,["datasource"],[],{}),
|
||||
items: [new MenuItem("","Data Policies","https://beta.openaire.eu/oa-policies-mandates","",false,["datasource"],[],{}),
|
||||
new MenuItem("","Repositories","","/search/content-providers",false,["datasource"],["/search/content-providers"],{}),
|
||||
new MenuItem("","Journals","","/search/journals",false,["datasource"],["/search/journals"],{}),
|
||||
new MenuItem("","Registries","","/search/entity-registries",false,["datasource"],["/search/entity-registries"],{}),
|
||||
new MenuItem("","Browse all","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{})]
|
||||
}
|
||||
];
|
||||
ngOnInit() {
|
||||
|
||||
this.propertiesService.loadEnvironment()
|
||||
.then(es => {
|
||||
this.propertiesService.setEnvProperties(es);
|
||||
this.properties = this.propertiesService.envSpecific;
|
||||
}, error => {
|
||||
console.log("App couldn't fetch properties");
|
||||
console.log(error);
|
||||
|
||||
});
|
||||
if (typeof document !== 'undefined') {
|
||||
try{
|
||||
this.isClient = true;
|
||||
|
@ -53,4 +104,7 @@ export class AppComponent {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -12,89 +12,54 @@ import { CookieLawModule } from './sharedComponents/cookie-law/cookie-law.module
|
|||
import {Meta} from '../angular2-meta';
|
||||
// import { ErrorModule } from './error/error.module';
|
||||
import { ConfigurationService } from './utils/configuration/configuration.service';
|
||||
import { ErrorPageComponent } from './error/errorPage.component';
|
||||
import {SearchComponent} from './searchPages/find/search.component';
|
||||
import {MainSearchModule} from './searchPages/find/mainSearch.module';
|
||||
import {PublicationComponent} from './landingPages/publication/publication.component';
|
||||
import {PublicationModule} from './landingPages/publication/publication.module';
|
||||
import {DatasetComponent} from './landingPages/dataset/dataset.component';
|
||||
import {DatasetModule} from './landingPages/dataset/dataset.module';
|
||||
import {SoftwareComponent} from './landingPages/software/software.component';
|
||||
import {SoftwareModule} from './landingPages/software/software.module';
|
||||
import {DataProviderComponent} from './landingPages/dataProvider/dataProvider.component';
|
||||
import {DataProviderModule} from './landingPages/dataProvider/dataProvider.module';
|
||||
import {ProjectComponent} from './landingPages/project/project.component';
|
||||
import {ProjectModule} from './landingPages/project/project.module';
|
||||
import {OrganizationComponent} from './landingPages/organization/organization.component';
|
||||
import {OrganizationModule} from './landingPages/organization/organization.module';
|
||||
import {ReloadModule} from './reload/reload.module';
|
||||
import {ErrorModule} from './error/error.module';
|
||||
import {DepositDatasetsModule} from './deposit/datasets/depositDatasets.module';
|
||||
import {DepositDatasetsComponent} from './deposit/datasets/depositDatasets.component';
|
||||
import {DepositDatasetsResultsModule} from './deposit/datasets/depositDatasetsResults.module';
|
||||
import {DepositDatasetsResultComponent} from './deposit/datasets/depositDatasetsResult.component';
|
||||
import {DepositBySubjectResultsModule} from './deposit/datasets/depositBySubjectResults.module';
|
||||
import {DepositBySubjectResultComponent} from './deposit/datasets/depositBySubjectResult.component';
|
||||
import {DepositPublicationsModule} from './deposit/publications/depositPublications.module';
|
||||
import {DepositPublicationsComponent} from './deposit/publications/depositPublications.component';
|
||||
import {DepositPublicationsResultsModule} from './deposit/publications/depositPublicationsResults.module';
|
||||
import {DepositPublicationsResultComponent} from './deposit/publications/depositPublicationsResult.component';
|
||||
|
||||
import {SearchPublicationsModule} from './searchPages/simple/searchPublications.module';
|
||||
import {SearchPublicationsComponent} from './searchPages/simple/searchPublications.component';
|
||||
import {SearchDatasetsModule} from './searchPages/simple/searchDatasets.module';
|
||||
import {SearchDatasetsComponent} from './searchPages/simple/searchDatasets.component';
|
||||
import {SearchSoftwareModule} from './searchPages/simple/searchSoftware.module';
|
||||
import {SearchSoftwareComponent} from './searchPages/simple/searchSoftware.component';
|
||||
import {SearchDataProvidersModule} from './searchPages/simple/searchDataProviders.module';
|
||||
import {SearchDataprovidersComponent} from './searchPages/simple/searchDataproviders.component';
|
||||
import {SearchProjectsModule} from './searchPages/simple/searchProjects.module';
|
||||
import {SearchProjectsComponent} from './searchPages/simple/searchProjects.component';
|
||||
import {SearchOrganizationsModule} from './searchPages/simple/searchOrganizations.module';
|
||||
import {SearchOrganizationsComponent} from './searchPages/simple/searchOrganizations.component';
|
||||
|
||||
import {AdvancedSearchPublicationsModule} from './searchPages/advanced/advancedSearchPublications.module';
|
||||
import {AdvancedSearchPublicationsComponent} from './searchPages/advanced/advancedSearchPublications.component';
|
||||
import {AdvancedSearchDatasetsModule} from './searchPages/advanced/advancedSearchDatasets.module';
|
||||
import {AdvancedSearchDatasetsComponent} from './searchPages/advanced/advancedSearchDatasets.component';
|
||||
import {AdvancedSearchSoftwareModule} from './searchPages/advanced/advancedSearchSoftware.module';
|
||||
import {AdvancedSearchSoftwareComponent} from './searchPages/advanced/advancedSearchSoftware.component';
|
||||
import {AdvancedSearchDataProvidersModule} from './searchPages/advanced/advancedSearchDataProviders.module';
|
||||
import {AdvancedSearchDataProvidersComponent} from './searchPages/advanced/advancedSearchDataProviders.component';
|
||||
import {AdvancedSearchProjectsModule} from './searchPages/advanced/advancedSearchProjects.module';
|
||||
import {AdvancedSearchProjectsComponent} from './searchPages/advanced/advancedSearchProjects.component';
|
||||
import {AdvancedSearchOrganizationsModule} from './searchPages/advanced/advancedSearchOrganizations.module';
|
||||
import {AdvancedSearchOrganizationsComponent} from './searchPages/advanced/advancedSearchOrganizations.component';
|
||||
|
||||
|
||||
import {EntityRegistriesModule} from './searchPages/dataProviders/entityRegistries.module';
|
||||
import {SearchEntityRegistriesComponent} from './searchPages/dataProviders/entityRegistries.component';
|
||||
import {EntityRegistriesTableModule} from './searchPages/dataProviders/entityRegistriesTable.module';
|
||||
import {SearchEntityRegistriesTableComponent} from './searchPages/dataProviders/entityRegistriesTable.component';
|
||||
|
||||
import {JournalsTableModule} from './searchPages/dataProviders/journalsTable.module';
|
||||
import {SearchJournalsTableComponent} from './searchPages/dataProviders/journalsTable.component';
|
||||
import {JournalsModule} from './searchPages/dataProviders/journals.module';
|
||||
import {SearchJournalsComponent} from './searchPages/dataProviders/journals.component';
|
||||
|
||||
|
||||
import {CompatibleDataProvidersModule} from './searchPages/dataProviders/compatibleDataProviders.module';
|
||||
import {SearchCompatibleDataprovidersComponent} from './searchPages/dataProviders/compatibleDataProviders.component';
|
||||
import {CompatibleDataProvidersTableModule} from './searchPages/dataProviders/compatibleDataProvidersTable.module';
|
||||
import {SearchCompatibleDataprovidersTableComponent} from './searchPages/dataProviders/compatibleDataProvidersTable.component';
|
||||
|
||||
import {ClaimsAdminModule} from './claims/claimsAdmin/claimsAdmin.module';
|
||||
import {ClaimsAdminComponent} from './claims/claimsAdmin/claimsAdmin.component';
|
||||
import {MyClaimsModule} from './claims/myClaims/myClaims.module';
|
||||
import {MyClaimsComponent} from './claims/myClaims/myClaims.component';
|
||||
import {ClaimsByTokenModule} from './claims/claimsByToken/claimsByToken.module';
|
||||
import {ClaimsByTokenComponent} from './claims/claimsByToken/claimsByToken.component';
|
||||
import {DirectLinkingModule} from './claims/directLinking/directLinking.module';
|
||||
import {DirectLinkingComponent} from './claims/directLinking/directLinking.component';
|
||||
import {LinkingGenericModule} from './claims/linking/linkingGeneric.module';
|
||||
import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component';
|
||||
|
||||
|
||||
import{ HtmlProjectReportModule} from './landingPages/htmlProjectReport/htmlProjectReport.module';
|
||||
import {IsRouteEnabled} from './error/isRouteEnabled.guard';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
@NgModule({
|
||||
|
||||
imports: [
|
||||
|
@ -113,53 +78,9 @@ import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component
|
|||
EntityRegistriesModule, CompatibleDataProvidersModule, JournalsModule,
|
||||
JournalsTableModule, EntityRegistriesTableModule, CompatibleDataProvidersTableModule,
|
||||
ClaimsAdminModule, MyClaimsModule, ClaimsByTokenModule, LinkingGenericModule, DirectLinkingModule,
|
||||
HtmlProjectReportModule,
|
||||
BrowserModule.withServerTransition({appId: 'my-app'}),
|
||||
RouterModule.forRoot([
|
||||
{ path: '', component: SearchComponent},
|
||||
{ path: 'home', component: SearchComponent},
|
||||
{ path: 'search/publication', component: PublicationComponent },
|
||||
{ path: 'search/dataset', component: DatasetComponent},
|
||||
{ path: 'search/software', component: SoftwareComponent},
|
||||
{ path: 'search/project', component: ProjectComponent },
|
||||
{ path: 'search/dataprovider', component: DataProviderComponent },
|
||||
{ path: 'search/organization', component: OrganizationComponent },
|
||||
{ path: 'participate/deposit-datasets', component: DepositDatasetsComponent },
|
||||
{ path: 'participate/deposit-datasets-result', component: DepositDatasetsResultComponent},
|
||||
{ path: 'participate/deposit-subject-result', component: DepositBySubjectResultComponent },
|
||||
{ path: 'participate/deposit-publications', component: DepositPublicationsComponent },
|
||||
{ path: 'participate/deposit-publications-result', component: DepositPublicationsResultComponent},
|
||||
{ path: 'search/find', component: SearchComponent},
|
||||
{ path: 'search/find/publications', component: SearchPublicationsComponent },
|
||||
{ path: 'search/find/datasets', component:SearchDatasetsComponent},
|
||||
{ path: 'search/find/software', component:SearchSoftwareComponent},
|
||||
{ path: 'search/find/projects', component:SearchProjectsComponent},
|
||||
{ path: 'search/find/dataproviders', component:SearchDataprovidersComponent },
|
||||
{ path: 'search/find/organizations', component:SearchOrganizationsComponent },
|
||||
{ path: 'search/content-providers', component: SearchCompatibleDataprovidersComponent},
|
||||
{ path: 'search/content-providers-table', component: SearchCompatibleDataprovidersTableComponent},
|
||||
{ path: 'search/entity-registries',component: SearchEntityRegistriesComponent},
|
||||
{ path: 'search/entity-registries-table', component: SearchEntityRegistriesTableComponent},
|
||||
{ path: 'search/journals', component: SearchJournalsComponent },
|
||||
{ path: 'search/journals-table', component: SearchJournalsTableComponent },
|
||||
{ path: 'search/advanced/publications', component: AdvancedSearchPublicationsComponent },
|
||||
{ path: 'search/advanced/datasets', component: AdvancedSearchPublicationsComponent },
|
||||
{ path: 'search/advanced/software', component: AdvancedSearchPublicationsComponent },
|
||||
{ path: 'search/advanced/organizations',component: AdvancedSearchPublicationsComponent },
|
||||
{ path: 'search/advanced/dataproviders', component: AdvancedSearchPublicationsComponent },
|
||||
{ path: 'search/advanced/projects', component: AdvancedSearchPublicationsComponent },
|
||||
{ path: 'project-report', loadChildren: './landingPages/htmlProjectReport/htmlProjectReport.module#HtmlProjectReportModule' },
|
||||
{ path: 'myclaims',component: MyClaimsComponent },
|
||||
{ path: 'claims', component: ClaimsAdminComponent },
|
||||
{ path: 'participate/claim', component: LinkingGenericComponent},
|
||||
{ path: 'participate/direct-claim',component: DirectLinkingComponent},
|
||||
{ path: 'claims-project-manager', component: ClaimsByTokenComponent },
|
||||
{ path: 'reload', loadChildren: './reload/reload.module#ReloadModule' },
|
||||
{ path: 'user-info', loadChildren: './login/user.module#UserModule' },
|
||||
{ path: 'error', component: ErrorPageComponent },
|
||||
{ path: '**',pathMatch: 'full',component: ErrorPageComponent }
|
||||
|
||||
|
||||
]),
|
||||
AppRoutingModule
|
||||
],
|
||||
declarations: [ AppComponent ],
|
||||
exports: [ AppComponent ],
|
||||
|
@ -167,3 +88,9 @@ import {LinkingGenericComponent} from './claims/linking/linkingGeneric.component
|
|||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule {}
|
||||
/*
|
||||
|
||||
, canActivate: [ IsRouteEnabled], data: {
|
||||
redirect: '/error'
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -7,6 +7,7 @@ import { StaticAutoCompleteComponent } from '../../utils/staticAutoComplete/stat
|
|||
declare var UIkit:any;
|
||||
import {Session} from '../../login/utils/helper.class';
|
||||
import {ErrorCodes} from '../../login/utils/guardHelper.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
// moduleId: module.id,
|
||||
|
@ -32,7 +33,7 @@ import {ErrorCodes} from '../../login/utils/guardHelper.class';
|
|||
</div>
|
||||
<div class="uk-width-expand@m">
|
||||
|
||||
<static-autocomplete [(list)] = concepts [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Concept name'" title = "Concepts" [multipleSelections]=true (addItem) = "select($event)" > </static-autocomplete>
|
||||
<static-autocomplete [(properties)]=properties[(list)] = concepts [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Concept name'" title = "Concepts" [multipleSelections]=true (addItem) = "select($event)" > </static-autocomplete>
|
||||
</div>
|
||||
</div-->
|
||||
<table class="uk-width-1-1 uk-table uk-table-responsive" ><tr>
|
||||
|
@ -49,7 +50,7 @@ import {ErrorCodes} from '../../login/utils/guardHelper.class';
|
|||
<option *ngFor="let category of categories" [value]="category.id" >{{category.label}}</option>
|
||||
</select>
|
||||
</td><td >
|
||||
<static-autocomplete [(list)] = concepts [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Concept name'" title = "Concepts" [multipleSelections]=true (addItem) = "select($event)" > </static-autocomplete>
|
||||
<static-autocomplete [(properties)]=properties [(list)] = concepts [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Concept name'" title = "Concepts" [multipleSelections]=true (addItem) = "select($event)" > </static-autocomplete>
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
@ -132,6 +133,8 @@ public showComponent:boolean = true ; // for claimed started from landing pages
|
|||
@Input() public projects;
|
||||
@Input() public results;
|
||||
@Input() public inlineEntity;
|
||||
@Input() public properties:EnvProperties;
|
||||
|
||||
public selectedCommunityId:string = "0";
|
||||
public selectedCategoryId:string ="0";
|
||||
// @Output() contextSelected = new EventEmitter();
|
||||
|
@ -206,7 +209,7 @@ getCommunities () {
|
|||
}else{
|
||||
this.loading = true;
|
||||
var token=Session.getUserJwt();
|
||||
this._contextService.getCommunities().subscribe(
|
||||
this._contextService.getCommunities(this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.communities = data.communities;
|
||||
this.loading = false;
|
||||
|
@ -228,7 +231,7 @@ getCommunities () {
|
|||
|
||||
}else{
|
||||
var token=Session.getUserJwt();
|
||||
this._contextService.getCategories(this.selectedCommunityId).subscribe(
|
||||
this._contextService.getCategories(this.selectedCommunityId,this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
|
||||
this.categories = (Array.isArray(data.category))? data.category:[data.category];
|
||||
|
@ -257,7 +260,7 @@ getCommunities () {
|
|||
}else{
|
||||
this.concepts = [];
|
||||
var token=Session.getUserJwt();
|
||||
this._contextService.getConcepts(this.selectedCategoryId, "",true).subscribe(
|
||||
this._contextService.getConcepts(this.selectedCategoryId, "",true, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
|
||||
this.concepts =data;
|
||||
|
@ -301,7 +304,7 @@ getCommunities () {
|
|||
this.conceptsClass[categoryId] = [];
|
||||
var token=Session.getUserJwt();
|
||||
this.conceptsCategoryLoading[categoryId] = true;
|
||||
this._contextService.getConcepts(categoryId, "",false).subscribe(
|
||||
this._contextService.getConcepts(categoryId, "",false, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
var concepts = (Array.isArray(data))? data:[data];
|
||||
for(var i=0;i<concepts.length; i++){
|
||||
|
|
|
@ -6,6 +6,8 @@ import {ProjectService} from '../../landingPages/project/project.service';
|
|||
import { Subject } from 'rxjs/Subject';
|
||||
import {ClaimProject} from './claimEntities.class';
|
||||
declare var UIkit:any;
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'claim-projects-search-form',
|
||||
|
||||
|
@ -21,7 +23,7 @@ declare var UIkit:any;
|
|||
</div>
|
||||
<div class="uk-width-expand@m">
|
||||
|
||||
<entities-autocomplete entityType="project" [funderId]="selectedFunderId" [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Project name or ID'" title = "Projects" [multipleSelections]=true (addItem) = "select($event)" ></entities-autocomplete>
|
||||
<entities-autocomplete [(properties)]=properties entityType="project" [funderId]="selectedFunderId" [allowDuplicates]=true [showSelected]=false [placeHolderMessage] = "'Project name or ID'" title = "Projects" [multipleSelections]=true (addItem) = "select($event)" ></entities-autocomplete>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
@ -45,6 +47,7 @@ export class ClaimProjectsSearchFormComponent {
|
|||
public selectedFunderId:string ="0";
|
||||
selectedFunderName:string ="Select funder:";
|
||||
@Output() projectSelected = new EventEmitter();
|
||||
@Input() public properties:EnvProperties;
|
||||
|
||||
public projects:string[];
|
||||
public warningMessage = "";
|
||||
|
@ -167,7 +170,7 @@ handleClick(event){
|
|||
}
|
||||
getFunders () {
|
||||
console.info("Getting Funders....");
|
||||
this._projectService.getFunders().subscribe(
|
||||
this._projectService.getFunders(this.properties).subscribe(
|
||||
data => {
|
||||
this.funders = data[1];
|
||||
console.log("this.funders");
|
||||
|
|
|
@ -10,6 +10,8 @@ import {SearchSoftwareService} from '../../services/searchSoftware.service';
|
|||
import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ClaimResult} from '../claim-utils/claimEntities.class';
|
||||
import{DOI} from '../../utils/string-utils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
declare var UIkit:any;
|
||||
|
||||
@Component({
|
||||
|
@ -27,6 +29,8 @@ export class ClaimResultSearchFormComponent {
|
|||
|
||||
}
|
||||
ngOnInit() {
|
||||
console.log("Init of ClaimResultSearchFormComponent");
|
||||
console.log(this.properties);
|
||||
if(this.keyword !=null && this.keyword.length > 0){
|
||||
this.search(false);
|
||||
}
|
||||
|
@ -43,6 +47,8 @@ export class ClaimResultSearchFormComponent {
|
|||
@Input() public select:boolean = true ;
|
||||
@Input() public keyword:string = '';
|
||||
@Input() public selectedResults:ClaimResult[];
|
||||
@Input() public properties:EnvProperties;
|
||||
|
||||
// @Output() datasetsChange = new EventEmitter();
|
||||
// @Output() publicationsChange = new EventEmitter();
|
||||
|
||||
|
@ -146,14 +152,14 @@ export class ClaimResultSearchFormComponent {
|
|||
private getCrossrefResults (term: string, size : number, page : number) {
|
||||
this.crossrefStatus = this.errorCodes.LOADING;
|
||||
if( this.DOIs.length > 0 ){
|
||||
this._searchCrossrefService.searchCrossrefByDOIs(this.DOIs).subscribe(
|
||||
this._searchCrossrefService.searchCrossrefByDOIs(this.DOIs, this.properties.searchCrossrefAPIURL).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.crossrefResults = data.items;
|
||||
this.crossrefPage=page;
|
||||
this.crossrefResultsNum = data['total-results'];
|
||||
if(data.items == 0){
|
||||
this._searchCrossrefService.searchCrossrefResults(term, size, page).subscribe(
|
||||
this._searchCrossrefService.searchCrossrefResults(term, size, page, this.properties.searchCrossrefAPIURL).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.crossrefResults = data.items;
|
||||
|
@ -178,7 +184,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
|
|||
},
|
||||
err => {
|
||||
//console.log(err);
|
||||
this._searchCrossrefService.searchCrossrefResults(term, size, page).subscribe(
|
||||
this._searchCrossrefService.searchCrossrefResults(term, size, page, this.properties.searchCrossrefAPIURL).subscribe(
|
||||
data => {
|
||||
this.crossrefResults = data.items;
|
||||
this.crossrefPage=page;
|
||||
|
@ -198,7 +204,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
|
|||
}else{
|
||||
|
||||
|
||||
this._searchCrossrefService.searchCrossrefResults(term, size, page).subscribe(
|
||||
this._searchCrossrefService.searchCrossrefResults(term, size, page, this.properties.searchCrossrefAPIURL).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.crossrefResults = data.items;
|
||||
|
@ -222,7 +228,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
|
|||
|
||||
if(this.DOIs.length > 0 ){
|
||||
this.openairePubsStatus = this.errorCodes.LOADING;
|
||||
this._searchPublicationsService.searchPublicationsByDois(this.DOIs, null, page, size, []).subscribe(
|
||||
this._searchPublicationsService.searchPublicationsByDois(this.DOIs, null, page, size, [], this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.openairePubsPage=page;
|
||||
|
@ -243,7 +249,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
|
|||
);
|
||||
}else{
|
||||
this.openairePubsStatus = this.errorCodes.LOADING;
|
||||
this._searchPublicationsService.searchPublications('q='+term, null, page, size, []).subscribe(
|
||||
this._searchPublicationsService.searchPublications('q='+term, null, page, size, [], this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.openairePubsPage=page;
|
||||
|
@ -300,7 +306,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
|
|||
|
||||
//passing structures in order to fill them in service
|
||||
this._searchOrcidService.searchOrcidAuthor(term, this.authorIds,
|
||||
this.authorGivenNames, this.authorFamilyNames).subscribe(
|
||||
this.authorGivenNames, this.authorFamilyNames, this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null && data == true) {
|
||||
this.getOrcidResultsByIndex(0);
|
||||
|
@ -330,7 +336,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
|
|||
this.orcidStatus = this.errorCodes.LOADING;
|
||||
//passing structures in order to fill them in service
|
||||
this._searchOrcidService.searchOrcidAuthors(term, this.authorIds,
|
||||
this.authorGivenNames, this.authorFamilyNames).subscribe(
|
||||
this.authorGivenNames, this.authorFamilyNames, this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null && data == true) {
|
||||
this.getOrcidResultsByIndex(0);
|
||||
|
@ -366,7 +372,7 @@ private getCrossrefResults (term: string, size : number, page : number) {
|
|||
this.authorId = id;
|
||||
console.info("getOrcidResultsById: "+id);
|
||||
this.orcidStatus = this.errorCodes.LOADING;
|
||||
this._searchOrcidService.searchOrcidPublications(id).subscribe(
|
||||
this._searchOrcidService.searchOrcidPublications(id, this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.orcidResults=data['orcid-work'];
|
||||
|
@ -492,7 +498,7 @@ openaireSoftwarePageChange($event) {
|
|||
private searchOpenaireData (term: string, size : number, page : number) {
|
||||
if(this.DOIs.length > 0 ){
|
||||
this.openaireDataStatus = this.errorCodes.LOADING;
|
||||
this._searchDatasetsService.searchDatasetsByDois(this.DOIs, null, page, size, []).subscribe(
|
||||
this._searchDatasetsService.searchDatasetsByDois(this.DOIs, null, page, size, [], this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.openaireDataPage=page;
|
||||
|
@ -510,7 +516,7 @@ openaireSoftwarePageChange($event) {
|
|||
}
|
||||
);
|
||||
}else{
|
||||
this._searchDatasetsService.searchDatasets('q='+term+'', null, page, size, []).subscribe(
|
||||
this._searchDatasetsService.searchDatasets('q='+term+'', null, page, size, [], this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.openaireDataPage=page;
|
||||
|
@ -535,7 +541,7 @@ openaireSoftwarePageChange($event) {
|
|||
private searchOpenaireSoftware (term: string, size : number, page : number) {
|
||||
if(this.DOIs.length > 0 ){
|
||||
this.openaireSoftwareStatus = this.errorCodes.LOADING;
|
||||
this._searchSoftwareService.searchSoftwareByDois(this.DOIs, null, page, size, []).subscribe(
|
||||
this._searchSoftwareService.searchSoftwareByDois(this.DOIs, null, page, size, [], this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.openaireSoftwarePage=page;
|
||||
|
@ -553,7 +559,7 @@ openaireSoftwarePageChange($event) {
|
|||
}
|
||||
);
|
||||
}else{
|
||||
this._searchSoftwareService.searchSoftware('q='+term+'', null, page, size, []).subscribe(
|
||||
this._searchSoftwareService.searchSoftware('q='+term+'', null, page, size, [], this.properties).subscribe(
|
||||
data => {
|
||||
if(data != null) {
|
||||
this.openaireSoftwarePage=page;
|
||||
|
@ -576,7 +582,8 @@ openaireSoftwarePageChange($event) {
|
|||
|
||||
}
|
||||
private getDataciteResults (term: string, size : number, page : number) {
|
||||
this._searchDataciteService.searchDataciteResults(term, size, page).subscribe(
|
||||
console.log("getDataciteResults + "+this.properties.searchDataciteAPIURL)
|
||||
this._searchDataciteService.searchDataciteResults(term, size, page, this.properties).subscribe(
|
||||
data => {
|
||||
this.dataciteResults = data.data;
|
||||
this.datacitePage=page;
|
||||
|
|
|
@ -99,8 +99,8 @@
|
|||
<tr *ngFor="let claim of claims " >
|
||||
<td *ngIf="enableDelete"><input [id]="claim.id" type="checkbox" (click)="select(claim,$event)" [ngModel]="isSelected(claim.id)"/></td>
|
||||
|
||||
<td><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
|
||||
<td><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
|
||||
<td><claim-entity [entity]="claim.target" [type]="claim.targetType" [(properties)]=properties> </claim-entity></td>
|
||||
<td><claim-entity [entity]="claim.source" [type]="claim.sourceType" [(properties)]=properties> </claim-entity></td>
|
||||
<td *ngIf="showUserEmail">{{claim.userMail}}</td>
|
||||
<td>{{claim.date}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -6,6 +6,7 @@ import {ClaimsService} from '../service/claims.service';
|
|||
import {ModalLoading} from '../../../utils/modal/loading.component';
|
||||
import {AlertModal} from '../../../utils/modal/alert';
|
||||
import {Session} from '../../../login/utils/helper.class';
|
||||
import{EnvProperties} from '../../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -15,10 +16,17 @@ import {Session} from '../../../login/utils/helper.class';
|
|||
|
||||
})
|
||||
export class DisplayClaimsComponent {
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (private _claimService: ClaimsService, private route: ActivatedRoute, private _router:Router, private location: Location) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
if( this.myClaims){
|
||||
this.fetchBy = "User";
|
||||
|
@ -109,7 +117,7 @@ export class DisplayClaimsComponent {
|
|||
types+=(types.length>0?'&':'')+"types="+type;
|
||||
}
|
||||
if(this.fetchBy =="Project" ){
|
||||
this._claimService.getClaimsByProject(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe(
|
||||
this._claimService.getClaimsByProject(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.claims = data.data;
|
||||
this.resultsNum= data.total;
|
||||
|
@ -119,7 +127,7 @@ export class DisplayClaimsComponent {
|
|||
}
|
||||
);
|
||||
}else if(this.fetchBy =="User"){
|
||||
this._claimService.getClaimsByUser(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe(
|
||||
this._claimService.getClaimsByUser(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types,this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.claims = data.data;
|
||||
this.resultsNum= data.total;
|
||||
|
@ -129,7 +137,7 @@ export class DisplayClaimsComponent {
|
|||
}
|
||||
);
|
||||
}else if(this.fetchBy =="Result"){
|
||||
this._claimService.getClaimsByResult(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe(
|
||||
this._claimService.getClaimsByResult(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.claims = data.data;
|
||||
this.resultsNum= data.total;
|
||||
|
@ -139,7 +147,7 @@ export class DisplayClaimsComponent {
|
|||
}
|
||||
);
|
||||
}else if(this.fetchBy =="Context"){
|
||||
this._claimService.getClaimsBycontext(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe(
|
||||
this._claimService.getClaimsBycontext(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.claims = data.data;
|
||||
this.resultsNum= null;
|
||||
|
@ -150,7 +158,7 @@ export class DisplayClaimsComponent {
|
|||
}
|
||||
);
|
||||
}else{
|
||||
this._claimService.getClaims(this.size,this.page,this.keyword,this.sortby,this.descending, types).subscribe(
|
||||
this._claimService.getClaims(this.size,this.page,this.keyword,this.sortby,this.descending, types, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.claims = data.data;
|
||||
this.resultsNum = null;
|
||||
|
@ -418,7 +426,7 @@ handleErrors(err){
|
|||
var token=Session.getUserJwt();
|
||||
console.log("Deleting claim with id:"+id);
|
||||
// this._claimService.deleteClaimById(id);
|
||||
this._claimService.deleteClaimById(id).subscribe(
|
||||
this._claimService.deleteClaimById(id, this.properties.claimsAPIURL).subscribe(
|
||||
res => {
|
||||
console.log('Delete response'+res.code );
|
||||
console.log("Deleted claim with id:"+ id);
|
||||
|
@ -450,7 +458,7 @@ handleErrors(err){
|
|||
}else{
|
||||
var token=Session.getUserJwt();
|
||||
console.warn("Deleting claim with ids:"+ids);
|
||||
this._claimService.deleteBulk(ids).subscribe(
|
||||
this._claimService.deleteBulk(ids,this.properties.claimsAPIURL).subscribe(
|
||||
res => {
|
||||
console.info('Delete response'+res.code );
|
||||
console.warn("Deleted ids:"+ res.deletedIds);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import{EnvProperties} from '../../../utils/properties/env-properties';
|
||||
|
||||
//Usage Example "<claim-entity [entity]="" [type]="" > </claim-entity>"
|
||||
|
||||
|
@ -22,7 +23,7 @@ import {Component, Input} from '@angular/core';
|
|||
</div>
|
||||
<div *ngIf="type == 'project' " title="Project">
|
||||
<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="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg></span>
|
||||
<project-title [project]="entity"></project-title>
|
||||
<project-title [project]="entity" [(searchLink)]=properties.searchLinkToProject></project-title>
|
||||
</div>
|
||||
<div *ngIf="type == 'context' " title="Concept">
|
||||
<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"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>
|
||||
|
@ -34,14 +35,11 @@ import {Component, Input} from '@angular/core';
|
|||
export class ClaimEntityFormatter {
|
||||
@Input() entity: string[];
|
||||
@Input() type: string;
|
||||
@Input() properties: EnvProperties;
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
if(this.type && this.type == "software"){
|
||||
|
||||
console.log(this.entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../../../utils/routerHelper.class';
|
||||
|
||||
//Usage Example "<project-title [project]="X" > </project-title>"
|
||||
|
@ -15,11 +14,12 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
|
|||
|
||||
export class ProjectTitleFormatter {
|
||||
@Input() project: string[];
|
||||
@Input() searchLink: string;
|
||||
public url:string;
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
this.url = OpenaireProperties.getsearchLinkToProject() + "?projectId=" + this.project["openaireId"];
|
||||
this.url =this.searchLink+ "?projectId=" + this.project["openaireId"];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,62 +3,57 @@ import {URLSearchParams } from '@angular/http';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
// import {Claim} from '../claim';
|
||||
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import { } from '../../../shared/cache.service';
|
||||
import { CustomOptions } from './customOptions.class';
|
||||
@Injectable()
|
||||
export class ClaimsService {
|
||||
private baseUrl;
|
||||
constructor(private http: Http ) {
|
||||
this.baseUrl = OpenaireProperties.getClaimsAPIURL();
|
||||
}
|
||||
|
||||
private getClaimRequest(size : number, page : number, url :string, fromCache:boolean):any {
|
||||
console.info('ClaimsService: Claims request: '+url);
|
||||
let key = url;
|
||||
//(fromCache && OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url
|
||||
return this.http.get(url, CustomOptions.getAuthOptions())
|
||||
return this.http.get(url, CustomOptions.getAuthOptions())
|
||||
.map(request => <any> request.json())
|
||||
.do(request => console.info("Get claims: offset = "+(size*(page-1)) + " limit ="+size ))
|
||||
.catch(this.handleError);
|
||||
}
|
||||
getClaims( size : number, page : number, keyword:string, sortby: string, descending: boolean, types: string):any {
|
||||
getClaims( size : number, page : number, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string):any {
|
||||
console.info('ClaimsService: getClaims ' );
|
||||
console.info('ClaimsService: Types : '+types );
|
||||
let url = this.baseUrl +"claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
let url = apiUrl +"claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
return this.getClaimRequest(size,page,url,true);
|
||||
|
||||
}
|
||||
getClaimsByUser( size : number, page : number, user:string, keyword:string, sortby: string, descending: boolean, types: string):any {
|
||||
getClaimsByUser( size : number, page : number, user:string, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string):any {
|
||||
console.info('ClaimsService: getClaims for user : '+user);
|
||||
let url = this.baseUrl +"users/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
let url = apiUrl +"users/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
return this.getClaimRequest(size,page,url,false);
|
||||
|
||||
}
|
||||
getClaimsBycontext( size : number, page : number, contextId:string, keyword:string, sortby: string, descending: boolean, types: string ):any {
|
||||
getClaimsBycontext( size : number, page : number, contextId:string, keyword:string, sortby: string, descending: boolean, types: string , apiUrl:string):any {
|
||||
console.info('ClaimsService: getClaims for context : '+contextId);
|
||||
let url = this.baseUrl +"contexts/"+contextId+"/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
let url = apiUrl +"contexts/"+contextId+"/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
return this.getClaimRequest(size,page,url,true);
|
||||
|
||||
}
|
||||
getClaimsByResult( size : number, page : number, resultId:string, keyword:string, sortby: string, descending: boolean, types: string ):any {
|
||||
getClaimsByResult( size : number, page : number, resultId:string, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string ):any {
|
||||
console.info('ClaimsService: getClaims for result : '+resultId);
|
||||
let url = this.baseUrl +"results/"+resultId+"/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
let url = apiUrl +"results/"+resultId+"/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
return this.getClaimRequest(size,page,url,true);
|
||||
|
||||
}
|
||||
getClaimsByProject( size : number, page : number, projectId:string, keyword:string, sortby: string, descending: boolean, types: string ):any {
|
||||
getClaimsByProject( size : number, page : number, projectId:string, keyword:string, sortby: string, descending: boolean, types: string, apiUrl:string ):any {
|
||||
console.info('ClaimsService: getClaims for project : '+projectId);
|
||||
let url = this.baseUrl +"projects/"+projectId+"/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
let url = apiUrl +"projects/"+projectId+"/claims"+"?offset="+(size*(page-1) + "&limit="+size)+"&keyword="+keyword+"&sortby="+sortby+"&descending="+descending+"&"+types;
|
||||
return this.getClaimRequest(size,page,url,true);
|
||||
}
|
||||
|
||||
deleteClaimById(claimId:string ):any{
|
||||
deleteClaimById(claimId:string , apiUrl:string):any{
|
||||
console.warn('Trying to delete claim with id : '+claimId);
|
||||
let url = this.baseUrl +"claims/"+claimId;
|
||||
let url = apiUrl +"claims/"+claimId;
|
||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
||||
// let options = new RequestOptions({ headers: headers });
|
||||
return this.http.delete( url, CustomOptions.getAuthOptionsWithBody()).map(request => <any> request.json())
|
||||
|
@ -66,7 +61,7 @@ export class ClaimsService {
|
|||
.catch(this.handleError);
|
||||
|
||||
}
|
||||
deleteBulk(claimIds:string[]):any{
|
||||
deleteBulk(claimIds:string[], apiUrl:string):any{
|
||||
|
||||
console.warn('Trying to delete claims with ids : '+claimIds);
|
||||
var url = "";
|
||||
|
@ -74,7 +69,7 @@ export class ClaimsService {
|
|||
for(var claimId of claimIds){
|
||||
url=url+(url.length >0 ?"&":"")+"claimId="+claimId;
|
||||
}
|
||||
url= this.baseUrl +"claims/bulk?"+url;
|
||||
url= apiUrl +"claims/bulk?"+url;
|
||||
|
||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
||||
// let options = new RequestOptions({ headers: headers });
|
||||
|
@ -83,9 +78,9 @@ export class ClaimsService {
|
|||
.catch(this.handleError);
|
||||
|
||||
}
|
||||
insertBulkClaims(claims):any{
|
||||
insertBulkClaims(claims, apiUrl:string):any{
|
||||
console.warn('Trying toinsert claims : '+claims);
|
||||
let url = this.baseUrl +"claims/bulk";
|
||||
let url = apiUrl +"claims/bulk";
|
||||
let body = JSON.stringify( claims );
|
||||
console.warn('Json body: : '+body);
|
||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
||||
|
@ -96,9 +91,9 @@ export class ClaimsService {
|
|||
.catch(this.handleError);
|
||||
|
||||
}
|
||||
insertClaim(claim):any{
|
||||
insertClaim(claim, apiUrl:string):any{
|
||||
console.warn('Trying toinsert claim : '+claim);
|
||||
let url = this.baseUrl +"claims";
|
||||
let url = apiUrl +"claims";
|
||||
let body = JSON.stringify( claim );
|
||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
||||
// let options = new RequestOptions({ headers: headers });
|
||||
|
@ -108,9 +103,9 @@ export class ClaimsService {
|
|||
.catch(this.handleError);
|
||||
|
||||
}
|
||||
insertDirectRecords(records):any{
|
||||
insertDirectRecords(records, apiUrl:string):any{
|
||||
console.warn('Trying to feedrecords : '+records);
|
||||
let url = this.baseUrl +"feed/bulk";
|
||||
let url = apiUrl +"feed/bulk";
|
||||
let body = JSON.stringify( records );
|
||||
console.warn('Json body: : '+body);
|
||||
// let headers = new Headers({ 'Content-Type': 'application/json' });
|
||||
|
@ -128,8 +123,8 @@ export class ClaimsService {
|
|||
return Observable.throw(error || 'Server error');
|
||||
}
|
||||
|
||||
getClaim(id:string):any {
|
||||
let url = this.baseUrl+"claims/"+id;
|
||||
getClaim(id:string, apiUrl:string):any {
|
||||
let url = apiUrl+"claims/"+id;
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get(url)
|
||||
.map(res => res.json())
|
||||
|
|
|
@ -3,22 +3,18 @@ import {Jsonp, URLSearchParams, RequestOptions, Headers} from '@angular/http';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Claim} from '../claim';
|
||||
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
||||
import {AutoCompleteValue} from '../../../searchPages/searchUtils/searchHelperClasses.class';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import { } from '../../../shared/cache.service';
|
||||
import { COOKIE } from '../../../login/utils/helper.class';
|
||||
@Injectable()
|
||||
export class ContextsService {
|
||||
private baseUrl;
|
||||
constructor(private http: Http ) {
|
||||
this.baseUrl = OpenaireProperties.getClaimsAPIURL();
|
||||
}
|
||||
|
||||
public getCommunities():any {
|
||||
let url = this.baseUrl + 'communities';
|
||||
public getCommunities( apiUrl:string):any {
|
||||
let url = apiUrl + 'communities';
|
||||
let key = url;
|
||||
|
||||
|
||||
|
@ -28,9 +24,9 @@ export class ContextsService {
|
|||
// .do(request => console.info("Get claims: offset = "))
|
||||
.catch(this.handleError);
|
||||
}
|
||||
public getCategories(communityId :string):any {
|
||||
public getCategories(communityId :string, apiUrl:string):any {
|
||||
console.info('ContextsService: request categories for community with id '+communityId);
|
||||
let url= this.baseUrl + 'communities/' + communityId + '/categories';
|
||||
let url= apiUrl + 'communities/' + communityId + '/categories';
|
||||
let key = url;
|
||||
|
||||
|
||||
|
@ -39,9 +35,9 @@ export class ContextsService {
|
|||
// .do(request => console.info("Get claims: offset = " ))
|
||||
.catch(this.handleError);;
|
||||
}
|
||||
public getConcepts(categoryId :string, keyword: string, parsing:boolean):any {
|
||||
public getConcepts(categoryId :string, keyword: string, parsing:boolean, apiUrl:string):any {
|
||||
console.info('ContextsService: request concept for category with id '+categoryId + ' and keyword '+ keyword);
|
||||
let url= this.baseUrl + 'categories/' + categoryId+ "/concepts";
|
||||
let url= apiUrl + 'categories/' + categoryId+ "/concepts";
|
||||
let key = url+"_parsing="+parsing;
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
|
@ -10,8 +9,8 @@ export class SearchCrossrefService {
|
|||
constructor( private http: Http ) {}
|
||||
|
||||
|
||||
searchCrossrefResults (term: string, size : number, page : number):any {
|
||||
let url = OpenaireProperties.getSearchCrossrefAPIURL()+'?query='+term+'&rows='+size+'&offset='+(size*(page-1));
|
||||
searchCrossrefResults (term: string, size : number, page : number, apiUrl:string):any {
|
||||
let url = apiUrl+'?query='+term+'&rows='+size+'&offset='+(size*(page-1));
|
||||
let key = url;
|
||||
|
||||
return this.http.get(url)
|
||||
|
@ -20,18 +19,13 @@ export class SearchCrossrefService {
|
|||
//.catch(this.handleError);
|
||||
|
||||
}
|
||||
searchCrossrefByDOIs(DOIs: string[]):any {
|
||||
/*
|
||||
$request ="http://api.crossref.org/works"."?filter=";
|
||||
foreach($dois as $doi){
|
||||
$request.="doi:".urlencode( trim($doi)).",";
|
||||
}
|
||||
*/
|
||||
searchCrossrefByDOIs(DOIs: string[], apiUrl:string):any {
|
||||
|
||||
var doisParams = "";
|
||||
for(var i =0 ;i < DOIs.length; i++){
|
||||
doisParams+=(doisParams.length > 0?",":"")+'doi:'+DOIs[i];
|
||||
}
|
||||
let url = OpenaireProperties.getSearchCrossrefAPIURL()+'?filter='+doisParams;
|
||||
let url = apiUrl+'?filter='+doisParams;
|
||||
let key = url;
|
||||
|
||||
|
||||
|
@ -41,12 +35,12 @@ export class SearchCrossrefService {
|
|||
//.catch(this.handleError);
|
||||
|
||||
}
|
||||
searchCrossrefByMultipleDOIs(dois: string[]):any {
|
||||
let url = OpenaireProperties.getSearchCrossrefAPIURL()+'?filter=doi:';
|
||||
searchCrossrefByMultipleDOIs(dois: string[], apiUrl:string):any {
|
||||
let url = apiUrl+'?filter=doi:';
|
||||
for(var i=0; i<dois.length; i++){
|
||||
url=url+(url.length==0?'':',')+'doi:'+dois[i];
|
||||
}
|
||||
url = OpenaireProperties.getSearchCrossrefAPIURL()+'?filter='+url;
|
||||
url = apiUrl+'?filter='+url;
|
||||
let key = url;
|
||||
|
||||
|
||||
|
|
|
@ -1,31 +1,32 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import{EnvProperties} from '../../../utils/properties/env-properties';
|
||||
|
||||
@Injectable()
|
||||
export class SearchDataciteService {
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
searchDataciteResults (term: string, size : number, page : number):any {
|
||||
console.info("In search datacite results "+term);
|
||||
let url = OpenaireProperties.getSearchDataciteAPIURL()+'?query='+term+'&rows='+size+'&start='+(size*(page-1));
|
||||
searchDataciteResults (term: string, size : number, page : number, properties:EnvProperties):any {
|
||||
console.info("In search datacite results "+term+ " "+properties.searchDataciteAPIURL);
|
||||
let url = properties.searchDataciteAPIURL+'?query='+term+'&rows='+size+'&start='+(size*(page-1));
|
||||
let key = url;
|
||||
|
||||
return this.http.get( (OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get( ( properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(request => <any> request.json())
|
||||
.do(items => console.info(items))
|
||||
.do(items => console.log("Datacite Results: total results = "+items.meta.total+" keyword = "+term));
|
||||
//.catch(this.handleError);
|
||||
}
|
||||
getDataciteResultByDOI (doi: string):any {
|
||||
getDataciteResultByDOI (doi: string, properties:EnvProperties):any {
|
||||
console.info("Fetch datacite resultt by DOI: "+doi);
|
||||
let url = OpenaireProperties.getSearchDataciteAPIURL()+'/'+doi;
|
||||
let url = properties.searchDataciteAPIURL+'/'+doi;
|
||||
let key = url;
|
||||
|
||||
return this.http.get( (OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get( (properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(request => <any> request.json())
|
||||
.do(items => console.info(items));
|
||||
// .do(items => console.log("Datacite Results: total results = "+items.meta.total+" doi = "+doi))
|
||||
|
|
|
@ -3,7 +3,7 @@ import {URLSearchParams} from '@angular/http';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import { Headers, RequestOptions } from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
||||
import{EnvProperties} from '../../../utils/properties/env-properties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
|
@ -14,13 +14,13 @@ export class SearchOrcidService {
|
|||
|
||||
|
||||
searchOrcidAuthor (term: string, authorIds: string[],
|
||||
authorGivenNames: string[], authorFamilyNames: string[]):any {
|
||||
authorGivenNames: string[], authorFamilyNames: string[], properties:EnvProperties):any {
|
||||
console.info("In searchOrcidAuthor: "+term);
|
||||
|
||||
var headers = new Headers();
|
||||
headers.append('Accept', 'application/orcid+json');
|
||||
|
||||
let url = OpenaireProperties.getSearchOrcidURL()+term+'/orcid-bio';
|
||||
let url = properties.searchOrcidURL + term+'/orcid-bio';
|
||||
let key = url;
|
||||
|
||||
return this.http.get(url, { headers: headers })
|
||||
|
@ -32,13 +32,13 @@ export class SearchOrcidService {
|
|||
}
|
||||
|
||||
searchOrcidAuthors (term: string, authorIds: string[],
|
||||
authorGivenNames: string[], authorFamilyNames: string[]):any {
|
||||
authorGivenNames: string[], authorFamilyNames: string[], properties:EnvProperties):any {
|
||||
console.info("In search Orcid authors for keyword: "+term);
|
||||
|
||||
var headers = new Headers();
|
||||
headers.append('Accept', 'application/orcid+json');
|
||||
|
||||
let url = OpenaireProperties.getSearchOrcidURL()+'search/orcid-bio?defType=edismax&q='+term+'&qf=given-name^1.0+family-name^2.0+other-names^1.0+credit-name^1.0&start=0&rows=10';
|
||||
let url = properties.searchOrcidURL+'search/orcid-bio?defType=edismax&q='+term+'&qf=given-name^1.0+family-name^2.0+other-names^1.0+credit-name^1.0&start=0&rows=10';
|
||||
let key = url;
|
||||
|
||||
return this.http.get(url, { headers: headers })
|
||||
|
@ -47,13 +47,13 @@ export class SearchOrcidService {
|
|||
|
||||
}
|
||||
|
||||
searchOrcidPublications (id: string):any {
|
||||
searchOrcidPublications (id: string, properties:EnvProperties):any {
|
||||
console.info("In search Orcid publications for author: "+id);
|
||||
|
||||
var headers = new Headers();
|
||||
headers.append('Accept', 'application/orcid+json');
|
||||
|
||||
let url = OpenaireProperties.getSearchOrcidURL()+id+'/orcid-works';
|
||||
let url =properties.searchOrcidURL+id+'/orcid-works';
|
||||
let key = url;
|
||||
|
||||
return this.http.get(url, { headers: headers })
|
||||
|
|
|
@ -0,0 +1,166 @@
|
|||
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
||||
<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="uk-container">
|
||||
<!--div *ngIf="accessStatus=='empty'" class="uk-margin-top uk-width-medium-2-3 uk-container-center">
|
||||
<div class="uk-block uk-block-primary uk-block-large uk-contrast uk-text-center">
|
||||
<p class="uk-text-large">Please enter your email and then press 'See Claims' button.</p>
|
||||
<form class="uk-form">
|
||||
<fieldset data-uk-margin>
|
||||
<input type="text" placeholder="example@email.com" name="email" [(ngModel)]="email">
|
||||
<button (click)="validateJWTandToken()" class=" uk-button uk-button-default">See Claims</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div-->
|
||||
|
||||
<div *ngIf="accessStatus=='invalid'" class="uk-margin-top uk-width-medium-2-3 uk-container-center">
|
||||
<div class="uk-block uk-block-primary uk-block-large uk-contrast uk-text-center">
|
||||
<!--p class="uk-text-large">Oops! There is no entry for you! Please retry with another email or for another project.</p-->
|
||||
<!--button (click)="accessStatus='empty'" class=" uk-button uk-button-default">Retry</button-->
|
||||
<p class="uk-text-large">Oops! Your email does not give you the authority to view claims for the selected project. Please contact the administrators.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="accessStatus=='valid'">
|
||||
<div class="uk-article-title custom-article-title">
|
||||
Claims Administrator
|
||||
<a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
|
||||
routerLinkActive="router-link-active"
|
||||
routerLink="/search/project" >
|
||||
{{project['name']}} ({{project['funderName']}})
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h2> Pending Claims</h2>
|
||||
|
||||
<div *ngIf=" pending_claims && pending_claims.length == 0" >
|
||||
<div class = "uk-alert uk-alert-primary " >No pending claims found.</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-overflow-container custom-dataTable-content">
|
||||
|
||||
<div class="uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted">
|
||||
<form class="uk-text-center uk-panel">
|
||||
<input type="text" class="uk-input uk-width-1-3" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="filterQuery" name="keyword" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<span *ngIf="pending_claims && pending_claims.length > 0 && totalPendingResults.count > 0">
|
||||
{{totalPendingResults.count}} pending claims, page {{activePendingPage.page}} of {{totalPages(totalPendingResults.count)}}
|
||||
<paging-no-load class="uk-float-right" [currentPage]="activePendingPage.page" [totalResults]="totalPendingResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table1, $event, 'pending')"></paging-no-load>
|
||||
</span>
|
||||
<table #filtered1 *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped">
|
||||
<!--[mfData]="pending_claims | claimsDatatable : [filterQuery, totalPendingResults, activePendingPage]" #mf1="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
|
||||
<!--[(mfSortBy)]="sortByClaimDate1" (mfSortOrder)="sortOrder"-->
|
||||
<thead>
|
||||
<tr>
|
||||
<th> Research Result </th>
|
||||
<th class="uk-text-center">Claimed By </th>
|
||||
<th class="uk-text-center">Claimed Date </th>
|
||||
<th class="uk-text-center">Approve</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="uk-table-middle" *ngFor="let claim1 of mf1.data">
|
||||
<td class="uk-width-2-5" *ngIf="claim1.targetType != 'project'"><claim-entity [entity]="claim1.target" [type]="claim1.targetType" [(properties)]=properties> </claim-entity></td>
|
||||
<td class="uk-width-2-5 uk-text-center" *ngIf="claim1.sourceType != 'project'"><claim-entity [entity]="claim1.source" [type]="claim1.sourceType" [(properties)]=properties> </claim-entity></td>
|
||||
<td class="uk-width-1-5 uk-text-center">{{claim1.userMail}}</td>
|
||||
<td class="uk-width-1-5 uk-text-center">{{claim1.date}}</td>
|
||||
<td class="uk-width-1-5 uk-text-center">
|
||||
|
||||
<label>
|
||||
Yes <input [id]="claim1.id" type="checkbox" (click)="selectApprove(claim1.id,$event)" [ngModel]="isSelectedRight(claim1.id)"/>
|
||||
</label>
|
||||
<label>
|
||||
No <input [id]="claim1.id" type="checkbox" (click)="selectDisapprove(claim1.id,$event)" [ngModel]="isSelectedWrong(claim1.id)"/>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="uk-text-small uk-text-right">*Note that claims you did not approved or disapproved are considered as right (but not curated)</div>
|
||||
<button class="uk-button uk-button-primary uk-float-right" type="submit" (click)="saveChanges()">Save Changes</button>
|
||||
|
||||
<h2> Already Curated Claims</h2>
|
||||
|
||||
<div *ngIf=" curated_claims && curated_claims.length == 0" >
|
||||
<div class = "uk-alert uk-alert-primary " >No curated claims found.</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-overflow-container custom-dataTable-content">
|
||||
|
||||
<div class="uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted">
|
||||
<form class="uk-text-center uk-panel">
|
||||
<input type="text" class="uk-input uk-width-1-3" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="filterQuery2" name="keyword" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<span *ngIf="curated_claims && curated_claims.length > 0 && totalCuratedResults.count > 0">
|
||||
{{totalCuratedResults.count}} curated claims, page {{activeCuratedPage.page}} of {{totalPages(totalCuratedResults.count)}}
|
||||
<paging-no-load class="uk-float-right" [currentPage]="activeCuratedPage.page" [totalResults]="totalCuratedResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table2, $event, 'curated')"> </paging-no-load>
|
||||
</span>
|
||||
|
||||
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped" >
|
||||
<!--[mfData]="curated_claims | claimsDatatable : [filterQuery2, totalCuratedResults, activeCuratedPage]" #mf2="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
|
||||
<!--[(mfSortBy)]="sortByCurationDate2" [(mfSortOrder)]="sortOrder"-->
|
||||
<thead>
|
||||
<!--tr>
|
||||
<td colspan="6">
|
||||
<form class="uk-text-center uk-panel uk-background-muted">
|
||||
<input type="text" class="uk-input uk-width-1-3" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="filterQuery2" name="keyword" />
|
||||
</form>
|
||||
</td>
|
||||
</tr-->
|
||||
<!--tr>
|
||||
<td>
|
||||
Filter curated claims:
|
||||
<input class="uk-input uk-width-1-3" [(ngModel)]="filterQuery2"/>
|
||||
</td>
|
||||
</tr-->
|
||||
<tr>
|
||||
<th>Research Result</th>
|
||||
<!--th>Link to</th-->
|
||||
<th class="uk-text-center">Claimed by </th>
|
||||
<th class="uk-text-center">Claimed Date </th>
|
||||
<th class="uk-text-center">Curated by </th>
|
||||
<th class="uk-text-center">Curation Date </th>
|
||||
<th class="uk-text-center">Approved</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="uk-table-middle" *ngFor="let claim of mf2.data let i=index">
|
||||
<td class="uk-width-1-6" *ngIf="claim.targetType != 'project'"><claim-entity [entity]="claim.target" [type]="claim.targetType" [(properties)]=properties> </claim-entity></td>
|
||||
<td class="uk-width-1-6" *ngIf="claim.sourceType != 'project'"><claim-entity [entity]="claim.source" [type]="claim.sourceType" [(properties)]=properties> </claim-entity></td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.userMail}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.date}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.curatedBy}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.curationDate}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">
|
||||
|
||||
<label>
|
||||
Yes <input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" [ngModel]="isRight(claim)"/>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
No <input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" [ngModel]="isWrong(claim)"/>
|
||||
</label>
|
||||
|
||||
</td>
|
||||
<!--td><input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" (click)="selectDisapprove(claim.id,$event)" [ngModel]="isWrong(claim)"/></td-->
|
||||
<!--td><button class="uk-button" (click)="editable.add(i)">Edit</button></td-->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--modal-select (alertOutput)="curatorSelected($event)"></modal-select-->
|
||||
<modal-loading [message]= "'Loading...'"></modal-loading>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -13,177 +13,11 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
import { Meta} from '../../../angular2-meta';
|
||||
import {ClaimsDatatablePipe} from '../../utils/pipes/claimsDatatable.pipe';
|
||||
import { DataTableDirective } from 'angular-datatables';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'claims-project-manager',
|
||||
template: `
|
||||
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" >
|
||||
<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="uk-container">
|
||||
<!--div *ngIf="accessStatus=='empty'" class="uk-margin-top uk-width-medium-2-3 uk-container-center">
|
||||
<div class="uk-block uk-block-primary uk-block-large uk-contrast uk-text-center">
|
||||
<p class="uk-text-large">Please enter your email and then press 'See Claims' button.</p>
|
||||
<form class="uk-form">
|
||||
<fieldset data-uk-margin>
|
||||
<input type="text" placeholder="example@email.com" name="email" [(ngModel)]="email">
|
||||
<button (click)="validateJWTandToken()" class=" uk-button uk-button-default">See Claims</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div-->
|
||||
|
||||
<div *ngIf="accessStatus=='invalid'" class="uk-margin-top uk-width-medium-2-3 uk-container-center">
|
||||
<div class="uk-block uk-block-primary uk-block-large uk-contrast uk-text-center">
|
||||
<!--p class="uk-text-large">Oops! There is no entry for you! Please retry with another email or for another project.</p-->
|
||||
<!--button (click)="accessStatus='empty'" class=" uk-button uk-button-default">Retry</button-->
|
||||
<p class="uk-text-large">Oops! Your email does not give you the authority to view claims for the selected project. Please contact the administrators.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="accessStatus=='valid'">
|
||||
<div class="uk-article-title custom-article-title">
|
||||
Claims Administrator
|
||||
<a [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])"
|
||||
routerLinkActive="router-link-active"
|
||||
routerLink="/search/project" >
|
||||
{{project['name']}} ({{project['funderName']}})
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<h2> Pending Claims</h2>
|
||||
|
||||
<div *ngIf=" pending_claims && pending_claims.length == 0" >
|
||||
<div class = "uk-alert uk-alert-primary " >No pending claims found.</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-overflow-container custom-dataTable-content">
|
||||
|
||||
<div class="uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted">
|
||||
<form class="uk-text-center uk-panel">
|
||||
<input type="text" class="uk-input uk-width-1-3" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="filterQuery" name="keyword" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<span *ngIf="pending_claims && pending_claims.length > 0 && totalPendingResults.count > 0">
|
||||
{{totalPendingResults.count}} pending claims, page {{activePendingPage.page}} of {{totalPages(totalPendingResults.count)}}
|
||||
<paging-no-load class="uk-float-right" [currentPage]="activePendingPage.page" [totalResults]="totalPendingResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table1, $event, 'pending')"></paging-no-load>
|
||||
</span>
|
||||
<table #filtered1 *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped">
|
||||
<!--[mfData]="pending_claims | claimsDatatable : [filterQuery, totalPendingResults, activePendingPage]" #mf1="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
|
||||
<!--[(mfSortBy)]="sortByClaimDate1" (mfSortOrder)="sortOrder"-->
|
||||
<thead>
|
||||
<tr>
|
||||
<th> Research Result </th>
|
||||
<th class="uk-text-center">Claimed By </th>
|
||||
<th class="uk-text-center">Claimed Date </th>
|
||||
<th class="uk-text-center">Approve</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="uk-table-middle" *ngFor="let claim1 of mf1.data">
|
||||
<td class="uk-width-2-5" *ngIf="claim1.targetType != 'project'"><claim-entity [entity]="claim1.target" [type]="claim1.targetType" > </claim-entity></td>
|
||||
<td class="uk-width-2-5 uk-text-center" *ngIf="claim1.sourceType != 'project'"><claim-entity [entity]="claim1.source" [type]="claim1.sourceType" > </claim-entity></td>
|
||||
<td class="uk-width-1-5 uk-text-center">{{claim1.userMail}}</td>
|
||||
<td class="uk-width-1-5 uk-text-center">{{claim1.date}}</td>
|
||||
<td class="uk-width-1-5 uk-text-center">
|
||||
|
||||
<label>
|
||||
Yes <input [id]="claim1.id" type="checkbox" (click)="selectApprove(claim1.id,$event)" [ngModel]="isSelectedRight(claim1.id)"/>
|
||||
</label>
|
||||
<label>
|
||||
No <input [id]="claim1.id" type="checkbox" (click)="selectDisapprove(claim1.id,$event)" [ngModel]="isSelectedWrong(claim1.id)"/>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="uk-text-small uk-text-right">*Note that claims you did not approved or disapproved are considered as right (but not curated)</div>
|
||||
<button class="uk-button uk-button-primary uk-float-right" type="submit" (click)="saveChanges()">Save Changes</button>
|
||||
|
||||
<h2> Already Curated Claims</h2>
|
||||
|
||||
<div *ngIf=" curated_claims && curated_claims.length == 0" >
|
||||
<div class = "uk-alert uk-alert-primary " >No curated claims found.</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-overflow-container custom-dataTable-content">
|
||||
|
||||
<div class="uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted">
|
||||
<form class="uk-text-center uk-panel">
|
||||
<input type="text" class="uk-input uk-width-1-3" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="filterQuery2" name="keyword" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<span *ngIf="curated_claims && curated_claims.length > 0 && totalCuratedResults.count > 0">
|
||||
{{totalCuratedResults.count}} curated claims, page {{activeCuratedPage.page}} of {{totalPages(totalCuratedResults.count)}}
|
||||
<paging-no-load class="uk-float-right" [currentPage]="activeCuratedPage.page" [totalResults]="totalCuratedResults.count" [size]="rowsOnPage" (pageChange)="refreshTable(table2, $event, 'curated')"> </paging-no-load>
|
||||
</span>
|
||||
|
||||
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped" >
|
||||
<!--[mfData]="curated_claims | claimsDatatable : [filterQuery2, totalCuratedResults, activeCuratedPage]" #mf2="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"-->
|
||||
<!--[(mfSortBy)]="sortByCurationDate2" [(mfSortOrder)]="sortOrder"-->
|
||||
<thead>
|
||||
<!--tr>
|
||||
<td colspan="6">
|
||||
<form class="uk-text-center uk-panel uk-background-muted">
|
||||
<input type="text" class="uk-input uk-width-1-3" placeholder="Type keywords..." aria-describedby="sizing-addon2" [(ngModel)]="filterQuery2" name="keyword" />
|
||||
</form>
|
||||
</td>
|
||||
</tr-->
|
||||
<!--tr>
|
||||
<td>
|
||||
Filter curated claims:
|
||||
<input class="uk-input uk-width-1-3" [(ngModel)]="filterQuery2"/>
|
||||
</td>
|
||||
</tr-->
|
||||
<tr>
|
||||
<th>Research Result</th>
|
||||
<!--th>Link to</th-->
|
||||
<th class="uk-text-center">Claimed by </th>
|
||||
<th class="uk-text-center">Claimed Date </th>
|
||||
<th class="uk-text-center">Curated by </th>
|
||||
<th class="uk-text-center">Curation Date </th>
|
||||
<th class="uk-text-center">Approved</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="uk-table-middle" *ngFor="let claim of mf2.data let i=index">
|
||||
<td class="uk-width-1-6" *ngIf="claim.targetType != 'project'"><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
|
||||
<td class="uk-width-1-6" *ngIf="claim.sourceType != 'project'"><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.userMail}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.date}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.curatedBy}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">{{claim.curationDate}}</td>
|
||||
<td class="uk-width-1-6 uk-text-center">
|
||||
|
||||
<label>
|
||||
Yes <input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" [ngModel]="isRight(claim)"/>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
No <input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" [ngModel]="isWrong(claim)"/>
|
||||
</label>
|
||||
|
||||
</td>
|
||||
<!--td><input [id]="claim.id" type="checkbox" [disabled]="!editable.has(i)" (click)="selectDisapprove(claim.id,$event)" [ngModel]="isWrong(claim)"/></td-->
|
||||
<!--td><button class="uk-button" (click)="editable.add(i)">Edit</button></td-->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--modal-select (alertOutput)="curatorSelected($event)"></modal-select-->
|
||||
<modal-loading [message]= "'Loading...'"></modal-loading>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
templateUrl: 'claimsByToken.component.html'
|
||||
|
||||
})
|
||||
export class ClaimsByTokenComponent {
|
||||
|
@ -219,13 +53,18 @@ export class ClaimsByTokenComponent {
|
|||
|
||||
@ViewChild (ModalSelect) selectModal : ModalSelect;
|
||||
@ViewChild (ModalLoading) loading : ModalLoading ;
|
||||
|
||||
properties:EnvProperties;
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
||||
constructor ( private route: ActivatedRoute, private claimsByTokenService: ClaimsByTokenService, private _meta: Meta) {
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.token = params['token'];
|
||||
this.selectedRight = new Set<string>();
|
||||
|
@ -287,7 +126,7 @@ public sortByTitle2= (claim: any) => {
|
|||
validateJWTandToken() {
|
||||
var jwtToken=Session.getUserJwt();
|
||||
if(this.token) {
|
||||
this.claimsByTokenService.getClaims(this.token, jwtToken).subscribe(
|
||||
this.claimsByTokenService.getClaims(this.token, jwtToken, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.closeLoading();
|
||||
this.accessStatus = "valid";
|
||||
|
@ -376,7 +215,7 @@ public sortByTitle2= (claim: any) => {
|
|||
console.info("Changes Saved!");
|
||||
var jwtToken=Session.getUserJwt();
|
||||
|
||||
this.claimsByTokenService.updateClaimsCuration(this.selectedRight, this.selectedWrong).subscribe(
|
||||
this.claimsByTokenService.updateClaimsCuration(this.selectedRight, this.selectedWrong, this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
console.info(data);
|
||||
},
|
||||
|
|
|
@ -2,7 +2,6 @@ import {Injectable} from '@angular/core';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Jsonp, URLSearchParams,ResponseOptions, RequestOptions, Headers} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/operator/do';
|
||||
|
||||
import { CustomOptions } from '../claim-utils/service/customOptions.class';
|
||||
|
@ -12,17 +11,17 @@ export class ClaimsByTokenService {
|
|||
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
getClaims(token: string, jwtToken: string):any {
|
||||
getClaims(token: string, jwtToken: string, apiURL:string):any {
|
||||
console.info("getClaims in service");
|
||||
|
||||
let url = OpenaireProperties.getClaimsAPIURL()+"project/claims?projectToken="+token;
|
||||
let url = apiURL+"project/claims?projectToken="+token;
|
||||
|
||||
let key = url;
|
||||
|
||||
return this.http.get(url, CustomOptions.getAuthOptions())
|
||||
//.map(res => <any> res.text())
|
||||
.map(request => <any> request.json());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,8 +39,8 @@ export class ClaimsByTokenService {
|
|||
}
|
||||
*/
|
||||
|
||||
updateClaimsCuration( selectedRight: Set<string>, selectedWrong: Set<string>) {
|
||||
let url = OpenaireProperties.getClaimsAPIURL() + "curate/bulk";
|
||||
updateClaimsCuration( selectedRight: Set<string>, selectedWrong: Set<string>, apiURL:string) {
|
||||
let url = apiURL + "curate/bulk";
|
||||
let claimsCurationInfo: any = []; //e.g.: [{"id":"2","approved":true},{"id":"1","approved":true}]
|
||||
|
||||
selectedRight.forEach(function(selected) {
|
||||
|
|
|
@ -102,11 +102,11 @@
|
|||
|
||||
<div class = "uk-margin-top">
|
||||
|
||||
<claim-projects-search-form *ngIf=" linkTo =='project' " [(selectedProjects)]="projects" > </claim-projects-search-form>
|
||||
<claim-projects-search-form *ngIf=" linkTo =='project' " [(selectedProjects)]="projects" [(properties)] = properties > </claim-projects-search-form>
|
||||
|
||||
<claim-contexts-search-form *ngIf=" linkTo =='context' " [(selectedList)]="contexts" [projects]="projects" [results]="results" [inlineEntity]="inlineResult" > </claim-contexts-search-form>
|
||||
<claim-contexts-search-form *ngIf=" linkTo =='context' " [(selectedList)]="contexts" [projects]="projects" [results]="results" [inlineEntity]="inlineResult" [(properties)]=properties> </claim-contexts-search-form>
|
||||
|
||||
<claim-result-search-form *ngIf=" linkTo =='result' && show!='claim' " [selectedResults]="results" > </claim-result-search-form>
|
||||
<claim-result-search-form *ngIf=" linkTo =='result' && show!='claim' " [selectedResults]="results" [(properties)]=properties > </claim-result-search-form>
|
||||
|
||||
</div>
|
||||
<div *ngIf=" show == 'claim' " class="uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l ">
|
||||
|
@ -114,7 +114,7 @@
|
|||
</claim-selected-results>
|
||||
<div class="uk-width-1-1 uk-margin-small-top">
|
||||
<claim-insert class="uk-float-right" [contexts]="contexts" [results]="results" [projects]="projects" [inlineEntity] = "inlineResult" [show] = "show"
|
||||
(showChange)="showChange($event)" ></claim-insert>
|
||||
(showChange)="showChange($event)" [(properties)]=properties></claim-insert>
|
||||
</div>
|
||||
</div>
|
||||
<ul *ngIf="linkTo == 'result'" class="uk-pagination">
|
||||
|
|
|
@ -6,6 +6,7 @@ import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
|
|||
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
||||
import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
||||
import {SearchSoftwareService} from '../../services/searchSoftware.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
|
||||
|
@ -31,11 +32,18 @@ export class DirectLinkingComponent {
|
|||
sub:any =null;
|
||||
show:string="claim"; //{claim,result}
|
||||
validInput:boolean = null;//'true;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor ( private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
|
||||
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService, private softwareSearch:SearchSoftwareService, private _meta: Meta) {
|
||||
this._meta.setTitle("OpenAIRE | Direct Linking");
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
|
||||
});
|
||||
if(localStorage.getItem("projects")){
|
||||
this.projects = JSON.parse(localStorage.getItem("projects"));
|
||||
}
|
||||
|
@ -101,7 +109,7 @@ export class DirectLinkingComponent {
|
|||
}
|
||||
}
|
||||
getProjectById(id:string){
|
||||
this.sub = this.entitySearch.fetchByType(id,"project").subscribe(
|
||||
this.sub = this.entitySearch.fetchByType(id,"project", this.properties).subscribe(
|
||||
data => {
|
||||
console.log(data);
|
||||
var item =data[0];
|
||||
|
@ -128,7 +136,7 @@ export class DirectLinkingComponent {
|
|||
}
|
||||
getPublicationById(id:string, isInlineResult:boolean){
|
||||
|
||||
this.sub = this.publicationsSearch.searchPublicationById(id).subscribe(
|
||||
this.sub = this.publicationsSearch.searchPublicationById(id,this.properties).subscribe(
|
||||
data => {
|
||||
var item =data[0];
|
||||
var result: ClaimResult = new ClaimResult();
|
||||
|
@ -154,7 +162,7 @@ export class DirectLinkingComponent {
|
|||
});
|
||||
}
|
||||
getDatasetById(id:string, isInlineResult:boolean){
|
||||
this.sub = this.datasetsSearch.searchDatasetById(id).subscribe(
|
||||
this.sub = this.datasetsSearch.searchDatasetById(id,this.properties).subscribe(
|
||||
data => {
|
||||
var item =data[0];
|
||||
var result: ClaimResult = new ClaimResult();
|
||||
|
@ -180,7 +188,7 @@ export class DirectLinkingComponent {
|
|||
});
|
||||
}
|
||||
getSoftwareById(id:string, isInlineResult:boolean){
|
||||
this.sub = this.softwareSearch.searchSoftwareById(id).subscribe(
|
||||
this.sub = this.softwareSearch.searchSoftwareById(id,this.properties).subscribe(
|
||||
data => {
|
||||
var item =data[0];
|
||||
var result: ClaimResult = new ClaimResult();
|
||||
|
|
|
@ -5,8 +5,8 @@ import {SearchDataciteService} from '../../claim-utils/service/searchDatacite.se
|
|||
|
||||
import {ModalLoading} from '../../../utils/modal/loading.component';
|
||||
import {Dates, DOI} from '../../../utils/string-utils.class';
|
||||
import {OpenaireProperties} from '../../../utils/properties/openaireProperties';
|
||||
import {ClaimResult} from '../../claim-utils/claimEntities.class';
|
||||
import{EnvProperties} from '../../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -86,6 +86,7 @@ export class BulkClaimComponent {
|
|||
resultsFromSearch:number;
|
||||
@Input() public select:boolean = true ;
|
||||
@Input() public results;
|
||||
@Input() public properties:EnvProperties;
|
||||
|
||||
allIds:string[] = [];
|
||||
foundIds:string[] = [];
|
||||
|
@ -113,7 +114,7 @@ export class BulkClaimComponent {
|
|||
}
|
||||
this.loading.open();
|
||||
|
||||
this.makeFileRequest(OpenaireProperties.getUploadServiceUrl(), [], this.filesToUpload).then((result) => {
|
||||
this.makeFileRequest(this.properties.uploadService, [], this.filesToUpload).then((result) => {
|
||||
var rows = (result as any).split('\n'); // I have used space, you can use any thing.
|
||||
var i = 0;
|
||||
this.duplicateIds = [];
|
||||
|
@ -199,7 +200,7 @@ export class BulkClaimComponent {
|
|||
}
|
||||
|
||||
fetchResult(id:string,accessMode:string,date:string){
|
||||
this._searchCrossrefService.searchCrossrefByDOIs([id]).subscribe(
|
||||
this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties.searchCrossrefAPIURL).subscribe(
|
||||
data => {
|
||||
|
||||
var crossrefResult = data.items[0];
|
||||
|
@ -222,7 +223,7 @@ export class BulkClaimComponent {
|
|||
);
|
||||
}
|
||||
searchInDatacite(id:string,accessMode:string,date:string){
|
||||
this._searchDataciteService.getDataciteResultByDOI(id).subscribe(
|
||||
this._searchDataciteService.getDataciteResultByDOI(id,this.properties).subscribe(
|
||||
item => {
|
||||
var dataciteResult = item.data;
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// import {Component, Input} from '@angular/core';
|
||||
// import {Observable} from 'rxjs/Observable';
|
||||
//
|
||||
// @Component({
|
||||
// selector: 'bulk-linking',
|
||||
// //providers: [MdRadioDispatcher],
|
||||
// template: `
|
||||
// <linking-generic [bulkMode]=true> </linking-generic>
|
||||
// `
|
||||
//
|
||||
// })
|
||||
// //[(ngModel)]="date"
|
||||
// export class BulkLinkingComponent {
|
||||
// constructor () {
|
||||
// }
|
||||
// }
|
|
@ -8,6 +8,7 @@ import {AlertModal} from '../../../utils/modal/alert';
|
|||
import {Md5} from 'ts-md5/dist/md5';
|
||||
import {Session} from '../../../login/utils/helper.class';
|
||||
import {ErrorCodes} from '../../../login/utils/guardHelper.class';
|
||||
import{EnvProperties} from '../../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'claim-insert',
|
||||
|
@ -40,6 +41,7 @@ export class ClaimInsertComponent {
|
|||
@Input() public showButton:boolean = true;
|
||||
@Input() show='claim';
|
||||
@Input() inlineEntity = null; // the entity from the landing page
|
||||
@Input() public properties:EnvProperties;
|
||||
@Output() showChange = new EventEmitter();
|
||||
|
||||
@ViewChild (ModalLoading) loading : ModalLoading ;
|
||||
|
@ -122,7 +124,7 @@ private insertActions(){
|
|||
//first call direct index service - when call is done (success or error) call isertBulkClaims method to insert claims in DB
|
||||
console.info("\n\ndirectclaims: "+directclaims.length+"\n\n");
|
||||
if(directclaims.length > 0){
|
||||
this.claimService.insertDirectRecords(directclaims).subscribe(
|
||||
this.claimService.insertDirectRecords(directclaims,this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.insertedRecords = data.insertedIds;
|
||||
|
||||
|
@ -149,7 +151,7 @@ private insertActions(){
|
|||
|
||||
private isertBulkClaims(claims){
|
||||
console.info("try to insert "+claims.length+" claims");
|
||||
this.claimService.insertBulkClaims(claims).subscribe(
|
||||
this.claimService.insertBulkClaims(claims,this.properties.claimsAPIURL).subscribe(
|
||||
data => {
|
||||
this.insertedClaims = data.insertedIds;
|
||||
this.errorInClaims = data.errorInClaims;
|
||||
|
|
|
@ -52,11 +52,11 @@
|
|||
<ul id="tabs" class="uk-switcher uk-margin-left uk-width-1-1">
|
||||
<li>
|
||||
|
||||
<claim-projects-search-form [(selectedProjects)]="projects" > </claim-projects-search-form>
|
||||
<claim-projects-search-form [(selectedProjects)]="projects" [(properties)] = properties> </claim-projects-search-form>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<claim-contexts-search-form [(selectedList)]="contexts" [projects]="projects" [results]="results" [inlineEntity]="inlineResult" > </claim-contexts-search-form>
|
||||
<claim-contexts-search-form [(selectedList)]="contexts" [projects]="projects" [results]="results" [inlineEntity]="inlineResult" [(properties)]=properties> </claim-contexts-search-form>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -82,8 +82,8 @@
|
|||
</span></span>
|
||||
</span>
|
||||
</div>
|
||||
<claim-result-search-form *ngIf="!bulkMode" [selectedResults]="results" > </claim-result-search-form>
|
||||
<bulk-claim *ngIf="bulkMode" [results]="results" > </bulk-claim>
|
||||
<claim-result-search-form *ngIf="!bulkMode" [selectedResults]="results" [(properties)]=properties > </claim-result-search-form>
|
||||
<bulk-claim *ngIf="bulkMode" [results]="results" [(properties)] = properties> </bulk-claim>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="step==3" class="uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l">
|
||||
|
@ -100,7 +100,7 @@
|
|||
</li>
|
||||
<li *ngIf=" step == 3 " (click)="next()" >
|
||||
<claim-insert [contexts]="contexts" [results]="results" [projects]="projects" [show] = "show"
|
||||
(showChange)="showChange($event)" ></claim-insert>
|
||||
(showChange)="showChange($event)" [(properties)] = properties></claim-insert>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -6,6 +6,8 @@ import {ClaimProject, ClaimResult} from '../claim-utils/claimEntities.class';
|
|||
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
||||
import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
declare var UIkit:any;
|
||||
|
||||
@Component({
|
||||
|
@ -34,11 +36,18 @@ export class LinkingGenericComponent {
|
|||
entityTypes=["dataset", "publication", "project","context"];
|
||||
inlineResult:ClaimResult =null;
|
||||
sub:any =null;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor ( private _router: Router, private route: ActivatedRoute, private entitySearch:EntitiesSearchService,
|
||||
private publicationsSearch:SearchPublicationsService, private datasetsSearch:SearchDatasetsService, private _meta: Meta) {
|
||||
this._meta.setTitle("OpenAIRE | Linking");
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
|
||||
});
|
||||
if( typeof localStorage !== 'undefined') {
|
||||
if(localStorage.getItem("projects")){
|
||||
this.projects = JSON.parse(localStorage.getItem("projects"));
|
||||
|
|
|
@ -9,11 +9,7 @@ import {ClaimContext} from '../../claim-utils/claimEntities.class';
|
|||
|
||||
<div class="uk-placeholder uk-margin-top" >
|
||||
|
||||
<!--div class="uk-width-1-2 ">
|
||||
|
||||
<div class="uk-clearfix"><button *ngIf=" !showsearch " (click)="showsearch = true;" class="uk-button uk-button-default uk-animation uk-float-right">Add more <span><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg></span></button></div>
|
||||
<claim-contexts-search-form *ngIf=" showsearch " [selectedList]="contexts" [projects]="projects" [results]="results" [inlineEntity]="inlineEntity" > </claim-contexts-search-form>
|
||||
</div-->
|
||||
|
||||
<div *ngIf="contexts.length > 0 " class=" ">
|
||||
<h5 class=" uk-margin uk-h5 uk-text-primary">Selected Communities ({{contexts.length}}) </h5>
|
||||
|
||||
|
|
|
@ -8,12 +8,7 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
|
|||
|
||||
|
||||
<div class="uk-placeholder uk-margin-top" >
|
||||
|
||||
<!--div class="uk-width-1-2 ">
|
||||
<!--div class="uk-clearfix"><button *ngIf=" !showsearch " (click)="showsearch = true;" class="uk-button-default uk-float-right uk-animation ">Add more <span><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="1"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg></span></button></div>
|
||||
<claim-projects-search-form *ngIf=" showsearch " [selectedProjects]="projects" (projectSelected)="projectSelected($event)" > </claim-projects-search-form>
|
||||
</div>
|
||||
<div class="uk-width-1-2 "-->
|
||||
|
||||
<div>
|
||||
<h5 class=" uk-margin uk-h5 uk-text-primary" *ngIf="projects.length > 0 "> Selected Projects ({{projects.length}}) </h5>
|
||||
<ul class="uk-list uk-list-divider">
|
||||
|
|
|
@ -10,17 +10,6 @@ import {Dates} from '../../../utils/string-utils.class';
|
|||
|
||||
|
||||
|
||||
|
||||
<!--div *ngIf="showSearch " class="uk-width-1-2 ">
|
||||
<div class="uk-clearfix"><a (click)="bulkMode = !bulkMode;" class=" uk-animation uk-float-right">
|
||||
<span *ngIf="!bulkMode">Switch to Upload mode <i class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="upload" ratio="1"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg></i></span>
|
||||
<span *ngIf="bulkMode">Switch to Search mode <span class="uk-icon">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="search" ratio="1"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>
|
||||
</span></span>
|
||||
</a></div>
|
||||
<claim-result-search-form *ngIf="!bulkMode" [selectedResults]="results" > </claim-result-search-form>
|
||||
<bulk-claim *ngIf="bulkMode" [results]="results" > </bulk-claim>
|
||||
</div-->
|
||||
<div class="uk-placeholder uk-margin-top" >
|
||||
<div *ngIf="results.length == 0 " class="uk-text-center">There are no selected research results</div>
|
||||
<div *ngIf="results.length > 0 ">
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Router } from '@angular/router';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
|
||||
|
||||
|
@ -29,6 +28,6 @@ export class DepositBySubjectComponent {
|
|||
constructor (private _router: Router) { }
|
||||
|
||||
public search() {
|
||||
this._router.navigate( ['participate/deposit-subject-result'], { queryParams: { "q": this.subjectKeyword } } );
|
||||
this._router.navigate( ['participate/deposit-subject-result'], { queryParams: { "subject": this.subjectKeyword } } );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
<search-result [(results)]="fetchDataproviders.results"
|
||||
type="dataprovider" urlParam="datasourceId" [showSubjects]=true
|
||||
[custom_class]="'other-results'">
|
||||
[custom_class]="'other-results'" [(properties)] = properties>
|
||||
</search-result>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||
|
@ -11,6 +11,7 @@ import { Meta} from '../../../angular2-meta';
|
|||
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'deposit-by-subject-result',
|
||||
|
@ -41,31 +42,37 @@ export class DepositBySubjectResultComponent {
|
|||
|
||||
sub: any;
|
||||
piwiksub: any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor ( private _router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private _searchDataprovidersService: SearchDataprovidersService,
|
||||
private _meta: Meta, private _piwikService:PiwikService) {
|
||||
|
||||
this.zenodo = OpenaireProperties.getZenodoURL();
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
|
||||
this.status = this.errorCodes.LOADING;
|
||||
this.updateTitle("Deposit "+this.requestFor);
|
||||
this.updateDescription("Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor);
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("Deposit "+this.requestFor).subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
this.zenodo = this.properties.zenodo;
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("Deposit "+this.requestFor).subscribe();
|
||||
}
|
||||
|
||||
});
|
||||
console.info('depositResult init');
|
||||
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.subject = params['q'];
|
||||
this.subject = params['subject'];
|
||||
this.newSubject = this.subject;
|
||||
this.searchDataproviders();
|
||||
});
|
||||
|
@ -95,8 +102,8 @@ export class DepositBySubjectResultComponent {
|
|||
|
||||
public searchDataproviders() {
|
||||
this.subject = this.newSubject;
|
||||
this.fetchDataproviders.getResultsBySubjectsForDeposit( (this.subject =="")?"*":this.subject, this.requestFor, this.page, 10);
|
||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();
|
||||
this.fetchDataproviders.getResultsBySubjectsForDeposit( (this.subject =="")?"*":this.subject, this.requestFor, this.page, 10, this.properties);
|
||||
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;
|
||||
}
|
||||
|
||||
public goToDeposit() {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
<form class= "uk-grid">
|
||||
<div class="uk-width-1-2 ">
|
||||
<entities-autocomplete fieldId="organization" (click)="warningMessage = ''" [entityType]="'organization'" [depositType]=compatibility [selectedValue]=selectedId [showSelected]=true
|
||||
<entities-autocomplete [(properties)]=properties fieldId="organization" (click)="warningMessage = ''" [entityType]="'organization'" [depositType]=compatibility [selectedValue]=selectedId [showSelected]=true
|
||||
[placeHolderMessage] = "'Organization name'" [title] = "'Organizations'" [multipleSelections]=false
|
||||
(selectedValueChanged)="valueChanged($event)">
|
||||
</entities-autocomplete>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Router } from '@angular/router';
|
||||
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
||||
import { Router, ActivatedRoute} from '@angular/router';
|
||||
import { Meta} from '../../angular2-meta';
|
||||
import {PiwikService} from '../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -36,22 +36,30 @@ export class DepositComponent {
|
|||
public warningMessage: string = "";
|
||||
|
||||
piwiksub:any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (private _router: Router, private _meta: Meta, private _piwikService:PiwikService) {
|
||||
constructor ( private route: ActivatedRoute, private _router: Router, private _meta: Meta, private _piwikService:PiwikService) {
|
||||
|
||||
this.openAccess = OpenaireProperties.getOpenAccess();
|
||||
this.openAccessRepo = OpenaireProperties.getOpenAccessRepo();
|
||||
this.fp7Guidlines = OpenaireProperties.getFP7Guidlines();
|
||||
this.h2020Guidlines = OpenaireProperties.getH2020Guidlines();
|
||||
this.ercGuidlines = OpenaireProperties.getERCGuidlines();
|
||||
this.helpdesk = OpenaireProperties.getHelpdesk();
|
||||
this.updateTitle("Deposit "+this.requestFor);
|
||||
this.updateDescription("Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor);
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("Deposit "+this.requestFor).subscribe();
|
||||
}
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.openAccess = this.properties.openAccess;
|
||||
this.openAccessRepo = this.properties.openAccessRepo;
|
||||
this.fp7Guidlines = this.properties.fp7Guidlines
|
||||
this.h2020Guidlines = this.properties.h2020Guidlines
|
||||
this.ercGuidlines = this.properties.ercGuidlines
|
||||
this.helpdesk = this.properties.helpdesk;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("Deposit "+this.requestFor).subscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
ngOnDestroy() {
|
||||
if(this.piwiksub){
|
||||
this.piwiksub.unsubscribe();
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties';
|
||||
import { Router } from '@angular/router';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import {ErrorCodes} from '../utils/properties/openaireProperties';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { FetchDataproviders } from '../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||
import { SearchDataprovidersService } from '../services/searchDataproviders.service';
|
||||
|
||||
|
@ -11,6 +10,7 @@ import { Meta} from '../../angular2-meta';
|
|||
|
||||
import {RouterHelper} from '../utils/routerHelper.class';
|
||||
import {PiwikService} from '../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'deposit-result',
|
||||
|
@ -37,7 +37,7 @@ import {PiwikService} from '../utils/piwik/piwik.service';
|
|||
|
||||
<form class= "uk-grid">
|
||||
<div class="uk-width-1-2 ">
|
||||
<entities-autocomplete fieldId="organization" (click)="warningMessage = ''" [entityType]="'organization'"
|
||||
<entities-autocomplete [(properties)]=properties fieldId="organization" (click)="warningMessage = ''" [entityType]="'organization'"
|
||||
[depositType]=compatibility [showSelected]=true [placeHolderMessage] = "'Organization name'"
|
||||
[title] = "'Organizations'" [multipleSelections]=false (selectedValueChanged)="valueChanged($event)">
|
||||
</entities-autocomplete>
|
||||
|
@ -79,7 +79,7 @@ import {PiwikService} from '../utils/piwik/piwik.service';
|
|||
<search-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]= "fetchDataproviders.searchUtils.status"
|
||||
type="dataprovider" urlParam="datasourceId" [showOrganizations] = false
|
||||
[custom_class]="'other-results'">
|
||||
[custom_class]="'other-results'" [(properties)] =properties>
|
||||
</search-result>
|
||||
</div>
|
||||
|
||||
|
@ -154,6 +154,7 @@ export class DepositResultComponent {
|
|||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
sub: any; piwiksub: any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor ( private _router: Router,
|
||||
private route: ActivatedRoute,
|
||||
|
@ -161,19 +162,25 @@ export class DepositResultComponent {
|
|||
private _organizationService: OrganizationService,
|
||||
private _meta: Meta, private _piwikService:PiwikService) {
|
||||
|
||||
this.zenodo = OpenaireProperties.getZenodoURL();
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
|
||||
this.status = this.errorCodes.LOADING;
|
||||
this.updateTitle("Deposit "+this.requestFor);
|
||||
this.updateDescription("Openaire, repositories, open access, content provider, compatibility, organization, deposit "+ this.requestFor);
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("Deposit "+this.requestFor).subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.zenodo = this.properties.zenodo;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("Deposit "+this.requestFor).subscribe();
|
||||
}
|
||||
});
|
||||
|
||||
console.info('depositResult init');
|
||||
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -204,15 +211,15 @@ export class DepositResultComponent {
|
|||
// if(this.organization != undefined) {
|
||||
// this.fetchDataproviders.getResults(this.organization.name, false, 1, 10);
|
||||
// } else if(this.organizationId != undefined) {
|
||||
this.fetchDataproviders.getResultsForDeposit( this.organizationId,this.requestFor, 1, 10);
|
||||
this.fetchDataproviders.getResultsForDeposit( this.organizationId,this.requestFor, 1, 10, this.properties);
|
||||
//}
|
||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();
|
||||
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;
|
||||
}
|
||||
|
||||
private getOrganizationInfo () {
|
||||
console.info("inside getOrganizationInfo of component");
|
||||
|
||||
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
|
||||
this._organizationService.getOrganizationInfo(this.organizationId,this.properties).subscribe(
|
||||
data => {
|
||||
if(data == null) {
|
||||
this.status = this.errorCodes.NOT_FOUND;
|
||||
|
|
|
@ -1,23 +1,28 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Router,CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router';
|
||||
import {ActivatedRoute, Router,CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import 'rxjs/add/operator/filter';
|
||||
import { ConfigurationService } from '../utils/configuration/configuration.service';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
@Injectable()
|
||||
export class IsRouteEnabled implements CanActivate {
|
||||
|
||||
constructor(private router: Router, private config: ConfigurationService) {}
|
||||
constructor(private route: ActivatedRoute,private router: Router, private config: ConfigurationService) {}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean {
|
||||
let customRedirect = route.data['redirect'];
|
||||
console.log("In IsRouteEnabled");
|
||||
console.log(state.url.split("?")[0].substring(1));
|
||||
let isEnabled = this.config.isPageEnabled(state.url.split("?")[0].substring(1));
|
||||
let redirect = !!customRedirect ? customRedirect : '/error';
|
||||
isEnabled.filter(enabled => !enabled)
|
||||
.subscribe(() => this.router.navigate([redirect], { queryParams: { "page": state.url } }));
|
||||
|
||||
let customRedirect = route.data['redirect'];
|
||||
let api = route.data['api'];
|
||||
let community = route.data['community']
|
||||
console.log("In IsRouteEnabled");
|
||||
console.log(state.url.split("?")[0].substring(1));
|
||||
let isEnabled = this.config.isPageEnabled(api, community,"/"+state.url.split("?")[0].substring(1));
|
||||
let redirect = !!customRedirect ? customRedirect : '/error';
|
||||
isEnabled.filter(enabled => !enabled)
|
||||
.subscribe(() => this.router.navigate([redirect], { queryParams: { "page": state.url } }));
|
||||
|
||||
return isEnabled;
|
||||
}
|
||||
return isEnabled;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,22 +129,22 @@
|
|||
<!--*ngIf="tab.content=='publicationsTab'"-->
|
||||
<publicationsTab *ngIf="activeTab=='Publications'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchPublications] = "fetchPublications">
|
||||
[fetchPublications] = "fetchPublications" [(properties)]=properties>
|
||||
</publicationsTab>
|
||||
<!--*ngIf="tab.content=='datasetsTab'"-->
|
||||
<datasetsTab *ngIf="activeTab=='Research Data'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchDatasets]="fetchDatasets">
|
||||
[fetchDatasets]="fetchDatasets" [(properties)]=properties>
|
||||
</datasetsTab>
|
||||
<!--*ngIf=" tab.content=='projectsTab'"-->
|
||||
<projectsTab *ngIf="activeTab=='Projects'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchProjects]="fetchProjects">
|
||||
[fetchProjects]="fetchProjects" [(properties)]=properties>
|
||||
</projectsTab>
|
||||
<!--*ngIf=" tab.content=='datasourcesTab'"-->
|
||||
<datasourcesTab *ngIf="activeTab=='Datasources'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchDataproviders]="fetchDataproviders">
|
||||
[fetchDataproviders]="fetchDataproviders" [(properties)]=properties>
|
||||
</datasourcesTab>
|
||||
<!--*ngIf=" tab.content=='organizationsTab'"-->
|
||||
<organizationsTab *ngIf="activeTab=='Organizations'"
|
||||
|
@ -156,7 +156,7 @@
|
|||
[results]="dataProviderInfo.relatedDatasources"
|
||||
[loading]="loadingRelatedDatasources"
|
||||
[fetchPublications]="fetchAggregatorsPublications"
|
||||
[fetchDatasets]="fetchAggregatorsDatasets">
|
||||
[fetchDatasets]="fetchAggregatorsDatasets" [(properties)]=properties>
|
||||
<!--[type]="relatedDataprovidersResultsType"-->
|
||||
</relatedDatasourcesTab>
|
||||
|
||||
|
@ -207,7 +207,7 @@
|
|||
<!--[name]="dataProviderInfo.title['name']"-->
|
||||
<metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
|
||||
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
|
||||
(metricsResults)="metricsResults($event)">
|
||||
(metricsResults)="metricsResults($event)" [(properties)] = properties>
|
||||
</metrics>
|
||||
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"
|
||||
[url]=viewsFrameUrl width="100%" height="250">
|
||||
|
|
|
@ -13,9 +13,10 @@ import { SearchProjectsService } from '../../services/searchProjects.service';
|
|||
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||
import { SearchDataprovidersService } from '../../services/searchDataproviders.service';
|
||||
import { RelatedDatasourcesTabComponent } from './relatedDatasourcesTab.component';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
import 'rxjs/add/operator/switch';
|
||||
import 'rxjs/add/operator/switchMap';
|
||||
|
@ -83,6 +84,7 @@ export class DataProviderComponent {
|
|||
piwiksub: any;
|
||||
subInfo: any;
|
||||
relatedDatasourcesSub: any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (private element: ElementRef,
|
||||
private _dataproviderService: DataProviderService,
|
||||
|
@ -99,10 +101,15 @@ export class DataProviderComponent {
|
|||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
this.updateTitle("Content provider");
|
||||
this.updateDescription("Content provider, search, repositories, open access");
|
||||
|
@ -142,14 +149,14 @@ export class DataProviderComponent {
|
|||
this.showLoading = false;
|
||||
this.warningMessage="No valid datasource id";
|
||||
}else{
|
||||
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId).subscribe(
|
||||
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
|
||||
data => {
|
||||
this.dataProviderInfo = data;
|
||||
this.initTabs();
|
||||
this.showTabs = true ;
|
||||
this.updateTitle(this.dataProviderInfo.title.name);
|
||||
this.updateDescription("Content provider, search, repositories, open access,"+this.dataProviderInfo.title.name);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.dataProviderInfo.title.name).subscribe();
|
||||
}
|
||||
|
||||
|
@ -198,13 +205,13 @@ export class DataProviderComponent {
|
|||
|
||||
this.metricsClicked = false;
|
||||
|
||||
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
this.viewsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcRepoViews","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"dtsrcOpenAIRETimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"dtsrcRepoTimeline", "dtsrcName":"'+this.datasourceId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
*/
|
||||
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcRepoDownloads","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
this.downloadsFrameUrl = this.properties.framesAPIURL +'merge.php?com=query&data=[{"query":"dtsrcDownloadsTimeline","dtsrcName":"'+this.datasourceId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"chart","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["spline"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
*/
|
||||
|
||||
this.docsTimelineUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcYear","dtsrcName":"'+this.datasourceId+'","table": "result", "fields": [{"fld": "number", "agg": "count", "type": "line", "yaxis":1, "c":true}], "xaxis":{"name": "year", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": -30, "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [{"f":0, "text": "Yearly"}], "filters": [{"name":"year","max":"2016","min":"1997"},{"name": "result_datasources-datasource-name", "values":[""], "to": "-1"}],"having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": "Year"}&w=600&h=250';
|
||||
|
@ -274,52 +281,52 @@ export class DataProviderComponent {
|
|||
if( this.reloadPublications &&
|
||||
( this.fetchPublications.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchPublications.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
||||
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
||||
}
|
||||
this.reloadPublications = false;
|
||||
}
|
||||
|
||||
private countPublications(page: number, size: number) {
|
||||
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
||||
this.fetchPublications.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
||||
}
|
||||
|
||||
private searchDatasets(page: number, size: number) {
|
||||
if( this.reloadDatasets &&
|
||||
( this.fetchDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchDatasets.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
||||
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
||||
}
|
||||
this.reloadDatasets = false;
|
||||
}
|
||||
|
||||
private countDatasets(page: number, size: number) {
|
||||
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size);
|
||||
this.fetchDatasets.getResultsForDataproviders(this.datasourceId, this.dataProviderInfo.resultsBy, page, size, this.properties);
|
||||
}
|
||||
|
||||
private searchProjects(page: number, size: number) {
|
||||
if( this.reloadProjects &&
|
||||
( this.fetchProjects.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchProjects.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size);
|
||||
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
||||
}
|
||||
this.reloadProjects = false;
|
||||
}
|
||||
|
||||
private countProjects(page: number, size: number) {
|
||||
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size);
|
||||
this.fetchProjects.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
||||
}
|
||||
|
||||
private searchDatasources(page: number, size: number) {
|
||||
if( this.reloadDataproviders &&
|
||||
( this.fetchDataproviders.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchDataproviders.searchUtils.status == this.errorCodes.DONE ) ) {
|
||||
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size);
|
||||
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
||||
}
|
||||
this.reloadDataproviders = false;
|
||||
}
|
||||
|
||||
private countDatasources(page: number, size: number) {
|
||||
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size);
|
||||
this.fetchDataproviders.getResultsForDataproviders(this.datasourceId, page, size, this.properties);
|
||||
}
|
||||
|
||||
private searchRelatedDatasources(page: number, size: number) {
|
||||
|
@ -338,8 +345,8 @@ export class DataProviderComponent {
|
|||
() => { this.preprocessRelatedDatasources(); }
|
||||
)
|
||||
|
||||
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size);
|
||||
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size);
|
||||
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size, this.properties);
|
||||
} else {
|
||||
this.loadingRelatedDatasources = false;
|
||||
}
|
||||
|
@ -349,8 +356,8 @@ export class DataProviderComponent {
|
|||
}
|
||||
|
||||
private countRelatedDatasources(page: number, size: number) {
|
||||
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size);
|
||||
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size);
|
||||
this.fetchAggregatorsPublications.getAggregatorResults(this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsDatasets.getAggregatorResults(this.datasourceId, page, size, this.properties);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ import {Injectable} from '@angular/core';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Injectable()
|
||||
|
@ -15,12 +15,12 @@ export class DataProviderService {
|
|||
|
||||
dataProviderInfo: DataProviderInfo;
|
||||
|
||||
getDataproviderInfo (id: string):any {
|
||||
getDataproviderInfo (id: string, properties:EnvProperties):any {
|
||||
console.info("getDataProviderInfo in service");
|
||||
let url = OpenaireProperties.getSearchAPIURLLast() + 'datasources/' +id +"?format=json";
|
||||
let url = properties.searchAPIURLLAst + 'datasources/' +id +"?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
.map(res => res['result']['metadata']['oaf:entity'])
|
||||
.map(res => [res['oaf:datasource'],
|
||||
|
@ -142,7 +142,7 @@ export class DataProviderService {
|
|||
|
||||
this.dataProviderInfo.organizations[counter] = {"name": "", "id": ""};
|
||||
this.dataProviderInfo.organizations[counter]['name'] = mydata.legalname;
|
||||
this.dataProviderInfo.organizations[counter]['id'] = /*OpenaireProperties.getsearchLinkToOrganization()+*/mydata['to'].content;
|
||||
this.dataProviderInfo.organizations[counter]['id'] = mydata['to'].content;
|
||||
|
||||
if(mydata.country != '' && mydata['country'].classname != '') {
|
||||
if(!countriesSet.has(mydata['country'].classname)) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
||||
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'datasetsTab',
|
||||
|
@ -35,13 +36,14 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
|
|||
export class DatasetsTabComponent {
|
||||
@Input() paramsForSearchLink = {};
|
||||
@Input() fetchDatasets : FetchDatasets;
|
||||
@Input() properties:EnvProperties ;
|
||||
public linkToSearchDatasets = "";
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
this.linkToSearchDatasets = OpenaireProperties.getLinkToAdvancedSearchDatasets();
|
||||
this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import { FetchDataproviders } from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'datasourcesTab',
|
||||
|
@ -37,13 +38,15 @@ export class DatasourcesTabComponent {
|
|||
|
||||
@Input() paramsForSearchLink = {};
|
||||
@Input() fetchDataproviders : FetchDataproviders;
|
||||
@Input() properties:EnvProperties ;
|
||||
|
||||
public linkToSearchDataproviders = "";
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToAdvancedSearchDataProviders();
|
||||
this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
|
|
@ -2,7 +2,8 @@ import {Component, Input} from '@angular/core';
|
|||
|
||||
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'projectsTab',
|
||||
|
@ -36,13 +37,15 @@ export class ProjectsTabComponent {
|
|||
|
||||
@Input() paramsForSearchLink = {};
|
||||
@Input() fetchProjects : FetchProjects;
|
||||
@Input() properties:EnvProperties ;
|
||||
|
||||
public linkToSearchProjects = "";
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
this.linkToSearchProjects = OpenaireProperties.getLinkToAdvancedSearchProjects();
|
||||
this.linkToSearchProjects = this.properties.searchLinkToAdvancedProjects;
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
||||
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'publicationsTab',
|
||||
|
@ -37,13 +38,15 @@ import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openairePro
|
|||
export class PublicationsTabComponent {
|
||||
@Input() paramsForSearchLink = {};//: string = "";
|
||||
@Input() fetchPublications : FetchPublications;
|
||||
@Input() properties:EnvProperties ;
|
||||
|
||||
public linkToSearchPublications = "";
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications();//+this.paramsForSearchLink;
|
||||
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
|
|
@ -3,9 +3,10 @@ import {Component, Input} from '@angular/core';
|
|||
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
||||
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
||||
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'relatedDatasourcesTab',
|
||||
|
@ -89,6 +90,7 @@ export class RelatedDatasourcesTabComponent {
|
|||
@Input() loading: boolean = true;
|
||||
// Εvery content provider's id is a single key of a map
|
||||
@Input() results: Map<string, {"name": string, "countPublications": string, "countDatasets": string}>;
|
||||
@Input() properties:EnvProperties ;
|
||||
|
||||
public linkToSearchPublications: string = "";
|
||||
public linkToSearchResearchData: string = "";
|
||||
|
@ -102,8 +104,8 @@ export class RelatedDatasourcesTabComponent {
|
|||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications();//+"?&hostedBy=";//+ +"&ho=and&collectedFrom="+ +"&co=and";
|
||||
this.linkToSearchResearchData = OpenaireProperties.getLinkToAdvancedSearchDatasets();
|
||||
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;
|
||||
this.linkToSearchResearchData = this.properties.searchLinkToAdvancedDatasets;
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import { SearchDatasetsComponent } from '../../searchPages/simple/searchDatasets.component';
|
||||
import { SearchPublicationsComponent } from '../../searchPages/simple/searchPublications.component';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
|
||||
@Component({
|
||||
selector: 'statisticsTab',
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
<div class="uk-width-3-4@l uk-width-3-4@xl uk-width-3-4@m uk-width-1-1@s">
|
||||
<showTitle [title]="datasetInfo.title"></showTitle>
|
||||
<span *ngIf="datasetInfo.types.length > 0"class="uk-label custom-label label-dataset " title="Type">{{datasetInfo.types.join(", ")}}</span>
|
||||
<span *ngIf="datasetInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{datasetInfo.languages.join(", ")}}</span>
|
||||
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{datasetInfo.languages.join(", ")}}</span>
|
||||
|
||||
<span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " >{{datasetInfo.title.accessMode}}</span>
|
||||
<span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " title="Access Mode">{{datasetInfo.title.accessMode}}</span>
|
||||
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >
|
||||
<span uk-tooltip="pos:right; delay:10"
|
||||
title="{{buildCurationTooltip()}}">
|
||||
|
@ -155,7 +155,7 @@
|
|||
<div *ngFor="let provenanceaction of getKeys(datasetInfo.relatedResearchResults)">
|
||||
<div class="uk-text-large">{{provenanceaction}}</div>
|
||||
|
||||
<tabTable [info]="datasetInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
|
||||
<tabTable [info]="datasetInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -165,14 +165,14 @@
|
|||
No similar research results available
|
||||
</div>
|
||||
<div *ngIf="datasetInfo.similarResearchResults">
|
||||
<tabTable [info]="datasetInfo.similarResearchResults"></tabTable>
|
||||
<tabTable [info]="datasetInfo.similarResearchResults" [(properties)]=properties></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="activeTab=='Metrics'" class="uk-animation-fade">
|
||||
<!-- Page Views: {{pageViews}} -->
|
||||
<metrics [pageViews]="pageViews"
|
||||
[id]="datasetId" [entityType]="'results'" [entity]="'Research Data'"
|
||||
(metricsResults)="metricsResults($event)">
|
||||
(metricsResults)="metricsResults($event)" [(properties)] = properties>
|
||||
</metrics>
|
||||
<i-frame *ngIf="metricsClicked && totalViews > 0"
|
||||
[url]=viewsFrameUrl width="100%" height="250">
|
||||
|
|
|
@ -3,10 +3,10 @@ import {Observable} from 'rxjs/Observable';
|
|||
import {DatasetService} from './dataset.service';
|
||||
import {DatasetInfo} from '../../utils/entities/datasetInfo';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties'
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'dataset',
|
||||
|
@ -45,6 +45,7 @@ export class DatasetComponent {
|
|||
|
||||
private result ;
|
||||
sub: any; piwiksub: any; infoSub: any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (private element: ElementRef,
|
||||
private _datasetService: DatasetService,
|
||||
|
@ -52,10 +53,15 @@ export class DatasetComponent {
|
|||
private route: ActivatedRoute,
|
||||
private _meta: Meta,
|
||||
private _router: Router) {
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.datasetInfo = null;
|
||||
this.updateTitle("Dataset");
|
||||
|
@ -73,12 +79,12 @@ export class DatasetComponent {
|
|||
|
||||
this.metricsClicked = false;
|
||||
|
||||
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
*/
|
||||
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
*/
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
|
@ -102,12 +108,12 @@ export class DatasetComponent {
|
|||
this.errorMessage=""
|
||||
this.showLoading = true;
|
||||
|
||||
this.infoSub = this._datasetService.getDatasetInfo(id).subscribe(
|
||||
this.infoSub = this._datasetService.getDatasetInfo(id, this. properties).subscribe(
|
||||
data => {
|
||||
this.datasetInfo = data;
|
||||
this.updateTitle(this.datasetInfo.title.name);
|
||||
this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title.name);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.datasetInfo.title.name).subscribe();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ import {Injectable} from '@angular/core';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {DatasetInfo} from '../../utils/entities/datasetInfo';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
import { ParsingFunctions } from '../landing-utils/parsingFunctions.class';
|
||||
|
||||
|
@ -19,14 +19,14 @@ export class DatasetService {
|
|||
public parsingFunctions: ParsingFunctions;
|
||||
datasetInfo: DatasetInfo;
|
||||
|
||||
getDatasetInfo (id: string):any {
|
||||
getDatasetInfo (id: string, properties:EnvProperties):any {
|
||||
console.info("getDatasetInfo in service");
|
||||
|
||||
let url = OpenaireProperties. getSearchAPIURLLast()+'datasets/'+id+"?format=json";
|
||||
let url = properties.searchAPIURLLAst+'datasets/'+id+"?format=json";
|
||||
let key = url;
|
||||
|
||||
|
||||
return this.http.get((OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
.do(res => console.info(res['result']['metadata']['oaf:entity']))
|
||||
.map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']['oaf:result']])
|
||||
|
|
|
@ -3,9 +3,9 @@ import {Observable} from 'rxjs/Observable';
|
|||
import {ActivatedRoute, Params, Router} from '@angular/router';
|
||||
import {HtmlProjectReportService} from './htmlProjectReport.service';
|
||||
import {ProjectService} from '../project/project.service';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
declare var UIkit: any;
|
||||
|
||||
|
@ -57,16 +57,22 @@ export class HtmlProjectReportComponent{
|
|||
public warningMessage: string = "";
|
||||
public errorMessage: string = "";
|
||||
public showLoading: boolean = true;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor ( private route: ActivatedRoute,
|
||||
private htmlService: HtmlProjectReportService,
|
||||
private _piwikService:PiwikService,
|
||||
private _projectService: ProjectService,
|
||||
private _meta: Meta, private _router: Router) {
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.projectId = params['projectId'];
|
||||
|
||||
|
@ -119,7 +125,7 @@ export class HtmlProjectReportComponent{
|
|||
}
|
||||
|
||||
private createHeaders() {
|
||||
this.subHTMLInfo = this._projectService.getHTMLInfo(this.projectId).subscribe(
|
||||
this.subHTMLInfo = this._projectService.getHTMLInfo(this.projectId, this.properties).subscribe(
|
||||
data => {
|
||||
this.createHeader1(data);
|
||||
if(data.acronym) {
|
||||
|
@ -127,7 +133,7 @@ export class HtmlProjectReportComponent{
|
|||
} else if(data.title){
|
||||
this.updateTitle(data.title+" "+this.resultsType+" report");
|
||||
}
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(((data.acronym)?data.acronym:data.title)+" "+this.resultsType+" report").subscribe();
|
||||
}
|
||||
},
|
||||
|
@ -154,10 +160,15 @@ export class HtmlProjectReportComponent{
|
|||
intro += '</head>';
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
this.subHTML = this.htmlService.getHTML(this.projectId, this.totalResults, this.resultsType).subscribe(
|
||||
this.subHTML = this.htmlService.getHTML(this.projectId, this.totalResults, this.resultsType, this.properties.csvAPIURL).subscribe(
|
||||
data => {
|
||||
let body: string = intro+'<body><h1>'+this.header1+'</h1><h2>'+this.header2+'</h2>'+data+'</body></html>';
|
||||
this.htmlResult = data;
|
||||
//let body: string = intro+'<body><h1>'+this.header1+'</h1><h2>'+this.header2+'</h2>'+data+'</body></html>';
|
||||
let body: string = intro+'<body><h1>'+this.header1+'</h1><h2>'+this.header2+'</h2>';
|
||||
body += "<table><thead><tr> <th>Title</th><th>Authors</th><th>Publication Year</th><th>DOI</th><th>Permanent Identifier</th><th>Publication type</th><th>Journal</th><th>Project Name (GA Number)</th><th>Access Mode</th></tr></thead><tbody>"+data+"</tbody></table>";
|
||||
body += '</body></html>';
|
||||
|
||||
//this.htmlResult = data;
|
||||
this.htmlResult = "<table><thead><tr> <th>Title</th><th>Authors</th><th>Publication Year</th><th>DOI</th><th>Permanent Identifier</th><th>Publication type</th><th>Journal</th><th>Project Name (GA Number)</th><th>Access Mode</th></tr></thead><tbody>"+data+"</tbody></table>";
|
||||
|
||||
let clipboard;
|
||||
let Clipboard;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/operator/do';
|
||||
|
||||
@Injectable()
|
||||
|
@ -9,7 +8,7 @@ export class HtmlProjectReportService {
|
|||
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
getHTML(id: string, size: number, type:string):any {
|
||||
getHTML(id: string, size: number, type:string, csvAPIURL: string ):any {
|
||||
console.info("getHTML in service");
|
||||
|
||||
let resultTypeId: string;
|
||||
|
@ -25,9 +24,9 @@ export class HtmlProjectReportService {
|
|||
requestType = 'software'
|
||||
}
|
||||
|
||||
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
|
||||
let url = OpenaireProperties.getCsvAPIURL();
|
||||
url += 'resources?format=html&page=0&size='+size+'&type='+requestType+'&query=(((oaftype exact result) and (resulttypeid exact '+resultTypeId+')) and (relprojectid exact "'+id+'"))';
|
||||
let url = csvAPIURL;
|
||||
url += '?format=html&type='+requestType+'&fq=(((oaftype exact result) and (resulttypeid exact '+resultTypeId+')) and (relprojectid exact "'+id+'"))';
|
||||
|
||||
let key = url;
|
||||
|
||||
return this.http.get(url)
|
||||
|
|
|
@ -27,12 +27,12 @@ export class AddThisComponent {
|
|||
ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
if (typeof document !== 'undefined' && typeof addthis !== 'undefined') {
|
||||
try{
|
||||
addthis.init();
|
||||
addthis.layers.refresh();
|
||||
}catch (e) {
|
||||
console.log(e);
|
||||
console.log("AddThis may didn't load properly");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Component, Input, ElementRef} from '@angular/core';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
@Component({
|
||||
selector: 'availableOn',
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import {Component, Input, ElementRef} from '@angular/core';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fundedBy',
|
||||
template: `
|
||||
|
|
|
@ -4,6 +4,7 @@ import {MetricsService } from '../../services/metrics.service';
|
|||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
|
||||
import { Subscription } from 'rxjs/Subscription';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'metrics',
|
||||
|
@ -167,6 +168,7 @@ export class MetricsComponent {
|
|||
@Input() entity: string;
|
||||
//@Input() name: string = "";
|
||||
@Input() pageViews: number = 0;
|
||||
@Input() properties:EnvProperties;
|
||||
|
||||
public metrics: Metrics;
|
||||
public errorCodes:ErrorCodes;
|
||||
|
@ -194,7 +196,7 @@ export class MetricsComponent {
|
|||
// console.log("supplied id in metrics is not acceptable");
|
||||
//}
|
||||
|
||||
this.sub = this._metricsService.getMetrics(this.id, this.entityType).subscribe(
|
||||
this.sub = this._metricsService.getMetrics(this.id, this.entityType, this.properties).subscribe(
|
||||
data => {
|
||||
this.metrics = data;
|
||||
this.status = this.errorCodes.DONE;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
export class ParsingFunctions {
|
||||
|
||||
|
@ -157,7 +156,7 @@ export class ParsingFunctions {
|
|||
available.downloadName = publisher;
|
||||
}
|
||||
|
||||
let url = OpenaireProperties.getDoiURL()+identifiers.get("doi")[0];
|
||||
let url = "https://dx.doi.org/"+identifiers.get("doi")[0];
|
||||
|
||||
available.downloadUrl = new Array<string>();
|
||||
available.accessMode = new Array<string>();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Component, Input, ElementRef} from '@angular/core';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
@Component({
|
||||
selector: 'publishedIn',
|
||||
|
|
|
@ -4,9 +4,10 @@ import {ActivatedRoute} from '@angular/router';
|
|||
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||
import { SearchProjectsService } from '../../services/searchProjects.service';
|
||||
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'searchingProjectsTab',
|
||||
|
@ -57,6 +58,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
export class SearchingProjectsTabComponent {
|
||||
@Input() fetchProjects : FetchProjects;
|
||||
@Input() organizationId:string = "";
|
||||
@Input() properties:EnvProperties;
|
||||
public page :number = 1;
|
||||
public size :number = 10;
|
||||
public linkToSearchProjects: string;
|
||||
|
@ -74,7 +76,7 @@ export class SearchingProjectsTabComponent {
|
|||
ngOnInit() {
|
||||
|
||||
if(this.organizationId) {
|
||||
this.linkToSearchProjects = OpenaireProperties.getLinkToAdvancedSearchProjects();//+"?organization="+this.organizationId+"or=and";;
|
||||
this.linkToSearchProjects = this.properties.searchLinkToAdvancedPublications;//+"?organization="+this.organizationId+"or=and";;
|
||||
if(this.fetchProjects.searchUtils.totalResults > 0) {
|
||||
this.search(false,"");
|
||||
}
|
||||
|
@ -84,7 +86,7 @@ export class SearchingProjectsTabComponent {
|
|||
|
||||
private search(refine:boolean, filterQuery:string){
|
||||
var refineFields:string [] = ["funder"];
|
||||
this.fetchProjects.getResultsForOrganizations(this.organizationId, filterQuery, this.page, this.size,(refine)?refineFields:[]);
|
||||
this.fetchProjects.getResultsForOrganizations(this.organizationId, filterQuery, this.page, this.size,(refine)?refineFields:[], this.properties);
|
||||
}
|
||||
|
||||
public pageChange($event) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import {Component, Input, ElementRef} from '@angular/core';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
@Component({
|
||||
selector: 'showIdentifiers',
|
||||
|
@ -47,9 +46,9 @@ export class ShowIdentifiersComponent {
|
|||
public pageSize: number = 10;
|
||||
|
||||
constructor (private element: ElementRef) {
|
||||
this.doiURL = OpenaireProperties.getDoiURL();
|
||||
this.pmcURL = OpenaireProperties.getPmcURL();
|
||||
this.handleURL = OpenaireProperties.getHandleURL();
|
||||
this.doiURL = "https://dx.doi.org/";
|
||||
this.pmcURL = "http://europepmc.org/articles/";
|
||||
this.handleURL = "http://hdl.handle.net/";
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
//import {PagingModule} from '../utils/paging.module';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'tabTable',
|
||||
|
@ -69,7 +69,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
|
||||
export class TabTableComponent {
|
||||
@Input() info: { "name": string, "url": string, "date": string, "trust": number}[];//Map<string, string[]>;
|
||||
|
||||
@Input() properties:EnvProperties;
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
public searchLinkToPublication: string;
|
||||
public searchLinkToDataset: string;
|
||||
|
@ -81,8 +81,8 @@ export class TabTableComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.searchLinkToPublication = OpenaireProperties.getsearchLinkToPublication();
|
||||
this.searchLinkToDataset = OpenaireProperties.getsearchLinkToDataset();
|
||||
this.searchLinkToPublication = this.properties.searchLinkToPublication;
|
||||
this.searchLinkToDataset = this.properties.searchLinkToDataset;
|
||||
}
|
||||
|
||||
totalPages(totalResults: number): number {
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div *ngIf="activeTab=='Projects'" class="uk-animation-fade">
|
||||
<searchingProjectsTab *ngIf="projectsClicked" [(fetchProjects)]="fetchProjects" [organizationId]="organizationId"></searchingProjectsTab>
|
||||
<searchingProjectsTab *ngIf="projectsClicked" [(fetchProjects)]="fetchProjects" [organizationId]="organizationId" [(properties)]=properties></searchingProjectsTab>
|
||||
</div>
|
||||
|
||||
<div *ngIf="activeTab=='Content Providers'" class="uk-animation-fade">
|
||||
|
@ -160,7 +160,7 @@
|
|||
<!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}">
|
||||
Download projects report (CSV) for {{key}}
|
||||
</a-->
|
||||
<a class="clickable" (click)="downloadFile(downloadURLAPI+'resources?size='+funder.number+'&'+csvProjectParamsHead+encodeURI(funder.id)+csvParamsTail)">
|
||||
<a class="clickable" (click)="downloadFile(downloadURLAPI+'?'+csvProjectParamsHead+encodeURI(funder.id)+csvParamsTail)">
|
||||
<!--span class="clickable" (click)="downloadProjectsFile(downloadURLAPI+'organizations/'+organizationId+'/projects?fq=(funderid exact '+funder.id+')&size='+funder.number)"-->
|
||||
<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>
|
||||
<span class="uk-icon-download"> Project list for {{funder.name}} (CSV)</span>
|
||||
|
@ -175,7 +175,10 @@
|
|||
</li>
|
||||
</ng-container>
|
||||
<li>
|
||||
<a class="clickable" (click)="downloadFile(downloadURLAPI+'organizations/'+organizationId+'/publications?format=csv')">
|
||||
<!-- url = this.downloadURLAPI+"format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))"-->
|
||||
|
||||
<!-- <a class="clickable" (click)="downloadFile(downloadURLAPI+'/organizations/'+organizationId+'?type=publications&format=csv')"> -->
|
||||
<a class="clickable" (click)="downloadFile(downloadURLAPI+'?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact '+organizationId+'))')">
|
||||
<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>
|
||||
<span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span>
|
||||
</a>
|
||||
|
|
|
@ -13,7 +13,7 @@ import {SearchPublicationsService} from '../../services/searchPublications.servi
|
|||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchingProjectsTabComponent} from '../landing-utils/searchingProjectsInTab.component';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
|
||||
|
@ -21,6 +21,7 @@ import {ModalLoading} from '../../utils/modal/loading.component';
|
|||
import {AlertModal} from '../../utils/modal/alert';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'organization',
|
||||
|
@ -85,7 +86,7 @@ export class OrganizationComponent {
|
|||
countProjectsSub: any;
|
||||
countPublSub: any;
|
||||
downloadProjectPublSub: any;
|
||||
|
||||
properties:EnvProperties;
|
||||
//private ngUnsubscribe: Subject<void> = new Subject<void>();
|
||||
|
||||
constructor (private element: ElementRef,
|
||||
|
@ -101,10 +102,15 @@ export class OrganizationComponent {
|
|||
this.fetchPublications = new FetchPublications(this._searchPublicationsService);
|
||||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
});
|
||||
console.info('organization init');
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.organizationInfo=null;
|
||||
|
@ -130,8 +136,8 @@ export class OrganizationComponent {
|
|||
|
||||
});
|
||||
|
||||
this.downloadURLAPI = OpenaireProperties.getCsvAPIURL();
|
||||
this.csvProjectParamsHead = 'format=csv&type=projects&page=0&query=( (oaftype exact project)and (funder exact "';
|
||||
this.downloadURLAPI =this.properties.csvAPIURL;
|
||||
this.csvProjectParamsHead = 'format=csv&type=projects&fq=( (oaftype exact project)and (funder exact "';
|
||||
//this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact ';
|
||||
}
|
||||
|
||||
|
@ -172,7 +178,7 @@ export class OrganizationComponent {
|
|||
this.errorMessage=""
|
||||
this.showLoading = true;
|
||||
|
||||
this.infoSub = this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
|
||||
this.infoSub = this._organizationService.getOrganizationInfo(this.organizationId, this.properties).subscribe(
|
||||
data => {
|
||||
if(data == null) {
|
||||
this.showLoading = false;
|
||||
|
@ -181,16 +187,16 @@ export class OrganizationComponent {
|
|||
this.organizationInfo = data;
|
||||
this.updateTitle(this.organizationInfo.title.name);
|
||||
this.updateDescription("Organization, country, projects, search, repositories, open access"+this.organizationInfo.title.name);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.organizationInfo.title.name).subscribe();
|
||||
}
|
||||
var refineFields:string [] = ["funder"];
|
||||
|
||||
this.searchPublications();
|
||||
|
||||
this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0,refineFields);
|
||||
this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0,refineFields,this.properties);
|
||||
|
||||
this.fetchDataproviders.getNumForEntity("organization", this.organizationId);
|
||||
this.fetchDataproviders.getNumForEntity("organization", this.organizationId,this.properties);
|
||||
|
||||
this.showLoading = false;
|
||||
|
||||
|
@ -215,19 +221,7 @@ export class OrganizationComponent {
|
|||
}
|
||||
);
|
||||
}
|
||||
/*
|
||||
private getMetrics() {
|
||||
console.info("getOrganizationMetrics: component");
|
||||
this._organizationService.getMetrics(this.organizationId).subscribe(
|
||||
data => {
|
||||
this.metrics = data;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
private handleClick(funder: string) {
|
||||
if(this.emptyFundersSet) {
|
||||
|
@ -256,8 +250,8 @@ export class OrganizationComponent {
|
|||
//}
|
||||
|
||||
private searchPublications() {
|
||||
this.fetchPublications.getResultsForEntity("organization", this.organizationId, 1, 10);
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications();// + "?project=" + this.projectId+"&pr=and";
|
||||
this.fetchPublications.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties);
|
||||
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;
|
||||
if(this.fetchPublications.searchUtils.totalResults > 0) {
|
||||
//this.activeTab = "Publications";
|
||||
} else {
|
||||
|
@ -266,8 +260,8 @@ export class OrganizationComponent {
|
|||
}
|
||||
|
||||
private searchDataproviders() {
|
||||
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10);
|
||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToAdvancedSearchDataProviders();
|
||||
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties);
|
||||
this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
|
||||
|
||||
if(this.fetchDataproviders.searchUtils.totalResults > 0) {
|
||||
this.reloadDataproviders = false;
|
||||
|
@ -293,7 +287,7 @@ export class OrganizationComponent {
|
|||
data => {
|
||||
this.closeLoading();
|
||||
window.open(window.URL.createObjectURL(data));
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.downloadFilePiwikSub = this._piwikService.trackDownload(url).subscribe();
|
||||
}
|
||||
},
|
||||
|
@ -317,24 +311,27 @@ export class OrganizationComponent {
|
|||
let counter: number = count;
|
||||
let title: boolean = false;
|
||||
|
||||
this.countProjectsSub = this._searchProjectsService.getProjectsForOrganizations(this.organizationId,' and (funder exact "'+ funderId + '" ) ',1,count,[]).subscribe(
|
||||
this.countProjectsSub = this._searchProjectsService.getProjectsForOrganizations(this.organizationId,' and (funder exact "'+ funderId + '" ) ',1,count,[], this.properties).subscribe(
|
||||
data =>
|
||||
{
|
||||
projects = data[1];
|
||||
for(let index=0; index < projects.length; index++) {
|
||||
this.countPublSub = this._searchPublicationsService.numOfEntityPublications(projects[index].id, "project").subscribe(
|
||||
this.countPublSub = this._searchPublicationsService.numOfEntityPublications(projects[index].id, "project", this.properties).subscribe(
|
||||
data =>
|
||||
{
|
||||
// let index: number = this.organizationInfo.projects.get(funder).indexOf(project);
|
||||
|
||||
let url: string;
|
||||
if(index == 0 || !title) {
|
||||
url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special&size="+data;
|
||||
if(!title) {
|
||||
//url = this.downloadURLAPI+"projects/"+projects[index].id+"?type=publications&format=csv-special";//&size="+data;
|
||||
url = this.downloadURLAPI+"?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))"
|
||||
console.info(url);
|
||||
} else {
|
||||
url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special-notitle&size="+data;
|
||||
//url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special-notitle";//&size="+data;
|
||||
url = this.downloadURLAPI+"?format=csv-special-notitle&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))"
|
||||
}
|
||||
|
||||
if(data == 0) { // if no publications for this project
|
||||
if(data == 0 && (counter > 1 || title)) { // if no publications for this project
|
||||
counter--;
|
||||
response[index] = "";
|
||||
if(counter == 0) {
|
||||
|
@ -345,7 +342,7 @@ export class OrganizationComponent {
|
|||
}
|
||||
this.closeLoading();
|
||||
window.open(window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' })));
|
||||
// if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
// if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
// this._piwikService.trackDownload(url).subscribe();
|
||||
// }
|
||||
}
|
||||
|
@ -366,7 +363,7 @@ export class OrganizationComponent {
|
|||
}
|
||||
this.closeLoading();
|
||||
window.open(window.URL.createObjectURL(new Blob([totalResponse], { type: 'text/csv' })));
|
||||
// if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
// if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
// this._piwikService.trackDownload(url).subscribe();
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@
|
|||
<!--[name]="projectName"-->
|
||||
<metrics [pageViews]="pageViews"
|
||||
[id]="projectId" [entityType]="'projects'" [entity]="'Project'"
|
||||
(metricsResults)="metricsResults($event)">
|
||||
(metricsResults)="metricsResults($event)" [(properties)] = properties>
|
||||
</metrics>
|
||||
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="800" height="350"></i-frame-->
|
||||
<i-frame *ngIf="metricsClicked && totalViews > 0"
|
||||
|
@ -323,7 +323,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParams+fetchPublications.searchUtils.totalResults)">
|
||||
<a class="clickable" (click)="downloadfile(downloadURLAPI+csvParams)">
|
||||
<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> Get {{projectInfo.funder}} report (CSV)
|
||||
</a>
|
||||
</li>
|
||||
|
@ -356,7 +356,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParamsDatasets+fetchDatasets.searchUtils.totalResults)">
|
||||
<a class="clickable" (click)="downloadfile(downloadURLAPI+csvParamsDatasets)">
|
||||
<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> Get {{projectInfo.funder}} report (CSV)
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -15,10 +15,11 @@ import { SearchSoftwareService } from '../../services/searchSoftware.service';
|
|||
import {ModalLoading} from '../../utils/modal/loading.component';
|
||||
|
||||
import {ReportsService} from '../../services/reports.service';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'project',
|
||||
|
@ -84,7 +85,7 @@ export class ProjectComponent{
|
|||
@ViewChild('AlertModalCsvError') alertCsvError;
|
||||
|
||||
sub: any; piwiksub: any; infoSub: any; downloadFilePiwikSub: any;
|
||||
|
||||
properties:EnvProperties;
|
||||
constructor ( private element: ElementRef,
|
||||
private _projectService: ProjectService,
|
||||
private _piwikService:PiwikService,
|
||||
|
@ -94,10 +95,15 @@ export class ProjectComponent{
|
|||
private _searchSoftwareService: SearchSoftwareService,
|
||||
private _reportsService: ReportsService, private _meta: Meta,
|
||||
private _router: Router) {
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.metricsClicked = false;
|
||||
this.statsClicked = false;
|
||||
|
@ -142,19 +148,19 @@ export class ProjectComponent{
|
|||
|
||||
this.getProjectInfo(this.projectId);
|
||||
this.searchPublications();
|
||||
this.fetchDatasets.getNumForEntity("project", this.projectId);
|
||||
this.fetchSoftware.getNumForEntity("project", this.projectId);
|
||||
this.fetchDatasets.getNumForEntity("project", this.projectId, this.properties);
|
||||
this.fetchSoftware.getNumForEntity("project", this.projectId, this.properties);
|
||||
}else{
|
||||
this.showLoading = false;
|
||||
this.warningMessage="No valid project id";
|
||||
}
|
||||
|
||||
this.downloadURLAPI = OpenaireProperties.getCsvAPIURL();
|
||||
this.downloadURLAPI = this.properties.csvAPIURL;
|
||||
|
||||
this.createClipboard();
|
||||
this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size=";
|
||||
this.csvParamsDatasets = "format=csv-special&page=0&type=datasets&query=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact "+this.projectId+"))&size=";
|
||||
this.csvParamsSoftware = "format=csv-special&page=0&type=software&query=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact "+this.projectId+"))&size=";
|
||||
this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))";
|
||||
this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact "+this.projectId+"))";
|
||||
this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact "+this.projectId+"))";
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
|
@ -189,8 +195,8 @@ export class ProjectComponent{
|
|||
}
|
||||
|
||||
private searchPublications() {
|
||||
this.fetchPublications.getResultsForEntity("project", this.projectId, 1, 10);
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications();// + "?project=" + this.projectId+"&pr=and";
|
||||
this.fetchPublications.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
|
||||
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and";
|
||||
if(this.fetchPublications.searchUtils.totalResults > 0) {
|
||||
//this.activeTab = "Publications";
|
||||
} else {
|
||||
|
@ -199,16 +205,16 @@ export class ProjectComponent{
|
|||
}
|
||||
|
||||
private searchDatasets() {
|
||||
this.fetchDatasets.getResultsForEntity("project", this.projectId, 1, 10);
|
||||
this.linkToSearchDatasets = OpenaireProperties.getLinkToAdvancedSearchDatasets();// + "?project=" + this.projectId+"&pr=and";
|
||||
this.fetchDatasets.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
|
||||
this.linkToSearchDatasets = this.properties.searchLinkToAdvancedDatasets;// + "?project=" + this.projectId+"&pr=and";
|
||||
|
||||
this.reloadDatasets = false;
|
||||
//this.activeTab = "Research Data";
|
||||
}
|
||||
|
||||
private searchSoftware() {
|
||||
this.fetchSoftware.getResultsForEntity("project", this.projectId, 1, 10);
|
||||
this.linkToSearchSoftware = OpenaireProperties.getLinkToAdvancedSearchSoftware();
|
||||
this.fetchSoftware.getResultsForEntity("project", this.projectId, 1, 10, this.properties);
|
||||
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
|
||||
this.reloadSoftware = false;
|
||||
}
|
||||
|
||||
|
@ -234,7 +240,7 @@ export class ProjectComponent{
|
|||
this.errorMessage=""
|
||||
this.showLoading = true;
|
||||
|
||||
this.infoSub = this._projectService.getProjectInfo(id).subscribe(
|
||||
this.infoSub = this._projectService.getProjectInfo(id, this.properties).subscribe(
|
||||
data => {
|
||||
this.projectInfo = data;
|
||||
|
||||
|
@ -244,15 +250,15 @@ export class ProjectComponent{
|
|||
}
|
||||
this.updateTitle(this.projectName);
|
||||
this.updateDescription("project, funding, open access, publications, research data, "+this.projectName+ ","+this.projectInfo.funder);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.projectName).subscribe();
|
||||
}
|
||||
|
||||
this.project= { funderId: "", funderName: this.projectInfo.funder, projectId: this.projectId, projectName: this.projectInfo.title, projectAcronym: this.projectInfo.acronym, startDate: this.projectInfo.startDate, endDate: this.projectInfo.endDate };
|
||||
|
||||
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projRepoViews","projTitle":"'+this.projectId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"projRepoViews","projTitle":"'+this.projectId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"projRepoDownloads","projTitle":"'+this.projectId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"projRepoDownloads","projTitle":"'+this.projectId+'","table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[]}]&info_types=["column"]&stacking=&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
|
||||
//stats tab charts
|
||||
this.chartScientificResultsUrl='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"projScient","projTitle":"'+this.projectId+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "spline", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Research Results"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [" "], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
||||
|
@ -277,7 +283,7 @@ export class ProjectComponent{
|
|||
data => {
|
||||
this.closeLoading();
|
||||
window.open(window.URL.createObjectURL(data));
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.downloadFilePiwikSub = this._piwikService.trackDownload(url).subscribe();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,10 +2,10 @@ import {Injectable} from '@angular/core';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {ProjectInfo} from '../../utils/entities/projectInfo';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
import { ParsingFunctions } from '../landing-utils/parsingFunctions.class';
|
||||
|
||||
|
@ -19,31 +19,31 @@ export class ProjectService {
|
|||
public parsingFunctions: ParsingFunctions;
|
||||
projectInfo: ProjectInfo;
|
||||
|
||||
getProjectInfo (id: string):any {
|
||||
getProjectInfo (id: string, properties:EnvProperties):any {
|
||||
console.info("getProjectInfo in service");
|
||||
|
||||
let url = OpenaireProperties. getSearchAPIURLLast() + 'projects/'+id+"?format=json";
|
||||
let url = properties.searchAPIURLLAst + 'projects/'+id+"?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
.map(res => res['result']['metadata']['oaf:entity']['oaf:project'])
|
||||
.map(res => [res,
|
||||
res['fundingtree'],
|
||||
res['rels']['rel']])
|
||||
.map(res => this.parseProjectInfo(res));
|
||||
.map(res => this.parseProjectInfo(res, properties));
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
get project strtDate and endDate
|
||||
*/
|
||||
getProjectDates (id: string):any {
|
||||
getProjectDates (id: string, properties:EnvProperties):any {
|
||||
|
||||
let url = OpenaireProperties. getSearchAPIURLLast()+'projects/'+id+"?format=json";
|
||||
let url = properties.searchAPIURLLAst+'projects/'+id+"?format=json";
|
||||
let key = url+'_projectDates';
|
||||
|
||||
return this.http.get((OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
.map(res => res['result']['metadata']['oaf:entity']['oaf:project'])
|
||||
.map(res => [res,
|
||||
|
@ -53,11 +53,11 @@ export class ProjectService {
|
|||
|
||||
}
|
||||
|
||||
getHTMLInfo(id: string): any {
|
||||
let url = OpenaireProperties. getSearchAPIURLLast() + 'projects/'+id+"?format=json";
|
||||
getHTMLInfo(id: string, properties:EnvProperties): any {
|
||||
let url = properties.searchAPIURLLAst + 'projects/'+id+"?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
.map(res => res['result']['metadata']['oaf:entity']['oaf:project'])
|
||||
.map(res => this.parseHTMLInfo(res));
|
||||
|
@ -79,7 +79,7 @@ export class ProjectService {
|
|||
return htmlInfo;
|
||||
}
|
||||
|
||||
parseProjectInfo (data: any):any {
|
||||
parseProjectInfo (data: any, properties:EnvProperties):any {
|
||||
this.projectInfo = new ProjectInfo();
|
||||
|
||||
if(data[0] != null) {
|
||||
|
@ -186,7 +186,7 @@ export class ProjectService {
|
|||
}
|
||||
|
||||
if(this.projectInfo.funder == "EC") {
|
||||
this.projectInfo.url = OpenaireProperties.getCordisURL()+this.projectInfo.contractNum;
|
||||
this.projectInfo.url = properties.cordisURL+this.projectInfo.contractNum;
|
||||
this.projectInfo.urlInfo = "Detailed project information (CORDIS)";
|
||||
}
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@
|
|||
<div *ngFor="let provenanceaction of getKeys(publicationInfo.relatedResearchResults)">
|
||||
<div class="uk-text-large uk-margin-bottom">{{provenanceaction}}</div>
|
||||
|
||||
<tabTable [info]="publicationInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
|
||||
<tabTable [info]="publicationInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -297,7 +297,7 @@
|
|||
</div>
|
||||
<div *ngIf="publicationInfo.similarResearchResults">
|
||||
|
||||
<tabTable [info]="publicationInfo.similarResearchResults"></tabTable>
|
||||
<tabTable [info]="publicationInfo.similarResearchResults" [(properties)]=properties></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -419,7 +419,7 @@
|
|||
<!-- Page Views: {{pageViews}} -->
|
||||
<metrics [pageViews]="pageViews"
|
||||
[id]="articleId" [entityType]="'results'" [entity]="'Publication'"
|
||||
(metricsResults)="metricsResults($event)">
|
||||
(metricsResults)="metricsResults($event)" [(properties)] = properties>
|
||||
</metrics>
|
||||
<!--i-frame *ngIf="metricsClicked" [url]=viewsFrameUrl width="100%" height="250"></i-frame-->
|
||||
<i-frame *ngIf="metricsClicked && totalViews>0"
|
||||
|
|
|
@ -3,9 +3,9 @@ import {Observable} from 'rxjs/Observable';
|
|||
import {PublicationService} from './publication.service';
|
||||
import {PublicationInfo} from '../../utils/entities/publicationInfo';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
|
||||
|
@ -61,16 +61,22 @@ export class PublicationComponent {
|
|||
private doi: string;
|
||||
private result;
|
||||
sub: any; piwiksub: any; infoSub: any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor ( private element: ElementRef,
|
||||
private _publicationService: PublicationService,
|
||||
private _piwikService:PiwikService,
|
||||
private route: ActivatedRoute, private _meta: Meta,
|
||||
private _router: Router) {
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
this.publicationInfo = null;
|
||||
this.updateTitle("Publication");
|
||||
|
@ -92,9 +98,9 @@ export class PublicationComponent {
|
|||
this.warningMessage="No valid publication id";
|
||||
}
|
||||
|
||||
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.downloadsFrameUrl =this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
|
@ -117,7 +123,7 @@ export class PublicationComponent {
|
|||
this.errorMessage=""
|
||||
this.showLoading = true;
|
||||
|
||||
this.infoSub = this._publicationService.getPublicationInfo(this.articleId).subscribe(
|
||||
this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe(
|
||||
data => {
|
||||
this.publicationInfo = data;
|
||||
|
||||
|
@ -125,7 +131,7 @@ export class PublicationComponent {
|
|||
// this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestaccessright, embargoEndDate: ''};
|
||||
this.updateTitle(this.publicationInfo.title.name);
|
||||
this.updateDescription("Dataset, search, repositories, open access,"+this.publicationInfo.title.name);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.publicationInfo.title.name).subscribe();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ import {Injectable} from '@angular/core';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {PublicationInfo} from '../../utils/entities/publicationInfo';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import 'rxjs/add/operator/map';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
import { ParsingFunctions } from '../landing-utils/parsingFunctions.class';
|
||||
|
@ -22,12 +22,12 @@ export class PublicationService {
|
|||
public parsingFunctions: ParsingFunctions;
|
||||
publicationInfo: PublicationInfo;
|
||||
|
||||
getPublicationInfo (id: string):any {
|
||||
getPublicationInfo (id: string, properties:EnvProperties):any {
|
||||
console.info("getPublicationInfo in service");
|
||||
let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
|
||||
let url = properties.searchAPIURLLAst + 'publications/' +id+"?format=json";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
.map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']])
|
||||
.map(res => [ res[1]['oaf:result'],
|
||||
|
@ -325,7 +325,7 @@ export class PublicationService {
|
|||
citationId = Array.isArray(citation['id']) ? citation['id'][j] : citation['id'];
|
||||
|
||||
if(citationId.type == "pmid") {
|
||||
url = OpenaireProperties.getPmidURL()+citationId.value;
|
||||
url = "http://www.ncbi.nlm.nih.gov/pubmed/"+citationId.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<div class="uk-width-3-4@l uk-width-3-4@xl uk-width-3-4@m uk-width-1-1@s">
|
||||
<showTitle [title]="softwareInfo.title"></showTitle>
|
||||
<span *ngIf="softwareInfo.types.length > 0"class="uk-label custom-label label-software " title="Type">{{softwareInfo.types.join(", ")}}</span>
|
||||
<span *ngIf="softwareInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{softwareInfo.languages.join(", ")}}</span>
|
||||
<span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " >{{softwareInfo.title.accessMode}}</span>
|
||||
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{softwareInfo.languages.join(", ")}}</span>
|
||||
<span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " title="Access Mode">{{softwareInfo.title.accessMode}}</span>
|
||||
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >
|
||||
<span uk-tooltip="pos:right; delay:10"
|
||||
title="{{buildCurationTooltip()}}">
|
||||
|
@ -156,7 +156,7 @@
|
|||
<div *ngFor="let provenanceaction of getKeys(softwareInfo.relatedResearchResults)">
|
||||
<div class="uk-text-large">{{provenanceaction}}</div>
|
||||
|
||||
<tabTable [info]="softwareInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
|
||||
<tabTable [info]="softwareInfo.relatedResearchResults.get(provenanceaction)" [(properties)]=properties></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -173,7 +173,7 @@
|
|||
<!-- Page Views: {{pageViews}} -->
|
||||
<metrics [pageViews]="pageViews"
|
||||
[id]="softwareId" [entityType]="'results'" [entity]="'Software'"
|
||||
(metricsResults)="metricsResults($event)">
|
||||
(metricsResults)="metricsResults($event)" [(properties)] = properties>
|
||||
</metrics>
|
||||
<i-frame *ngIf="metricsClicked && totalViews > 0"
|
||||
[url]=viewsFrameUrl width="100%" height="250">
|
||||
|
|
|
@ -3,10 +3,10 @@ import {Observable} from 'rxjs/Observable';
|
|||
import {SoftwareService} from './software.service';
|
||||
import {SoftwareInfo} from '../../utils/entities/softwareInfo';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties'
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'software',
|
||||
|
@ -45,6 +45,7 @@ export class SoftwareComponent {
|
|||
|
||||
private result ;
|
||||
sub: any; piwiksub: any; infoSub: any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (private element: ElementRef,
|
||||
private _softwareService: SoftwareService,
|
||||
|
@ -52,10 +53,15 @@ export class SoftwareComponent {
|
|||
private route: ActivatedRoute,
|
||||
private _meta: Meta,
|
||||
private _router: Router) {
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.updateUrl(data.envSpecific.baseLink+this._router.url);
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.softwareInfo = null;
|
||||
this.updateTitle("Software");
|
||||
|
@ -73,12 +79,12 @@ export class SoftwareComponent {
|
|||
|
||||
this.metricsClicked = false;
|
||||
|
||||
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
*/
|
||||
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
/*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
*/
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
|
@ -102,12 +108,12 @@ export class SoftwareComponent {
|
|||
this.errorMessage=""
|
||||
this.showLoading = true;
|
||||
|
||||
this.infoSub = this._softwareService.getSoftwareInfo(id).subscribe(
|
||||
this.infoSub = this._softwareService.getSoftwareInfo(id, this.properties).subscribe(
|
||||
data => {
|
||||
this.softwareInfo = data;
|
||||
this.updateTitle(this.softwareInfo.title.name);
|
||||
this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if( this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.softwareInfo.title.name).subscribe();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ import {Injectable} from '@angular/core';
|
|||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {SoftwareInfo} from '../../utils/entities/softwareInfo';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/observable/of';
|
||||
import 'rxjs/add/operator/do';
|
||||
import 'rxjs/add/operator/share';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
import { ParsingFunctions } from '../landing-utils/parsingFunctions.class';
|
||||
|
||||
|
@ -19,14 +19,14 @@ export class SoftwareService {
|
|||
public parsingFunctions: ParsingFunctions;
|
||||
softwareInfo: SoftwareInfo;
|
||||
|
||||
getSoftwareInfo (id: string):any {
|
||||
getSoftwareInfo (id: string, properties:EnvProperties):any {
|
||||
console.info("getSoftwareInfo in service");
|
||||
|
||||
let url = OpenaireProperties. getSearchAPIURLLast()+'software/'+id+"?format=json";
|
||||
let url = properties.searchAPIURLLAst+'software/'+id+"?format=json";
|
||||
let key = url;
|
||||
|
||||
|
||||
return this.http.get((OpenaireProperties.isCacheEnabled())? (OpenaireProperties.getCacheUrl()+encodeURIComponent(url)): url)
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
.do(res => console.info(res['result']['metadata']['oaf:entity']))
|
||||
.map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']['oaf:result']])
|
||||
|
|
|
@ -3,6 +3,8 @@ import { Router,CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot} from '
|
|||
import {Observable} from 'rxjs/Observable';
|
||||
import {Session} from './utils/helper.class';
|
||||
import {ErrorCodes} from './utils/guardHelper.class';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
@Injectable()
|
||||
export class AdminLoginGuard implements CanActivate {
|
||||
|
||||
|
@ -13,7 +15,7 @@ export class AdminLoginGuard implements CanActivate {
|
|||
var loggedIn = false;
|
||||
var isAdmin = false;
|
||||
var errorCode = ErrorCodes.NOT_LOGGIN;
|
||||
|
||||
var properties:EnvProperties = route.data.envSpecific;
|
||||
if(Session.isLoggedIn()){
|
||||
loggedIn = true;
|
||||
if(!Session.isValidAndRemove()){
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Router,CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router';
|
||||
import { Router,CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, ActivatedRoute} from '@angular/router';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Session} from './utils/helper.class';
|
||||
import {ErrorCodes} from './utils/guardHelper.class';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
@Injectable()
|
||||
export class FreeGuard implements CanActivate {
|
||||
|
@ -14,7 +15,9 @@ export class FreeGuard implements CanActivate {
|
|||
var valid = true;
|
||||
var loggedIn = false;
|
||||
var errorCode = ErrorCodes.NOT_LOGGIN;
|
||||
|
||||
var properties = route.data;
|
||||
console.log("FreeGuard");
|
||||
console.log(properties);
|
||||
if(Session.isLoggedIn()){
|
||||
loggedIn = true;
|
||||
if(!Session.isValidAndRemove()){
|
||||
|
|
|
@ -3,6 +3,7 @@ import { Router,CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot} from '
|
|||
import {Observable} from 'rxjs/Observable';
|
||||
import {Session} from './utils/helper.class';
|
||||
import {ErrorCodes} from './utils/guardHelper.class';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
@Injectable()
|
||||
export class LoginGuard implements CanActivate {
|
||||
|
@ -13,6 +14,8 @@ export class LoginGuard implements CanActivate {
|
|||
var user;
|
||||
var loggedIn = false;
|
||||
var errorCode = ErrorCodes.NOT_LOGGIN;
|
||||
var properties:EnvProperties = route.data.envSpecific;
|
||||
|
||||
if(Session.isLoggedIn()){
|
||||
loggedIn = true;
|
||||
if(!Session.isValidAndRemove()){
|
||||
|
|
|
@ -6,7 +6,7 @@ import {ActivatedRoute, Router} from '@angular/router';
|
|||
import {User,Session} from './utils/helper.class';
|
||||
import {RouterHelper} from '../utils/routerHelper.class';
|
||||
import { Meta} from '../../angular2-meta';
|
||||
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'user',
|
||||
|
@ -24,7 +24,8 @@ export class UserComponent {
|
|||
public errorCode: string = "";
|
||||
public redirectUrl: string = "";
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
public loginUrl= OpenaireProperties.getLoginURL();
|
||||
public loginUrl;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor( private router: Router,
|
||||
private route: ActivatedRoute, private _meta: Meta) {
|
||||
|
@ -32,6 +33,12 @@ export class UserComponent {
|
|||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.loginUrl = this.properties.loginUrl;
|
||||
|
||||
});
|
||||
if( typeof document !== 'undefined') {
|
||||
this.server = false;
|
||||
}
|
||||
|
@ -113,7 +120,7 @@ export class UserComponent {
|
|||
Session.setCurrentParameters(queryParams);
|
||||
}
|
||||
|
||||
window.location.href = OpenaireProperties.getLoginURL();
|
||||
window.location.href = this.properties.loginUrl;
|
||||
}
|
||||
|
||||
// login() {
|
||||
|
|
|
@ -5,9 +5,9 @@ import {Location} from '@angular/common';
|
|||
// import {LoginService} from './login.service';
|
||||
import {User,Session} from './utils/helper.class';
|
||||
import {RouterHelper} from '../utils/routerHelper.class';
|
||||
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
||||
import {StringUtils} from '../utils/string-utils.class';
|
||||
import {LogoutOpenaireService} from './utils/logoutOpenaire.service';
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
|
||||
declare var logoutClicked;
|
||||
@Component({
|
||||
selector: 'user-mini',
|
||||
|
@ -31,8 +31,8 @@ declare var logoutClicked;
|
|||
<li *ngIf="isAuthorized"><a routerLinkActive="uk-link" routerLink="/claims">Manage all Claims</a></li-->
|
||||
<ng-container *ngFor="let item of userMenuItems ">
|
||||
<li *ngIf="item.needsAuthorization && isAuthorized || !item.needsAuthorization">
|
||||
<a *ngIf="item.route.length > 0" routerLinkActive="uk-link" routerLink="{{item.route}}" >{{item.title}}</a>
|
||||
<a *ngIf="item.route.length == 0 && item.url.length > 0"routerLinkActive="uk-link" href="{{submenu.url}}" >{{item.title}}</a>
|
||||
<a *ngIf="item.route.length > 0" routerLinkActive="uk-link" routerLink="{{item.route}}" [queryParams]=submenu.params >{{item.title}}</a>
|
||||
<a *ngIf="item.route.length == 0 && item.url.length > 0" routerLinkActive="uk-link" href="{{submenu.url}}" >{{item.title}}</a>
|
||||
</li>
|
||||
</ng-container>
|
||||
<li><a (click)="logOut()" id="logout" >Log out</a></li>
|
||||
|
@ -80,19 +80,25 @@ export class UserMiniComponent {
|
|||
@Input() userMenuItems;
|
||||
@Input() logInUrl;
|
||||
@Input() logOutUrl;
|
||||
@Input() cookieDomain;
|
||||
public redirectUrl: string = "";
|
||||
private baseUrl = "user-info";
|
||||
sub:any;
|
||||
constructor( private router: Router, private route: ActivatedRoute, private location: Location, private logoutOpenaire: LogoutOpenaireService) {}
|
||||
// public properties:EnvProperties;
|
||||
|
||||
constructor( private router: Router, private route: ActivatedRoute, private location: Location) {}
|
||||
|
||||
ngOnInit() {
|
||||
if( typeof document !== 'undefined') {
|
||||
this.server = false;
|
||||
}
|
||||
this.initialize();
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.initialize();
|
||||
});
|
||||
|
||||
if( typeof document !== 'undefined') {
|
||||
this.server = false;
|
||||
}
|
||||
this.initialize();
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.initialize();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
ngOnDestroy(){
|
||||
this.sub.unsubscribe();
|
||||
|
@ -139,7 +145,7 @@ export class UserMiniComponent {
|
|||
// });
|
||||
logoutClicked();
|
||||
console.log("Redirect to "+location.href);
|
||||
window.location.href = (this.logOutUrl)?this.logOutUrl:OpenaireProperties.getLogoutURL()+ StringUtils.URIEncode(location.href);
|
||||
window.location.href = this.logOutUrl + StringUtils.URIEncode(location.href);
|
||||
|
||||
}
|
||||
this.loggedIn = false;
|
||||
|
@ -150,7 +156,7 @@ export class UserMiniComponent {
|
|||
logIn(){
|
||||
Session.setCurrentUrl(location.pathname);
|
||||
Session.setCurrentParameters(location.search);
|
||||
window.location.href = (this.logInUrl)?this.logInUrl:OpenaireProperties.getLoginURL();
|
||||
window.location.href = this.logInUrl
|
||||
}
|
||||
|
||||
onClick(id: string) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
|
||||
|
||||
export class User {
|
||||
email:string;
|
||||
firstname: string;
|
||||
|
@ -271,6 +269,6 @@ export class MyJWT{
|
|||
d.setTime(d.getTime() + expireDays * 24 * 60 * 60 * 1000);
|
||||
let expires:string = `expires=${d.toUTCString()}`;
|
||||
// let cpath:string = path ? `; path=${path}` : '';
|
||||
document.cookie = name+'='+value+'; path='+path+'; domain='+OpenaireProperties.getCookieDomain()+';';
|
||||
document.cookie = name+'='+value+'; path='+path+'; domain='+document.domain+';';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import 'rxjs/add/operator/do';
|
||||
@Injectable()
|
||||
export class LogoutOpenaireService {
|
||||
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
logout():any {
|
||||
console.info("Logout openaire");
|
||||
//let url = OpenaireProperties. getSearchAPIURLLast() + 'publications/' +id+"?format=json";
|
||||
let url = OpenaireProperties.getLogoutOpenaireURL();
|
||||
|
||||
return this.http.get(url).do(request => console.info("Log out?" ));
|
||||
}
|
||||
|
||||
}
|
|
@ -3,7 +3,6 @@ import {Observable} from 'rxjs/Observable';
|
|||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Location} from '@angular/common';
|
||||
|
||||
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../utils/routerHelper.class';
|
||||
import {Session} from '../login/utils/helper.class';
|
||||
|
|
|
@ -4,11 +4,12 @@ import { Router, ActivatedRoute} from '@angular/router';
|
|||
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -20,7 +21,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
[(searchUtils)] = "searchUtils"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/dataproviders"
|
||||
[csvParams]="csvParams" csvPath="datasources" simpleSearchLink="/search/find/dataproviders"
|
||||
[disableForms]="disableForms"
|
||||
[loadPaging]="loadPaging"
|
||||
[oldTotalResults]="oldTotalResults">
|
||||
|
@ -47,16 +48,29 @@ export class AdvancedSearchDataProvidersComponent {
|
|||
public disableForms: boolean = false;
|
||||
public loadPaging: boolean = true;
|
||||
public oldTotalResults: number = 0;
|
||||
public pagingLimit: number = 0;
|
||||
public isPiwikEnabled;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
|
||||
this.results =[];
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedDataProviders;
|
||||
|
||||
console.info("Con -base url:"+this.searchUtils.baseUrl );
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties= data.envSpecific;
|
||||
this.searchUtils.baseUrl = data.envSpecific.searchLinkToAdvancedDataProviders;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
if(params['page'] && this.searchUtils.page != params['page']) {
|
||||
this.loadPaging = false;
|
||||
|
@ -78,22 +92,26 @@ export class AdvancedSearchDataProvidersComponent {
|
|||
}
|
||||
sub: any;
|
||||
public getResults(parameters:string, page: number, size: number){
|
||||
if(page > this.pagingLimit ) {
|
||||
size=0;
|
||||
}
|
||||
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
||||
if(parameters!= null && parameters != '' ) {
|
||||
this.csvParams ="&type=datasources&query=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
}else{
|
||||
this.csvParams ="&type=datasources&query="+this.resourcesQuery;
|
||||
this.csvParams ="&fq="+this.resourcesQuery;
|
||||
}
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search for Content Providers: Execute search query "+parameters);
|
||||
this._searchDataProvidersService.advancedSearchDataproviders(parameters, page, size).subscribe(
|
||||
data => {
|
||||
console.info("Advanced Search for Content Providers: Execute search query "+parameters);
|
||||
this._searchDataProvidersService.advancedSearchDataproviders(parameters, page, size, this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("Adv Search Content Providers total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
|
@ -117,32 +135,33 @@ export class AdvancedSearchDataProvidersComponent {
|
|||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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.disableForms = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public queryChanged($event) {
|
||||
this.loadPaging = true;
|
||||
|
||||
|
||||
var parameters = $event.value;
|
||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||
console.info("queryChanged: Execute search query "+parameters);
|
||||
|
|
|
@ -4,10 +4,11 @@ import { Router, ActivatedRoute} from '@angular/router';
|
|||
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -19,7 +20,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/datasets"
|
||||
[csvParams]="csvParams" csvPath="datasets" simpleSearchLink="/search/find/datasets"
|
||||
[disableForms]="disableForms"
|
||||
[loadPaging]="loadPaging"
|
||||
[oldTotalResults]="oldTotalResults">
|
||||
|
@ -30,6 +31,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
|
||||
export class AdvancedSearchDatasetsComponent {
|
||||
private errorCodes: ErrorCodes;
|
||||
properties:EnvProperties;
|
||||
|
||||
public results =[];
|
||||
public filters =[];
|
||||
|
@ -47,17 +49,25 @@ export class AdvancedSearchDatasetsComponent {
|
|||
public disableForms: boolean = false;
|
||||
public loadPaging: boolean = true;
|
||||
public oldTotalResults: number = 0;
|
||||
|
||||
public pagingLimit: number = 0;
|
||||
public isPiwikEnabled;
|
||||
constructor (private route: ActivatedRoute, private _searchDatasetsService: SearchDatasetsService ) {
|
||||
this.results =[];
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedDatasets;
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties= data.envSpecific;
|
||||
this.searchUtils.baseUrl = data.envSpecific.searchLinkToAdvancedDataProviders;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
|
||||
});
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -82,67 +92,72 @@ export class AdvancedSearchDatasetsComponent {
|
|||
}
|
||||
sub: any;
|
||||
public getResults(parameters:string, page: number, size: number){
|
||||
if(page > this.pagingLimit) {
|
||||
size=0;
|
||||
}
|
||||
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
||||
if(parameters!= null && parameters != '' ) {
|
||||
this.csvParams ="&type=datasets&query=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
}else{
|
||||
this.csvParams ="&type=datasets&query="+this.resourcesQuery;
|
||||
this.csvParams ="&fq="+this.resourcesQuery;
|
||||
}
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search for Research Data: Execute search query "+parameters);
|
||||
this._searchDatasetsService.advancedSearchDatasets(parameters, page, size).subscribe(
|
||||
console.info("Advanced Search for Research Data: Execute search query "+parameters);
|
||||
this._searchDatasetsService.advancedSearchDatasets(parameters, page, size, this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Research Data total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Research Data total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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;
|
||||
}
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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.disableForms = false;
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
private setFilters(){
|
||||
//TODO set filters from
|
||||
|
@ -150,7 +165,7 @@ export class AdvancedSearchDatasetsComponent {
|
|||
|
||||
public queryChanged($event) {
|
||||
this.loadPaging = true;
|
||||
|
||||
|
||||
var parameters = $event.value;
|
||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||
console.info("queryChanged: Execute search query "+parameters);
|
||||
|
|
|
@ -4,10 +4,11 @@ import { Router, ActivatedRoute} from '@angular/router';
|
|||
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchOrganizationsService} from '../../services/searchOrganizations.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -19,7 +20,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/organizations"
|
||||
[csvParams]="csvParams" csvPath="organizations" simpleSearchLink="/search/find/organizations"
|
||||
[disableForms]="disableForms"
|
||||
[loadPaging]="loadPaging"
|
||||
[oldTotalResults]="oldTotalResults">
|
||||
|
@ -30,6 +31,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
|
||||
export class AdvancedSearchOrganizationsComponent {
|
||||
private errorCodes: ErrorCodes;
|
||||
properties:EnvProperties;
|
||||
|
||||
public results =[];
|
||||
public filters =[];
|
||||
|
@ -43,6 +45,8 @@ export class AdvancedSearchOrganizationsComponent {
|
|||
public disableForms: boolean = false;
|
||||
public loadPaging: boolean = true;
|
||||
public oldTotalResults: number = 0;
|
||||
public pagingLimit: number = 0;
|
||||
public isPiwikEnabled;
|
||||
|
||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
|
||||
|
@ -51,12 +55,19 @@ public resourcesQuery = "(oaftype exact organization)";
|
|||
this.results =[];
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedOrganizations;
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties= data.envSpecific;
|
||||
this.searchUtils.baseUrl = data.envSpecific.searchLinkToAdvancedDataProviders;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
|
||||
});
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
|
@ -82,21 +93,25 @@ public resourcesQuery = "(oaftype exact organization)";
|
|||
}
|
||||
sub: any;
|
||||
public getResults(parameters:string, page: number, size: number){
|
||||
if(page > this.pagingLimit) {
|
||||
size=0;
|
||||
}
|
||||
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
||||
if(parameters!= null && parameters != '' ) {
|
||||
this.csvParams ="&type=organizations&query=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
}else{
|
||||
this.csvParams ="&type=organizations&query="+this.resourcesQuery;
|
||||
this.csvParams ="&fq="+this.resourcesQuery;
|
||||
}
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search for Organizations: Execute search query "+parameters);
|
||||
this._searchOrganizationsService.advancedSearchOrganizations(parameters, page, size).subscribe(
|
||||
console.info("Advanced Search for Organizations: Execute search query "+parameters);
|
||||
this._searchOrganizationsService.advancedSearchOrganizations(parameters, page, size, this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Organizations total="+this.searchUtils.totalResults);
|
||||
|
@ -142,7 +157,8 @@ public resourcesQuery = "(oaftype exact organization)";
|
|||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
private setFilters(){
|
||||
//TODO set filters from
|
||||
|
@ -150,7 +166,7 @@ public resourcesQuery = "(oaftype exact organization)";
|
|||
|
||||
public queryChanged($event) {
|
||||
this.loadPaging = true;
|
||||
|
||||
|
||||
var parameters = $event.value;
|
||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||
console.info("queryChanged: Execute search query "+parameters);
|
||||
|
|
|
@ -4,10 +4,11 @@ import { Router, ActivatedRoute} from '@angular/router';
|
|||
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'advanced-search-projects',
|
||||
|
@ -18,7 +19,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/projects"
|
||||
[csvParams]="csvParams" csvPath="projects" simpleSearchLink="/search/find/projects"
|
||||
[disableForms]="disableForms"
|
||||
[loadPaging]="loadPaging"
|
||||
[oldTotalResults]="oldTotalResults">
|
||||
|
@ -39,6 +40,7 @@ export class AdvancedSearchProjectsComponent {
|
|||
public fieldIds: string[] = this.searchFields.PROJECT_ADVANCED_FIELDS;
|
||||
public fieldIdsMap = this.searchFields.PROJECT_FIELDS;
|
||||
public selectedFields:AdvancedField[] = [];
|
||||
properties:EnvProperties;
|
||||
|
||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
public resourcesQuery = "(oaftype exact project)";
|
||||
|
@ -46,18 +48,28 @@ export class AdvancedSearchProjectsComponent {
|
|||
public disableForms: boolean = false;
|
||||
public loadPaging: boolean = true;
|
||||
public oldTotalResults: number = 0;
|
||||
public pagingLimit: number = 0;
|
||||
public isPiwikEnabled;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) {
|
||||
|
||||
this.results =[];
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedProjects;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties= data.envSpecific;
|
||||
this.searchUtils.baseUrl = data.envSpecific.searchLinkToAdvancedDataProviders;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
|
||||
});
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -82,68 +94,73 @@ export class AdvancedSearchProjectsComponent {
|
|||
}
|
||||
sub: any;
|
||||
public getResults(parameters:string, page: number, size: number){
|
||||
if(page > this.pagingLimit) {
|
||||
size=0;
|
||||
}
|
||||
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
||||
if(parameters!= null && parameters != '' ) {
|
||||
this.csvParams ="&type=projects&query=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
}else{
|
||||
this.csvParams ="&type=projects&query="+this.resourcesQuery;
|
||||
this.csvParams ="&fq="+this.resourcesQuery;
|
||||
}
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search for Publications: Execute search query "+parameters);
|
||||
this._searchProjectsService.advancedSearchProjects(parameters, page, size).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("Advanced Search for Projects total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
console.info("Advanced Search for Publications: Execute search query "+parameters);
|
||||
this._searchProjectsService.advancedSearchProjects(parameters, page, size, this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("Advanced Search for Projects total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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.disableForms = false;
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
private setFilters(){
|
||||
//TODO set filters from
|
||||
|
@ -151,7 +168,7 @@ export class AdvancedSearchProjectsComponent {
|
|||
|
||||
public queryChanged($event) {
|
||||
this.loadPaging = true;
|
||||
|
||||
|
||||
var parameters = $event.value;
|
||||
this.getResults(parameters, this.searchUtils.page,this.searchUtils.size);
|
||||
console.info("queryChanged: Execute search query "+parameters);
|
||||
|
|
|
@ -4,10 +4,11 @@ import { Router, ActivatedRoute} from '@angular/router';
|
|||
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -19,10 +20,12 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/publications"
|
||||
[csvParams]="csvParams" csvPath="publications" simpleSearchLink="/search/find/publications"
|
||||
[disableForms]="disableForms"
|
||||
[loadPaging]="loadPaging"
|
||||
[oldTotalResults]="oldTotalResults">
|
||||
[oldTotalResults]="oldTotalResults"
|
||||
[(openaireLink)]=openaireLink
|
||||
[(connectCommunityId)]=connectCommunityId>
|
||||
</advanced-search-page>
|
||||
`
|
||||
})
|
||||
|
@ -44,6 +47,11 @@ export class AdvancedSearchPublicationsComponent {
|
|||
public disableForms: boolean = false;
|
||||
public loadPaging: boolean = true;
|
||||
public oldTotalResults: number = 0;
|
||||
@Input() openaireLink: string ;
|
||||
@Input() connectCommunityId: string = "egi||EGI Federation";
|
||||
public pagingLimit: number = 0;
|
||||
public isPiwikEnabled;
|
||||
properties:EnvProperties;
|
||||
|
||||
@ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ;
|
||||
|
||||
|
@ -53,12 +61,19 @@ export class AdvancedSearchPublicationsComponent {
|
|||
this.results =[];
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedPublications;
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties= data.envSpecific;
|
||||
this.searchUtils.baseUrl = data.envSpecific.searchLinkToAdvancedDataProviders;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
|
||||
});
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -83,68 +98,73 @@ export class AdvancedSearchPublicationsComponent {
|
|||
}
|
||||
sub: any;
|
||||
public getResults(parameters:string, page: number, size: number){
|
||||
if(page > this.pagingLimit) {
|
||||
size=0;
|
||||
}
|
||||
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
||||
if(parameters!= null && parameters != '' ) {
|
||||
this.csvParams ="&type=publications&query=("+this.resourcesQuery +" and (" + parameters + "))";
|
||||
this.csvParams ="&fq=("+this.resourcesQuery +" and (" + parameters + "))";
|
||||
}else{
|
||||
this.csvParams ="&type=publications&query="+this.resourcesQuery;
|
||||
this.csvParams ="&fq="+this.resourcesQuery;
|
||||
}
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search for Publications: Execute search query "+parameters);
|
||||
this._searchPublicationsService.advancedSearchPublications(parameters, page, size).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("searchPubl total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
console.info("Advanced Search for Publications: Execute search query "+parameters);
|
||||
this._searchPublicationsService.advancedSearchPublications(parameters, page, size, this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("searchPubl total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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.disableForms = false;
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public queryChanged($event) {
|
||||
|
|
|
@ -4,10 +4,11 @@ import { Router, ActivatedRoute} from '@angular/router';
|
|||
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchSoftwareService} from '../../services/searchSoftware.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {AdvancedSearchPageComponent} from '../searchUtils/advancedSearchPage.component';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -19,7 +20,7 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
|||
[(searchUtils)] = "searchUtils"
|
||||
[(fieldIds)]="fieldIds" [(fieldIdsMap)]="fieldIdsMap" [(selectedFields)]="selectedFields"
|
||||
(queryChange)="queryChanged($event)"
|
||||
[csvParams]="csvParams" csvPath="resources" simpleSearchLink="/search/find/software"
|
||||
[csvParams]="csvParams" csvPath="software" simpleSearchLink="/search/find/software"
|
||||
[disableForms]="disableForms"
|
||||
[loadPaging]="loadPaging"
|
||||
[oldTotalResults]="oldTotalResults">
|
||||
|
@ -47,17 +48,27 @@ export class AdvancedSearchSoftwareComponent {
|
|||
public disableForms: boolean = false;
|
||||
public loadPaging: boolean = true;
|
||||
public oldTotalResults: number = 0;
|
||||
public pagingLimit: number = 0;
|
||||
public isPiwikEnabled;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchSoftwareService: SearchSoftwareService ) {
|
||||
this.results =[];
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.searchUtils.baseUrl = OpenaireProperties.searchLinkToAdvancedSoftware;
|
||||
|
||||
|
||||
|
||||
}
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties= data.envSpecific;
|
||||
this.searchUtils.baseUrl = data.envSpecific.searchLinkToAdvancedDataProviders;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
|
||||
});
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -82,67 +93,72 @@ export class AdvancedSearchSoftwareComponent {
|
|||
}
|
||||
sub: any;
|
||||
public getResults(parameters:string, page: number, size: number){
|
||||
if(page >this.pagingLimit) {
|
||||
size=0;
|
||||
}
|
||||
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
|
||||
if(parameters!= null && parameters != '' ) {
|
||||
this.csvParams ="&type=software&query=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
|
||||
}else{
|
||||
this.csvParams ="&type=software&query="+this.resourcesQuery;
|
||||
this.csvParams ="&fq="+this.resourcesQuery;
|
||||
}
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
//this.searchPage.openLoading();
|
||||
this.disableForms = true;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
console.info("Advanced Search for Software: Execute search query "+parameters);
|
||||
this._searchSoftwareService.advancedSearchSoftware(parameters, page, size).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Software total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
console.info("Advanced Search for Software: Execute search query "+parameters);
|
||||
this._searchSoftwareService.advancedSearchSoftware(parameters, page, size, this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Software total="+this.searchUtils.totalResults);
|
||||
this.results = data[1];
|
||||
this.searchPage.updateBaseUrlWithParameters();
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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.disableForms = false;
|
||||
|
||||
//this.searchPage.closeLoading();
|
||||
this.disableForms = false;
|
||||
}
|
||||
);
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = errorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//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.disableForms = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
private setFilters(){
|
||||
//TODO set filters from
|
||||
|
|
|
@ -4,10 +4,11 @@ import { ActivatedRoute} from '@angular/router';
|
|||
import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageComponent } from '../searchUtils/searchPage.component';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-content-providers',
|
||||
|
@ -50,13 +51,12 @@ export class SearchCompatibleDataprovidersComponent {
|
|||
public resourcesQuery = '&query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other) not(datasourcetypeuiid exact "pubsrepository::journal") not(datasourcetypeuiid exact "aggregator::pubsrepository::journals"))';
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
properties:EnvProperties;
|
||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.baseUrl = OpenaireProperties.getLinkToSearchCompatibleDataProviders();
|
||||
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
||||
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
||||
this._prefixQuery+="&" + this._prefixQueryFields[i].field + "="
|
||||
|
@ -68,6 +68,13 @@ export class SearchCompatibleDataprovidersComponent {
|
|||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.baseUrl = data.envSpecific.searchLinkToCompatibleDataProviders
|
||||
|
||||
|
||||
});
|
||||
this.searchPage.refineFields = this.refineFields;
|
||||
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -97,7 +104,7 @@ export class SearchCompatibleDataprovidersComponent {
|
|||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchDataprovidersService.searchCompatibleDataproviders(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchCompatibleDataproviders(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, [],this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
|
|
|
@ -4,10 +4,11 @@ import { ActivatedRoute} from '@angular/router';
|
|||
import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageTableViewComponent } from '../searchUtils/searchPageTableView.component';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-content-providers-table',
|
||||
|
@ -45,16 +46,21 @@ export class SearchCompatibleDataprovidersTableComponent {
|
|||
public resourcesQuery = "&query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))";*/
|
||||
|
||||
public disableForms: boolean = false;
|
||||
|
||||
properties:EnvProperties;
|
||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.baseUrl = OpenaireProperties.getLinkToSearchCompatibleDataProvidersTable();
|
||||
}
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.baseUrl = data.envSpecific.searchLinkToEntityRegistriesDataProvidersTable;
|
||||
|
||||
});
|
||||
this.searchPage.refineFields = this.refineFields;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||
|
@ -82,11 +88,11 @@ export class SearchCompatibleDataprovidersTableComponent {
|
|||
this.searchUtils.totalResults = 0;
|
||||
|
||||
let size: number = 0;
|
||||
this.subResults = this._searchDataprovidersService.searchCompatibleDataprovidersTable().subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchCompatibleDataprovidersTable(this.properties).subscribe(
|
||||
data => {
|
||||
size = data;
|
||||
if(size > 0) {
|
||||
this.subResults = this._searchDataprovidersService.searchCompatibleDataproviders("", null, 1, size, []).subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchCompatibleDataproviders("", null, 1, size, [],this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Content Providers [total results:"+this.searchUtils.totalResults+"]");
|
||||
|
|
|
@ -3,10 +3,11 @@ import { ActivatedRoute} from '@angular/router';
|
|||
import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageComponent } from '../searchUtils/searchPage.component';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-entity-registries',
|
||||
|
@ -53,11 +54,11 @@ export class SearchEntityRegistriesComponent {
|
|||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
public resourcesQuery = "&query=((oaftype exact datasource) and(datasourcetypeuiid = other))";
|
||||
public csvParams: string;
|
||||
|
||||
properties:EnvProperties;
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.baseUrl = OpenaireProperties.getLinkToSearchEntityRegistries();
|
||||
|
||||
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
||||
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
||||
this._prefixQuery+="&" + this._prefixQueryFields[i].field + "="
|
||||
|
@ -69,6 +70,13 @@ export class SearchEntityRegistriesComponent {
|
|||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.baseUrl = data.envSpecific.searchLinkToEntityRegistriesDataProviders;
|
||||
|
||||
|
||||
});
|
||||
this.searchPage.refineFields = this.refineFields;
|
||||
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -98,7 +106,7 @@ export class SearchEntityRegistriesComponent {
|
|||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchDataprovidersService.searchEntityRegistries(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchEntityRegistries(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, [],this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Entity Registries: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
|
|
|
@ -3,10 +3,11 @@ import { ActivatedRoute} from '@angular/router';
|
|||
import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageTableViewComponent } from '../searchUtils/searchPageTableView.component';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-entity-registries-table',
|
||||
|
@ -37,7 +38,7 @@ export class SearchEntityRegistriesTableComponent {
|
|||
public searchFields:SearchFields = new SearchFields();
|
||||
public refineFields: string[] = this.searchFields.ENTITY_REGISTRIES_FIELDS;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
properties:EnvProperties;
|
||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
|
@ -46,6 +47,12 @@ export class SearchEntityRegistriesTableComponent {
|
|||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.baseUrl = data.envSpecific.searchLinkToEntityRegistriesDataProviders;
|
||||
|
||||
});
|
||||
this.searchPage.refineFields = this.refineFields;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||
|
@ -72,11 +79,11 @@ export class SearchEntityRegistriesTableComponent {
|
|||
this.searchUtils.totalResults = 0;
|
||||
|
||||
let size: number = 0;
|
||||
this.subResults = this._searchDataprovidersService.searchEntityRegistriesTable().subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchEntityRegistriesTable(this.properties).subscribe(
|
||||
data => {
|
||||
size = data;
|
||||
if(size > 0) {
|
||||
this.subResults = this._searchDataprovidersService.searchEntityRegistries("",null, page, size, []).subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchEntityRegistries("",null, page, size, [],this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Entity Registries [total results:"+this.searchUtils.totalResults+"]");
|
||||
|
|
|
@ -5,10 +5,11 @@ import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
|||
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageComponent } from '../searchUtils/searchPage.component';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-journals',
|
||||
|
@ -52,13 +53,12 @@ export class SearchJournalsComponent {
|
|||
//"&query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))";
|
||||
public csvParams: string;
|
||||
public disableForms: boolean = false;
|
||||
|
||||
properties:EnvProperties;
|
||||
@ViewChild (SearchPageComponent) searchPage : SearchPageComponent ;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.baseUrl = OpenaireProperties.getLinkToSearchJournals();
|
||||
for(var i = 0; i < this._prefixQueryFields.length; i++ ){
|
||||
for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
|
||||
this._prefixQuery+="&" + this._prefixQueryFields[i].field + "="
|
||||
|
@ -70,6 +70,13 @@ export class SearchJournalsComponent {
|
|||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.baseUrl = data.envSpecific.searchLinkToJournals;
|
||||
|
||||
|
||||
});
|
||||
this.searchPage.refineFields = this.refineFields;
|
||||
this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
@ -99,7 +106,7 @@ export class SearchJournalsComponent {
|
|||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
|
||||
this.subResults = this._searchDataprovidersService.searchJournals(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchJournals(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, [],this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Journals: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
|
|
|
@ -5,10 +5,11 @@ import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
|||
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageTableViewComponent } from '../searchUtils/searchPageTableView.component';
|
||||
import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-journals-table',
|
||||
|
@ -37,7 +38,7 @@ export class SearchJournalsTableComponent {
|
|||
public _location:Location;
|
||||
public searchFields:SearchFields = new SearchFields();
|
||||
public refineFields: string[] = this.searchFields.JOURNAL_FIELDS;
|
||||
|
||||
properties:EnvProperties;
|
||||
/*public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ],
|
||||
"export":[]
|
||||
};
|
||||
|
@ -52,10 +53,15 @@ export class SearchJournalsTableComponent {
|
|||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.baseUrl = OpenaireProperties.getLinkToSearchJournalsTable();
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.baseUrl = data.envSpecific.searchLinkToJournalsTable;
|
||||
|
||||
});
|
||||
this.searchPage.refineFields = this.refineFields;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||
|
@ -72,7 +78,8 @@ export class SearchJournalsTableComponent {
|
|||
}
|
||||
if(this.subResults){
|
||||
this.subResults.unsubscribe();
|
||||
} }
|
||||
}
|
||||
}
|
||||
private _getResults(){
|
||||
//this.csvParams = this.resourcesQuery+"&type=datasources";
|
||||
|
||||
|
@ -83,11 +90,11 @@ export class SearchJournalsTableComponent {
|
|||
this.searchUtils.totalResults = 0;
|
||||
|
||||
let size: number = 0;
|
||||
this.subResults = this._searchDataprovidersService.searchJournalsTable().subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchJournalsTable(this.properties).subscribe(
|
||||
data => {
|
||||
size = data;
|
||||
if(size > 0) {
|
||||
this.subResults = this._searchDataprovidersService.searchJournals("", null, 1, size, []).subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchJournals("", null, 1, size, [],this.properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info("search Journals [total results:"+this.searchUtils.totalResults+"]");
|
||||
|
|
|
@ -123,11 +123,11 @@
|
|||
</div>
|
||||
<search-result [(results)]="fetchPublications.results"
|
||||
[(status)]= "fetchPublications.searchUtils.status" showLoading = true
|
||||
type="publication" urlParam="articleId">
|
||||
type="publication" urlParam="articleId" [(properties)]=properties>
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='publications'" class ="uk-animation-fade" >
|
||||
<browse-entities entityName="publication" baseUrl="/search/find/publications" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
<browse-entities [(properties)]=properties entityName="publication" baseUrl="/search/find/publications" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
</div>
|
||||
<!--/li>
|
||||
<li-->
|
||||
|
@ -143,11 +143,11 @@
|
|||
</div>
|
||||
<search-result [(results)]="fetchDatasets.results"
|
||||
[(status)]= "fetchDatasets.searchUtils.status" showLoading = true
|
||||
type="dataset" urlParam="datasetId">
|
||||
type="dataset" urlParam="datasetId" [(properties)]=properties>
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='research data'" class ="uk-animation-fade">
|
||||
<browse-entities entityName="dataset" baseUrl="/search/find/datasets" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
<browse-entities [(properties)]=properties entityName="dataset" baseUrl="/search/find/datasets" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
</div>
|
||||
<!--/li>
|
||||
<li-->
|
||||
|
@ -162,11 +162,11 @@
|
|||
</div>
|
||||
<search-result [(results)]="fetchSoftware.results"
|
||||
[(status)]= "fetchSoftware.searchUtils.status" showLoading = true
|
||||
type="software" urlParam="softwareId">
|
||||
type="software" urlParam="softwareId" [(properties)]=properties>
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='software'" class ="uk-animation-fade">
|
||||
<browse-entities entityName="software" baseUrl="/search/find/software" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
<browse-entities [(properties)]=properties entityName="software" baseUrl="/search/find/software" [refineFields]=searchFields.RESULT_REFINE_FIELDS></browse-entities>
|
||||
</div>
|
||||
<!--/li>
|
||||
<li-->
|
||||
|
@ -182,11 +182,11 @@
|
|||
</div>
|
||||
<search-result [(results)]="fetchProjects.results"
|
||||
[(status)]= "fetchProjects.searchUtils.status" showLoading = true
|
||||
type="project" urlParam="projectId">
|
||||
type="project" urlParam="projectId" [(properties)]=properties>
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='projects'" class ="uk-animation-fade">
|
||||
<browse-entities entityName="project" baseUrl="/search/find/projects" [refineFields]=searchFields.PROJECT_REFINE_FIELDS></browse-entities>
|
||||
<browse-entities [(properties)]=properties entityName="project" baseUrl="/search/find/projects" [refineFields]=searchFields.PROJECT_REFINE_FIELDS></browse-entities>
|
||||
</div>
|
||||
<!--/li>
|
||||
<li-->
|
||||
|
@ -202,11 +202,11 @@
|
|||
</div>
|
||||
<search-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]= "fetchDataproviders.searchUtils.status" showLoading = true
|
||||
type="dataprovider" urlParam="datasourceId">
|
||||
type="dataprovider" urlParam="datasourceId" [(properties)]=properties>
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0 && activeTab=='content providers'" class ="uk-animation-fade" >
|
||||
<browse-entities entityName="dataprovider" baseUrl="/search/find/dataproviders" [refineFields]=searchFields.DATASOURCE_REFINE_FIELDS></browse-entities>
|
||||
<browse-entities [(properties)]=properties entityName="dataprovider" baseUrl="/search/find/dataproviders" [refineFields]=searchFields.DATASOURCE_REFINE_FIELDS></browse-entities>
|
||||
</div>
|
||||
<!--/li>
|
||||
<li-->
|
||||
|
@ -222,11 +222,11 @@
|
|||
</div>
|
||||
<search-result [(results)]="fetchOrganizations.results"
|
||||
[(status)]= "fetchOrganizations.searchUtils.status" showLoading = true
|
||||
type="organization" urlParam="organizationId">
|
||||
type="organization" urlParam="organizationId" [(properties)]=properties>
|
||||
</search-result>
|
||||
</div>
|
||||
<div *ngIf = "keyword.length == 0" class ="uk-animation-fade">
|
||||
<browse-entities entityName="organization" baseUrl="/search/find/organizations" [refineFields]=searchFields.ORGANIZATION_REFINE_FIELDS></browse-entities>
|
||||
<browse-entities [(properties)]=properties entityName="organization" baseUrl="/search/find/organizations" [refineFields]=searchFields.ORGANIZATION_REFINE_FIELDS></browse-entities>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -19,13 +19,13 @@ import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
|||
import {SearchSoftwareService} from '../../services/searchSoftware.service';
|
||||
import {SearchOrganizationsService} from '../../services/searchOrganizations.service';
|
||||
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import {RefineFieldResultsService} from '../../services/refineFieldResults.service';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import { ConfigurationService } from '../../utils/configuration/configuration.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
|
@ -83,6 +83,9 @@ export class SearchComponent {
|
|||
showProjects:boolean= false;
|
||||
showDataProviders:boolean= false;
|
||||
showOrganizations:boolean= false;
|
||||
|
||||
properties: EnvProperties;
|
||||
|
||||
public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
||||
constructor ( private route: ActivatedRoute,
|
||||
private _router: Router,
|
||||
|
@ -102,78 +105,86 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
this.fetchSoftware = new FetchSoftware(this._searchSoftwareService);
|
||||
this.fetchOrganizations = new FetchOrganizations( this._searchOrganizationsService);
|
||||
|
||||
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ";
|
||||
|
||||
var title = "OpenAIRE | Search publications, research data, projects... | OpenAIRE";
|
||||
|
||||
var url = OpenaireProperties.getBaseLink()+this._router.url;
|
||||
this._meta.setTitle(title);
|
||||
this._meta.updateMeta("description", description);
|
||||
this._meta.updateProperty("og:description", description);
|
||||
this._meta.updateProperty("og:title", title);
|
||||
this._meta.updateProperty("og:url", url);
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("OpenAIRE |Search publications, research data, projects...").subscribe();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
const entityOne = this.config.isEntityEnabled("publication");
|
||||
const entityTwo = this.config.isEntityEnabled("dataset");
|
||||
const entityThree = this.config.isEntityEnabled("project");
|
||||
const entityFour = this.config.isEntityEnabled("organization");
|
||||
const entityFive = this.config.isEntityEnabled("datasource");
|
||||
const entitySix = this.config.isEntityEnabled("software");
|
||||
const example = Observable.zip(entityOne,entityTwo,entityThree,entityFour,entityFive,entitySix);
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
|
||||
//wait until all observables have emitted a value then emit all as an array
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
const subscribe = example.subscribe(data => {
|
||||
this.showPublications = data[0];
|
||||
this.showDatasets = data[1];
|
||||
this.showProjects = data[2];
|
||||
this.showOrganizations = data[3];
|
||||
this.showDataProviders = data[4];
|
||||
this.showSoftware = data[5];
|
||||
console.log(data)
|
||||
this.keyword = (params['keyword'])?params['keyword']:"";
|
||||
if(this.keyword !=null && this.keyword.length > 0){
|
||||
this.reloadTabs();
|
||||
//if showPublications == false will set another entity as the first
|
||||
if(this.showPublications){
|
||||
this.activeTab = "publications";
|
||||
this.searchPublications();
|
||||
}else if(this.showDatasets){
|
||||
this.activeTab = "research data";
|
||||
this.searchDatasets();
|
||||
}else if(this.showSoftware){
|
||||
this.activeTab = "software";
|
||||
this.searchSoftware();
|
||||
}else if(this.showProjects){
|
||||
this.activeTab = "projects";
|
||||
this.searchProjects();
|
||||
}else if(this.showDataProviders){
|
||||
this.activeTab = "content providers";
|
||||
this.searchDataProviders();
|
||||
}else if(this.showOrganizations){
|
||||
this.activeTab = "organizations";
|
||||
this.searchOrganizations();
|
||||
}
|
||||
this.count();
|
||||
var description = "open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ";
|
||||
|
||||
var title = "OpenAIRE | Search publications, research data, projects... | OpenAIRE";
|
||||
this.properties = data.envSpecific;
|
||||
var url =data.envSpecific.baseLink+this._router.url;
|
||||
this._meta.setTitle(title);
|
||||
this._meta.updateMeta("description", description);
|
||||
this._meta.updateProperty("og:description", description);
|
||||
this._meta.updateProperty("og:title", title);
|
||||
this._meta.updateProperty("og:url", url);
|
||||
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView("OpenAIRE |Search publications, research data, projects...").subscribe();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.config.getCommunityInformation(this.properties.adminToolsAPIURL, this.properties.adminToolsCommunity ).subscribe(data => {
|
||||
var showEntity = {};
|
||||
for(var i=0; i< data.entities.length; i++){
|
||||
|
||||
showEntity[""+data.entities[i]["pid"]+""] = data.entities[i]["isEnabled"];
|
||||
}
|
||||
});
|
||||
});
|
||||
this.showPublications = showEntity["publication"];
|
||||
this.showDatasets = showEntity["dataset"];
|
||||
this.showProjects = showEntity["project"];
|
||||
this.showOrganizations = showEntity["organization"];
|
||||
this.showDataProviders = showEntity["datasource"];
|
||||
this.showSoftware = showEntity["software"];
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
||||
this.keyword = (params['keyword'])?params['keyword']:"";
|
||||
if(this.keyword !=null && this.keyword.length > 0){
|
||||
this.reloadTabs();
|
||||
//if showPublications == false will set another entity as the first
|
||||
if(this.showPublications){
|
||||
this.activeTab = "publications";
|
||||
this.searchPublications();
|
||||
}else if(this.showDatasets){
|
||||
this.activeTab = "research data";
|
||||
this.searchDatasets();
|
||||
}else if(this.showSoftware){
|
||||
this.activeTab = "software";
|
||||
this.searchSoftware();
|
||||
}else if(this.showProjects){
|
||||
this.activeTab = "projects";
|
||||
this.searchProjects();
|
||||
}else if(this.showDataProviders){
|
||||
this.activeTab = "content providers";
|
||||
this.searchDataProviders();
|
||||
}else if(this.showOrganizations){
|
||||
this.activeTab = "organizations";
|
||||
this.searchOrganizations();
|
||||
}
|
||||
this.count();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
public ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
if(this.piwiksub){
|
||||
this.piwiksub.unsubscribe();
|
||||
}
|
||||
this.piwiksub.unsubscribe();
|
||||
}
|
||||
if(this.keyword !=null && this.keyword.length > 0){
|
||||
if(this.subPub){
|
||||
this.subPub.unsubscribe();
|
||||
|
@ -199,8 +210,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
this.fetchPublications.searchUtils.status != this.errorCodes.NONE &&
|
||||
this.fetchPublications.searchUtils.status != this.errorCodes.ERROR) {
|
||||
this.reloadPublications = false;
|
||||
this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10);
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications();// + "?keyword=" + this.keyword;
|
||||
this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10,this.properties);
|
||||
this.linkToSearchPublications = this.properties.searchLinkToPublications;// + "?keyword=" + this.keyword;
|
||||
}
|
||||
}
|
||||
public searchDatasets() {
|
||||
|
@ -209,8 +220,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
this.fetchDatasets.searchUtils.status != this.errorCodes.NONE &&
|
||||
this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR) {
|
||||
this.reloadDatasets = false;
|
||||
this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10);
|
||||
this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets();// + "?keyword=" + this.keyword;
|
||||
this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10,this.properties);
|
||||
this.linkToSearchDatasets =this.properties.searchLinkToDatasets;// + "?keyword=" + this.keyword;
|
||||
}
|
||||
}
|
||||
public searchSoftware() {
|
||||
|
@ -219,8 +230,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchSoftware.searchUtils.status == this.errorCodes.DONE )) {
|
||||
this.reloadSoftware = false;
|
||||
this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10);
|
||||
this.linkToSearchSoftware = OpenaireProperties.getLinkToSearchSoftware();// + "?keyword=" + this.keyword;
|
||||
this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10,this.properties);
|
||||
this.linkToSearchSoftware = this.properties.searchLinkToSoftware;// + "?keyword=" + this.keyword;
|
||||
}
|
||||
}
|
||||
public searchProjects() {
|
||||
|
@ -229,8 +240,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
this.fetchProjects.searchUtils.status != this.errorCodes.NONE &&
|
||||
this.fetchProjects.searchUtils.status != this.errorCodes.ERROR) {
|
||||
this.reloadProjects = false;
|
||||
this.fetchProjects.getResultsByKeyword(this.keyword, 1, 10);
|
||||
this.linkToSearchProjects = OpenaireProperties.getLinkToSearchProjects();// + "?keyword=" + this.keyword;
|
||||
this.fetchProjects.getResultsByKeyword(this.keyword, 1, 10,this.properties);
|
||||
this.linkToSearchProjects = this.properties.searchLinkToProjects;// + "?keyword=" + this.keyword;
|
||||
}
|
||||
}
|
||||
public searchDataProviders() {
|
||||
|
@ -239,8 +250,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
this.fetchDataproviders.searchUtils.status != this.errorCodes.NONE &&
|
||||
this.fetchDataproviders.searchUtils.status != this.errorCodes.ERROR) {
|
||||
this.reloadDataproviders = false;
|
||||
this.fetchDataproviders.getResultsByKeyword(this.keyword, 1, 10);
|
||||
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();// + "?keyword=" + this.keyword;
|
||||
this.fetchDataproviders.getResultsByKeyword(this.keyword, 1, 10,this.properties);
|
||||
this.linkToSearchDataproviders = this.properties.searchLinkToDataProviders;// + "?keyword=" + this.keyword;
|
||||
}
|
||||
}
|
||||
public searchOrganizations() {
|
||||
|
@ -249,8 +260,8 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
this.fetchOrganizations.searchUtils.status != this.errorCodes.NONE &&
|
||||
this.fetchOrganizations.searchUtils.status != this.errorCodes.ERROR) {
|
||||
this.reloadOrganizations = false;
|
||||
this.fetchOrganizations.getResultsByKeyword(this.keyword, 1, 10);
|
||||
this.linkToSearchOrganizations = OpenaireProperties.getLinkToSearchOrganizations();// + "?keyword=" + this.keyword;
|
||||
this.fetchOrganizations.getResultsByKeyword(this.keyword, 1, 10,this.properties);
|
||||
this.linkToSearchOrganizations = this.properties.searchLinkToOrganizations;// + "?keyword=" + this.keyword;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -287,7 +298,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
if(this.activeTab != "publications" && this.showPublications){
|
||||
this.fetchPublications.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.fetchPublications.results = [];
|
||||
this.subPub = this._searchPublicationsService.numOfSearchPublications(this.keyword).subscribe(
|
||||
this.subPub = this._searchPublicationsService.numOfSearchPublications(this.keyword,this.properties).subscribe(
|
||||
data => {
|
||||
console.log("Count results: "+data);
|
||||
this.fetchPublications.searchUtils.totalResults = data;
|
||||
|
@ -305,7 +316,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
if(this.activeTab != "research data" && this.showDatasets){
|
||||
this.fetchDatasets.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.fetchDatasets.results = [];
|
||||
this.subData = this._searchDatasetsService.numOfSearchDatasets(this.keyword).subscribe(
|
||||
this.subData = this._searchDatasetsService.numOfSearchDatasets(this.keyword,this.properties).subscribe(
|
||||
data => {
|
||||
this.fetchDatasets.searchUtils.totalResults = data;
|
||||
this.fetchDatasets.searchUtils.status = this.errorCodes.DONE;
|
||||
|
@ -322,7 +333,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
if(this.activeTab != "software" && this.showSoftware){
|
||||
this.fetchSoftware.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.fetchSoftware.results = [];
|
||||
this.subData = this._searchSoftwareService.numOfSearchSoftware(this.keyword).subscribe(
|
||||
this.subData = this._searchSoftwareService.numOfSearchSoftware(this.keyword,this.properties).subscribe(
|
||||
data => {
|
||||
this.fetchSoftware.searchUtils.totalResults = data;
|
||||
this.fetchSoftware.searchUtils.status = this.errorCodes.DONE;
|
||||
|
@ -346,7 +357,7 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
if(this.activeTab != "projects" && this.showProjects){
|
||||
this.fetchProjects.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.fetchProjects.results = [];
|
||||
this.subProjects = this._searchProjectsService.numOfSearchProjects(this.keyword).subscribe(
|
||||
this.subProjects = this._searchProjectsService.numOfSearchProjects(this.keyword,this.properties).subscribe(
|
||||
data => {
|
||||
this.fetchProjects.searchUtils.totalResults = data;
|
||||
this.fetchProjects.searchUtils.status = this.errorCodes.DONE;
|
||||
|
@ -362,12 +373,12 @@ public subPub;public subData;public subProjects;public subOrg; public subDataPr;
|
|||
}
|
||||
if(this.activeTab != "content providers" && this.showDataProviders){
|
||||
this.fetchDataproviders.results = [];
|
||||
this.fetchDataproviders.getNumForSearch(this.keyword);
|
||||
this.fetchDataproviders.getNumForSearch(this.keyword,this.properties);
|
||||
}
|
||||
if(this.activeTab != "organizations" && this.showOrganizations){
|
||||
this.fetchOrganizations.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.fetchOrganizations.results = [];
|
||||
this.subOrg = this._searchOrganizationsService.numOfSearchOrganizations(this.keyword).subscribe(
|
||||
this.subOrg = this._searchOrganizationsService.numOfSearchOrganizations(this.keyword,this.properties).subscribe(
|
||||
data => {
|
||||
this.fetchOrganizations.searchUtils.totalResults = data;
|
||||
this.fetchOrganizations.searchUtils.status = this.errorCodes.DONE;
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
<date-filter [(dateValue)]=selectedField.dateValue ></date-filter>
|
||||
</td>
|
||||
<td *ngIf = " selectedField.id && selectedField.type == 'vocabulary'" >
|
||||
<static-autocomplete *ngIf = " selectedField.id" [(vocabularyId)] = selectedField.param [fieldId]=selectedField.id
|
||||
<static-autocomplete [(properties)]=properties *ngIf = " selectedField.id" [(vocabularyId)] = selectedField.param [fieldId]=selectedField.id
|
||||
[(list)] = this.fieldList[selectedField.id] [entityName] = "entityType" [selectedValue]=selectedField.value [showSelected]=true
|
||||
[placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false
|
||||
(selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete>
|
||||
</td>
|
||||
<td *ngIf = " selectedField.id && selectedField.type == 'refine'" >
|
||||
<static-autocomplete [(list)] = this.fieldList[selectedField.id] [fieldId]=selectedField.id [entityName] = "entityType" [fieldName] = [selectedField.id] [selectedValue]=selectedField.value [showSelected]=true [placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete></td>
|
||||
<td *ngIf = "selectedField.type == 'entity'" ><entities-autocomplete [fieldId]=selectedField.id [entityType]=selectedField.param [selectedValue]=selectedField.value [showSelected]=true
|
||||
<static-autocomplete [(properties)]=properties [(list)] = this.fieldList[selectedField.id] [fieldId]=selectedField.id [entityName] = "entityType" [fieldName] = [selectedField.id] [selectedValue]=selectedField.value [showSelected]=true [placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false (selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)"></static-autocomplete></td>
|
||||
<td *ngIf = "selectedField.type == 'entity'" ><entities-autocomplete [(properties)]=properties [fieldId]=selectedField.id [entityType]=selectedField.param [selectedValue]=selectedField.value [showSelected]=true
|
||||
[placeHolderMessage] = "'Search for '+selectedField.name" [title] = "selectedField.name" [multipleSelections]=false
|
||||
(selectedValueChanged)="valueChanged($event,i)" (listUpdated) = "listUpdated($event,selectedField.id)" >
|
||||
</entities-autocomplete></td>
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import {Component, Input, Output, EventEmitter, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { Subject } from 'rxjs/Subject';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import {AdvancedField, OPERATOR} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {Dates} from '../../utils/string-utils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'advanced-search-form',
|
||||
|
@ -22,12 +24,17 @@ export class AdvancedSearchFormComponent {
|
|||
newFieldName:string;
|
||||
fieldList:{[id:string]:any[]} = {};
|
||||
public searchFields:SearchFields = new SearchFields();
|
||||
|
||||
properties:EnvProperties;
|
||||
public operators: [{name:string, id:string}] = this.searchFields.ADVANCED_SEARCH_OPERATORS;
|
||||
constructor () {
|
||||
constructor (private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
|
||||
});
|
||||
for(var i = 0; i < this.fieldIds.length; i++){
|
||||
this.fieldList[this.fieldIds[i]]=[];
|
||||
}
|
||||
|
|
|
@ -23,19 +23,25 @@
|
|||
<div class="uk-width-1-1 uk-grid helper-grid" >
|
||||
<helper class="helper-left-right uk-visible@m" position="left"></helper>
|
||||
<div class="uk-width-expand@m uk-with-1-1@s">
|
||||
<div *ngIf="openaireLink"> <a class="uk-margin-top uk-button uk-button-text" [href]=openaireLink target="_blank" >Results in OpenAIRE</a></div>
|
||||
<div class="uk-align-center uk-margin-remove-bottom">
|
||||
<search-paging [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
||||
</div>
|
||||
|
||||
<search-download *ngIf="searchUtils.totalResults <= 10000" class="uk-width-1-1@s uk-hidden@m" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download>
|
||||
<search-download *ngIf="searchUtils.totalResults <= csvLimit" class="uk-width-1-1@s uk-hidden@m" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download>
|
||||
|
||||
<div class="uk-margin-top">
|
||||
<div *ngIf="(searchUtils.page <= pagingLimit)" class="uk-margin-top">
|
||||
<search-result [results]="results"
|
||||
[status]=searchUtils.status
|
||||
[type]="entityType"
|
||||
[showLoading]="true">
|
||||
[showLoading]="true" [(properties)]=properties>
|
||||
</search-result>
|
||||
</div>
|
||||
|
||||
<div [class]="searchUtils.page > pagingLimit ? 'search-results' : ''" *ngIf="(searchUtils.page >= pagingLimit) && (searchUtils.totalResults > resultsPerPage*pagingLimit)">
|
||||
<p class="uk-alert-warning" uk-alert>For more results please try a new, more specific query</p>
|
||||
</div>
|
||||
|
||||
<div class="uk-align-center uk-margin-remove-bottom">
|
||||
<search-paging [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [(results)] = "results" [(baseUrl)] = "searchUtils.baseUrl" [(parameterNames)] = "parameterNames" [(parameterValues)] = "parameterValues" ></search-paging>
|
||||
</div>
|
||||
|
@ -43,11 +49,11 @@
|
|||
<helper class="uk-hidden@m" position="left" styleName="uk-width-1-1@s"></helper>
|
||||
<helper class="uk-hidden@m" position="right" styleName="uk-width-1-1@s"></helper>
|
||||
</div>
|
||||
<div *ngIf="searchUtils.totalResults <= 10000" class="uk-visible@m helper-left-right">
|
||||
<div *ngIf="searchUtils.totalResults <= csvLimit" class="uk-visible@m helper-left-right">
|
||||
<search-download [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults" ></search-download>
|
||||
<helper position="right"></helper>
|
||||
</div>
|
||||
<helper *ngIf="searchUtils.totalResults > 10000" class="helper-left-right uk-visible@m" position="right"></helper>
|
||||
<helper *ngIf="searchUtils.totalResults > csvLimit" class="helper-left-right uk-visible@m" position="right"></helper>
|
||||
</div>
|
||||
|
||||
<div class="uk-width-1-1">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Location} from '@angular/common';
|
||||
import { Router} from '@angular/router';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Filter, Value,AdvancedField} from '../searchUtils/searchHelperClasses.class';
|
||||
import {SearchResult} from '../../utils/entities/searchResult';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
|
@ -9,8 +9,8 @@ import {SearchUtilsClass} from './searchUtils.class';
|
|||
import {ModalLoading} from '../../utils/modal/loading.component';
|
||||
import {StringUtils, Dates} from '../../utils/string-utils.class';
|
||||
import { Meta} from '../../../angular2-meta';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'advanced-search-page',
|
||||
|
@ -33,29 +33,48 @@ export class AdvancedSearchPageComponent {
|
|||
@Input() disableForms:boolean = false;
|
||||
@Input() loadPaging: boolean = true;
|
||||
@Input() oldTotalResults: number = 0;
|
||||
|
||||
@Input() openaireLink: string;
|
||||
@Input() connectCommunityId: string;
|
||||
piwiksub: any;
|
||||
public parameterNames:string[] =[];
|
||||
public parameterValues:string[] =[];
|
||||
|
||||
public baseURLWithParameters:string = '';
|
||||
|
||||
public csvLimit: number = 0;
|
||||
public pagingLimit: number = 0;
|
||||
public resultsPerPage: number = 0;
|
||||
isPiwikEnabled = false;
|
||||
properties:EnvProperties;
|
||||
|
||||
@Output() queryChange = new EventEmitter();
|
||||
constructor (private location: Location, private _meta: Meta, private _piwikService:PiwikService, private router: Router) {
|
||||
constructor (private route: ActivatedRoute,private location: Location, private _meta: Meta, private _piwikService:PiwikService, private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.resultsPerPage =data.envSpecific.resultsPerPage;
|
||||
this.csvLimit = data.envSpecific.csvLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
if(typeof window !== 'undefined') {
|
||||
this.updateUrl(data.envSpecific.baseLink+location.pathname);
|
||||
}
|
||||
if(typeof document !== 'undefined' && this.isPiwikEnabled){
|
||||
this.piwiksub = this._piwikService.trackView(this.pageTitle).subscribe();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.updateTitle("Advanced search "+this.pageTitle);
|
||||
this.updateDescription("Openaire, search, repositories, open access, type, content provider, funder, project, "+ this.pageTitle);
|
||||
if(typeof window !== 'undefined') {
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+location.pathname);
|
||||
}
|
||||
|
||||
|
||||
this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
|
||||
this.updateBaseUrlWithParameters();
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.pageTitle).subscribe();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
@ -118,7 +137,10 @@ export class AdvancedSearchPageComponent {
|
|||
}
|
||||
|
||||
}else{
|
||||
this.selectedFields.push(new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,StringUtils.unquote(values[j]),operators[j]) );
|
||||
console.log(" "+this.connectCommunityId+" "+values[j]+" "+ fieldId)
|
||||
if(!(this.connectCommunityId && fieldId == "community" && this.connectCommunityId == values[j] )){
|
||||
this.selectedFields.push(new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,StringUtils.unquote(values[j]),operators[j]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -164,6 +186,7 @@ export class AdvancedSearchPageComponent {
|
|||
this.parameterValues.push(fields[this.fieldIds[i]].operators.join());
|
||||
}
|
||||
}
|
||||
//TODO --
|
||||
if(includePage && this.searchUtils.page != 1){
|
||||
params += "&page="+this.searchUtils.page;
|
||||
}
|
||||
|
@ -195,7 +218,7 @@ export class AdvancedSearchPageComponent {
|
|||
countParams++;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO --
|
||||
return params;
|
||||
|
||||
}
|
||||
|
@ -215,7 +238,7 @@ export class AdvancedSearchPageComponent {
|
|||
console.log("In PreviousRouteRecorder : "+this.router.url );
|
||||
localStorage.setItem('previousRoute', this.router.url);
|
||||
}
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.isPiwikEnabled && (typeof document !== 'undefined')){
|
||||
this.piwiksub = this._piwikService.trackView(this.pageTitle).subscribe();
|
||||
}
|
||||
/* End Piwik Code */
|
||||
|
|
|
@ -5,10 +5,11 @@ import {Location} from '@angular/common';
|
|||
import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
||||
|
||||
import {RefineFieldResultsService} from '../../services/refineFieldResults.service';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageComponent } from '../searchUtils/searchPage.component';
|
||||
import {SearchUtilsClass} from '../searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'browse-entities',
|
||||
|
@ -36,13 +37,13 @@ export class BrowseEntitiesComponent {
|
|||
@Input() public baseUrl:string = "";
|
||||
@Input() public entityName:string = "";
|
||||
@Input() public refineFields: string[] ;//= this.searchFields.RESULT_REFINE_FIELDS;
|
||||
@Input() properties:EnvProperties;
|
||||
public sub: any;
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
public status = this.errorCodes.LOADING;
|
||||
public fieldIdsMap=this.searchFields.RESULT_REFINE_FIELDS;
|
||||
|
||||
constructor ( private _refineFieldsService: RefineFieldResultsService ) {
|
||||
// this.baseUrl = OpenaireProperties.getLinkToSearchPublications();
|
||||
|
||||
}
|
||||
|
||||
|
@ -67,7 +68,7 @@ export class BrowseEntitiesComponent {
|
|||
private getStats(){
|
||||
|
||||
this.status = this.errorCodes.LOADING;
|
||||
this.sub = this._refineFieldsService.getRefineFieldsResultsByEntityName(this.refineFields,this.entityName).subscribe(
|
||||
this.sub = this._refineFieldsService.getRefineFieldsResultsByEntityName(this.refineFields,this.entityName, this.properties).subscribe(
|
||||
data => {
|
||||
console.info("Get Stats for "+this.entityName+ ": [Total:"+data[0]+" ] [fields: "+data[1].length+"]");
|
||||
this.filters = data[1];
|
||||
|
|
|
@ -5,11 +5,13 @@ import {Location} from '@angular/common';
|
|||
import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
|
||||
|
||||
import {RefineFieldResultsService} from '../../services/refineFieldResults.service';
|
||||
import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields';
|
||||
import {SearchPageComponent } from '../searchUtils/searchPage.component';
|
||||
import {SearchUtilsClass} from '../searchUtils/searchUtils.class';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'browse-statistic',
|
||||
templateUrl: 'browseStatistic.component.html'
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { ActivatedRoute} from '@angular/router';
|
||||
import {AlertModal} from '../../utils/modal/alert';
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import {ReportsService} from '../../services/reports.service';
|
||||
import {ModalLoading} from '../../utils/modal/loading.component';
|
||||
import {PiwikService} from '../../utils/piwik/piwik.service';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-download',
|
||||
template: `
|
||||
<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="uk-margin-large-right" *ngIf="totalResults > 0 && totalResults <= csvLimit">
|
||||
<!--span class="clickable" (click)="downloadfile(downloadURLAPI+type+'?format=csv&page=0&size='+totalResults+csvParams,type+'-report-'+totalResults)"-->
|
||||
<span class="clickable" (click)="downloadfile(downloadURLAPI+'?type='+type+'&format=csv'+csvParams,type+'-report-'+totalResults)">
|
||||
<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>
|
||||
|
@ -31,14 +33,23 @@ export class SearchDownloadComponent {
|
|||
sub: any;
|
||||
downloadFilePiwikSub: any;
|
||||
|
||||
public csvLimit: number = 0;
|
||||
|
||||
@ViewChild (ModalLoading) loading : ModalLoading ;
|
||||
// Alert box when something is wrong with CSV requests
|
||||
@ViewChild('AlertModalCsvError') alertCsvError;
|
||||
public isPiwikEnabled;
|
||||
|
||||
constructor ( private _reportsService: ReportsService, private _piwikService:PiwikService) {}
|
||||
constructor (private route: ActivatedRoute, private _reportsService: ReportsService, private _piwikService:PiwikService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.downloadURLAPI = OpenaireProperties.getCsvAPIURL();
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
|
||||
this.csvLimit = data.envSpecific.csvLimit;
|
||||
this.downloadURLAPI = data.envSpecific.csvAPIURL;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
@ -70,7 +81,7 @@ export class SearchDownloadComponent {
|
|||
data => {
|
||||
this.closeLoading();
|
||||
window.open(window.URL.createObjectURL(data),filename+".csv");
|
||||
if(OpenaireProperties.isPiwikTrackEnabled() && (typeof document !== 'undefined')){
|
||||
if(this.isPiwikEnabled && (typeof document !== 'undefined')){
|
||||
this.downloadFilePiwikSub = this._piwikService.trackDownload(url).subscribe();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -7,18 +7,23 @@
|
|||
<div class="searchFilterBoxValues ">
|
||||
<div *ngFor = "let value of getSelectedValues(filter)" class = "uk-animation-fade filterItem">
|
||||
|
||||
|
||||
<!--span *ngIf="!connectCommunityId || !(connectCommunityId && connectCommunityId == value.id)"-->
|
||||
<span class="filterName"><div title = "{{value.name}}">
|
||||
<input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span>
|
||||
<span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
<!--/span-->
|
||||
</div>
|
||||
<!--div class="uk-grid-divider uk-margin-remove"></div-->
|
||||
<hr *ngIf="getSelectedValues(filter).length > 0 && getNotSelectedValues(filter).length > 0" class="uk-grid-divider uk-margin-remove">
|
||||
<hr *ngIf="getSelectedValues(filter).length > 0 && getNotSelectedValues(filter).length > 0 " class="uk-grid-divider uk-margin-remove">
|
||||
<div *ngFor = "let value of getNotSelectedValues(filter).slice(0,(!addShowMore?getNotSelectedValues(filter).length:5-getSelectedValues(filter).length))" class = "uk-animation-fade filterItem">
|
||||
|
||||
<!--span *ngIf="!connectCommunityId || !(connectCommunityId && connectCommunityId == value.id)"-->
|
||||
<span class="filterName"><div title = "{{value.name}}"> <input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span>
|
||||
<span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
<!--/span-->
|
||||
</div>
|
||||
|
||||
<!--a *ngIf="(getSelectedValues(filter).length + getNotSelectedValues(filter).length) > 5" (click)="toggle()" [class]="(isDisabled)?'uk-disabled uk-link-muted':''">Show More</a-->
|
||||
|
@ -41,19 +46,24 @@
|
|||
{{filter.title}}
|
||||
</h5>
|
||||
<span *ngIf="filter.values.length >= 99" class="uk-article-meta uk-text-center">Showing top {{filter.values.length}} values. </span>
|
||||
|
||||
<div class="uk-modal-body uk-overflow-auto uk-height-medium uk-padding-remove
|
||||
uk-margin-medium-left uk-margin-medium-right uk-margin-small-top uk-margin-bottom">
|
||||
<div *ngFor = "let value of getSelectedValues(filter)" class = "uk-animation-fade filterItem">
|
||||
<span class="filterName"><div title = "{{value.name}}">
|
||||
<input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="close(); filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span>
|
||||
<span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
<!--span *ngIf="!connectCommunityId || !(connectCommunityId && connectCommunityId == value.id)"==>
|
||||
<span class="filterName"><div title = "{{value.name}}">
|
||||
<input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="close(); filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span>
|
||||
<span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
<!--/span-->
|
||||
</div>
|
||||
<hr *ngIf="getSelectedValues(filter).length > 0 && getNotSelectedValues(filter).length > 0" class="uk-grid-divider uk-margin-remove">
|
||||
<div *ngFor = "let value of getNotSelectedValues(filter)" class = "uk-animation-fade filterItem">
|
||||
<span class="filterName"><div title = "{{value.name}}"> <input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="close(); filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span>
|
||||
<span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
<!--span *ngIf="!connectCommunityId || !(connectCommunityId && connectCommunityId == value.id)"-->
|
||||
<span class="filterName"><div title = "{{value.name}}"> <input [disabled]="isDisabled" [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="close(); filterChange(value.selected)" />
|
||||
{{_formatName(value)}} </div></span>
|
||||
<span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
|
||||
<!--/span-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -15,7 +15,7 @@ export class SearchFilterComponent {
|
|||
@Input() showResultCount:boolean = true;
|
||||
@Input() isDisabled:boolean = false;
|
||||
@Input() addShowMore:boolean = true;
|
||||
|
||||
@Input() connectCommunityId:string
|
||||
public showAll:boolean = false;
|
||||
public _maxCharacters:number =28;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue