Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java	(revision 6044)
@@ -29,4 +29,5 @@
 import eu.dasish.annotation.schema.ObjectFactory;
 import eu.dasish.annotation.schema.Access;
+import eu.dasish.annotation.schema.AnnotationInfo;
 import eu.dasish.annotation.schema.PermissionList;
 import eu.dasish.annotation.schema.ReferenceList;
@@ -59,6 +60,6 @@
 
 /**
- * REST class for GETting, POSTing, PUTting and DELETing annotations or their substructures (child elements);
- * Every REST method in the case of successful completion of its action outputs the declared output type
+ * A REST class for GETting, POSTing, PUTting and DELETing annotations or their substructures (child elements).
+ * Every REST method in the case of successful completion produces the object of the declared output type
  * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
  * @author olhsha
@@ -72,15 +73,8 @@
     final private String[] admissibleMatchModes = {"exact", "starts_with", "ends_with", "contains"};
 
-   /**
-    * 
-    * @param httpServletResponse a {@link HttpServletResponse} object, setting us used in unit tests.
-    */
-    public void setHttpServletResponse(HttpServletResponse httpServletResponse) {
-        this.httpServletResponse = httpServletResponse;
-    }
-    
-    /**
-     * 
-     * @param httpServletRequest a {@link HttpServletRequest} object, setting is used in the unit tests.
+ 
+    /**
+     * 
+     * @param httpServletRequest a {@link HttpServletRequest} object; set explicitely in the unit tests.
      */
     public void setHttpServletRequest(HttpServletRequest httpServletRequest) {
@@ -90,6 +84,6 @@
     /**
      * 
-     * @param providers a {@link Providers} object, to be set to "this" object and to be used to force 
-     * validation of the input/output xml files w.r.t. the dasish schema.
+     * @param providers a {@link Providers} object, used by JAXB, also 
+     * to validate input and output xml files w.r.t. the dasish schema.
      */
     public void setProviders(Providers providers) {
@@ -103,8 +97,8 @@
     /**
      * 
-     * @param externalIdentifier the string representing the UUID of an annotation.
+     * @param externalIdentifier the UUID of an annotation.
      * @return the xml-element representing the annotation with "externalIdentifier" built up 
      * from the "annotation" table and the corresponding junction tables. 
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -141,6 +135,6 @@
      * 
      * @param externalIdentifier the string representing the UUID of an annotation.
-     * @return the xml element representing the list of h-references of the annotation with "externalIdentifier".
-     * @throws IOException if sending the error fails.
+     * @return the xml element representing the list of h-references of the targets of the annotation with "externalIdentifier".
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -177,5 +171,5 @@
      * 
      * @param link the link representing one of the target sources of the annotation.
-     * @param matchMode the relation of the actual target-source link to "link" parameter: "exact", "starts_with", "ends_with", "contains"
+     * @param matchMode the relation of the actual target-source link to the "link" parameter: "exact", "starts_with", "ends_ith", "contains".
      * @param text the text fragment that must be present in the annotation body.
      * @param access the access mode of the logged in user to the requested annotations.
@@ -186,5 +180,5 @@
      * @return the xml-element representing the list of {@link AnnotationInfo} objects representing 
      * the annotations satisfying the requirements defined by the parameters.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -238,9 +232,8 @@
     
     /**
-     * 
-     * @param n # of requested annotations (to which logged in principal has "read" access.
-     * @return the external UUIDs of some n annotations to which the logged in principal has "read" access,
-     * if the principal has "admin" or "developer" type of account.
-     * @throws IOException if sending the error fails.
+     * The request can be sent by principals with "developer" or "admin" account.
+     * @param n # of threads.
+     * @return a message reporting test success.
+     * @throws IOException if sending an error fails.
      * @throws NotInDataBaseException if getting annotation fails.
      */
@@ -288,5 +281,5 @@
     * @return the xml-element representing the list of permissions, i.e. pairs (principalId, accessMode),
     * built upon the table "annotations_principals_accesses".
-    * @throws IOException if sending the error fails.
+    * @throws IOException if sending an error fails.
     */
     @GET
@@ -323,6 +316,6 @@
      * 
      * @param externalIdentifier the external UUID of the annotation to be deleted.
-     * @return the message if the annotation is deleted or not.
-     * @throws IOException if sending the error fails.
+     * @return the message telling if the annotation is deleted or not.
+     * @throws IOException if sending an error fails.
      */
     @DELETE
@@ -356,10 +349,10 @@
     /**
      * 
-     * @param annotation an {@link Annotation} object,
+     * @param annotation an {@link Annotation} object.
      * @return the {@link ResponseBody} element that contains the xml element representing 
-     * the fresh annotation (with its generated by the method external UUID), and the list
+     * the fresh annotation (with its freshly generated by the back-end external UUID), and the list
      * of action-elements representing the actions the client should care for,
      * e.g. add a cached representation for a certain target.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @POST
@@ -401,9 +394,9 @@
     * 
     * @param externalId the external UUID of the annotation to be updated.
-    * @param annotation the {@link Annotation} object that represent the new annotation that should replace the annotation with "externalId".
+    * @param annotation the {@link Annotation} object representing the new annotation that should replace the annotation with "externalId".
     * @return the {@link ResponseBody} element that contains the xml element representing 
      * the updated annotation, and the list of action-elements representing the actions the client should care for,
      * e.g. add a cached representation for a certain target.
-     * @throws IOException if sending the error fails. 
+     * @throws IOException if sending an error fails. 
     */
     @PUT
@@ -459,5 +452,5 @@
     * @return the {@link ResponseBody} element that contains the xml element representing 
     * the updated annotation, and the list of action-elements representing the actions the client should care for.
-    * @throws IOException if sending the error fails.  
+    * @throws IOException if sending an error fails.  
     */
     @PUT
@@ -500,8 +493,8 @@
      * 
      * @param externalIdentifier the external UUID of the annotation whose headline is to be updated.
-     * @param newHeadline the string representing the new headline.
+     * @param newHeadline a new headline.
      * @return the {@link ResponseBody} element that contains the xml element representing 
      * the updated annotation, and the list of action-elements representing the actions the client should care for.
-     * @throws IOException if sending the error fails.  
+     * @throws IOException if sending an error fails.  
      */
     @PUT
@@ -546,8 +539,8 @@
     * @param annotationHeadline the annotation's headline.
     * @param access the new value for the public attribute of the annotation.
-    * @return the message if the database has been updated and how many rows have been updated;
+    * @return the message telling if the database has been updated and how many rows have been updated;
     * if "annotationDatabaseId" == null or empty then all the annotations with "annotationHeadline"
-    * must be updated,
-    * @throws IOException if sending the error fails.
+    * must be updated.
+    * @throws IOException if sending an error fails.
     */
     @POST
@@ -615,7 +608,7 @@
      * @param annotationExternalId the external UUID of an annotation.
      * @param principalExternalId the external UUID of a principal whose access mode to the annotation must be updated.
-     * @param access the access mode that should assigned to the principal.
+     * @param access the access mode that should be assigned to the principal.
      * @return the message about the amount of updated rows.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @PUT
@@ -637,5 +630,5 @@
 
     /**
-     * One of 3 principal-related parameters must be non-null and non-empty; one of 2 annotation related parameters must be non-null and non-empty.
+     * One of 3 principal-related parameters must be non-null and non-empty; one of 2 annotation-related parameters must be non-null and non-empty.
      * @param remoteID the remote ID of the principal whose access mode to the annotation (see below) must be updated.
      * @param fullName the full name of the principal whose access mode to the annotation must be updated.
@@ -645,5 +638,5 @@
      * @param access the new access mode.
      * @return the message explaining how many rows have been updated. 
-     * @throws IOException  if sending error message fails.
+     * @throws IOException  if sending an error fails.
      */
     @POST
@@ -738,5 +731,5 @@
      * the updated annotation, and the list of action-elements representing the actions the client should care for,
      * e.g. add the e-mail of a certain principal.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @PUT
@@ -781,6 +774,6 @@
      * @param annotationId the external UUID of the annotation.
      * @param principalId the external UUID of a principal whose access mode must be deleted.
-     * @return the amount of updated/removed rows in the database.
-     * @throws IOException if sending the error fails.
+     * @return the amount of removed rows in the database.
+     * @throws IOException if sending an error fails.
      */
     @DELETE
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java	(revision 6044)
@@ -35,6 +35,6 @@
 
 /**
- * REST class for GETting a logged in principal, log-in and log-out;
- * Every REST method in the case of successful completion of its action outputs the declared output type
+ * A REST class for GETting a logged in principal, log-in and log-out.
+ * Every REST method in the case of successful completion produces the object of the declared output type
  * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
  * @author olhsha
@@ -47,6 +47,6 @@
     /**
      * 
-     * @return the {@link Principal} object representing the current logged-on principal.
-     * @throws IOException if sending the error fails.
+     * @return the {@link Principal} object representing the current logged-in principal.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -84,5 +84,5 @@
     /**
      * 
-     * @throws IOException if sending redirect fails.
+     * @throws IOException if sending the redirect to logout page fails.
      */
     @GET
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java	(revision 6044)
@@ -52,7 +52,7 @@
 
 /**
- * REST class for GETting, POSTing and PUTting cached representations; 
- * DELETing cached representation is provided by TargetRsource class;
- * Every REST method in the case of successful completion of its action outputs the declared output type
+ * A REST class for GETting, POSTing and PUTting cached representations. 
+ * DELETing cached representation is provided by {@link TargetRsource} class.
+ * Every REST method in the case of successful completion produces an object of the declared output type
  * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
  * @author olhsha
@@ -63,17 +63,10 @@
 public class CachedRepresentationResource extends ResourceResource {
    
-    /**
-     * 
-     * @param request a {@link HttpServletRequest} object representing request; the set parameter is used in unit tests.
-     */
-    public void setHttpRequest(HttpServletRequest request) {
-        this.httpServletRequest = request;
-    }
-
-    /**
-     * 
-     * @param externalId the external UUID of a cached representations.
-     * @return a {@link CachedRepresentationInfo} representing the metadata for the cached representation with the "externalId".
-     * @throws IOException if sending the error fails.
+   
+    /**
+     * 
+     * @param externalId the external UUID of a cached representation.
+     * @return a {@link CachedRepresentationInfo} object representing the metadata for the cached representation with the "externalId".
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -112,5 +105,5 @@
      * @param externalId the external UUID of a cached representation.
      * @return the image-blob if the cached-representation's blob is an image file.
-     * @throws IOException if logging the error fails (should be changed to sending httpResponse error message).
+     * @throws IOException if logging an error fails (should be changed to sending httpResponse error message).
      */
     @GET
@@ -150,5 +143,5 @@
      * @param externalId the external UUID of a cached representation.
      * @return the cached-representation's blob.
-     * @throws IOException is sending the error fails.
+     * @throws IOException is sending an error fails.
      */
     @GET
@@ -180,8 +173,8 @@
     /**
      * 
-     * @param cachedIdentifier the external uuid of a cached representation.
-     * @param multiPart a {@link MultiPart} object containing two parts: a {@linkCachedRepresentationInfo} object for the cached-representation's metadata, and its blob.
-     * @return a message about how many rows in "cached_representation" table have been update; "1" if updated, and "0" otherwisee.
-     * @throws IOException if sending the error fails.
+     * @param cachedIdentifier the external UUID of a cached representation.
+     * @param multiPart a {@link MultiPart} object containing two parts: a {@link CachedRepresentationInfo} object for the cached-representation's metadata, and its blob.
+     * @return a message about how many rows in "cached_representation" table have been updated; "1" if updated, and "0" otherwisee.
+     * @throws IOException if sending an error fails.
      */
     @PUT
@@ -263,7 +256,7 @@
     /**
      * 
-     * @param cachedInfo a {@link CachedRepresentationInfo} representing the new metadata.
-     * @return a message about how many rows in "cached_representation" table, "1" if updated, "0" otherwise.
-     * @throws IOException if sending the error fails.
+     * @param cachedInfo a {@link CachedRepresentationInfo} object representing the new metadata.
+     * @return a message about how many rows in "cached_representation" table have been updated: "1" if updated, "0" otherwise.
+     * @throws IOException if sending an error fails.
      */
     @PUT
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/DebugResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/DebugResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/DebugResource.java	(revision 6044)
@@ -44,8 +44,8 @@
 
 /**
- * REST class for GETting information useful for debugging the back-end or a front-end;
- * Every REST method in the case of successful completion of its action outputs the declared output type
- * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise;
- * The class is used only by "admin" and "developer" principals; these account types are set in "principal" table.
+ * A REST class for GETting information useful for debugging the back-end or a front-end.
+ * Every REST method in the case of successful completion produces the object of the declared output type
+ * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
+ * The class is used only by "admin" and "developer" principals; these account types are set in the "principal" table.
  * @author olhsha
  */
@@ -69,7 +69,7 @@
     /**
      * 
-     * @return An {@link AnnotationInfoList}-element containing the list of {@link AnnotationInfo} objects of ALL the annotations,
+     * @return An {@link AnnotationInfoList}-element containing the list of {@link AnnotationInfo} elements of ALL the annotations,
      * with the latest (youngest) annotation on the top.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -98,5 +98,5 @@
      * @param n # of strings.
      * @return the latest n strings of the dasish database log file.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -135,5 +135,5 @@
     * @param n # of strings
     * @return the last n strings of the dasish server logger (non-SQL-request logs).
-    * @throws IOException if sending the error fails.
+    * @throws IOException if sending an error fails.
     */
     @GET
@@ -158,8 +158,8 @@
     /**
      * 
-     * @param principalId the external UUID of a principal whose account type must be updated,
+     * @param principalId the external UUID of a principal whose account type must be updated.
      * @param account the new account type (admin, developer, user). 
-     * @return a message if the account has been updated or not.
-     * @throws IOException if sending the error fails.
+     * @return a message telling if the account has been updated or not.
+     * @throws IOException if sending an error fails.
      */
     @PUT
@@ -194,6 +194,6 @@
      * @param oldExternalId the old external UUID of the resource.
      * @param newExternalId the new UUID of the resource
-     * @return the message if the "newExternalIdentifier" has replaced the "oldExternalIdentifier" or not,
-     * @throws IOException is sending the error fails.
+     * @return a message telling if the "newExternalIdentifier" has replaced the "oldExternalIdentifier" or not.
+     * @throws IOException is sending an error fails.
      */
     @PUT
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/GetThread.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/GetThread.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/GetThread.java	(revision 6044)
@@ -22,5 +22,5 @@
 
 /**
- * A helper class used by an "admin" or a "dedeloper" in "stress testing" method AnnotationResource.getAnnotationsMultithread(..)
+ * A helper class used by an "admin" or a "dedeloper" in "stress testing" method AnnotationResource.getAnnotationsMultithread(..). Check {@link AnnotationResource} class.
  * @author olhsha
  */
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/JaxbUnmarshallerFactory.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/JaxbUnmarshallerFactory.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/JaxbUnmarshallerFactory.java	(revision 6044)
@@ -29,5 +29,5 @@
 
 /**
- * Implemented to deserialise xml-elements into java objects, used to validate XML data.
+ * Implemented to deserialise xml-elements into java objects, used by JAXB, also to validate input XML files.
  * @author olhsha
  */
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/NotebookResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/NotebookResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/NotebookResource.java	(revision 6044)
@@ -47,8 +47,8 @@
 
 /**
- * REST interface for GETting, POSTing, PUTting and DELETing notebooks or their substructures (child elements);
- * Every REST method in the case of successful completion of its action outputs the declared output type
+ * A REST interface for GETting, POSTing, PUTting and DELETing notebooks or their substructures (child elements).
+ * Every REST method in the case of successful completion produces the object of the declared output type
  * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
- * @author Peter Withers <peter.withers@mpi.nl>, olhsha@mpi.nl
+ * @author olhsha@mpi.nl
  */
 @Component
@@ -65,5 +65,5 @@
     * @return the {@link NotebookInfoList} element containing the list of {@link NotebookInfo} elements
     * of all the notebooks to which the in-logged principal has "access" access.
-    * @throws IOException if sending the error fails.
+    * @throws IOException if sending an error fails.
     */
     @GET
@@ -87,5 +87,5 @@
      * 
      * @return the {@link ReferenceList} element containing the list of h-references of all the notebooks owned by the in-logged principal.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -105,9 +105,9 @@
      * 
      * @param externalIdentifier the external UUID identifier of a notebook.
-     * @param accessMode the access mode on which principals must be filtered, 
+     * @param accessMode the access mode on which principals must be filtered; 
      * can be "none", "read", "write", "all".
      * @return a {@link ReferenceList} element representing the list of h-references of the
-     * principal that have access "accessMode"
-     * @throws IOException if sending the error fails.
+     * principals that have access "accessMode".
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -140,7 +140,7 @@
    * 
    * @param externalIdentifier the external UUID identifier of a notebook.
-   * @return a {@link Notebook} element built up on the whole information 
-   * ("notebook" table and the corresponding junction tables) for the notebook with "externalIdentifier".
-   * @throws IOException if sending the error fails.
+   * @return a {@link Notebook} element representing the notebook with "externalIdentifier"; built up on the whole information 
+   * (the "notebook" table and the corresponding junction tables) for the notebook with "externalIdentifier".
+   * @throws IOException if sending an error fails.
    */
     
@@ -174,14 +174,13 @@
     /**
      * 
-     * @param externalIdentifier the external UUID identifier of a notebook.
-     * @param maximumAnnotations the maximum amount of annotations from this notebook to output
+     * @param externalIdentifier the external UUID of a notebook.
+     * @param maximumAnnotations the maximum amount of annotations from this notebook to output;
      * if the amount of annotations in the notebook is more than  (startAnnotations-1) + maximumAnnotations,
-     * then exactly maximumAnnotations will be output, otherwise  the amount of annotations of 
-     * output is limited by "# of annotations in the notebook" - startAnnotation
+     * then exactly maximumAnnotations will be output, otherwise  the amount of annotations is limited by "# of annotations in the notebook" - (startAnnotation-1)
      * @param startAnnotations the index of the first annotation, min value is "1". 
      * @param orderBy the field in the table "notebook" on which annotations must be ordered.
      * @param desc if true then the annotations in the list must be ordered in descending order, otherwise in ascending order.
-     * @return a {@link ReferenceList} element representing the list of (maximum) maximumAnnotations
-     * @throws IOException if sending the error fails.
+     * @return a {@link ReferenceList} element representing the list of annotations filtered according to the parameters.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -222,6 +221,6 @@
      * @param notebookInfo the fresh {@link NotebookInfo} object.
      * @return a {@link ResponseBody} element containing the just updated {@link Notebook} element
-     * and the list of actions, which are not yet specified for the notebooks.
-     * @throws IOException if sending the error fails.
+     * and the list of actions (which are not yet specified for the notebooks).
+     * @throws IOException if sending an error fails.
      */
     @PUT
@@ -229,5 +228,5 @@
     @Produces(MediaType.APPLICATION_XML)
     @Path("{notebookid: " + BackendConstants.regExpIdentifier + "}")
-    public JAXBElement<ResponseBody> updateNotebookInfo(@PathParam("notebookid") String externalIdentifier, NotebookInfo notebookInfo) throws IOException, HTTPException {
+    public JAXBElement<ResponseBody> updateNotebookInfo(@PathParam("notebookid") String externalIdentifier, NotebookInfo notebookInfo) throws IOException{
         Number remotePrincipalID = this.getPrincipalID();
         if (remotePrincipalID == null) {
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/PrincipalResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/PrincipalResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/PrincipalResource.java	(revision 6044)
@@ -53,6 +53,6 @@
 
 /**
- * REST class for GETting, POSTing, PUTting and DELETing principals or their substructures (child elements);
- * Every REST method in the case of successful completion of its action outputs the declared output type
+ * A REST class for GETting, POSTing, PUTting and DELETing principals or their substructures (child elements).
+ * Every REST method in the case of successful completion produces an object of the declared output type
  * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
 * @author olhsha
@@ -65,13 +65,5 @@
     int shaStrength = 512;
 
-    
-    /**
-     * 
-     * @param request a {@link HttpServletRequest} object; set object is used in unit tests.
-     */
-    public void setHttpRequest(HttpServletRequest request) {
-        this.httpServletRequest = request;
-    }
-
+ 
     public PrincipalResource() {
     }
@@ -81,5 +73,5 @@
      * @param externalIdentifier the external UUID of a principal.
      * @return the {@link Principal} element representing the principal object with the "externalIdentifier".
-     * @throws IOException is sending the error fails.
+     * @throws IOException is sending an error fails.
      */
     @GET
@@ -113,6 +105,6 @@
     /**
      * 
-     * @return a message containing the fill name and the e-mail of the admin.
-     * @throws IOException if sending the error in the call of "this.getPrincipalID()".
+     * @return a message containing the full name and the e-mail of the admin.
+     * @throws IOException if sending an error in the call of "this.getPrincipalID()" fails.
      */
     @GET
@@ -130,8 +122,8 @@
    /**
     * 
-    * @param email a string representing the e-mail of a principal.
+    * @param email the e-mail of a principal.
     * @return a {@link Principal} representing the principal with the "email", 
     * if such a principal is found; otherwise "SC_NOT_FOUND" error is sent.
-    * @throws IOException if sending the error fails.
+    * @throws IOException if sending an error fails.
     */
     @GET
@@ -168,8 +160,8 @@
      * @return a {@link CurrentPrincipalInfo} element containing "true" if the principal 
      * with externalIdentifier is logged-in in this session; 
-     * withe the current implementation does not make that much sense for me,
+     * with the current implementation does not make that much sense for me,
      * because the logged-in user knows his/her externalIDdentifier and knows that the other UUIDs
-     * will be "not logged in", and therefore "false" is expected,
-     * @throws IOException if sending the error fails.
+     * will be "not logged in", and therefore "false" is expected.
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -261,7 +253,7 @@
      * @param remoteId the  remote id of the principal to be registered.
      * @param password the password selected by the principal to be registered.
-     * @param email an email of the principal to be registered.
-     * @return a @Link Principal} element representing the just registered principal.
-     * @throws IOException if sending the error fails.
+     * @param email the email of the principal to be registered.
+     * @return a {@link Principal} element representing the just registered principal.
+     * @throws IOException if sending an error fails.
      */
     @POST
@@ -310,9 +302,9 @@
     /**
      * 
-     * @param name the name of the principal to be registered
+     * @param name the name of the principal to be registered.
      * @param remoteId the remote shibboleth id.
      * @param email the email.
-     * @return a @Link Principal} element representing the just registered principal.
-     * @throws IOException if sending the error fails.
+     * @return a {@link Principal} element representing the just registered principal.
+     * @throws IOException if sending an error fails.
      */
     @POST
@@ -353,5 +345,5 @@
 
     /**
-     * It is of a good convenience method limiting proliferation of user profiles, however
+     * It is a convenience method limiting proliferation of user profiles, however
      * the method is currently not used till security issues will be discussed with the LAT 
      * system administrators.
@@ -359,6 +351,6 @@
      * @param password a shibboleth password which will be set as a basic-authentication password.
      * @return a message about amount of records; which must be 2 if everything goes well: 
-     * 1 record for the principal, another for the authorities table
-     * @throws IOException if sending the error fails.
+     * 1 record for the "principal" table, 1is for the "authorities" tabl.
+     * @throws IOException if sending an error fails.
      */
     @POST
@@ -381,7 +373,7 @@
      * 
      * @param principal a {@link Principal} object representing new information (name, e-mail) about the principal 
-     * with the eternal UUID given in the object,
-     * @return a @Link Principal} element representing the just updated principal.
-     * @throws IOException if sending the error message fails.
+     * with the eternal UUID given in the object.
+     * @return a {@link Principal} element representing the just updated principal.
+     * @throws IOException if sending an error message fails.
      */
     @PUT
@@ -418,9 +410,9 @@
      * 
      * @param name a new full name.
-     * @param email a new email
-     * @return a @Link Principal} element representing the just updated principal.
-     * @throws IOException if sending the error fails.
+     * @param email a new email.
+     * @return a {@link Principal} element representing the just updated principal.
+     * @throws IOException if sending an error fails.
      * @throws NotInDataBaseException if the in-logged principal is not found in the database
-     * or updated fails.
+     * or update fails.
      */
     @POST
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ProjectInfoResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ProjectInfoResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ProjectInfoResource.java	(revision 6044)
@@ -41,5 +41,5 @@
      * 
      * @return a message string containing the number of the version of the backend.
-     * @throws IOException if getting a principal or sending the error fails.s
+     * @throws IOException if getting a principal or sending an error fails.
      */
     @GET
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/RequestWrappers.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/RequestWrappers.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/RequestWrappers.java	(revision 6044)
@@ -33,6 +33,6 @@
 
 /**
- * Different requests for different resources still have some steps in common and therefore
- * can be wrapped in a class whose higher-order methods performs the common steps and then call 
+ * Different requests for different resources have some steps in common and therefore
+ * can be wrapped in a class whose higher-order methods perform the common steps and then call 
  * the methods performing the specific part; the specific-part object is passed as a parameter.
  * @author olhsha
@@ -48,5 +48,5 @@
     /**
      * Set the instance of a specific REST class.
-     * @param resourceResource 
+     * @param resourceResource a {@link ResourceResource} object representing one of the rest resource classes of this package.
      */
     public RequestWrappers(ResourceResource resourceResource) {
@@ -59,5 +59,5 @@
      * @param resource a type of resource: "annotation", "principal", "cached representation", "notebook", "target".
      * @param action a string naming the action that should have been performed.
-     * @return 
+     * @return a string representing a tuned error message.
      */
     public String FORBIDDEN_RESOURCE_ACTION(String identifier, String resource, String action) {
@@ -70,5 +70,5 @@
      * @param dbRequestor the object that will be performing the specific part of the request ("continuation").
      * @return the requested resource.
-     * @throws IOException if sending error message fails in the called methods.
+     * @throws IOException if sending an error fails in the called methods.
      * @throws NotInDataBaseException if thrown by the specific part of the request.
      * @throws ForbiddenException if the action is forbidden for the inlogged user.
@@ -87,9 +87,9 @@
      * @param params list of parameters that will be used by a specific part of the request (in "the continuation").
      * @param dbRequestor the object that will be performing the specific part of the request ("continuation").
-     * @param resource a {@link Resource} object, representing the type of a resource  "annotation", "principal", "cached representation", "notebook", "target".
+     * @param resource a {@link Resource} object, representing the type of a resource:  "annotation", "principal", "cached representation", "notebook", "target".
      * @param action an {@link Access} object representing the type ("mightiness")  of the action.
      * @param externalId the external UUID of the resource.
      * @return the resource.
-     * @throws IOException if sending error message fails in the called methods.
+     * @throws IOException if sending an error fails in the called methods.
      * @throws NotInDataBaseException if thrown by the specific part of the request.
      * @throws ForbiddenException if the action is forbidden for the inlogged user.
@@ -120,8 +120,8 @@
      * @param dbRequestor the object that will be performing the specific part of the request ("continuation").
      * @return a {@link Principal} element.
-     * @throws IOException if sending error message fails in the called methods.
+     * @throws IOException if sending an error fails in the called methods.
      * @throws NotInDataBaseException if thrown by the specific part of the request.
      * @throws PrincipalExists if a principal with the given e-mail or name is already exist in the database
-     * (thrown if the request is to add or update a principal)
+     * (can be sthrown if the request is to add or update a principal).
      */
     public JAXBElement<Principal> wrapAddPrincipalRequest(Map params, ILambdaPrincipal<Map, Principal> dbRequestor) throws IOException, NotInDataBaseException, PrincipalExists {
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ResourceResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ResourceResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ResourceResource.java	(revision 6044)
@@ -34,6 +34,6 @@
 
 /**
- * This class is a super-class of any [SpecificPart]Resource of this REST package and contains the methods
- * and field common for each of them.
+ * This class is a super-class of any [SpecificPart]Resource class of this package and contains the methods
+ * and fields common for each of them.
  * @author olhsha
  */
@@ -60,5 +60,5 @@
      * @return the internal database id of the logged in principal if the authentication went well,
      * otherwise sends a corresponding error message.
-     * @throws IOException  if sending the error fails.
+     * @throws IOException  if sending an error fails.
      */
     public Number getPrincipalID() throws IOException {
@@ -101,13 +101,17 @@
     
    
-
-    protected void ADMIN_RIGHTS_EXPECTED() throws IOException {
+  
+    protected void ADMIN_RIGHTS_EXPECTED(){
         loggerServer.debug("The request can be performed only by the principal with the admin rights.");
     }
 
-    protected void INVALID_ACCESS_MODE(String accessMode) throws IOException {
+    protected void INVALID_ACCESS_MODE(String accessMode) {
         loggerServer.debug(accessMode + " is an invalid access value, which must be either owner, or read, or write.");
     }
     
+    /**
+     * 
+     * @return concatenation of the context-path and servlet-path.
+     */
     protected String getRelativeServiceURI(){
         return httpServletRequest.getContextPath()+httpServletRequest.getServletPath();
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java	(revision 6043)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java	(revision 6044)
@@ -36,5 +36,4 @@
 import java.util.Map;
 import java.util.UUID;
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.ws.rs.Consumes;
@@ -49,13 +48,11 @@
 import javax.xml.bind.JAXBElement;
 import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.ws.http.HTTPException;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
- * REST class for GETting, POSTing, PUTting and DELETing targets or their substructures (child elements);
- * Every REST method in the case of successful completion of its action outputs the declared output type
+ * A REST class for GETting, POSTing, PUTting and DELETing targets or their substructures (child elements).
+ * Every REST method in the case of successful completion produces the object of the declared output type
  * (a JAXB-element or a message string) or sends a HTTP-error with the corresponding diagnostics otherwise.
-
  * @author olhsha
  */
@@ -66,12 +63,4 @@
 public class TargetResource extends ResourceResource {
 
-    /**
-     * Sets {@link HttpServletRequest} object, to be used in unit tests.
-     * @param request  a @link HttpServletRequest} object to be set.
-     */
-    public void setHttpRequest(HttpServletRequest request) {
-        this.httpServletRequest = request;
-    }
-
     public TargetResource() {
     }
@@ -79,5 +68,5 @@
     /**
      * 
-     * @param externalIdentifier the external UUId of the target.
+     * @param externalIdentifier the external UUId of a target.
      * @return a {@link Target} element representing a target object with "externalIdentifier".
      * @throws IOException if sending an error fails.
@@ -117,7 +106,7 @@
      * 
      * @param externalIdentifier the external UUID of a target.
-     * @return a {@link ReferenceList} element representing the list of he-references of the targets that 
-     * refer to the same link.
-     * @throws IOException if sending the error fails.
+     * @return a {@link ReferenceList} element representing the list of h-references of the targets that 
+     * refer to the same link as the target with "externalIdentifier".
+     * @throws IOException if sending an error fails.
      */
     @GET
@@ -157,9 +146,9 @@
      * @param fragmentDescriptor a string representing the location of the target within the cached-representation's content.
      * @param multiPart a {@link MultiPart} object representing two-part request body, containing the cached representation metadata 
-     * ({@link CachedRepresentationInfo} element} and a blob for a cached representation content.
+     * {@link CachedRepresentationInfo} element} and a blob for a cached representation content.
      * @return a {@link CachedRepresentationInfo} element containing the metadata of the just added cached representation;
      * the difference with the input metadata is that a persistent external UUID is assigned, and the last-updated
      * attribute is changed.
-     * @throws IOException  if sending the error fails.
+     * @throws IOException  if sending an error fails.
      */
     @POST
@@ -215,5 +204,5 @@
      * @param cachedIdentifier the external UUID of a cached representation.
      * @param fragmentDescriptor the new fragment descriptor locating the target within the cached representation. 
-     * @return a message about the updated; should be "1 row is updated" in a case of success.
+     * @return a message about the # of updated rows; should be "1 row is updated" in a case of success.
      * @throws IOException if sending an error fails.
      */
@@ -251,5 +240,5 @@
      * @return a message reporting how deletion went; in the case of success it tells 
      * how many pairing (target, cached) have been deleted.
-     * @throws IOException if sending the error fails.
+     * @throws IOException if sending an error fails.
      */
     @DELETE
