Small fixes on Project's endpoint listing.

This commit is contained in:
Diamantis Tziotzios 2019-01-31 16:06:43 +02:00
parent e829c5e6f0
commit 8b77ab759a
2 changed files with 8 additions and 8 deletions

View File

@ -174,6 +174,11 @@ public class ProjectListingModel implements DataModel<eu.eudat.data.entities.Pro
public ProjectListingModel fromDataModel(eu.eudat.data.entities.Project entity) { public ProjectListingModel fromDataModel(eu.eudat.data.entities.Project entity) {
this.id = entity.getId(); this.id = entity.getId();
this.label = entity.getLabel(); this.label = entity.getLabel();
return this;
}
public ProjectListingModel fromDataModelWIthDmps(eu.eudat.data.entities.Project entity) {
this.fromDataModel(entity);
this.abbreviation = entity.getAbbreviation(); this.abbreviation = entity.getAbbreviation();
this.reference = entity.getReference(); this.reference = entity.getReference();
this.uri = entity.getUri(); this.uri = entity.getUri();
@ -185,11 +190,6 @@ public class ProjectListingModel implements DataModel<eu.eudat.data.entities.Pro
this.modified = entity.getModified(); this.modified = entity.getModified();
this.description = entity.getDescription(); this.description = entity.getDescription();
this.files = entity.getContent() != null ? Arrays.asList(new ContentFile(entity.getContent().getLabel(), UUID.fromString(entity.getContent().getUri().split(":")[1]), "final", entity.getContent().getExtension())) : Arrays.asList(new ContentFile("default.png", null, null, null)); this.files = entity.getContent() != null ? Arrays.asList(new ContentFile(entity.getContent().getLabel(), UUID.fromString(entity.getContent().getUri().split(":")[1]), "final", entity.getContent().getExtension())) : Arrays.asList(new ContentFile("default.png", null, null, null));
return this;
}
public ProjectListingModel fromDataModelWIthDmps(eu.eudat.data.entities.Project entity) {
this.fromDataModel(entity);
this.dmps = entity.getDmps().stream().map(item -> new DataManagementPlanUrlListing().fromDataModel(item)).collect(Collectors.toList()); this.dmps = entity.getDmps().stream().map(item -> new DataManagementPlanUrlListing().fromDataModel(item)).collect(Collectors.toList());
return this; return this;
} }

View File

@ -20,11 +20,11 @@ export class ProjectService {
this.actionUrl = environment.Server + 'projects/'; this.actionUrl = environment.Server + 'projects/';
} }
getPaged(dataTableRequest: DataTableRequest<ProjectCriteria>,fieldsGroup?: string): Observable<DataTableData<ProjectListingModel>> { getPaged(dataTableRequest: DataTableRequest<ProjectCriteria>, fieldsGroup?: string): Observable<DataTableData<ProjectListingModel>> {
if(fieldsGroup){ if (fieldsGroup) {
return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + fieldsGroup, dataTableRequest, { headers: this.headers }); return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + fieldsGroup, dataTableRequest, { headers: this.headers });
} }
else{ else {
return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + 'autocomplete', dataTableRequest, { headers: this.headers }); return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + 'autocomplete', dataTableRequest, { headers: this.headers });
} }
} }