List of usage examples for org.apache.commons.lang ArrayUtils addAll
public static double[] addAll(double[] array1, double[] array2)
Adds all the elements of the given arrays into a new array.
From source file:org.ednovo.gooru.controllers.v2.api.FeedbackRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FEEDBACK_UPDATE }) @RequestMapping(method = RequestMethod.PUT, value = "/{id}") public ModelAndView updateFeedback(@RequestBody final String data, @PathVariable(value = ID) final String feedbackId, final HttpServletRequest request, final HttpServletResponse response) throws Exception { final User user = (User) request.getAttribute(Constants.USER); final List<Feedback> feedbacks = getFeedbackService().updateFeedback(feedbackId, this.buildFeedbackFromInputParameters(data, request), user); final String includes[] = (String[]) ArrayUtils.addAll(FEEDBACK_INCLUDE_FIELDS, ERROR_INCLUDE); return toModelAndViewWithIoFilter(feedbacks, RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }
From source file:org.ednovo.gooru.controllers.v2.api.FeedbackRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FEEDBACK_READ }) @RequestMapping(method = RequestMethod.GET, value = "/{id}") public ModelAndView getFeedback(@PathVariable(value = ID) final String feedbackId, final HttpServletRequest request, final HttpServletResponse response) throws Exception { final String includes[] = (String[]) ArrayUtils.addAll(FEEDBACK_INCLUDE_FIELDS, ERROR_INCLUDE); return toModelAndViewWithIoFilter(this.getFeedbackService().getFeedback(feedbackId), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }
From source file:org.ednovo.gooru.controllers.v2.api.FeedbackRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FEEDBACK_READ }) @RequestMapping(method = RequestMethod.GET, value = "") public ModelAndView getFeedbacks(final HttpServletRequest request, @RequestParam(value = TYPE, required = true) final String type, @RequestParam(value = TARGET_TYPE, required = true) final String targetType, @RequestParam(value = CREATOR_UID, required = false) final String creatorUid, @RequestParam(value = OFFSET_FIELD, required = false, defaultValue = "0") final Integer offset, @RequestParam(value = LIMIT_FIELD, required = false, defaultValue = "20") final Integer limit, final HttpServletResponse response) throws Exception { final String includes[] = (String[]) ArrayUtils.addAll(FEEDBACK_INCLUDE_FIELDS, ERROR_INCLUDE); return toModelAndViewWithIoFilter(this.getFeedbackService().getFeedbacks(getFeedbackCategory(request), targetType, type, creatorUid, limit, offset), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }
From source file:org.ednovo.gooru.controllers.v2.api.FolderRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FOLDER_ADD }) @RequestMapping(value = { " " }, method = RequestMethod.POST) public ModelAndView createFolder(@RequestBody final String data, final HttpServletRequest request, final HttpServletResponse response) throws Exception { final User user = (User) request.getAttribute(Constants.USER); final JSONObject json = requestData(data); final ActionResponseDTO<Collection> responseDTO = getCollectionService().createCollection( this.buildCollectionFromInputParameters(data, user), Boolean.parseBoolean( json != null && getValue(ADD_TO_SHELF, json) != null ? getValue(ADD_TO_SHELF, json) : FALSE),// w ww. j av a2s . com getValue(RESOURCE_ID, json), getValue(PARENT_ID, json), user); if (responseDTO.getErrors().getErrorCount() > 0) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); } String includes[] = (String[]) ArrayUtils.addAll(RESOURCE_INCLUDE_FIELDS, COLLECTION_INCLUDE_FIELDS); includes = (String[]) ArrayUtils.addAll(includes, COLLECTION_ITEM_INCLUDE_FILEDS); includes = (String[]) ArrayUtils.addAll(includes, ERROR_INCLUDE); return toModelAndViewWithIoFilter(responseDTO.getModelData(), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }
From source file:org.ednovo.gooru.controllers.v2.api.FolderRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FOLDER_UPDATE }) @RequestMapping(value = { "/{id}" }, method = { RequestMethod.PUT }) public ModelAndView updateFolder(@PathVariable(value = ID) final String collectionId, @RequestBody final String data, final HttpServletRequest request, final HttpServletResponse response) throws Exception { final User user = (User) request.getAttribute(Constants.USER); final JSONObject json = requestData(data); final ActionResponseDTO<Collection> responseDTO = getCollectionService().updateCollection( this.buildUpadteCollectionFromInputParameters(data, user), collectionId, getValue(OWNER_UID, json), getValue(CREATOR_UID, json), hasUnrestrictedContentAccess(), getValue(RELATED_CONTENT_ID, json), user, data);/* w w w. ja v a2 s .com*/ if (responseDTO.getErrors().getErrorCount() > 0) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); } String[] includes = (String[]) ArrayUtils.addAll(COLLECTION_INCLUDE_FIELDS, ERROR_INCLUDE); if (getValue(TAXONOMY_SET, json) != null) { includes = (String[]) ArrayUtils.addAll(includes, COLLECTION_TAXONOMY); } if (getValue(RELATED_CONTENT_ID, json) != null) { includes = (String[]) ArrayUtils.add(includes, "*.contentAssociation.associateContent"); } return toModelAndViewWithIoFilter(responseDTO.getModelData(), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }
From source file:org.ednovo.gooru.controllers.v2.api.FolderRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FOLDER_ITEM_ADD }) @RequestMapping(value = { "/{id}/item" }, method = RequestMethod.POST) public ModelAndView createFolderItem(@PathVariable(value = ID) final String collectionId, @RequestBody final String data, final HttpServletRequest request, final HttpServletResponse response) throws Exception { final User user = (User) request.getAttribute(Constants.USER); final JSONObject json = requestData(data); final ActionResponseDTO<CollectionItem> responseDTO = getCollectionService().createCollectionItem( getValue(GOORU_OID, json), collectionId, this.buildCollectionItemFromInputParameters(data, user), user, CollectionType.COLLECTION.getCollectionType(), false); if (responseDTO.getErrors().getErrorCount() > 0) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); }//from w w w . jav a 2 s . c om String[] includes = (String[]) ArrayUtils.addAll(COLLECTION_ITEM_INCLUDE_FILEDS, ERROR_INCLUDE); return toModelAndViewWithIoFilter(responseDTO.getModelData(), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }
From source file:org.ednovo.gooru.controllers.v2.api.FolderRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FOLDER_ITEM_UPDATE }) @RequestMapping(value = { "/item/{id}" }, method = RequestMethod.PUT) public ModelAndView updateFolderItem(@PathVariable(value = ID) final String collectionItemId, @RequestBody final String data, final HttpServletRequest request, final HttpServletResponse response) throws Exception { final User user = (User) request.getAttribute(Constants.USER); final ActionResponseDTO<CollectionItem> responseDTO = getCollectionService().updateCollectionItem( this.buildCollectionItemFromInputParameters(data, user), collectionItemId, user, data); if (responseDTO.getErrors().getErrorCount() > 0) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); }/*from w w w.jav a2 s . c o m*/ String[] includes = (String[]) ArrayUtils.addAll(COLLECTION_ITEM_INCLUDE_FILEDS, ERROR_INCLUDE); return toModelAndViewWithIoFilter(responseDTO.getModelData(), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }
From source file:org.ednovo.gooru.controllers.v2.api.FolderRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FOLDER_ITEM_UPDATE }) @RequestMapping(value = { "/item/{id}/reorder/{sequence}" }, method = RequestMethod.PUT) public ModelAndView reorderCollectionItemSequence(@PathVariable(value = ID) final String collectionItemId, @PathVariable(value = SEQUENCE) final int newSequence, final User user, final HttpServletRequest request, final HttpServletResponse response) throws Exception { final ActionResponseDTO<CollectionItem> responseDTO = getCollectionService() .reorderCollectionItem(collectionItemId, newSequence, user); if (responseDTO.getErrors().getErrorCount() > 0) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); }/* www . j a v a 2 s . c om*/ String[] includes = (String[]) ArrayUtils.addAll(COLLECTION_ITEM_INCLUDE_FILEDS, ERROR_INCLUDE); return toModelAndView( serialize(responseDTO.getModelData(), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes)); }
From source file:org.ednovo.gooru.controllers.v2.api.FolderRestV2Controller.java
@AuthorizeOperations(operations = { GooruOperationConstants.OPERATION_FOLDER_MOVE }) @RequestMapping(value = { "/move" }, method = RequestMethod.PUT) public ModelAndView moveCollectionToFolder(final HttpServletRequest request, @RequestBody final String data, final HttpServletResponse response) throws Exception { final User user = (User) request.getAttribute(Constants.USER); final JSONObject json = requestData(data); final ActionResponseDTO<CollectionItem> responseDTO = getCollectionService().moveCollectionToFolder( getValue(SOURCE_ID, json),/*from w w w. j a v a2 s.com*/ json != null && getValue(TARGET_ID, json) != null ? getValue(TARGET_ID, json) : null, user); if (responseDTO.getErrors().getErrorCount() > 0) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); } String[] includes = (String[]) ArrayUtils.addAll(COLLECTION_CREATE_ITEM_INCLUDE_FILEDS, ERROR_INCLUDE); return toModelAndViewWithIoFilter(responseDTO.getModelData(), RESPONSE_FORMAT_JSON, EXCLUDE_ALL, true, includes); }