fix query available languages by ordinal
This commit is contained in:
parent
8807d42121
commit
34df0b640c
|
@ -65,7 +65,7 @@ public class NotificationServiceImpl implements NotificationService {
|
||||||
public void persist(NotificationPersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException {
|
public void persist(NotificationPersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException {
|
||||||
logger.debug(new MapLogEntry("persisting notification").And("model", model).And("fields", fields));
|
logger.debug(new MapLogEntry("persisting notification").And("model", model).And("fields", fields));
|
||||||
|
|
||||||
//this.authorizationService.authorizeForce(Permission.AuthenticatedRole);
|
this.authorizationService.authorizeForce(Permission.AuthenticatedRole);
|
||||||
|
|
||||||
Boolean isUpdate = this.conventionService.isValidGuid(model.getId());
|
Boolean isUpdate = this.conventionService.isValidGuid(model.getId());
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.validation.ValidationFilterAnnotation;
|
import eu.eudat.commons.validation.ValidationFilterAnnotation;
|
||||||
import eu.eudat.data.LanguageEntity;
|
import eu.eudat.data.LanguageEntity;
|
||||||
import eu.eudat.model.Language;
|
import eu.eudat.model.Language;
|
||||||
|
import eu.eudat.model.UserContactInfo;
|
||||||
import eu.eudat.model.builder.LanguageBuilder;
|
import eu.eudat.model.builder.LanguageBuilder;
|
||||||
import eu.eudat.model.censorship.LanguageCensor;
|
import eu.eudat.model.censorship.LanguageCensor;
|
||||||
import eu.eudat.model.persist.LanguagePersist;
|
import eu.eudat.model.persist.LanguagePersist;
|
||||||
|
@ -16,6 +17,7 @@ import eu.eudat.service.language.LanguageService;
|
||||||
import gr.cite.tools.auditing.AuditService;
|
import gr.cite.tools.auditing.AuditService;
|
||||||
import gr.cite.tools.data.builder.BuilderFactory;
|
import gr.cite.tools.data.builder.BuilderFactory;
|
||||||
import gr.cite.tools.data.censor.CensorFactory;
|
import gr.cite.tools.data.censor.CensorFactory;
|
||||||
|
import gr.cite.tools.data.query.Ordering;
|
||||||
import gr.cite.tools.data.query.QueryFactory;
|
import gr.cite.tools.data.query.QueryFactory;
|
||||||
import gr.cite.tools.exception.MyApplicationException;
|
import gr.cite.tools.exception.MyApplicationException;
|
||||||
import gr.cite.tools.exception.MyForbiddenException;
|
import gr.cite.tools.exception.MyForbiddenException;
|
||||||
|
@ -138,6 +140,7 @@ public class LanguageController {
|
||||||
this.censorFactory.censor(LanguageCensor.class).censor(lookup.getProject(), null);
|
this.censorFactory.censor(LanguageCensor.class).censor(lookup.getProject(), null);
|
||||||
|
|
||||||
LanguageQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic);
|
LanguageQuery query = lookup.enrich(this.queryFactory).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic);
|
||||||
|
query.setOrder(new Ordering().addAscending(Language._ordinal));
|
||||||
List<LanguageEntity> data = query.collectAs(lookup.getProject());
|
List<LanguageEntity> data = query.collectAs(lookup.getProject());
|
||||||
List<Language> models = this.builderFactory.builder(LanguageBuilder.class).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic).build(lookup.getProject(), data);
|
List<Language> models = this.builderFactory.builder(LanguageBuilder.class).authorize(AuthorizationFlags.OwnerOrDmpAssociatedOrPermissionOrPublic).build(lookup.getProject(), data);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue