+ @RequestMapping(value = "/descriptionElement/{descriptionelement_uuid}/states", method = RequestMethod.GET)
+ public ModelAndView doGetDescriptionElementStates(
+ @PathVariable("descriptionelement_uuid") UUID uuid,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException {
+ logger.info("doGetDescriptionElementStates() - " + request.getServletPath());
+
+ ModelAndView mv = new ModelAndView();
+
+ DescriptionElementBase descriptionElement = service.loadDescriptionElement(uuid,
+ Arrays.asList( new String[]{
+ "states.state.representations",
+ "modifiers",
+ "modifyingText"
+ } ));
+ if(descriptionElement == null){
+ HttpStatusMessage.UUID_INVALID.send(response);
+ // method will exit here
+ return null;
+ }
+
+ if(descriptionElement instanceof CategoricalData){
+
+ }
+ List<StateData> states = ((CategoricalData)descriptionElement).getStates();
+ mv.addObject(states);
+ return mv;
+ }
+
+
+
+ @RequestMapping(value = "/descriptionElement/find", method = RequestMethod.GET)
+ public Pager<DescriptionElementBase> doFindDescriptionElements(
+ @RequestParam(value = "query", required = true) String queryString,
+ @RequestParam(value = "type", required = false) Class type,
+ @RequestParam(value = "pageSize", required = false) Integer pageSize,
+ @RequestParam(value = "pageNumber", required = false) Integer pageNumber,
+ @RequestParam(value = "matchMode", required = false) MatchMode matchMode,
+ HttpServletRequest request,
+ HttpServletResponse response
+ )
+ throws IOException {
+
+ logger.info("doFindDescriptionElements : " + request.getRequestURI() + "?" + request.getQueryString() );
+
+ PagerParameters pagerParams = new PagerParameters(pageSize, pageNumber);
+ pagerParams.normalizeAndValidate(response);
+
+ Pager<DescriptionElementBase> pager = service.searchElements(type, queryString, pageSize, pageNumber, null, DEFAULT_INIT_STRATEGY);
+
+ return pager;
+ }
+