enabling http POST for a couple of name catalogue controller methods
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / ReferenceController.java
index b7f590ac52b3acecec0ba0a821a35235ac714dd8..fd64e97f1d2063ad04a9287ec87d7fcbae86d37e 100644 (file)
@@ -20,8 +20,6 @@ import javax.servlet.http.HttpServletResponse;
 \r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.stereotype.Controller;\r
-import org.springframework.web.bind.WebDataBinder;\r
-import org.springframework.web.bind.annotation.InitBinder;\r
 import org.springframework.web.bind.annotation.PathVariable;\r
 import org.springframework.web.bind.annotation.RequestMapping;\r
 import org.springframework.web.bind.annotation.RequestMethod;\r
@@ -31,7 +29,7 @@ import org.springframework.web.servlet.ModelAndView;
 import eu.etaxonomy.cdm.api.service.IReferenceService;\r
 import eu.etaxonomy.cdm.model.reference.INomenclaturalReference;\r
 import eu.etaxonomy.cdm.model.reference.Reference;\r
-import eu.etaxonomy.cdm.remote.editor.UUIDPropertyEditor;\r
+import io.swagger.annotations.Api;\r
 \r
 /**\r
  * TODO write controller documentation\r
@@ -41,25 +39,26 @@ import eu.etaxonomy.cdm.remote.editor.UUIDPropertyEditor;
  */\r
 \r
 @Controller\r
+@Api("reference")\r
 @RequestMapping(value = {"/reference/{uuid}"})\r
-public class ReferenceController extends BaseController<Reference, IReferenceService>\r
+public class ReferenceController extends AbstractIdentifiableController<Reference, IReferenceService>\r
 {\r
 \r
     private static final List<String> NOMENCLATURAL_CITATION_INIT_STRATEGY = Arrays.asList(new String []{\r
             "$",\r
-            "authorTeam",\r
+            "authorship",\r
             "inReference.inReference",\r
-            "inReference.authorTeam"\r
+            "inReference.authorship"\r
     });\r
 \r
-    private static final List<String> CITATION_WITH_AUTHORTEAM_INIT_STRATEGY = Arrays.asList(new String []{\r
-            "authorTeam.$"\r
+    private static final List<String> CITATION_WITH_AUTHORSHIP_INIT_STRATEGY = Arrays.asList(new String []{\r
+            "authorship.$"\r
     });\r
 \r
     public ReferenceController(){\r
         setInitializationStrategy(Arrays.asList(new String[]{\r
                 "$",\r
-                "authorTeam.$"\r
+                "authorship.$"\r
              }));\r
     }\r
 \r
@@ -101,14 +100,14 @@ public class ReferenceController extends BaseController<Reference, IReferenceSer
     }\r
 \r
     @RequestMapping(\r
-            value = {"authorTeam"},\r
+            value = {"authorship"},\r
             method = RequestMethod.GET)\r
-        public ModelAndView doGetAuthorTeam(\r
+        public ModelAndView doGetAuthorship(\r
                 @PathVariable("uuid") UUID uuid,\r
                 HttpServletRequest request,\r
                 HttpServletResponse response) {\r
         ModelAndView mv = new ModelAndView();\r
-        Reference rb = service.load(uuid, CITATION_WITH_AUTHORTEAM_INIT_STRATEGY);\r
+        Reference rb = service.load(uuid, CITATION_WITH_AUTHORSHIP_INIT_STRATEGY);\r
         if(rb.getAuthorship() != null){\r
             mv.addObject(rb.getAuthorship());\r
         }\r