Revision 56052
Added by Argiro Kokogiannaki almost 5 years ago
community.component.ts | ||
---|---|---|
2 | 2 |
import {ActivatedRoute, Router} from '@angular/router'; |
3 | 3 |
import {Location} from '@angular/common'; |
4 | 4 |
import {Meta, Title} from '@angular/platform-browser'; |
5 |
|
|
6 |
import "rxjs/add/observable/zip"; |
|
7 |
|
|
8 | 5 |
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; |
9 | 6 |
|
10 | 7 |
import {CommunityService} from "../openaireLibrary/connect/community/community.service"; |
11 | 8 |
import {ConfigurationService} from '../openaireLibrary/utils/configuration/configuration.service'; |
12 | 9 |
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; |
13 |
import {SearchEntriesService} from '../searchEntries/searchEntries.service'; |
|
14 | 10 |
import {SearchZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service'; |
15 | 11 |
import {ZenodoCommunitiesService} from '../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service'; |
16 | 12 |
import {Session} from '../openaireLibrary/login/utils/helper.class'; |
... | ... | |
19 | 15 |
|
20 | 16 |
import {PiwikHelper} from '../utils/piwikHelper'; |
21 | 17 |
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class"; |
18 |
import {SearchCommunityDataprovidersService} from "../openaireLibrary/connect/contentProviders/searchDataproviders.service"; |
|
19 |
import {SearchCommunityProjectsService} from "../openaireLibrary/connect/projects/searchProjects.service"; |
|
20 |
import {SearchResearchResultsService} from "../openaireLibrary/services/searchResearchResults.service"; |
|
22 | 21 |
|
23 | 22 |
@Component({ |
24 | 23 |
selector: 'community', |
... | ... | |
73 | 72 |
private _piwikService: PiwikService, |
74 | 73 |
private config: ConfigurationService, |
75 | 74 |
private _communityService: CommunityService, |
76 |
private _searchEntriesService: SearchEntriesService, |
|
75 |
private _searchCommunityDataprovidersService:SearchCommunityDataprovidersService, |
|
76 |
private _searchCommunityProjectsService: SearchCommunityProjectsService, |
|
77 |
private _searchResearchResultsService: SearchResearchResultsService, |
|
77 | 78 |
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService, |
78 | 79 |
private _ΖenodoCommunitieService: ZenodoCommunitiesService) { |
79 | 80 |
|
... | ... | |
143 | 144 |
}); |
144 | 145 |
|
145 | 146 |
|
146 |
this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst + 'publications/count?format=json&fq=communityid=' + this.communityId).subscribe(
|
|
147 |
this._searchResearchResultsService.countTotalResults("publication", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
|
147 | 148 |
publicationTotal => { |
148 | 149 |
this.publicationTotal = publicationTotal; |
149 | 150 |
this.showLoading = true; |
... | ... | |
154 | 155 |
} |
155 | 156 |
); |
156 | 157 |
|
157 |
this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst + 'datasets/count?format=json&fq=communityid=' + this.communityId).subscribe(
|
|
158 |
this._searchResearchResultsService.countTotalResults("dataset", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
|
158 | 159 |
researchDataTotal => { |
159 | 160 |
this.researchDataTotal = researchDataTotal; |
160 | 161 |
}, |
... | ... | |
163 | 164 |
} |
164 | 165 |
); |
165 | 166 |
|
166 |
this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst + 'software/count?format=json&fq=communityid=' + this.communityId).subscribe(
|
|
167 |
this._searchResearchResultsService.countTotalResults("software", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
|
167 | 168 |
softwareTotal => { |
168 | 169 |
this.softwareTotal = softwareTotal; |
169 | 170 |
}, |
... | ... | |
172 | 173 |
} |
173 | 174 |
); |
174 | 175 |
|
175 |
this._searchEntriesService.getTotal(this.properties.searchAPIURLLAst + 'other/count?format=json&fq=communityid=' + this.communityId).subscribe(
|
|
176 |
this._searchResearchResultsService.countTotalResults("other", this.properties,"&fq=communityid=" + this.communityId).subscribe(
|
|
176 | 177 |
orpTotal => { |
177 | 178 |
this.orpTotal = orpTotal; |
178 | 179 |
}, |
... | ... | |
181 | 182 |
} |
182 | 183 |
); |
183 | 184 |
|
184 |
this._searchEntriesService.countTotal(this.properties.communityAPI + this.communityId + '/projects').subscribe(
|
|
185 |
this._searchCommunityProjectsService.countTotalProjects(this.properties, this.communityId ).subscribe(
|
|
185 | 186 |
projectTotal => { |
186 | 187 |
this.projectTotal = projectTotal; |
187 | 188 |
//console.log(projectTotal); |
... | ... | |
191 | 192 |
} |
192 | 193 |
); |
193 | 194 |
|
194 |
this._searchEntriesService.countTotal(this.properties.communityAPI + this.communityId + '/contentproviders').subscribe(
|
|
195 |
this._searchCommunityDataprovidersService.countTotalDataproviders(this.properties, this.communityId ).subscribe(
|
|
195 | 196 |
contentProviderTotal => { |
196 | 197 |
this.contentProviderTotal = contentProviderTotal; |
197 | 198 |
//console.log(contentProviderTotal); |
... | ... | |
209 | 210 |
|
210 | 211 |
|
211 | 212 |
/**/ |
212 |
this.config.getCommunityInformation(this.properties.adminToolsAPIURL, this.communityId).subscribe(
|
|
213 |
this.config.getCommunityInformation(this.properties, this.communityId).subscribe( |
|
213 | 214 |
res => { |
214 | 215 |
this.communityInfo = res; |
215 | 216 |
}, |
... | ... | |
225 | 226 |
public searchPublications() { |
226 | 227 |
this.activeTab = "publication"; |
227 | 228 |
if (this.publicationTotal > 0 && this.publicationResults == null) { |
228 |
this._searchEntriesService.getResults(this.properties.searchAPIURLLAst + 'publications?fq=communityid%20exact%20%22' + this.communityId + '%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe( |
|
229 |
//this._searchEntriesService.getResults(this.properties.searchAPIURLLAst + 'publications?fq=communityid%20exact%20%22' + this.communityId + '%22&sortBy=resultdateofacceptance,descending&format=json&size=5') |
|
230 |
this._searchResearchResultsService.search("publication","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties) |
|
231 |
.subscribe( |
|
229 | 232 |
publicationResults => { |
230 |
this.publicationResults = publicationResults;
|
|
233 |
this.publicationResults = publicationResults[1];
|
|
231 | 234 |
this.showLoading = false; |
232 | 235 |
//console.log(publicationResults); |
233 |
},
|
|
236 |
}, |
|
234 | 237 |
error => { |
235 | 238 |
this.handleError("Error getting publications for community with id: " + this.communityId, error); |
236 | 239 |
} |
... | ... | |
241 | 244 |
public searchResearchData() { |
242 | 245 |
this.activeTab = "dataset"; |
243 | 246 |
if (this.researchDataTotal > 0 && this.researchDataResults == null) { |
244 |
this._searchEntriesService.getResults(this.properties.searchAPIURLLAst + 'datasets?fq=communityid%20exact%20%22' + this.communityId + '%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe(
|
|
247 |
this._searchResearchResultsService.search("dataset","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties).subscribe(
|
|
245 | 248 |
researchDataResults => { |
246 |
this.researchDataResults = researchDataResults; |
|
249 |
this.researchDataResults = researchDataResults[1];
|
|
247 | 250 |
this.showLoading = false; |
248 | 251 |
}, |
249 | 252 |
error => { |
... | ... | |
256 | 259 |
public searchSoftware() { |
257 | 260 |
this.activeTab = "software"; |
258 | 261 |
if (this.softwareTotal > 0 && this.softwareResults == null) { |
259 |
this._searchEntriesService.getResults(this.properties.searchAPIURLLAst + 'software?fq=communityid%20exact%20%22' + this.communityId + '%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe(
|
|
262 |
this._searchResearchResultsService.search("software","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties).subscribe(
|
|
260 | 263 |
softwareResults => { |
261 |
this.softwareResults = softwareResults; |
|
264 |
this.softwareResults = softwareResults[1];
|
|
262 | 265 |
this.showLoading = false; |
263 | 266 |
}, |
264 | 267 |
error => { |
... | ... | |
271 | 274 |
public searchOrps() { |
272 | 275 |
this.activeTab = "orp"; |
273 | 276 |
if (this.orpTotal > 0 && this.orpResults == null) { |
274 |
this._searchEntriesService.getResults(this.properties.searchAPIURLLAst + 'other?fq=communityid%20exact%20%22' + this.communityId + '%22&sortBy=resultdateofacceptance,descending&format=json&size=5').subscribe(
|
|
277 |
this._searchResearchResultsService.search("other","","&fq=communityid=" + this.communityId,1,5,"resultdateofacceptance,descending",[],this.properties).subscribe(
|
|
275 | 278 |
orpResults => { |
276 |
this.orpResults = orpResults; |
|
279 |
this.orpResults = orpResults[1];
|
|
277 | 280 |
this.showLoading = false; |
278 | 281 |
}, |
279 | 282 |
error => { |
Also available in: Unified diff
[Connect|newlinking]
Merging trunk|library into branch newlinking 55972:56049