import org.springframework.web.bind.annotation.PathVariable;\r
import org.springframework.web.bind.annotation.RequestMapping;\r
import org.springframework.web.bind.annotation.RequestMethod;\r
+import org.springframework.web.servlet.ModelAndView;\r
\r
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;\r
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;\r
import eu.etaxonomy.cdm.api.service.IOccurrenceService;\r
+import eu.etaxonomy.cdm.model.media.Media;\r
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;\r
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;\r
import eu.etaxonomy.cdm.remote.editor.UUIDPropertyEditor;\r
return duf;\r
}\r
\r
+ @RequestMapping(value = {"derivedUnitMedia"}, method = RequestMethod.GET)\r
+ public ModelAndView doGetDerivedUnitMedia(\r
+ @PathVariable("uuid") UUID uuid,\r
+ HttpServletRequest request,\r
+ HttpServletResponse response) throws IOException {\r
+\r
+ logger.info("doGetDerivedUnitMedia() - " + request.getServletPath());\r
+ ModelAndView mv = new ModelAndView();\r
+ DerivedUnitFacade duf = newFacadeFrom(uuid, response,Arrays.asList(new String []{\r
+ "derivedUnitMedia.representations.parts", "derivedUnitMedia.title"}));\r
+ mv.addObject(duf.getDerivedUnitMedia());\r
+ return mv;\r
+ }\r
+ \r
+ @RequestMapping(value = {"fieldObjectMedia"}, method = RequestMethod.GET)\r
+ public ModelAndView doGetFieldObjectMedia(\r
+ @PathVariable("uuid") UUID uuid,\r
+ HttpServletRequest request,\r
+ HttpServletResponse response) throws IOException {\r
+\r
+ logger.info("doGetFieldObjectMedia() - " + request.getServletPath());\r
+ ModelAndView mv = new ModelAndView();\r
+ DerivedUnitFacade duf = newFacadeFrom(uuid, response,Arrays.asList(new String []{\r
+ "fieldObjectMedia.representations.parts", "fieldObjectMedia.title"}));\r
+ mv.addObject(duf.getFieldObjectMedia());\r
+ return mv;\r
+ }\r
+ \r
// TODO \r
- @RequestMapping(method = RequestMethod.GET, value = "{uuid}/collectingareas")\r
+ //@RequestMapping(method = RequestMethod.GET, value = "{uuid}/collectingareas")\r
+ @RequestMapping(\r
+ value = {"collectingareas"},\r
+ method = RequestMethod.GET)\r
public Object doGetCollectingAreas(\r
@PathVariable("uuid") UUID uuid,\r
HttpServletRequest request,\r
return duf.getCollectingAreas();\r
}\r
\r
- @RequestMapping(method = RequestMethod.GET, value = "{uuid}/collection")\r
+ @RequestMapping(method = RequestMethod.GET, value = "collection")\r
public Object doGetCollection(\r
@PathVariable("uuid") UUID uuid,\r
HttpServletRequest request,\r
\r
private DerivedUnitFacade newFacadeFrom(UUID uuid, HttpServletResponse response, List<String> extendedInitStrategy)\r
throws IOException {\r
- List<String> initStrategy = new ArrayList<String>(DEFAULT_INIT_STRATEGY);\r
+ List<String> initStrategy = new ArrayList<String>(initializationStrategy);\r
if(extendedInitStrategy != null && extendedInitStrategy.size() > 0){\r
initStrategy.addAll(extendedInitStrategy);\r
}\r