Project

General

Profile

« Previous | Next » 

Revision 58992

[Trunk | Monitor Service]:
1. TopicController.java & CategoryController.java & SubCategoryController.java: New methods for reorder added.
2. CategoryController.java: Method "checkForExceptions()" added.
3. IndicatorController.java: [Bug Fix] When updating a default indicator and all indicators based on that are updated too, set description field when needed (not name again).

View differences:

SubCategoryController.java
297 297
        return true;
298 298
    }
299 299

  
300
    @RequestMapping(value = "/{stakeholderId}/{topicId}/{categoryId}/reorder", method = RequestMethod.POST)
301
    public List<SubCategory> reorderSubCategories(@PathVariable("stakeholderId") String stakeholderId,
302
                                            @PathVariable("topicId") String topicId,
303
                                            @PathVariable("categoryId") String categoryId,
304
                                            @RequestBody List<String> subCategories) {
305
        log.debug("reorder subCategories");
306
        log.debug("Stakeholder: "+stakeholderId + " - Topic: "+topicId + " - Category: "+categoryId);
307

  
308
        Category<String> category = checkForExceptions(stakeholderId, topicId, categoryId);
309

  
310
        category.setSubCategories(subCategories);
311

  
312
        categoryDAO.save(category);
313
        log.debug("SubCategories reordered!");
314

  
315
        List<SubCategory> subCategoriesFull = new ArrayList<>();
316
        for(String subCategoryId : subCategories) {
317
            subCategoriesFull.add(subCategoryDAO.findById(subCategoryId));
318
        }
319
        return subCategoriesFull;
320
    }
321

  
300 322
    @RequestMapping(value = "/{stakeholderId}/{topicId}/{categoryId}/{subcategoryId}/toggle-status", method = RequestMethod.POST)
301 323
    public Boolean toggleSubCategoryStatus(@PathVariable("stakeholderId") String stakeholderId,
302 324
                                           @PathVariable("topicId") String topicId,

Also available in: Unified diff