Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambda.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambda.java	(revision 6003)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambda.java	(revision 6004)
@@ -22,9 +22,17 @@
 
 /**
- *
+ * This is a help interface used in wrapper methods for REST requests, see RequestWrappers.java;
+ * "R" may stay for resource, e.g. Annotation.
  * @author olhsha
  */
 public interface ILambda<Map, R> {
     
+    /**
+     * 
+     * @param params list of pairs parameter->value, e.g. such map can contain the external Id of a resource, e.g. an annotation.
+     * @return an instance of "R" corresponding to these parameter values,e.g. an annotation if R is instantiated as "Annotation".
+     * @throws NotInDataBaseException see various implementations in REST resource classes.
+     * @throws ForbiddenException see various implementations in REST resource classes.
+     */
     public R apply(Map params)   throws NotInDataBaseException, ForbiddenException;
     
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambdaPrincipal.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambdaPrincipal.java	(revision 6003)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambdaPrincipal.java	(revision 6004)
@@ -22,9 +22,16 @@
 
 /**
- *
+ * This is a help interface used in wrapper methods for REST requests, see RequestWrappers.java;
  * @author olhsha
  */
 public interface ILambdaPrincipal<Map, R> {
     
+    /**
+     * 
+     * @param params list of pairs parameter -> value.
+     * @return the object corresponding to the parameter values from the "params".
+     * @throws NotInDataBaseException see the implementations.
+     * @throws PrincipalExists  see the implementations
+     */
     public R apply(Map params)   throws NotInDataBaseException, PrincipalExists;
     
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/NotebookDao.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/NotebookDao.java	(revision 6003)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/NotebookDao.java	(revision 6004)
@@ -43,11 +43,25 @@
   **/
     
+    /**
+     * 
+     * @param notebookID the internal ID of a notebook.
+     * @return the internal database Id of the owner of the notebook.
+     */
     Number getOwner(Number notebookID);
     
     
-    
+    /**
+     * 
+     * @param principalID the internal database id of some principal.
+     * @param acessMode {@link Access} object, representing one of the access modes: 
+     * "all", "write", "read" or "none".
+     * @return the list of internal database id's of the notebooks for which "principalID" has ""accessMode" access.
+     */
     List<Number> getNotebookIDs(Number principalID, Access acessMode);
     
-    // Returns a list of notebook Ids for the notebooks for which the given principal "principalID" is the owner.
+   /** 
+    * @param principaID the internal database id of some principal.
+    * @return  the list of internal database id's of the notebooks for which "principalID" is the owner.
+    */
     List<Number> getNotebookIDsOwnedBy(Number principaID);
     
@@ -56,6 +70,7 @@
     /**
      * 
-     * @param notebookID
-     * @return the notebook info for the notebook with notebookID
+     * @param notebookID the internal database id of a notebook.
+     * @return the {@link NotebookInfo} object built for the notebook with notebookID upon the corresponding row
+     * in the "notebook" table.
      */
     NotebookInfo getNotebookInfoWithoutOwner(Number notebookID);
@@ -64,6 +79,7 @@
     /**
      * 
-     * @param notebookID
-     * @return notebook metadata for the notebook with notebookID
+     * @param notebookID the internal database id of a notebook.
+     * @return the {@link Notebook} object built for the notebook with notebookID upon the corresponding row
+     * in the "notebook" table.
      */
     Notebook getNotebookWithoutAnnotationsAndAccesssAndOwner(Number notebookID);
@@ -81,13 +97,30 @@
     
     
-    /**
-     * 
-     * @param notebookID
-     * @return true if updated, false otherwise. Logs the reason if the notebook is not updated.
+
+    /**
+     * 
+     * @param notebookID the internal database id of a notebook.
+     * @param title a new title for the notebook.
+     * @param ownerID the internal database id of the owner principal of the notebook.
+     * @return true if the title "notebookID" is updated to "title", false otherwise.
      */
     boolean updateNotebookMetadata(Number notebookID, String title, Number ownerID);
     
+    
+    /**
+     * 
+     * @param notebookID the internal database id of a notebook.
+     * @param ownerID the internal database id of a new owner for the notebook.
+     * @return true if the owner_id is in "notebook" table is updated to "ownerID", false otherwise.
+     */
     boolean setOwner(Number notebookID, Number ownerID);
     
+    /**
+     * 
+     * @param notebookID the internal database id of a notebook.
+     * @param principalID the internal database id of a principal.
+     * @param access an {@link Access} object.
+     * @return true iff the access mode to "notebookID" for "principalID" has been assigned to "access"'s value.
+     */
     boolean updatePrincipalAccessForNotebook(Number notebookID, Number principalID, Access access);
     
@@ -99,8 +132,30 @@
      */
     
+    /**
+     * 
+     * @param notebook the {@link Notebook} object representing a notebook to be created in the database.
+     * @param ownerID the internal database id of the owner principal.
+     * @return the internal id of the created notebook.
+     * @throws NotInDataBaseException if creation the notebook fails. 
+     */
     public Number createNotebookWithoutAccesssAndAnnotations(Notebook notebook, Number ownerID) throws NotInDataBaseException;
     
+    /**
+     * 
+     * @param notebookID the internal database ID of a notebook.
+     * @param annotationID the internal database ID of an annotation.
+     * @return  true if the row for the (ntebookID,annotationID) has been added to the junction table 
+     * "notebooks_annotations".
+     */
     boolean addAnnotationToNotebook(Number notebookID, Number annotationID);
     
+    /**
+     * 
+     * @param notebookID the internal database ID of a notebook.
+     * @param principalID the internal database ID of a principal.
+     * @param access access an {@link Access} object.
+     * @return true iff the "access" mode to "notebookID" has been assigned for "principalID" 
+     * in the corresponding junction table.
+     */
     boolean addAccessToNotebook(Number notebookID, Number principalID, Access access);
     
@@ -114,12 +169,40 @@
      */
     
+    /**
+     * 
+     * @param notebookID the internal database ID of a notebook.
+     * @param annotationID annotationID the internal database ID of an annotation.
+     * @return  true iff the row for the (notebookID,annotationID) has been deleted from the junction table 
+     * "notebooks_annotations".
+     */
     boolean deleteAnnotationFromNotebook(Number notebookID, Number annotationID);
     
+    /**
+     * 
+     * @param notebookID the internal database ID of a notebook.
+     * @return true iff all the rows with "notebookID" have been removed from "notebooks_annotations" table.
+     */
     boolean deleteAllAnnotationsFromNotebook(Number notebookID);
     
+    /**
+     * 
+     * @param notebookID the internal database ID of a notebook.
+     * @param principalID the internal database ID of a principal.
+     * @return true iff the row for the pair (notebookID, principlaID) has been removed from the "notebooks_principals_accesses" table.
+     */
     boolean deleteNotebookPrincipalAccess(Number notebookID, Number principalID);
     
+    /**
+     * 
+     * @param notebookID the internal database ID of a notebook.
+     * @return true iff all the rows with "notebookID" have been removed from from the "notebooks_principals_accesses" table.
+     */
     boolean deleteAllAccesssForNotebook(Number notebookID);
     
+    /**
+     * 
+     * @param notebookID the internal database ID of a notebook.
+     * @return true iff the notebook with "notebookID" has been removed from the "notebook" table.
+     */
     boolean deleteNotebook(Number notebookID);
 }
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/PrincipalDao.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/PrincipalDao.java	(revision 6003)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/PrincipalDao.java	(revision 6004)
@@ -32,39 +32,137 @@
 public interface PrincipalDao extends ResourceDao{
     
+    
+    /**
+     * 
+     * @param internalID the internal database ID of a principal.
+     * @return the {@link Principal} object with the internal database id "internalID".
+     */
      public Principal getPrincipal(Number internalID);
      
+     /**
+      * 
+      * @param eMail an e-mail string.
+      * @return the {@link Principal} object with th e-mail "email".
+      * @throws NotInDataBaseException, if such a principal is not found.
+      */
      public Principal getPrincipalByInfo(String  eMail) throws NotInDataBaseException;
      
+     /**
+      * 
+      * @return  the internalID of a principal who is the admin of the data base (the first admin in the list of admins).
+      */
      public Number getDBAdminID();
      
-     // where is it used?
+    /**
+     * 
+     * @param principalID the internal database id of a principal.
+     * @return true iff "principalID" occurs in one of the junction tables.
+     */
      public boolean principalIsInUse(Number principalID);
      
-     // where is it used??
+     /**
+      * 
+      * @param remoteID the string representing the remote id of a principal.
+      * @return true iff a principal with "remoteID" exists in the table "principal".
+      */
      public boolean principalExists(String remoteID);
      
+     /**
+      * 
+      * @param internalID the internal database id of a principal.
+      * @return the type of a principal account: admin, developer, user.
+      */
      public String getTypeOfPrincipalAccount(Number internalID);
      
+     /**
+      * 
+      * @param internalID the internal database id of a principal.
+      * @return the string representing the remote id of the principal.
+      */
      public String getRemoteID(Number internalID);
      
      
+     /**
+      * 
+      * @param remoteID the string representing the remote id of a principal.
+      * @return the interna ld database id of the principal with "remotedID".
+      * @throws NotInDataBaseException if there is no principal with "remoteID".
+      */
      public Number getPrincipalInternalIDFromRemoteID(String remoteID) throws NotInDataBaseException;
      
+     /**
+      * 
+      * @param remoteID the string representing the remote id of a principal.
+      * @return the external UUID of the principal with "remotedID".
+      * @throws NotInDataBaseException  if there is no principal with "remoteID".
+      */
      public UUID getPrincipalExternalIDFromRemoteID(String remoteID) throws NotInDataBaseException;
      
+     /**
+      * 
+      * @param fullName the string representing the full name of a principal.
+      * @return the external UUID of the principal with "fullName.
+      * @throws NotInDataBaseException if there is no principal with "fullName".
+      */
      public UUID getExternalIdFromName(String fullName) throws NotInDataBaseException;
      
+     /**
+      * 
+      * @param notebookID the internal database id of a notebook.
+      * @param access an {@link Access} object. 
+      * @return  the list of internal database ids of the principals which have access "access"-value
+      * for the "notebookID".
+      */
      public List<Number> getPrincipalIDsWithAccessForNotebook(Number notebookID, Access access);
      
+  /**
+   * 
+   * @param externalID the external UUID of a principal.
+   * @param account a string representing the type of an account: admin, developer, user.
+   * @return true, if the account of "externalId" has been updated to "account".
+   * @throws NotInDataBaseException iff no principal with "externalId" is found.
+   */
      public boolean updateAccount(UUID externalID, String account) throws NotInDataBaseException;
      
+     /**
+      * 
+      * @param principal a {@link Principal} object which must update the principal referred by "externakId" given in this object.
+      * @return the internal id of a principal which has been updated.
+      * @throws NotInDataBaseException if principal with the externalId given in the "principal" is not found.
+      */
      public Number updatePrincipal(Principal principal) throws NotInDataBaseException;
     
+     /**
+      * 
+      * @param principal a {@link Principal} object to be added to the database.
+      * @param remoteID a string representing the remote of of the principal to be added.
+      * @return the internal id of the just added principal.
+      * @throws NotInDataBaseException if adding the principal fails.
+      */
      public Number addPrincipal(Principal principal, String remoteID) throws NotInDataBaseException;
      
+     /**
+      * 
+      * @param username the name of a user for spring basic authentication.
+      * @param password a password of a user for spring authentication.
+      * @param strength the strength of a password.
+      * @param salt 
+      * @return a number of added rows in "users" table; must be 1 of the user is added.
+      */
      public int addSpringUser(String username, String password, int strength, String salt);
      
+     /**
+      * 
+      * @param username the name of a user for spring basic authentication.
+      * @return the amount of rows added o "authorities" tables; "1" if "username" is added with the default "ROLE_USER"; 0 otherwise.
+      */
      public int addSpringAuthorities(String username);
      
+     /**
+      * 
+      * @param intenralID the internal ID of a principal to be deleted,
+      * @return the amount f deleted rows; "1" if deleted, "0" otherwise.
+      * @throws PrincipalCannotBeDeleted if the principal is in use, i.e. mentioned in one of the junction tables.
+      */
      public int deletePrincipal(Number intenralID) throws PrincipalCannotBeDeleted;
      
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ResourceDao.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ResourceDao.java	(revision 6003)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ResourceDao.java	(revision 6004)
@@ -25,29 +25,68 @@
 
 /**
- *
+ * This interfaces describes signatures common for all resources: Annotation, Target, Cached Representation, Principal, Notebook;
+ * the implementation must contain field "resourceTableName" whose value is one of the five names of resource tables:
+ * "annotation", "target", "cached_representation", "principal", "notebook".
  * @author olhsha
  */
 public interface ResourceDao {
 
+    /**
+     * 
+     * @param relResourcePath a string, representing "[relative-servise-url]/[resource]", e.g. "my-servlet/annotations".
+     */
     void setResourcePath(String relResourcePath);
 
+    /**
+     * 
+     * @param externalId the external UUId of a resource. 
+     * @return the internal ID of the resource.
+     * @throws NotInDataBaseException if the resource with this id is not found.
+     */
     Number getInternalID(UUID externalId) throws NotInDataBaseException;
 
+    /**
+     * 
+     * @param internalId the internal ID of the resource.
+     * @return  the external UUID of the resource. 
+     */
     UUID getExternalID(Number internalId);
 
+    /**
+     * 
+     * @param oldIdentifier the current external UUId of a resource.
+     * @param newIdentifier the new external ID of the resource.
+     * @return true iff the external id of the resource have been updated to the value of "newIDentifier".
+     */
     boolean updateResourceIdentifier(UUID oldIdentifier, UUID newIdentifier);
   
     /**
      *
-     * @param internalID
-     * @return URI string of the resource )of the type set in resourceTableName)
-     * with internalID
+     * @param internalID the internal databaseID of the resource.
+     * @return the hyper-reference string of the resource with "internalID". 
      */
     String getHrefFromInternalID(Number internalID);
     
+    /**
+     * 
+     * @param href the hyper-reference of a resource.
+     * @return  the internal ID of the resource with "href".
+     * @throws NotInDataBaseException if the resource with ""href" is not found in the corresponding database.
+     */
     Number getInternalIDFromHref(String href)  throws NotInDataBaseException;
 
+    /**
+     * 
+     * @param resourceID the internal database id of a resource.
+     * @return mapping "principal internal id" -> "access" for a given "resourceID"; 
+     * till now makes sense only for annotations and notebooks.
+     */
     List<Map<Number, String>> getPermissions(Number resourceID);
 
+    /**
+     * 
+     * @param resourceID the internal database id of a resource.
+     * @return the public access mode for "resourceID"; till now makes sense only for annotations and notebooks.
+     */
     Access getPublicAttribute(Number resourceID);
     
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/TargetDao.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/TargetDao.java	(revision 6003)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/TargetDao.java	(revision 6004)
@@ -37,6 +37,6 @@
     /**
      *
-     * @param inernalID
-     * @return the Target with the intrenal Id "internalID".
+     * @param inernalID the internal database id of a target.
+     * @return the {@link Target} object with the intrenal Id "internalID".
      */
     public Target getTarget(Number internalID);
@@ -44,7 +44,6 @@
     /**
      *
-     * @param targets
-     * @return the list of TargetInfo objects corresponding to the Targets with
-     * the internalIds from the list "Targets".
+     * @param targets the list of internal database ids of targets.
+     * @return the list of {@link TargetInfo} objects corresponding to the targets with the internalIds from the list "targets".
      */
     public List<TargetInfo> getTargetInfos(List<Number> targets);
@@ -52,7 +51,6 @@
     /**
      *
-     * @param targetID
-     * @return the list of pairs (cached_representation_id, fragment_descriptor)
-     * for the target with the internal ID "targetID".
+     * @param targetID the internal database id of a target.
+     * @return the list of pairs "cached_representation_id -> fragment_descriptor" for the target with the internal ID "targetID".
      */
     public Map<Number, String> getCachedRepresentationFragmentPairs(Number targetID);
@@ -62,6 +60,6 @@
     /**
      *
-     * @param targetID
-     * @return The link (uri) to the source to which the target refers
+     * @param targetID the internal database id of a target.
+     * @return The link (uri) to the source to which the target refers.
      */
     public String getLink(Number targetID);
@@ -69,9 +67,14 @@
     /**
      *
-     * @param link
-     * @return the list of Target ID's which link-fields is exactly "link"
+     * @param link a string representing a link (uri) to a target source.
+     * @return the list of internal database target ID's whose link-fields is exactly "link".
      */
     public List<Number> getTargetsForLink(String link);
 
+  /**
+   * 
+   * @param cachedID the internal database id of a cached representation.
+   * @return true iff "cachedID" is referred to for some target in "targets_cached_representations" table.
+   */
     boolean cachedIsInUse(Number cachedID);
 
