Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
import { Component , Input } from '@angular/core' ;
import { Router , ActivatedRoute } from '@angular/router' ;
import { Title , Meta } from '@angular/platform-browser' ;
2017-12-19 13:53:46 +01:00
2019-06-03 15:20:36 +02:00
import { Observable } from 'rxjs' ;
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
import { ErrorCodes } from '../utils/properties/errorCodes' ;
import { EnvProperties } from '../utils/properties/env-properties' ;
2017-12-19 13:53:46 +01:00
import { RouterHelper } from '../utils/routerHelper.class' ;
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
import { FetchDataproviders } from '../utils/fetchEntitiesClasses/fetchDataproviders.class' ;
import { SearchDataprovidersService } from '../services/searchDataproviders.service' ;
import { OrganizationService } from '../services/organization.service' ;
2017-12-19 13:53:46 +01:00
import { PiwikService } from '../utils/piwik/piwik.service' ;
2018-11-14 11:38:53 +01:00
import { SEOService } from '../sharedComponents/SEO/SEO.service' ;
2017-12-19 13:53:46 +01:00
2018-11-26 16:44:32 +01:00
import { ZenodoInformationClass } from './utils/zenodoInformation.class' ;
2017-12-19 13:53:46 +01:00
@Component ( {
selector : 'deposit-result' ,
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 " >
2019-02-18 16:06:35 +01:00
< schema2jsonld * ngIf = "url" [ URL ] = " url " name = "Share {{requestFor}}" type = "other" > < / schema2jsonld >
2017-12-19 13:53:46 +01:00
< div class = "uk-container uk-margin-top" >
2019-02-12 12:15:21 +01:00
< div class = "uk-article-title custom-article-title uk-margin-bottom" >
2019-02-18 16:06:35 +01:00
Share { { requestFor } }
2019-02-12 12:15:21 +01:00
< / div >
2017-12-19 13:53:46 +01:00
< helper position = "top" > < / helper >
< div class = "uk-grid helper-grid" >
< helper position = "left" styleName = " uk-width-1-5 uk-padding-left" > < / helper >
< div class = "uk-width-expand" >
<!-- div * ngIf = "status != errorCodes.LOADING" class = "uk-margin-bottom uk-margin-top" >
< h3 > See if your institution has a repository < / h3 >
< form class = "uk-grid" >
< div class = "uk-width-1-2 " >
2018-02-05 14:14:59 +01:00
< entities - autocomplete [ ( properties ) ] = properties fieldId = "organization" ( click ) = " warningMessage = '' " [ entityType ] = " ' organization ' "
2017-12-19 13:53:46 +01:00
[ depositType ] = compatibility [ showSelected ] = true [ placeHolderMessage ] = "'Organization name'"
[ title ] = "'Organizations'" [ multipleSelections ] = false ( selectedValueChanged ) = "valueChanged($event)" >
< / e n t i t i e s - a u t o c o m p l e t e >
< / div >
2018-10-03 16:12:42 +02:00
< button class = " uk-button portal-button" type = "submit" ( click ) = " organizationSelected ( selectedId ) " >
2017-12-19 13:53:46 +01:00
Locate
< / button >
< div * ngIf = "warningMessage.length > 0" class = "uk-alert uk-alert-warning uk-animation-fade" role = "alert" > { { warningMessage } } < / div >
< / form >
< / d i v - - >
2019-02-12 12:15:21 +01:00
< h4 * ngIf = " organization & & ( fetchDataproviders.searchUtils.status = = errorCodes.DONE | |
( fetchDataproviders . searchUtils . status == errorCodes . LOADING && ! fetchDataproviders . loadPaging && fetchDataproviders . oldTotalResults > 0 ) ) "
class = "organization" >
< a * ngIf = "organization['url']!=''" href = "{{organization.url}}" target = "_blank" >
< span > < i class = "custom-external" > < / i > { { organization [ 'name' ] } } < / span >
< / a >
< span * ngIf = "organization['url']==''" > { { organization [ 'name' ] } } < / span >
< / h4 >
< div * ngIf = "subjectResults" class = "uk-width-1-1 uk-margin uk-padding uk-panel uk-background-muted" >
< form class = "uk-margin uk-text-center uk-margin-top" >
< input type = "text" [ ( ngModel ) ] = " subject " class = " uk-input uk-width-1-2" name = "subject" placeholder = "Search for classifications..." / >
< button class = " uk-button portal-button" type = "submit" ( click ) = " newSubject ( ) " >
Search
< / button >
< / form >
< div * ngIf = "subject.length > 0" class = " uk-text-center " >
< span > Keywords : { { subject } } < span >
< a class = " " ( click ) = " subject = '' ; newSubject ( ) " > < span aria - hidden = "true" class = "uk-icon-button icon-button-small " >
< svg width = "16" height = "16" viewBox = "0 0 20 20" xmlns = "http://www.w3.org/2000/svg" icon = "close" ratio = "0.8" > < path fill = "none" stroke = "#000" stroke - width = "1.06" d = "M16,16 L4,4" > < / path > < path fill = "none" stroke = "#000" stroke - width = "1.06" d = "M16,4 L4,16" > < / path > < / svg >
< / span >
< / a >
2017-12-19 13:53:46 +01:00
2019-02-12 12:15:21 +01:00
< / span >
< / span >
< / div >
2017-12-19 13:53:46 +01:00
< / div >
2019-02-12 12:15:21 +01:00
< p class = "uk-text-meta"
* ngIf = " fetchDataproviders . searchUtils . status == errorCodes . DONE ||
( fetchDataproviders . searchUtils . status == errorCodes . LOADING && ! fetchDataproviders . loadPaging && fetchDataproviders . oldTotalResults > 0 ) " >
Please use the information below and contact your repository to deposit your < span class = "uk-text-lowercase" > { { requestFor } } < / span > .
< / p >
< div * ngIf = " fetchDataproviders.searchUtils.status = = errorCodes.DONE | |
( fetchDataproviders . searchUtils . status == errorCodes . LOADING && ! fetchDataproviders . loadPaging && fetchDataproviders . oldTotalResults > 0 ) "
class = "uk-align-center uk-margin-remove-bottom" >
< search - paging [ type ] = " ' content providers ' " [ ( searchUtils ) ] = " fetchDataproviders.searchUtils " [ ( results ) ] = " fetchDataproviders.results "
[ ( parameterNames ) ] = "parameterNames" [ ( parameterValues ) ] = "parameterValues"
[ loadPaging ] = "fetchDataproviders.loadPaging" [ oldTotalResults ] = "fetchDataproviders.oldTotalResults" >
< / s e a r c h - p a g i n g >
2017-12-19 13:53:46 +01:00
< / div >
2019-02-12 12:15:21 +01:00
< div * ngIf = "status == errorCodes.LOADING || fetchDataproviders.searchUtils.status == errorCodes.LOADING"
class = "uk-animation-fade uk-margin-top uk-width-1-1" role = "alert" > < span class = "loading-gif uk-align-center" > < / span >
< / div >
2017-12-19 13:53:46 +01:00
2019-02-12 12:15:21 +01:00
< div * ngIf = "fetchDataproviders.searchUtils.status == errorCodes.DONE" class = " uk-margin uk-margin-remove-top other-results" >
< div * ngFor = "let result of fetchDataproviders.results" [ title ] = " result.compatibilityUNKNOWN ? ' Incompatible content provider ' : ' ' " [ class ] = " ' uk - margin - small - top uk - card uk - padding - small uk - animation - fade ' + ( result.compatibilityUNKNOWN ? ' li - disabled ' : ' uk - card - default ' ) " >
< h5 >
< span * ngIf = "!result.compatibilityUNKNOWN" class = "" title = "Compatible Content Provider" >
< svg width = "20" height = "20" viewBox = "0 0 20 20" xmlns = "http://www.w3.org/2000/svg" icon = "check" ratio = "1" > < polyline fill = "none" stroke = "#000" stroke - width = "1.1" points = "4,10 8,15 17,4" > < / polyline > < / svg >
< / span >
< a * ngIf = "!result.compatibilityUNKNOWN" [ queryParams ] = " { datasourceId : result.id } " routerLinkActive = "router-link-active" routerLink = "/search/dataprovider" >
< span * ngIf = "result['title'].name" [ innerHTML ] = " result [ ' title ' ] .name " > < / span >
< span * ngIf = "!result['title'].name" > [ no title available ] < / span >
< / a >
< p * ngIf = "result.compatibilityUNKNOWN && result['title'].name" [ innerHTML ] = " result [ ' title ' ] .name " > < / p >
< p * ngIf = "result.compatibilityUNKNOWN && !result['title'].name" > [ no title available ] < / p >
< / h5 >
< approved - by - community [ contentProviderId ] = " result.id " > < / a p p r o v e d - b y - c o m m u n i t y >
< span * ngIf = "result['type'] != undefined && result['type'] != ''" class = "uk-label custom-label label-blue label-dataprovider" title = "Type" > { { result [ 'type' ] } } < / span >
< span * ngIf = "result['compatibility'] != undefined && result['compatibility'] != ''" class = "uk-label custom-label label-compatibility" title = "Compatibility" > { { result . compatibility } } < / span >
< div * ngIf = "subjectResults && result['organizations'] != undefined && result['organizations'].length > 0" >
< span > Organization : < / span >
< span * ngFor = "let organization of result['organizations'].slice(0,10) let i=index" >
<!-- a * ngIf = "organization.url != undefined" href = "{{organization.url}}" -- >
< a * ngIf = "organization.id" [ queryParams ] = " { organizationId : organization.id } " routerLinkActive = "router-link-active" routerLink = "/search/organization" >
{ { organization . name } } < / a > < span
* ngIf = "!organization.id" >
{ { organization . name } } < / span > < span
* ngIf = "(i < result['organizations'].length-1) && (i < 9)" > , < / span >
2017-12-19 13:53:46 +01:00
< / span >
2019-02-12 12:15:21 +01:00
< span * ngIf = "result['organizations'].length > 10" > . . . < / span >
2017-12-19 13:53:46 +01:00
< / div >
2019-02-12 12:15:21 +01:00
< div * ngIf = "result['countries'] && result['countries'].length > 0" >
Country : < span * ngFor = "let country of result['countries'].slice(0,10) let i = index" > { { country } } { { ( i < ( result [ 'countries' ] . slice ( 0 , 10 ) . length - 1 ) ) ? ", " : "" } } { { ( i == result [ 'countries' ] . slice ( 0 , 10 ) . length - 1 && result [ 'countries' ] . length > 10 ) ? "..." : "" } } < / span >
2017-12-19 13:53:46 +01:00
< / div >
2019-02-12 12:15:21 +01:00
< div * ngIf = "result['websiteURL'] != undefined && result['websiteURL'] != ''" >
< span > Website URL : < / span >
< span >
< a href = "{{result['websiteURL']}}" target = "_blank" class = "custom-external custom-icon" >
{ { result [ 'websiteURL' ] } }
< / a >
< / span >
2017-12-19 13:53:46 +01:00
< / div >
2019-02-12 12:15:21 +01:00
< div * ngIf = "result['OAIPMHURL'] != undefined && result['OAIPMHURL'] != ''" >
< span > OAI - PMH URL : < / span >
< span >
< a href = "{{result['OAIPMHURL']}}" target = "_blank" class = "custom-external custom-icon" >
{ { result [ 'OAIPMHURL' ] } }
< / a >
< / span >
< / div >
< div * ngIf = "subjectResults && result['subjects'] && result['subjects'].length > 0" >
Subject : < span * ngFor = "let subject of result['subjects'].slice(0,10) let i = index" > { { subject } } { { ( i < ( result [ 'subjects' ] . slice ( 0 , 10 ) . length - 1 ) ) ? ", " : "" } } { { ( i == result [ 'subjects' ] . slice ( 0 , 10 ) . length - 1 && result [ 'subjects' ] . length > 10 ) ? "..." : "" } } < / span >
< / div >
< / div >
< / div >
< div * ngIf = "!subjectResults" >
< div * ngIf = " status = = errorCodes.NOT_FOUND | | status = = errorCodes.ERROR | |
status == errorCodes . NOT_AVAILABLE || status == errorCodes . NONE " class = " alert alert - warning " >
< div * ngIf = "status == errorCodes.NOT_FOUND && organizationId != ''" >
No organization with ID : { { organizationId } } found .
< / div >
< div * ngIf = "status == errorCodes.ERROR && organizationId != ''" >
An error occured .
< / div >
< span * ngIf = "status == errorCodes.NOT_AVAILABLE && organizationId != ''" >
Service temprorarily unavailable . Please try again later .
< / span >
< div * ngIf = "status == errorCodes.NONE" >
No ID for organization .
< / div >
< / div >
< / div >
< div * ngIf = " status = = errorCodes.DONE & & fetchDataproviders.searchUtils.status ! = errorCodes.DONE
&& fetchDataproviders . searchUtils . status != errorCodes . LOADING " class = " alert alert - warning " >
< span * ngIf = "fetchDataproviders.searchUtils.status == errorCodes.ERROR" >
An error occured .
< / span >
< span * ngIf = "fetchDataproviders.searchUtils.status == errorCodes.NOT_AVAILABLE" >
2017-12-19 13:53:46 +01:00
Service temprorarily unavailable . Please try again later .
< / span >
2019-02-12 12:15:21 +01:00
< span * ngIf = "fetchDataproviders.searchUtils.status == errorCodes.OUT_OF_BOUND" >
Requested page out of bounds .
< / span >
< div * ngIf = "!subjectResults" >
No content providers found for institution :
< a * ngIf = "organization['url']!=''" target = "_blank" href = "{{organization.url}}" >
< span > { { organization [ 'name' ] } } ( < i class = "custom-external" > < / i > ) < / span >
< / a >
< span * ngIf = "organization['url']==''" > { { organization [ 'name' ] } } < / span >
.
< / div >
< div * ngIf = "subjectResults" >
No content providers found < span * ngIf = "subject != ''" > with classification "{{subject}}" < / span > .
2017-12-19 13:53:46 +01:00
< / div >
< / div >
< / div >
2019-02-12 12:15:21 +01:00
2018-11-26 16:44:32 +01:00
< div class = "uk-width-1-5" >
< helper position = "right" before = "true" > < / helper >
< div class = "uk-card uk-card-default uk-card-body portal-card" >
Deposit your { { requestFor } } in
< a href = "{{zenodoInformation.url}}" target = "_blank" uk - tooltip = "title: Zenodo is OpenAIRE's catch-all repository hosted by CERN." >
{ { zenodoInformation . name } } ( < i class = "custom-external" > < / i > ) < / a >
< div class = "uk-margin-top" * ngIf = "zenodoInformation && zenodoInformation.shareInZenodoUrl" >
< a href = "{{zenodoInformation.shareInZenodoUrl}}" > More Zenodo communities < / a >
< / div >
< / div >
2019-02-12 15:31:15 +01:00
<!-- div * ngIf = "fetchDataproviders.results.length > 0" class = "uk-card uk-card-default uk-card-body portal-card uk-margin-small-top" >
2019-02-12 12:15:21 +01:00
Compatibility is mpla mpla
2019-02-12 15:31:15 +01:00
< / d i v - - >
2019-02-12 12:15:21 +01:00
2018-11-26 16:44:32 +01:00
< helper position = "right" before = "false" > < / helper >
< / div >
2017-12-19 13:53:46 +01:00
< / div >
2018-06-01 14:28:49 +02:00
< button class = " uk-button uk-button-primary uk-margin-small-top" type = "submit" ( click ) = " goToDeposit ( ) " >
2017-12-19 13:53:46 +01:00
< span class = "uk-icon" > < svg width = "20" height = "20" viewBox = "0 0 20 20" xmlns = "http://www.w3.org/2000/svg" icon = "chevron-left" ratio = "1" > < polyline fill = "none" stroke = "#000" stroke - width = "1.03" points = "13 16 7 10 13 4" > < / polyline > < / svg > < / span > Back
< / button >
< helper position = "bottom" > < / helper >
< / div >
< / div >
< / div >
< / div >
`
} )
export class DepositResultComponent {
2018-11-26 16:44:32 +01:00
@Input ( ) zenodoInformation : ZenodoInformationClass ;
2017-12-19 13:53:46 +01:00
@Input ( ) compatibility : string = '' ;
2018-04-11 10:59:01 +02:00
@Input ( ) piwikSiteId = null ;
2017-12-19 13:53:46 +01:00
// Type of entity: Publication or Research Data
@Input ( ) requestFor : string = "Publications" ;
public organization : { "name" : string , "url" : string } ;
public organizationId : string = "" ;
// Id of the new selected organization to be searched
public selectedId : string = "" ;
2019-02-12 12:15:21 +01:00
@Input ( ) subjectResults : boolean = false ;
@Input ( ) subject : string = "" ;
2017-12-19 13:53:46 +01:00
public status : number ;
public warningMessage : string = "" ;
public fetchDataproviders : FetchDataproviders ;
public linkToSearchDataproviders : string = "" ;
2019-02-12 12:15:21 +01:00
public parameterNames :string [ ] = [ ] ;
public parameterValues :string [ ] = [ ] ;
2017-12-19 13:53:46 +01:00
public routerHelper :RouterHelper = new RouterHelper ( ) ;
public errorCodes :ErrorCodes = new ErrorCodes ( ) ;
sub : any ; piwiksub : any ;
2018-02-05 14:14:59 +01:00
properties :EnvProperties ;
2018-11-14 11:38:53 +01:00
url = null ;
2017-12-19 13:53:46 +01:00
constructor ( private _router : Router ,
private route : ActivatedRoute ,
private _searchDataprovidersService : SearchDataprovidersService ,
private _organizationService : OrganizationService ,
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
private _meta : Meta ,
private _title : Title ,
2018-11-14 11:38:53 +01:00
private _piwikService :PiwikService ,
private seoService : SEOService ) {
2017-12-19 13:53:46 +01:00
this . fetchDataproviders = new FetchDataproviders ( this . _searchDataprovidersService ) ;
this . status = this . errorCodes . LOADING ;
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
2019-02-12 12:15:21 +01:00
var title = "Deposit " + this . requestFor ;
var description = "Openaire, repositories, open access, content provider, compatibility, organization, deposit " + this . requestFor ;
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
this . updateTitle ( title ) ;
this . updateDescription ( description ) ;
2017-12-19 13:53:46 +01:00
2018-02-05 14:14:59 +01:00
}
2017-12-19 13:53:46 +01:00
ngOnInit() {
2018-02-05 14:14:59 +01:00
this . route . data
. subscribe ( ( data : { envSpecific : EnvProperties } ) = > {
this . properties = data . envSpecific ;
2019-02-11 16:03:38 +01:00
this . seoService . createLinkForCanonicalURL ( this . properties . baseLink + this . _router . url , false ) ;
2018-02-05 14:14:59 +01:00
this . updateUrl ( data . envSpecific . baseLink + this . _router . url ) ;
2018-11-14 11:38:53 +01:00
this . url = data . envSpecific . baseLink + this . _router . url ;
2018-02-05 14:14:59 +01:00
if ( this . properties . enablePiwikTrack && ( typeof document !== 'undefined' ) ) {
2018-04-11 10:59:01 +02:00
this . piwiksub = this . _piwikService . trackView ( this . properties , "Deposit " + this . requestFor , this . piwikSiteId ) . subscribe ( ) ;
2018-02-05 14:14:59 +01:00
}
} ) ;
2017-12-19 13:53:46 +01:00
this . sub = this . route . queryParams . subscribe ( params = > {
2019-02-12 12:15:21 +01:00
this . fetchDataproviders . searchUtils . page = ( params [ 'page' ] === undefined ) ? 1 : + params [ 'page' ] ;
if ( this . subjectResults ) {
this . status = this . errorCodes . DONE ;
this . subject = params [ 'subject' ] ;
if ( ! this . subject ) {
this . subject = "" ;
}
this . parameterNames . push ( 'subject' ) ;
this . parameterValues . push ( this . subject ) ;
this . searchDataprovidersBySubject ( ) ;
} else {
if ( this . organizationId ) {
this . searchDataproviders ( ) ;
} else {
this . organizationId = params [ 'organizationId' ] ;
this . parameterNames . push ( 'organizationId' ) ;
this . parameterValues . push ( this . organizationId ) ;
if ( this . organizationId ) {
this . getOrganizationInfo ( ) ;
}
}
this . selectedId = "" ;
2017-12-19 13:53:46 +01:00
}
} ) ;
}
ngDoCheck() {
2019-02-12 12:15:21 +01:00
if ( ! this . subjectResults && ( this . organizationId == "" || this . organizationId == undefined ) ) {
2017-12-19 13:53:46 +01:00
this . organizationId = "" ;
2019-02-12 12:15:21 +01:00
this . status = this . errorCodes . NONE ;
this . fetchDataproviders . searchUtils . status = this . errorCodes . NONE ;
2017-12-19 13:53:46 +01:00
}
}
ngOnDestroy() {
this . sub . unsubscribe ( ) ;
if ( this . piwiksub ) {
this . piwiksub . unsubscribe ( ) ;
}
}
2019-02-12 12:15:21 +01:00
public newSubject() {
this . _router . navigate ( [ 'participate/deposit-subject-result' ] , { queryParams : { "subject" : this . subject } } ) ;
}
public searchDataprovidersBySubject() {
this . parameterNames = [ ] ;
this . parameterValues = [ ] ;
this . parameterNames . push ( 'subject' ) ;
this . parameterValues . push ( this . subject ) ;
this . fetchDataproviders . getResultsBySubjectsForDeposit ( ( this . subject == "" ) ? "*" : this . subject , this . requestFor , this . fetchDataproviders . searchUtils . page , this . fetchDataproviders . searchUtils . size , this . properties ) ;
this . linkToSearchDataproviders = this . properties . searchLinkToDataProviders ;
}
2017-12-19 13:53:46 +01:00
private searchDataproviders() {
// if(this.organization != undefined) {
// this.fetchDataproviders.getResults(this.organization.name, false, 1, 10);
// } else if(this.organizationId != undefined) {
2019-02-12 12:15:21 +01:00
this . fetchDataproviders . getResultsForDeposit ( this . organizationId , this . requestFor , this . fetchDataproviders . searchUtils . page , this . fetchDataproviders . searchUtils . size , this . properties ) ;
2017-12-19 13:53:46 +01:00
//}
2018-02-05 14:14:59 +01:00
this . linkToSearchDataproviders = this . properties . searchLinkToDataProviders ;
2017-12-19 13:53:46 +01:00
}
private getOrganizationInfo ( ) {
2019-02-12 12:15:21 +01:00
this . fetchDataproviders . oldTotalResults = 0 ;
this . fetchDataproviders . searchUtils . totalResults = 0 ;
2017-12-19 13:53:46 +01:00
2019-02-12 12:15:21 +01:00
this . _organizationService . getOrganizationNameAndUrlById ( this . organizationId , this . properties ) . subscribe (
2017-12-19 13:53:46 +01:00
data = > {
if ( data == null ) {
this . status = this . errorCodes . NOT_FOUND ;
2019-02-12 12:15:21 +01:00
this . fetchDataproviders . searchUtils . status = this . errorCodes . NONE ;
2017-12-19 13:53:46 +01:00
} else {
2019-02-12 12:15:21 +01:00
this . organization = data ;
2017-12-19 13:53:46 +01:00
this . status = this . errorCodes . DONE ;
this . searchDataproviders ( ) ;
}
} ,
err = > {
//console.log(err)
2019-02-15 13:50:24 +01:00
this . handleError ( "Error getting organization name and url for id: " + this . organizationId , err ) ;
2017-12-19 13:53:46 +01:00
2019-02-12 12:15:21 +01:00
this . fetchDataproviders . searchUtils . status = this . errorCodes . NONE ;
2017-12-19 13:53:46 +01:00
if ( err . status == '404' ) {
this . status = this . errorCodes . NOT_FOUND ;
} else if ( err . status == '500' ) {
this . status = this . errorCodes . ERROR ;
} else {
this . status = this . errorCodes . NOT_AVAILABLE ;
}
}
) ;
}
public goToDeposit() {
if ( this . requestFor == "Publications" ) {
this . _router . navigate ( [ 'participate/deposit-publications' ] ) ;
} else if ( this . requestFor == "Research Data" ) {
this . _router . navigate ( [ 'participate/deposit-datasets' ] ) ;
}
}
public valueChanged ( $event ) {
this . selectedId = $event . value ;
}
public organizationSelected ( id : string ) {
if ( id && id . length > 0 && id != this . organizationId ) {
this . organization = null ;
this . status = this . errorCodes . LOADING ;
if ( this . requestFor == "Publications" ) {
this . _router . navigate ( [ 'participate/deposit-publications-result' ] , { queryParams : { "organizationId" : id } } ) ;
} else if ( this . requestFor == "Research Data" ) {
this . _router . navigate ( [ 'participate/deposit-datasets-result' ] , { queryParams : { "organizationId" : id } } ) ;
}
} else {
this . warningMessage = "No new organization selected" ;
}
}
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
private updateDescription ( description :string ) {
this . _meta . updateTag ( { content :description } , "name='description'" ) ;
this . _meta . updateTag ( { content :description } , "property='og:description'" ) ;
2017-12-19 13:53:46 +01:00
}
private updateTitle ( title :string ) {
var _prefix = "OpenAIRE | " ;
var _title = _prefix + ( ( title . length > 50 ) ? title . substring ( 0 , 50 ) : title ) ;
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
this . _title . setTitle ( _title ) ;
this . _meta . updateTag ( { content :_title } , "property='og:title'" ) ;
2017-12-19 13:53:46 +01:00
}
private updateUrl ( url :string ) {
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
this . _meta . updateTag ( { content :url } , "property='og:url'" ) ;
2017-12-19 13:53:46 +01:00
}
2019-02-15 13:50:24 +01:00
private handleError ( message : string , error ) {
console . error ( "Deposit Result Page: " + message , error ) ;
}
2017-12-19 13:53:46 +01:00
}