uoa-monitor-service/src/main/java/eu/dnetlib/uoamonitorservice/primitives/ReorderEvent.java

43 lines
871 B
Java
Raw Normal View History

package eu.dnetlib.uoamonitorservice.primitives;
[Trunk | Monitor Service]: 1. StakeholderController.java & TopicController.java & CategoryController.java & SubCategoryController.java && SectionController.java && IndicatorController.java: a. Comment logs for get requests. b. Use "ForbiddenException" instead of "AccessDeniedException" c. On /save, if full entity has id (already in DB), if not found in DB throw EntityNotFoundException. d. Get children (e.g. when saving a Topic, get its categories) from DB. 2. TopicController.java & CategoryController.java & SubCategoryController.java & SectionController.java: In /reorder, if there are in DB, ids that are missing from reordered list, do reordering and add in the end of list the missing ids. 3. ReorderEvent.java: [NEW] Added class ReorderEvent with fields "action" (String), "target" (String), "ids" (List<String>) (used in IndicatorController.java). 4. IndicatorController.java: a. In /reorder, @RequestBody changed from List<String> indicators to ReorderEvent reorderEvent. b. If there are in DB, ids that are missing from reordered list AND missing id is not moved to other section (action = removed and target = missing id), do reordering and add in the end of list the missing ids. 5. ExceptionsHandler.java: exception handler methods "invalidInput()", "nullPointerException()", "notFoundException()" moved to "Admin Tools Library" - "accessDeniedException()" is removed. 6. responses/ExceptionResponse.java: File and folder deleted (moved to "Admin Tools Library"). 7. RolesUtils.java: Added method "isLoggedIn()" (checks if no roles for user, or user has role "ROLE_ANONYMOUS").
2020-12-09 15:24:27 +01:00
import java.util.List;
public class ReorderEvent {
private String action; // "moved", "added", "removed"
private String target;
private List<String> ids;
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getTarget() {
return target;
}
public void setTarget(String target) {
this.target = target;
}
public List<String> getIds() {
return ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
@Override
public String toString() {
return "ReorderEvent{" +
"action='" + action + '\'' +
", target='" + target + '\'' +
", ids=" + ids +
'}';
}
}