Revision 46185
Added by Konstantina Galouni about 7 years ago
modules/uoa-services-portal/trunk/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts | ||
---|---|---|
118 | 118 |
} else if(entity == "person") { |
119 | 119 |
parameters = "people/"+id; |
120 | 120 |
} |
121 |
|
|
121 | 122 |
if(parameters != "") { |
122 | 123 |
this._searchPublicationsService.searchPublicationsForEntity(parameters, page, size).subscribe( |
123 | 124 |
data => { |
124 | 125 |
this.searchUtils.totalResults = data[0]; |
126 |
console.info(this.searchUtils.totalResults + " i think we got results"); |
|
127 |
|
|
125 | 128 |
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]"); |
126 | 129 |
this.results = data[1]; |
127 | 130 |
|
modules/uoa-services-portal/trunk/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts | ||
---|---|---|
16 | 16 |
<h4 class = "{{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode > |
17 | 17 |
<!--a href="{{result['title'].url}}"--> |
18 | 18 |
<!--a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication"--> |
19 |
<a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}"> |
|
19 |
<a *ngIf="lazy" [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
|
20 | 20 |
<p *ngIf="result['title'].name != undefined && result['title'].name != ''" |
21 | 21 |
[innerHTML]="result['title'].name"> |
22 | 22 |
</p> |
... | ... | |
24 | 24 |
{{result['title'].url}} |
25 | 25 |
</p> |
26 | 26 |
</a> |
27 |
<a *ngIf="!lazy" href="/search/{{type}}?{{urlParam}}={{result.id}}"> |
|
28 |
<p *ngIf="result['title'].name != undefined && result['title'].name != ''" |
|
29 |
[innerHTML]="result['title'].name"> |
|
30 |
</p> |
|
31 |
<p *ngIf="result['title'].name == undefined || result['title'].name == ''"> |
|
32 |
{{result['title'].url}} |
|
33 |
</p> |
|
34 |
</a> |
|
27 | 35 |
</h4> |
28 | 36 |
|
29 | 37 |
<div> |
... | ... | |
135 | 143 |
@Input() type: string; |
136 | 144 |
@Input() urlParam: string; |
137 | 145 |
@Input() showLoading: boolean = false; |
146 |
@Input() lazy: boolean = true; |
|
138 | 147 |
|
139 | 148 |
public errorCodes:ErrorCodes = new ErrorCodes(); |
140 | 149 |
public routerHelper:RouterHelper = new RouterHelper(); |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts | ||
---|---|---|
19 | 19 |
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div> |
20 | 20 |
<search-result [(results)]="fetchDataproviders.results" |
21 | 21 |
[(status)]= "fetchDataproviders.status" |
22 |
type="dataprovider" urlParam="datasourceId"> |
|
22 |
type="dataprovider" urlParam="datasourceId" |
|
23 |
lazy=false> |
|
23 | 24 |
</search-result> |
24 | 25 |
</div> |
25 | 26 |
` |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/htmlProjectReport/htmlProjectReport.component.ts | ||
---|---|---|
9 | 9 |
selector: 'htmlProjectReport', |
10 | 10 |
template: ` |
11 | 11 |
<div class="uk-container uk-margin-top"> |
12 |
<button class="uk-button uk-button-primary btn" (click)="copied = true;"> |
|
12 |
<button class="uk-icon-clipboard uk-button uk-button-primary btn" (click)="copied = true;">
|
|
13 | 13 |
Copy to clipboard |
14 | 14 |
</button> |
15 | 15 |
<!--span *ngIf="copied" class="uk-badge uk-badge-success">Success</span--> |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/project/project.component.html | ||
---|---|---|
177 | 177 |
View all Project Publications |
178 | 178 |
</a> |
179 | 179 |
</li> |
180 |
<!--li> |
|
181 |
<span class="clickable"> |
|
182 |
<span aria-hidden="true"></span> |
|
183 |
<span class="uk-icon-download">Dynamically incorporate publications in your site (HTML)</span> |
|
184 |
</span> |
|
185 |
</li--> |
|
180 |
<li> |
|
181 |
<div class="clickable" data-uk-toggle="{target:'#publications_dynamic', animation:'uk-animation-fade'}">Dynamically incorporate publications in your site (HTML)</div> |
|
186 | 182 |
|
183 |
<!--div class="uk-hidden uk-panel uk-panel-box" id="publications_dynamic"> |
|
184 |
{{publications_dynamic}} |
|
185 |
</div--> |
|
186 |
<div class="uk-vertical-align uk-hidden" id="publications_dynamic"> |
|
187 |
<button class="uk-float-right uk-icon-clipboard uk-button publ_clipboard_btn" data-clipboard-target="#publ_clipboard"> |
|
188 |
Copy to clipboard |
|
189 |
</button> |
|
190 |
<pre><code id="publ_clipboard">{{publications_dynamic}}</code></pre> |
|
191 |
</div> |
|
192 |
</li> |
|
193 |
<li> |
|
194 |
<div class="clickable" data-uk-toggle="{target:'#datasets_dynamic', animation:'uk-animation-fade'}">Dynamically incorporate research data in your site (HTML)</div> |
|
195 |
<div class="uk-vertical-align uk-hidden" id="datasets_dynamic"> |
|
196 |
<button class="uk-float-right uk-icon-clipboard uk-button datasets_clipboard_btn" data-clipboard-target="#datasets_clipboard"> |
|
197 |
Copy to clipboard |
|
198 |
</button> |
|
199 |
<pre><code id="datasets_clipboard">{{datasets_dynamic}}</code></pre> |
|
200 |
</div> |
|
201 |
</li> |
|
202 |
|
|
187 | 203 |
<!--li (click)="showHTML()"--> |
188 | 204 |
<li> |
189 | 205 |
<a target="_blank" |
... | ... | |
196 | 212 |
[linkname]="'Download '+ projectInfo.funder +' progress report (CSV)'" |
197 | 213 |
[filename]="'publications.csv'"> |
198 | 214 |
</export--> |
199 |
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParams)"> |
|
215 |
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParams+fetchPublications.searchUtils.totalResults)">
|
|
200 | 216 |
<span aria-hidden="true" class="glyphicon glyphicon-download"></span> |
201 | 217 |
<span class="uk-icon-download">{{projectInfo.funder}} progress report (CSV)</span> |
202 | 218 |
</span> |
modules/uoa-services-portal/trunk/portal-2/src/app/landingPages/project/project.component.ts | ||
---|---|---|
33 | 33 |
public chartAccessModeUrl: string; |
34 | 34 |
public chartDatasourcesUrl: string; |
35 | 35 |
|
36 |
public publications_dynamic: string; |
|
37 |
public datasets_dynamic: string; |
|
38 |
|
|
36 | 39 |
public project ; |
37 | 40 |
|
38 | 41 |
public downloadURLAPI: string; |
... | ... | |
71 | 74 |
this.projectId = params['projectId']; |
72 | 75 |
console.info("Id is :"+this.projectId); |
73 | 76 |
if(this.projectId){ |
77 |
this.publications_dynamic = |
|
78 |
"<script type=\"text/javascript\">" |
|
79 |
+ "\n<!--" |
|
80 |
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" |
|
81 |
+ "\ndocument.write('<script type=\"text/javascript\"" |
|
82 |
+ "\nsrc=\"https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=" |
|
83 |
+ this.projectId + "&type=publication\"></script>');" |
|
84 |
+ "\n-->" |
|
85 |
+ "\n</script>"; |
|
86 |
|
|
87 |
this.datasets_dynamic = |
|
88 |
"<script type=\"text/javascript\">" |
|
89 |
+ "\n<!--" |
|
90 |
+ "\ndocument.write('<div id=\"oa_widget\"></div>');" |
|
91 |
+ "\ndocument.write('<script type=\"text/javascript\"" |
|
92 |
+ "\nsrc=\"https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=" |
|
93 |
+ this.projectId + "&type=dataset\"></script>');" |
|
94 |
+ "\n-->" |
|
95 |
+ "\n</script>"; |
|
96 |
|
|
74 | 97 |
this.getProjectInfo(this.projectId); |
75 | 98 |
// this.subPublications = this.route.queryParams.subscribe(params => { |
76 | 99 |
this.searchPublications(); |
... | ... | |
88 | 111 |
} |
89 | 112 |
|
90 | 113 |
this.downloadURLAPI = OpenaireProperties.getCsvAPIURL(); |
91 |
this.csvParams = "format=csv-special&page=0&size="+this.fetchPublications.searchUtils.totalResults+"&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))";
|
|
114 |
});
|
|
92 | 115 |
|
93 |
}); |
|
116 |
if(typeof window !== undefined) { |
|
117 |
let publ_clipboard, datasets_clipboard; |
|
118 |
let Clipboard; |
|
119 |
Clipboard = require('clipboard'); |
|
120 |
publ_clipboard = new Clipboard('.publ_clipboard_btn'); |
|
121 |
datasets_clipboard = new Clipboard('.datasets_clipboard_btn'); |
|
122 |
} |
|
123 |
|
|
124 |
console.info(this.fetchPublications.searchUtils.totalResults + " just before csv"); |
|
125 |
this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size="; |
|
94 | 126 |
} |
95 | 127 |
|
96 | 128 |
|
... | ... | |
142 | 174 |
); |
143 | 175 |
} |
144 | 176 |
downloadfile(url:string){ |
177 |
|
|
145 | 178 |
console.log("Downloading file: "+ url); |
146 | 179 |
this._reportsService.downloadCSVFile(url) |
147 | 180 |
.subscribe(data => window.open(window.URL.createObjectURL(data)), |
Also available in: Unified diff
Lazy routing disabled in datasources tab of dataprovider landing page (parameter lazy=false in searchResults page) | Added widget for publications and research data in project landing page | Project landing page: bug solved for publications in csv (not any more size=0)