changeset 629:3bbfdef05ee1

Code documentation.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 23 Apr 2015 08:45:25 +0200
parents 21a49dc9984d
children 44d7ff0461f2
files src/main/java/de/intevation/lada/rest/KommentarMService.java src/main/java/de/intevation/lada/rest/exporter/LafExportService.java src/main/java/de/intevation/lada/rest/importer/LafImportService.java src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java
diffstat 5 files changed, 95 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/rest/KommentarMService.java	Wed Apr 22 14:03:53 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/KommentarMService.java	Thu Apr 23 08:45:25 2015 +0200
@@ -1,9 +1,9 @@
 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
  * Software engineering by Intevation GmbH
  *
- * This file is Free Software under the GNU GPL (v>=3) 
- * and comes with ABSOLUTELY NO WARRANTY! Check out 
- * the documentation coming with IMIS-Labordaten-Application for details. 
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
  */
 package de.intevation.lada.rest;
 
--- a/src/main/java/de/intevation/lada/rest/exporter/LafExportService.java	Wed Apr 22 14:03:53 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/exporter/LafExportService.java	Thu Apr 23 08:45:25 2015 +0200
@@ -1,3 +1,10 @@
+/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
+ */
 package de.intevation.lada.rest.exporter;
 
 import java.io.InputStream;
@@ -28,7 +35,17 @@
 import de.intevation.lada.util.auth.UserInfo;
 
 /**
- * This class produces a RESTful service to interact with probe objects.
+ * REST service to export probe objects and the child objects associated with
+ * the selected Probe objects.
+ * <p>
+ * To request objects post a JSON formatted string with an array of probe ids.
+ * <pre>
+ * <code>
+ * {
+ *  "proben": [[number], [number], ...]
+ * }
+ * </code>
+ * </pre>
  *
  * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
  */
@@ -36,26 +53,34 @@
 @RequestScoped
 public class LafExportService {
 
-    /* The logger used in this class.*/
+    /**
+     * The logger used in this class.
+     */
     @Inject
     private Logger logger;
 
+    /**
+     * The exporter.
+     */
     @Inject
     @ExportConfig(format=ExportFormat.LAF)
     private Exporter exporter;
 
+    /**
+     * The authorization module.
+     */
     @Inject
     @AuthorizationConfig(type=AuthorizationType.OPEN_ID)
-    Authorization authorization;
+    private Authorization authorization;
 
 
     /**
-     * Export LProbe objects.
+     * Export Probe objects.
      *
-     * The service takes form url encoded POST data containing probe ids and
-     * exports the LProbe objects filtered by these ids.
+     * The service takes JSON formatted  POST data containing probe ids and
+     * exports the Probe objects filtered by these ids.
      *
-     * @param proben    Form data (url encoded) string with probe ids.
+     * @param proben    JSON formatted string with an array of probe ids.
      * @param header    The HTTP header containing authorization information.
      * @return The LAF file to export.
      */
--- a/src/main/java/de/intevation/lada/rest/importer/LafImportService.java	Wed Apr 22 14:03:53 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/importer/LafImportService.java	Thu Apr 23 08:45:25 2015 +0200
@@ -1,9 +1,9 @@
 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
  * Software engineering by Intevation GmbH
  *
- * This file is Free Software under the GNU GPL (v>=3) 
- * and comes with ABSOLUTELY NO WARRANTY! Check out 
- * the documentation coming with IMIS-Labordaten-Application for details. 
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
  */
 package de.intevation.lada.rest.importer;
 
@@ -40,22 +40,30 @@
 @RequestScoped
 public class LafImportService {
 
-    /* The logger used in this class.*/
+    /**
+     * The logger used in this class.
+     */
     @Inject
     private Logger logger;
 
+    /**
+     * The importer
+     */
     @Inject
     @ImportConfig(format=ImportFormat.LAF)
     private Importer importer;
 
+    /**
+     * The authorization module.
+     */
     @Inject
     @AuthorizationConfig(type=AuthorizationType.OPEN_ID)
     private Authorization authorization;
 
     /**
-     * Import a file in the LAF format.
+     * Import a LAF formatted file.
      *
-     * @param input MulitpartFormDataInput containing the file to upload.
+     * @param input     String containing file content.
      * @param header    The HTTP header containing authorization information.
      * @return Response object.
      */
--- a/src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java	Wed Apr 22 14:03:53 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java	Thu Apr 23 08:45:25 2015 +0200
@@ -1,9 +1,9 @@
 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
  * Software engineering by Intevation GmbH
  *
- * This file is Free Software under the GNU GPL (v>=3) 
- * and comes with ABSOLUTELY NO WARRANTY! Check out 
- * the documentation coming with IMIS-Labordaten-Application for details. 
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
  */
 package de.intevation.lada.rest.stamm;
 
@@ -24,19 +24,50 @@
 import de.intevation.lada.util.data.RepositoryType;
 import de.intevation.lada.util.rest.Response;
 
+/**
+ * REST service for Datenbasis objects.
+ * <p>
+ * The services produce data in the application/json media type.
+ * All HTTP methods use the authorization module to determine if the user is
+ * allowed to perform the requested action.
+ * A typical response holds information about the action performed and the data.
+ * <pre>
+ * <code>
+ * {
+ *  "success": [boolean];
+ *  "message": [string],
+ *  "data":[{
+ *      "id": [number],
+ *      "beschreibung": [string],
+ *      "datenbasis": [string}
+ *  }],
+ *  "errors": [object],
+ *  "warnings": [object],
+ *  "readonly": [boolean],
+ *  "totalCount": [number]
+ * }
+ * </code>
+ * </pre>
+ *
+ * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
+ */
 @Path("datenbasis")
 @RequestScoped
 public class DatenbasisService {
 
-    /* The data repository granting read/write access.*/
+    /**
+     * The data repository granting read access.
+     */
     @Inject
     @RepositoryConfig(type=RepositoryType.RO)
     private Repository defaultRepo;
 
     /**
-     * Get all messung objects.
+     * Get all Datenbasis objects.
+     * <p>
+     * Example: http://example.com/datenbasis
      *
-     * @return Response object containing all messung objects.
+     * @return Response object containing all Datenbasis objects.
      */
     @GET
     @Path("/")
@@ -49,9 +80,13 @@
     }
 
     /**
-     * Get an object by id.
+     * Get an single Datenbasis object by id.
+     * <p>
+     * The id is appended to the URL as a path parameter.
+     * <p>
+     * Example: http://example.com/datenbasis/{id}
      *
-     * @return Response object containing a single kommentarP.
+     * @return Response object containing a single Datenabasis.
      */
     @GET
     @Path("/{id}")
--- a/src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java	Wed Apr 22 14:03:53 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java	Thu Apr 23 08:45:25 2015 +0200
@@ -1,9 +1,9 @@
 /* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz
  * Software engineering by Intevation GmbH
  *
- * This file is Free Software under the GNU GPL (v>=3) 
- * and comes with ABSOLUTELY NO WARRANTY! Check out 
- * the documentation coming with IMIS-Labordaten-Application for details. 
+ * This file is Free Software under the GNU GPL (v>=3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out
+ * the documentation coming with IMIS-Labordaten-Application for details.
  */
 package de.intevation.lada.rest.stamm;
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)