# HG changeset patch # User Raimund Renkert # Date 1429771525 -7200 # Node ID 3bbfdef05ee1b8cd07f89149aa25a56713c3233c # Parent 21a49dc9984ddd0b367f4a3f9c03a3de6762e1e1 Code documentation. diff -r 21a49dc9984d -r 3bbfdef05ee1 src/main/java/de/intevation/lada/rest/KommentarMService.java --- 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; diff -r 21a49dc9984d -r 3bbfdef05ee1 src/main/java/de/intevation/lada/rest/exporter/LafExportService.java --- 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. + *

+ * To request objects post a JSON formatted string with an array of probe ids. + *

+ * 
+ * {
+ *  "proben": [[number], [number], ...]
+ * }
+ * 
+ * 
* * @author Raimund Renkert */ @@ -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. */ diff -r 21a49dc9984d -r 3bbfdef05ee1 src/main/java/de/intevation/lada/rest/importer/LafImportService.java --- 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. */ diff -r 21a49dc9984d -r 3bbfdef05ee1 src/main/java/de/intevation/lada/rest/stamm/DatenbasisService.java --- 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. + *

+ * 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. + *

+ * 
+ * {
+ *  "success": [boolean];
+ *  "message": [string],
+ *  "data":[{
+ *      "id": [number],
+ *      "beschreibung": [string],
+ *      "datenbasis": [string}
+ *  }],
+ *  "errors": [object],
+ *  "warnings": [object],
+ *  "readonly": [boolean],
+ *  "totalCount": [number]
+ * }
+ * 
+ * 
+ * + * @author Raimund Renkert + */ @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. + *

+ * 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. + *

+ * The id is appended to the URL as a path parameter. + *

+ * Example: http://example.com/datenbasis/{id} * - * @return Response object containing a single kommentarP. + * @return Response object containing a single Datenabasis. */ @GET @Path("/{id}") diff -r 21a49dc9984d -r 3bbfdef05ee1 src/main/java/de/intevation/lada/rest/stamm/KoordinatenartService.java --- 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;