Changeset 6042 for DASISH


Ignore:
Timestamp:
02/24/15 16:08:22 (9 years ago)
Author:
olhsha@mpi.nl
Message:

Javadoc annotations are revised for "eu.daish.annotation.backend" and "eu.daish.annotation.backend.dao" packages.

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/MatchMode.java

    r5686 r6042  
    1919
    2020/**
    21  *
     21 * Represents four relations of a string X (e.g a target-source's link) to a string Y (e.g an input string fragment);
     22 * for instance X STARTS_WITH Y.
    2223 * @author olhsha
    2324 */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/MyResource.java

    r4603 r6042  
    2323import javax.ws.rs.Produces;
    2424
    25 /** Example reTarget class hosted at the URI path "/myreTarget"
     25/** Example resource class hosted at the URI path "/myresource"
    2626 */
    2727@Path("/myresource")
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/Resource.java

    r4603 r6042  
    1919
    2020/**
    21  *
     21 * Represents five kinds of DASISH resources: a principal, an annotation, a target, a cached representation and a notebook.
    2222 * @author olhsha
    2323 */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/AnnotationDao.java

    r5998 r6042  
    2828
    2929/**
    30  * Created on : Jun 27, 2013, 10:34:13 AM
    31  *
    32  * @author Peter Withers <peter.withers@mpi.nl>
     30 * @author olhsha@mpi.nl
    3331 */
    3432
     
    5755     *
    5856     * @param annotationID the internal (database) identifier of an annotation.
    59      * @return the {@link Annotation} object whose fields are filled in partially,
     57     * @return the {@link Annotation} object whose fields are filled partially,
    6058     * only with the information accessible from the table "annotation".
    61      * Constructing a complete {@link Annotation} object is done in the implementation of {@link DBDispatchter}.)
     59     * Constructing a complete {@link Annotation} object is done in the implementation of {@link DBDispatcher}.
    6260     */
    6361    public Annotation getAnnotationWithoutTargetsAndPemissionList(Number annotationID);
     
    6664     *
    6765     * @param ownerID the owner of annotations we search for; if null then the owner may be any.
    68      * @param text the text fragment which must occur in an annotation-body; if null, the now requirements on the annotation body.
     66     * @param text the text fragment which must occur in an annotation-body; if null, then no requirements on the annotation body.
    6967     * @param namespace (search on the parameter is not implemented).
    7068     * @param after the earliest time of creating/last-update of annotations; if null then search "from the beginning of time".
    7169     * @param before the latest time of creating/last-update of annotations; if null then search "till now".
    72      * @return the list of annotation internal database identifiers that satisfy the criteria defined by the parameters.
     70     * @return the list of the internal database identifiers of the annotations that satisfy the criteria defined by the parameters.
    7371     */
    7472    public List<Number> getFilteredAnnotationIDs(Number ownerID, String text, String namespace, String after, String before);
     
    7674    /**
    7775     *
    78      * @param principalID the internal database ID of a principal (user or, in general, a group).
    79      * @param acess access level (none, read, write, all).
    80      * @return the list of internal (database) annotation identifiers to which "principalID" has access at least "acess".
    81      * For instance, on access==write, the method should output id-s of the annotations to which user has "write" (update bodies),
    82      * or "all" access, according to the junction table "annotations-principals-acesses".
    83      */
    84     public List<Number> getAnnotationIDsPermissionAtLeast(Number principalID, Access acess);
    85    
    86     /**
    87      *
    88      * @param access the value of public assess of an annotation.
    89      * @return The list of internal (database identifiers to which public has at least "access" access;
     76     * @param principalID the internal database ID of a principal (a user or, in general, a group).
     77     * @param access an {@link Access} object representing an access level (none, read, write, all).
     78     * @return the list of the internal (database) identifiers of annotations to which "principalID" has access at least "acess".
     79     * For instance, if access' value is Access.WRITE, the method should output id-s of the annotations to which user has "write" (update bodies),
     80     * or "all" access, according to the junction table "annotations-principals-accesses".
     81     */
     82    public List<Number> getAnnotationIDsPermissionAtLeast(Number principalID, Access access);
     83   
     84    /**
     85     *
     86     * @param access an {@link Access} object representing  the public assess level of an annotation.
     87     * @return The list of the internal database identifiers of annotations for which "public" attribute has at least "access" access;
    9088     * for instance on "write" the method should output annotations
    9189     * whose "public" value is "write" or "all".
     
    9795    /**
    9896     *
    99      * @return the list of the internal (database) annotation IDs of all the annotations;
    100      * used only by the developers and the admin in the debugging mode to access all the existing annotations.
     97     * @return the list of the internal database identifiers of all the annotations, ordered by last-update, with the latest on top;
     98     * used only by developers and the admin in the debugging service to access all the existing annotations.
    10199     */
    102100    public List<Number> getAllAnnotationIDs();
     
    104102    /**
    105103     *
    106      * @param annotationIDs the list of internal annotationIDs.
     104     * @param annotationIDs the list of internal database annotation identifiers.
    107105     * @param offset the offset parameter for SELECT SQL request.
    108106     * @param limit the limit parameter for SELECT SQL request.
    109      * @param orderedBy criterion of ordering according to the SQL syntax (by some field).
     107     * @param orderedBy a criterion of ordering according to the SQL syntax (by some field).
    110108     * @param desc direction of ordering according to the SQL syntax.
    111109     * @return the SELECT response on the given parameters: i.e. the list of annotationID's starting from offset and to limit,
     
    115113   
    116114     /**
    117      * @param annotationIDs
    118      * @return annotationInfo for the annotation with the internal annotationID:
     115     * @param annotationIDs the internal database identifier of an annotation.
     116     * @return an {@link AnnotationInfo} object for the annotation with the internal annotationID:
    119117     * i.e. the information which you can take only from the "annotation" table
    120      * and not the junction tables connecting the annotations to permissions and targets.
     118     * and not from the junction tables connecting the annotations to permissions and targets.
    121119     *
    122120     */
     
    125123    /**
    126124     *
    127      * @param annotationIDs
    128      * @return list of target references where the i-th reference is constructed from the external
     125     * @param annotationIDs the list of the internal database annotation identifiers.
     126     * @return the list of target h-references where the i-th reference is constructed from the external
    129127     * identifier of the annotation with the i-th internal identifier from the list.
    130128     */
     
    134132    /**
    135133     *
    136      * @param annotationID
     134     * @param annotationID the internal database identifier of an annotation.
    137135     * @return the internal database ID of the owner of the annotation.
    138136     */
     
    141139    /**
    142140     *
    143      * @param annotationID
    144      * @param principalID
     141     * @param annotationID the internal database identifier of an annotation.
     142     * @param principalID the internal database identifier of a principal.
    145143     * @return access of the principalID w.r.t. annotationID, or Access.NONE if the access is not given.
    146144     */
     
    149147    /**
    150148     *
    151      * @param annotationID
    152      * @param principalID
     149     * @param annotationID the internal database identifier of an annotation.
     150     * @param principalID the internal database identifier of a principal.
    153151     * @return true if there is triple (annotationID, principalID, access) for some access
    154152     * in the corresponding junction table; false otherwise.
     
    158156    /**
    159157     *
    160      * @param annotationID
     158     * @param annotationID the internal database identifier of an annotation.
    161159     * @return the value of the "public" field for annotationID; can be one of ACCESS values.
    162160     */
     
    166164    /**
    167165     *
    168      * @param notebookID
    169      * @return the list of annotationIDs of the annotations from the notebook with notebookID.
     166     * @param notebookID the internal database identifier of a notebook.
     167     * @return the list of internal database identifiers of the annotations from the notebook with notebookID.
    170168     */
    171169    public List<Number> getAnnotations(Number notebookID);
     
    173171    /**
    174172     *
    175      * @param targetID
    176      * @return true if at least one annotation refers to this target; false otherwise.
     173     * @param targetID the internal database identifier of a target.
     174     * @return true if at least one annotation refers to the target with targetID; false otherwise.
    177175     */
    178176    public boolean targetIsInUse(Number targetID);
     
    184182    /**
    185183     *
    186      * @param annotationID
    187      * @param targetID
    188      * @return # updated rows in the joint table "annotations_targets".
     184     * @param annotationID the internal database identifier of an annotation.
     185     * @param targetID the internal database identifier of a target.
     186     * @return # of updated rows in the junction table "annotations_targets".
    189187     * Connects the annotation to its target by adding the pair (annotationID, targetID)
    190188     * to the junction table.
     
    195193    /**
    196194     *
    197      * @param annotationID
    198      * @param principalID
    199      * @param access
    200      * @return # rows added to the table "annotations_principals_access".
     195     * @param annotationID the internal database identifier of an annotation.
     196     * @param principalID the internal database identifier of a principal.
     197     * @param access the {@link Access} object representing an access level.
     198     * @return # of rows added to the table "annotations_principals_accesses".
    201199     * Sets the "access" for the "principalID" w.r.t. the annotation with "annotationID".
    202200     */
     
    207205    /**
    208206     *
    209      * @param annotationthe the object to be added to the table "annotation".
    210      * @param newOwnerID the ownerID,
     207     * @param annotation the object to be added to the table "annotation".
     208     * @param newOwnerID the ownerID.
    211209     * @return the internal ID of the added annotation, if it is added, or throws NotInDataBaseException otherwise.
    212      * @throws NotInDataBaseException if the request on the internal database annotation ID for the added annotation throws this exception.
     210     * @throws NotInDataBaseException if the request for the internal database annotation ID for the added annotation throws this exception.
    213211     */
    214212    public Number addAnnotation(Annotation annotation, Number newOwnerID)  throws NotInDataBaseException;
     
    222220    * @param text the new body text.
    223221    * @param mimeType the new mime type.
    224     * @param isXml if the new body is a text body or an xml.
     222    * @param isXml true if the new body is an xml, and false if it is a text.
    225223    * @return # of updated rows in the table "annotation".
    226224    */
     
    245243     *
    246244     * @param annotation the new annotation (including targets and permissions).
    247      * @param annotationID the ID of the annotation to be updated.
    248      * @param ownerID the Id of the new owner.
     245     * @param annotationID the internal database ID of the annotation to be updated.
     246     * @param ownerID the internal database Id of the new owner.
    249247     * @return # of updated rows in "annotation" table after this FULL updating the annotation. Should return 1 if update  happens.
    250248     */
     
    254252     /**
    255253     *
    256      * @param annotationID
    257      * @param principalID
    258      * @param access
    259      * @return # rows updated to the table "annotations_principals_access".
     254     * @param annotationID the internal database identifier of an annotation.
     255     * @param principalID the internal database identifier of a principal.
     256     * @param access a {@link Access} object representing an access level.
     257     * @return # of rows updated in the table "annotations_principals_accesses".
    260258     * Sets the "access" for the "principalID" w.r.t. the annotation with "annotationID".
    261259     */
     
    266264     * @param annotationID the internal database ID of the annotation to be updated.
    267265     * @param access access level.
    268      * @return # of updated rows in "annotation". should be "1" if updated and "0" otherwise.
     266     * @return # of updated rows in "annotation". Should be "1" if updated and "0" otherwise.
    269267     */
    270268    public int updatePublicAccess(Number annotationID, Access access);
     
    277275    /**
    278276     *
    279      * @param annotationId
    280      * @return # rows in the table "annotation". It should be "1" if the annotation with "annotationID" is successfully deleted, and "0" otherwise.
    281      */
    282    
    283    
    284    
    285     public int deleteAnnotation(Number annotationId);
    286    
    287     /**
    288      *
    289      * @param annotationId
    290      * @return # removed rows in the table "annotations_target_Targets".
     277     * @param annotationID the internal database identifier of an annotation.
     278     * @return # of deleted rows in the table "annotation". It should be "1" if the annotation with "annotationID" is successfully deleted, and "0" otherwise.
     279     */
     280   
     281   
     282   
     283    public int deleteAnnotation(Number annotationID);
     284   
     285    /**
     286     *
     287     * @param annotationID the internal database identifier of an annotation.
     288     * @return # of removed rows in the table "annotations_targets".
    291289     */
    292290   
     
    296294   /**
    297295    *
    298     * @param annotationID
    299     * @return # removed rows in the table "annotations_principals_access".
     296    * @param annotationID the internal database identifier of an annotation.
     297    * @return # of removed rows in the table "annotations_principals_accesses".
    300298    */
    301299    public int deletePermissions(Number annotationID);
     
    303301    /**
    304302     *
    305      * @param annotationID
    306      * @param principalID
    307      * @return # removed rows in the table "annotations_principals_access".
     303     * @param annotationID the internal database identifier of an annotation.
     304     * @param principalID the internal database identifier of a principal.
     305     * @return # removed rows in the table "annotations_principals_accesses".
    308306     * Should be "1" is removed and "0" otherwise.
    309307     */
     
    312310    /**
    313311     *
    314      * @param annotationID
    315      * @return # removed rows in the table "notebookds_annotations".
     312     * @param annotationID the internal database identifier of an annotation.
     313     * @return # of removed rows in the table "notebookds_annotations".
    316314     */
    317315    public int deleteAnnotationFromAllNotebooks(Number annotationID);
     
    323321    /**
    324322     *
    325      * @param annotationBody
    326      * @return two string components of the annotationBody: the text/xml content and the mime type.
     323     * @param annotationBody a {@link AnnotationBody} object.
     324     * @return two string components of the annotationBody: the text or xml content, and the mime type.
    327325     */
    328326    public String[] retrieveBodyComponents(AnnotationBody annotationBody);
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/CachedRepresentationDao.java

    r5998 r6042  
    3737     *
    3838     * @param internalID the internal database Id of the cached representation.
    39      * @return the object of the class "CachedRepresentationInfo" with the internal id "internalID".
     39     * @return a {@link CachedRepresentationInfo} object representing the metadata
     40     * of the cached representation with the internal id "internalID".
    4041     */
    4142    public CachedRepresentationInfo getCachedRepresentationInfo(Number internalID);
     
    4344    /**
    4445     *
    45      * @param internalID
     46     * @param internalID the internal database Id of a target.
    4647     * @return the Blob of the cached representation with the internal database id "internalID".
    4748     */
    4849    public InputStream getCachedRepresentationBlob(Number internalID);
    4950
    50     /*
    51      * @param targetID
    52      * @return the list of the cached representation's ID-s for the target the internal database ID "targetID".
     51    /**
     52     * @param targetID the internal database Id of a target.
     53     * @return the list of the cached representation's ID-s for the target with the internal database ID "targetID".
    5354     */
    5455    public List<Number> getCachedRepresentationsForTarget(Number targetID);
     
    5960    /**
    6061     *
    61      * @param cachedInfo the metadata of the cached representation (incl.the date of creation and mime-type.
     62     * @param cachedInfo a {@link CachedRepresentationInfo} object representing the metadata of a cached representation.
    6263     * @param cachedBlob the content of the cached representation, considered as BLOB.
    63      * @return the internal ID of the just added "cached", or throws the exception if adding fails.
     64     * @return the internal ID of the just added cached representation, or throws an exception if adding fails.
    6465     * @throws NotInDataBaseException if there is no object with the generated for the new cached representation external id.
    6566     * @throws IOException if reading blob fails.
     
    7475    /**
    7576     *
    76      * @param internalID the internal database id of the cached representation.
    77      * @param cachedInfo the new metadata for it.
     77     * @param internalID the internal database id of a cached representation.
     78     * @param cachedInfo new metadata for it.
    7879     * @return # of updated rows in the table "cached_representation". Must be 1 if updated, and 0 otherwise.
    7980     */
     
    8283    /**
    8384     *
    84      * @param internalID the internal database id of the cached representation.
     85     * @param internalID the internal database id of a cached representation.
    8586     * @param cachedBlob the new content considered as BLOB.
    8687     * @return # of updated rows in the table "cached_representation". Must be 1 if updated, and 0 otherwise.
     
    9495    /**
    9596     *
    96      * @param internalID the internal database id of the cached representation.
     97     * @param internalID the internal database id of a cached representation.
    9798     * @return # deleted rows on the table "cached_representation".
    9899     */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/DBDispatcher.java

    r6021 r6042  
    4646
    4747/**
    48  * This class does not implement access to the database directly but dispatch
    49  * the requests to the corresponding dao implementations; each defined in the
    50  * interface method implements a request; if the request addresses more then one
    51  * table in the database then the request is split up in a basic per-table
    52  * requests which are ordered so that there will not be constraint violation;
     48 * An implementation for this interface does not perform access to the database directly but dispatches
     49 * requests to the corresponding dao implementations. Each defined in the
     50 * interface method implements a simple or complex request. If the request addresses more than one
     51 * table in the database then the request is split up in basic per-table
     52 * requests whose calls are ordered to avoid constraint violation;
    5353 * e.g when a target is to be deleted then first it is checked if no annotation
    54  * refers to it, and if not it is deleted from "target" table.
     54 * refers to it, and if this is the case then it is deleted from "target" table.
    5555 *
    5656 * @author olhsha
     
    6060   
    6161    /**
    62      * Sets the server address, e.g. "http://lux16.mpi.nl/ds/webannotator/ ".
    63      * @param relServiceURI
     62     * Sets the server address, e.g. "ds/webannotator/ ".
     63     * @param relServiceURI a string representing a relative service URI.
    6464     *
    6565     */
     
    7373     *
    7474     * @param externalID the external UUID of the resource.
    75      * @param resource the type of resource (annotation, principal, cached representation, target, notebook)
    76      * which tell in which table to look for.
     75     * @param resource  a {@link Resource} object representing a type of resource (annotation, principal, cached representation, target, notebook);
     76     * it tells in which table to look for.
    7777     * @return the internal database id of the resource.
    7878     * @throws NotInDataBaseException
     
    8383     *
    8484     * @param resourceID the internal database identifier of the resource,
    85      * @param resource the type of resource (annotation, principal, cached representation, target, notebook)
    86      * which tell in which table to look for.
     85     * @param resource a {@link Resource} object representing a type of resource (annotation, principal, cached representation, target, notebook);
     86     * it tells in which table to look for.
    8787     * @return the external UUID of the resource.
    8888     */
     
    9292     *
    9393     * @param resourceID the internal database identifier of the resource.
    94      * @param resource the type of resource (annotation, principal, cached representation, target, notebook)
    95      * which tell in which table to look for.
    96      * @return the list of permissions (principal, permission) for the resource;
     94     * @param resource  a {@link Resource} object representing a type of resource (annotation, principal, cached representation, target, notebook);
     95     * it tells in which table to look for.
     96     * @return a {@link PermissionList} object, representing pairs (principal, permission) for the resource;
    9797     * currently makes sense  only for annotations and notebooks.
    9898     */
     
    101101    /**
    102102     *
    103      * @param ownerId the internal database identifier of the owner whose annotations must be output;
    104      * any owner is allowed when "null".
     103     * @param ownerId the internal database identifier of the owner whose annotations are searched for;
     104     * any owner is considered when "null".
     105     * @param link the link which at least one target source of the output annotations must contain;
     106     * no limitations on links when "null".
     107     * @param matchMode if the link of a target source must contain, beginWith,
     108     * endsWith or be exact match of the "link" parameter above.
     109     * @param text that must be in the body of the requested annotations; no limitations when "null".
     110     * @param inloggedPrincipalID the internal database id of the inlogged principal.
     111     * @param accessMode the access mode that relates the inlogged principal to the requested annotations.
     112     * @param namespace not implemented.
     113     * @param after the lower limit of the last-update date for requested annotations (the begin of the time, if "null").
     114     * @param before the upper limit of the lust-update date (now, if "null").
     115     * @return the list of the internal database identifiers of annotations satisfying the criteria defined by the parameters.
     116     * @throws NotInDataBaseException if one of the getters used in the implementation throws this exception.
     117     */
     118    List<Number> getFilteredAnnotationIDs(UUID ownerId, String link, MatchMode matchMode, String text, Number inloggedPrincipalID, String  accessMode, String namespace, String after, String before) throws NotInDataBaseException;
     119
     120    /**
     121     * The method must be used only in debug services by principals with "developer" role.
     122     * @return the {@link AnotationInfoList} object representing AnnotationInfo's  of all the annotations.
     123     */
     124    AnnotationInfoList getAllAnnotationInfos();
     125
     126  /**
     127   *
     128     * @param ownerId the internal database identifier of the owner whose annotations are searched for;
     129     * any owner is considered when "null".
    105130     * @param link the link which at least one target source of the output annotation(s) must contain;
    106      * no limitations on links when null.
    107      * @param matchMode if the link of a target source must "contain, beginWith,
     131     * no limitations on links when "null".
     132     * @param matchMode tells if the link of a target source must contain, beginWith,
    108133     * endsWith or be exact match of the "link" parameter above.
    109134     * @param text that must be in the body of the requested annotations; no limitations when null.
    110135     * @param inloggedPrincipalID the internal database id of the inlogged principal.
    111      * @param accessMode the access mode that related the inlogged principal to the requested annotations.
     136     * @param accessMode the access mode that relate the inlogged principal to the requested annotations.
    112137     * @param namespace not implemented.
    113      * @param after the lower limit of the last update date for requested annotations (the begin of the time, if null).
    114      * @param before the upper limit of the lust update(now, if null).
    115      * @return the list of the internal database identifiers of the annotations satisfying the criteria defined by the parameters.
    116      * @throws NotInDataBaseException if one of the getters used in the implementation throws this exception.
    117      */
    118     List<Number> getFilteredAnnotationIDs(UUID ownerId, String link, MatchMode matchMode, String text, Number inloggedPrincipalID, String  accessMode, String namespace, String after, String before) throws NotInDataBaseException;
    119 
    120     /**
    121      * The method must be used only in debug services by principals with "developer" role.
    122      * @return the AnnotationInfo-s of all the annotations (i.e. the information which is taken only from "annotations" table,
    123      * and junction tables for permissions and targets are not used.
    124      */
    125     AnnotationInfoList getAllAnnotationInfos();
    126 
    127   /**
    128    *
    129      * @param ownerId the internal database identifier of the owner whose annotations must be output;
    130      * any owner is allowed when "null".
    131      * @param link the link which at least one target source of the output annotation(s) must contain;
    132      * no limitations on links when null.
    133      * @param matchMode if the link of a target source must "contain, beginWith,
    134      * endsWith or be exact match of the "link" parameter above.
    135      * @param text that must be in the body of the requested annotations; no limitations when null.
    136      * @param inloggedPrincipalID the internal database id of the inlogged principal.
    137      * @param accessMode the access mode that related the inlogged principal to the requested annotations.
    138      * @param namespace not implemented.
    139      * @param after the lower limit of the last update date for requested annotations (the begin of the time, if null).
    140      * @param before the upper limit of the lust update(now, if null).
    141      * @return the list of the annotation info's (i.e. the information taken only from the table "annotations", and not from junction tables)
     138     * @param after the lower limit of the last-update date for requested annotations (the begin of the time, if null).
     139     * @param before the upper limit of the lust-update date(now, if null).
     140     * @return the {@link AnotationInfoList} object representing the list of the annotation info's (i.e. the information taken only from the table "annotations", and not from junction tables)
    142141     * of the annotations satisfying the criteria defined by the parameters.
    143142     * @throws NotInDataBaseException if getFileteredAnnotationIDs throws this exception.
     
    149148    /**
    150149     *
    151      * @param internalID
    152      * @return CachedRepresentationInfo (i.e. "metadata") for cached representation with the internal id "intenalID"
     150     * @param internalID the internal database id of a cached representation.
     151     * @return a {@link CachedRepresentationInfo} object representing the metadata for the cached representation with the internal id "intenalID".
    153152     */
    154153    CachedRepresentationInfo getCachedRepresentationInfo(Number internalID);
     
    157156     *
    158157     * @param annotationID an internal database annotation identifier.
    159      * @return the {@link Annotation} for this "annotationID, generated from the tables "annotation", "annotations_targets", "target", "annotations_principals_access".
     158     * @return the {@link Annotation} object for this "annotationID", generated from the tables "annotation", "annotations_targets", "target", "annotations_principals_accesses".
    160159     *
    161160     */
     
    179178     *
    180179     * @param annotationID an internal database annotation identifier.
    181      * @return the {@link ReferenceList} object containing the references of all targets of the annotationID.
     180     * @return the {@link ReferenceList} object containing the h-references of all the targets of the annotationID.
    182181     */
    183182    ReferenceList getAnnotationTargets(Number annotationID);
     
    193192     *
    194193     * @param annotationID an internal database annotation identifier.
    195      * @return the list of h-references of the principals which are mentioned in
    196      * the junction table "annotations-permissions" in a pair with "annotationID"
     194     * @return the list of h-references of the principals which are present in
     195     * the junction table "annotations_principals_accesses" in a pair with "annotationID"
    197196     * and for which principal's name and / or principal's e-mail is missing.
    198197     */
     
    202201     *
    203202     * @param targetID an internal database target identifier.
    204      * @return the list of the external  ID-s that refers to the same source (link) as targetID
     203     * @return the list of the external  ID of targets that refer to the same source (link) as targetID
    205204     */
    206205    ReferenceList getTargetsForTheSameLinkAs(Number targetID);
     
    208207    /**
    209208     *
    210      * @param cachedID an internal database cached representation identifier.
    211      * @return BLOB of the cached representation.
     209     * @param cachedID an internal database cached-representation identifier.
     210     * @return the BLOB of the cached representation.
    212211     */
    213212    InputStream getCachedRepresentationBlob(Number cachedID);
     
    216215     *
    217216     * @param internalID an internal database target identifier.
    218      * @return {@link Taget} object built for "internalID".
     217     * @return the {@link Taget} object representing  the target with "internalID".
    219218     */
    220219    Target getTarget(Number internalID);
     
    223222     *
    224223     * @param principalID an internal database principal identifier.
    225      * @return {@link Principal} object built for "principalID".
     224     * @return the {@link Principal} object representing the principal with "principalID".
    226225     */
    227226    Principal getPrincipal(Number principalID) ;
     
    231230     *
    232231     * @param eMail an email address.
    233      * @return {@link Principal} object with e-mail "eMail".
     232     * @return a {@link Principal} object representing a principal with e-mail "eMail".
    234233     * @throws NotInDataBaseException if an principal with such eMail is not found.
    235234     */
     
    238237    /**
    239238     *
    240      * @param internalID the databaseinternalId of a principal.
    241      * @return {@link Principal} object with this internalID; will throw runtime
     239     * @param internalID the internal database Id of a principal.
     240     * @return a {@link Principal} object with this internalID; will throw runtime
    242241     * "array out of bound exception" if a principal is not found due to the attempt
    243      * to access empty array; not crucial since if you already have the internalId
    244      * then the object must exist in the database, but fix it by throwing NotInDataBaseException;
     242     * to access the empty array; not crucial since if you already have the internalId
     243     * then the object must exist in the database, but fix it by throwing NotInDataBaseException.
    245244     */
    246245    String getPrincipalRemoteID(Number internalID);
     
    266265     * @param annotationID the internal database id of an annotation.
    267266     * @param principalID the internal database id of a principal.
    268      * @return access of the principalID w.r.t. annotationID, which is a maximal access
     267     * @return access of the principalID w.r.t. annotationID, computed is a maximum
    269268     * from "public" attribute of the annotation and the value "access" in the row
    270      * (annotationId, principalID, access) of the table "annotations_principals_access".
     269     * (annotationId, principalID, access) of the table "annotations_principals_accesses".
    271270     */
    272271    Access getAccess(Number annotationID, Number principalID) ;
     
    275274     *
    276275     * @param annotationID the internal database id of an annotation.
    277      * @return the public-attribute value for "annotationID"
    278      * (NONE if database return empty result; fix it to be "NotInDataBaseException".
     276     * @return the public-attribute value for "annotationID".
    279277     */
    280278    Access getPublicAttribute(Number annotationID);
     
    283281     *
    284282     * @param principalID the internal database id of a principal.
    285      * @return user, developer, or admin.
     283     * @return "user" or "developer" or "admin".
    286284     */
    287285    String getTypeOfPrincipalAccount(Number principalID);
     
    289287    /**
    290288     *
    291      * @return  the {@link Principal} object corresponding to the "first in the list" admin of the database
     289     * @return  the {@link Principal} object corresponding to the "first in the list" admin of the database.
    292290     */
    293291    Principal getDataBaseAdmin() ;
     
    295293    /**
    296294     *
    297      * @param action {@link Access} object defining which action is to be perfomed.
     295     * @param action an {@link Access} object defining which action is to be perfomed.
    298296     * @param principalID the internal Id of the principal who wants to perform "action".
    299      * @param resourceID the internal id of the resource on which action must be performed.
     297     * @param resourceID the internal id of the resource on which "action" must be performed.
    300298     * @param resource a type of resource (annotation, notebook, cached representation, target,
    301      * principal)
     299     * principal).
    302300     * @return true iff "principalId" is allowed to perform "action" on "resourceID"; false
    303      * otherwise false; currently is implemented only for "annotation" and return "true" on
    304      * all other types of resources.
     301     * otherwise; currently is implemented only for "annotation" and return "true" on
     302     * all other type of resources.
    305303     */
    306304    boolean canDo(Access action, Number principalID, Number resourceID, Resource resource);
     
    311309     *
    312310     * @param prinipalID the internal database id of a principal.
    313      * @param access a {@link Access} object.
    314      * @return {@link NotebookInfoList} object containing the list of all notebooks to which
     311     * @param access an {@link Access} object.
     312     * @return a {@link NotebookInfoList} object containing the list of all notebooks to which
    315313     * "principalID" has "access".
    316314     */
     
    330328     * @param principalID the internal database id of a principal.
    331329     * @return a {@link ReferenceList} object containing hrefs of notebooks owned
    332      * by "principlaID" 
     330     * by "principlaID".
    333331     */
    334332    ReferenceList getNotebooksOwnedBy(Number principalID);
     
    338336     * @param notebookID the internal database id of a notebook.
    339337     * @param access an {@link Access} object.
    340      * @return a {@link ReferenceList} object containing hrefs of principals
     338     * @return the {@link ReferenceList} object containing hrefs of principals
    341339     * which have "access" to "notebookID".
    342340     */
     
    345343 *
    346344 * @param notebookID the internal database id of a notebook.
    347  * @return a {@link Notebook} object corresponding to the notebook with "notebookID".
     345 * @return the {@link Notebook} object corresponding to the notebook with "notebookID".
    348346 */
    349347    Notebook getNotebook(Number notebookID);
     
    352350     *
    353351     * @param notebookID the internal database id of a notebook.
    354      * @return an internal database Id of the owner of the "notebookID".
     352     * @return the internal database Id of the owner of the "notebookID".
    355353     */
    356354    Number getNotebookOwner(Number notebookID);
     
    360358     * @param notebookID the internal database id of a notebook.
    361359     * @param startAnnotation the first index for the list (of annotations). min value is "1".
    362      * @param maximumAnnotations the maximum # of annotations in the output list expected.
     360     * @param maximumAnnotations the maximum # of annotations in the output list.
    363361     * @param orderedBy SQL "orderedBy" string value, must be one of the fields in the table "annotation".
    364362     * @param desc direction of ordering.
    365      * @return a {@link ReferenceList} object containing hrefs of annotations for notebookID,
    366      * "orderedBy" in "desc" order, starting from "startAnnotation" and and with "maximum" hrefs.
     363     * @return a {@link ReferenceList} object containing "maximum" hrefs of annotations in the notebook with "notebookID",
     364     * "orderedBy" in "desc" order, starting from "startAnnotation".
    367365     */
    368366    ReferenceList getAnnotationsForNotebook(Number notebookID, int startAnnotation, int maximumAnnotations, String orderedBy, boolean desc);
     
    377375     * @param oldIdentifier the external UUD of the resource.
    378376     * @param newIdentifier the new external UUID of the resource.
    379      * @return # of updated rows in the corresponding table. Must be 1 if the resource with oldIdentifier
     377     * @return # of updated rows in the corresponding table. Must be 1 if the resource with "oldIdentifier"
    380378     * gets the external identifier updated by "newIdentifier", and 0 otherwise.
    381379     * @throws NotInDataBaseException if the resource with "oldIdentifier" is not found.
     
    386384     *
    387385     * @param principalExternalID the external UUD of a principle.
    388      * @param account new type of account for this principle (a role: user, developer, admin).
     386     * @param account a new type of account for this principle (a role: user, developer, admin).
    389387     * @return "true" if the account gets updated, and "false" otherwise.
    390388     * @throws NotInDataBaseException if the principal with the external UUD of a principle.
     
    396394     *
    397395     * @param annotation an {@link Annotation} object.
    398      * @param remoteUser
    399      * @return # of rows in "annotation" table. "1" if the annotation gets updated, and "0" otherwise.
    400      * @throws NotInDataBaseException if the annotation with the external id given in the annotation object,
     396     * @param remoteUser   the remote id of the owner principal.
     397     * @return # of updated rows in "annotation" table: "1" if the annotation gets updated, and "0" otherwise.
     398     * @throws NotInDataBaseException if the annotation with the external id, given in the annotation object,
    401399     * or the remote user are not found in the database.
    402400     * @throws ForbiddenException if the "remoteUser" does not have "all" rights for the annotation with the external id,
     
    407405    /**
    408406     *
    409      * @param internalID the internal database id of an annotation whose body to be updated.
    410      * @param annotationBody an {@link Annotation} object.
    411      * @return # of rows in "annotation" table. "1" if the annotation body gets updated by
     407     * @param internalID the internal database id of an annotation whose body must be updated.
     408     * @param annotationBody an {@link AnnotationBody} object.
     409     * @return # of updated rows in "annotation" table: "1" if the annotation body gets updated by
    412410     * "annotationBody" gets updated, and "0" otherwise.
    413411     */
     
    416414    /**
    417415     *
    418      * @param internalID the internal database id of an annotation whose body to be updated.
    419      * @param newHeader  the header to be placed in the database for "internalID".
    420      * @return # of rows in "annotation" table. "1" if the annotation body gets updated by "newHeader",
     416     * @param internalID the internal database id of an annotation whose header must be updated.
     417     * @param newHeader  the new header for the annotation with "internalID".
     418     * @return # of updated rows in "annotation" table: "1" if the annotation body gets updated by "newHeader",
    421419     * and "0" otherwise.
    422420     */
     
    427425     * @param annotationID the internal database id of an annotation.
    428426     * @param principalID the internal database id of a principal.
    429      * @param access c
    430      * @return # rows updated to the table "annotations_principals_access. "1" if
     427     * @param access an {@link Access} object representing an access level.
     428     * @return # rows updated in the table "annotations_principals_access: "1" if
    431429     * "access" is assigned to the "principlaID" for the "ammotationID".
    432430     */
     
    436434     *
    437435     * @param annotationID the internal database id of an annotation.
    438      * @param accessList  {@link PermissionList} object containing the list  representing (principal, access) pairs.
    439      * @return  # of rows updated or added in the table "annotations_principals_access"  according to "accessList".
     436     * @param accessList  a {@link PermissionList} object containing the list  representing (principal, access) pairs.
     437     * @return  # of rows updated or added in the table "annotations_principals_access"  according to "permissionList".
    440438     * @throws NotInDataBaseException if one of the principals mentioned in the list, is not found.
    441439     */
     
    447445     * @param publicAttribute  an {@link Access} object.
    448446     * @return # of updated rows in "annotation" table; must be 1 if "public" field for
    449      * "annotationID" has been updated by value "publicAttribute".
     447     * "annotationID" has been updated by the value of "publicAttribute".
    450448     */
    451449    int updatePublicAttribute(Number annotationID, Access publicAttribute);
     
    453451    /**
    454452     *
    455      * @param principal a {@link Principal} project.
     453     * @param principal a {@link Principal} object.
    456454     * @return the internal database id of the updated principal.
    457455     * @throws NotInDataBaseException if the principal with the external id declared in "principal"
     
    471469    /**
    472470     *
    473      * @param cachedInfo a {@link CachedRepresentationInfo} object representing metadata of a cached representation.
     471     * @param cachedInfo a {@link CachedRepresentationInfo} object representing the metadata of a cached representation.
    474472     * @return # of updated rows in the table "cached_representation"; must be 1 if the
    475      * row with the external id declared in "cachedInfo" has got updated.
     473     * row with the external id declared in "cachedInfo" has been updated.
    476474     * @throws NotInDataBaseException if the cached representation with the external id declared in the
    477      * "cachedInfo" is nit found.
     475     * "cachedInfo" is not found.
    478476     */
    479477    int updateCachedMetada(CachedRepresentationInfo cachedInfo)  throws NotInDataBaseException;
     
    484482     * @param cachedBlob a new BLOB for the cached representation.
    485483     * @return # of updated rows in "cached_representations_table"; must be "1" if the row with
    486      * "internalID" got updated.
     484     * "internalID" has been updated.
    487485     * @throws IOException if reading BLOB fails.
    488486     */
     
    494492     * @param notebookID the internal database id of a notebook.
    495493     * @param upToDateNotebookInfo a {@link NotebookInfo} object.
    496      * @return true if the "notebooks" table has got updated, namely the row with "notebookID" updated
    497      * by the corresponding values declared in "upToDateNotebookInfo"; false when no updated happens,
     494     * @return true if the "notebooks" table has been updated, namely the row with "notebookID" updated
     495     * by the corresponding values declared in "upToDateNotebookInfo"; false when no updated happens.
    498496     * @throws NotInDataBaseException if the notebook with "internalID" is not found.
    499497     */
     
    504502     * @param notebookID the internal database id of a notebook.
    505503     * @param annotationID the internal database id of an annotation.
    506      * @return true if the junction table "notebook_annotation" is updated by adding row with values (notebookID, annotationID).
     504     * @return true if the junction table "notebooks_annotations" is updated by adding row with values (notebookID, annotationID).
    507505     */
    508506    boolean addAnnotationToNotebook(Number notebookID, Number annotationID);
     
    515513     *
    516514     * @param targetID the internal database id of a target.
    517      * @param fragmentDescriptor a string that located the target within the cached representation.
     515     * @param fragmentDescriptor a string that locates the target within the cached representation.
    518516     * @param cachedInfo a {@link CachedRepresentationInfo} object representing the metadata of the cached representation.
    519      * @param cachedBlob a BLOB, representing the content of a cached representation.
     517     * @param cachedBlob a BLOB, representing the content of the cached representation.
    520518     * @return result[0] = # updated rows in the table "targets_cached_representations" (must be 1 or 0). result[1] = the
    521519     * internal ID of the added cached (a new one if "cached" was new for the database).
     
    528526     *
    529527     * @param annotationID the internal database id of an annotation.
    530      * @param targets list of {@link TargetInfo} objects, where {@link targetInfo} represents
    531      * the most essential metadata of a target; it is supposed to be a list of targets
    532      * for the annotations when annotations is just being added to the database or updated.
     528     * @param targets list of {@link TargetInfo} objects, where a {@link TargetInfo} object represents
     529     * the most essential metadata of a target.
    533530     * @return a map "temporary targetID |--> target externalID"; its domain is the
    534531     * temporary IDs of all the new targets; while adding a new target, a new
    535532     * external ID is generated for it and it becomes the value of the map; the
    536      * targetIDs which are already present in the DB are not in the domain. If
     533     * targetIDs which are already present in the database are not in the domain. If
    537534     * all targets are old, then the map is empty.
    538535     * @throws NotInDataBaseException if adding of one of fresh targets fails.
     
    565562     * @param strength
    566563     * @param salt
    567      * @return the total of updated rows in the tables related to the Spring authentication; must be
     564     * @return the total # of updated rows in the tables related to the Spring authentication; must be
    568565     * 2=1+1, where 1 is for the table "users", and 1 is for the table "roles".
    569566     */
     
    585582     * @param annotation an {@link Annotation} object representing an annotation to be added.
    586583     * @param ownerID the internal database id of the notebook's owner (principal).
    587      * @return true if a new annotation has been added to the database and then it was added  to the notebook.
     584     * @return true iff the new annotation has been added to the database and then it was added  to the notebook.
    588585     * @throws NotInDataBaseException if adding annotation to the database fails.
    589586     */
     
    647644    /**
    648645     *
    649      * @param internalID he internal database ID of a target to be deleted.
     646     * @param internalID the internal database ID of a target to be deleted.
    650647     * @return # of deleted rows in the table "target"; must be one if "internalID" is deleted.
    651648     */
     
    676673     * @param annotationID the internal database id of an annotation.
    677674     * @return a {@link ResponseBody} object containing an annotation and a list of actions to do;
    678      * for instance if it is a just added annotation, the result object contains this annotation
    679      * and list of targets for which cached representations are missing.
     675     * for now, the result object contains the {@link Annotation} element representing annotation
     676     * with "annotationID" and list of targets for which cached representations are missing.
    680677     */
    681678    ResponseBody makeAnnotationResponseEnvelope(Number annotationID);
     
    683680    /**
    684681     *
    685      * @param notebookID the internal database id of an annotation.
     682     * @param notebookID the internal database id of a notebook.
    686683     * @return a {@link ResponseBody} object containing a notebook and a list of actions to do;
    687684     * actions are not specified yet.
     
    696693     * annotation, principal, notebook, target, cached_representation.
    697694     * @return a {@link ResponseBody} object containing the list of (principal, permission) for this resource;
    698      * if information about a principal (e.g. an e-mail) is missing then the corresponding action
     695     * if information about a principal (e.g. an e-mail) is missing then the action like "add_principal_info"
    699696     * is added to the list of actions.
    700697     */
     
    704701     *
    705702     * @param fullName a string representing a full name of a principal.
    706      * @return the external Id of the (first) principal with with full name.
     703     * @return the external Id of the (first) principal with this full name.
    707704     * @throws NotInDataBaseException if such principal is not found.
    708705     */
     
    711708    /**
    712709     *
    713      * @param headline a string representing the headline of an annotation.
     710     * @param headline the headline of an annotation.
    714711     * @return  the list of UUID's of all the annotations with this headline.
    715712     */
     
    718715    /**
    719716     *
    720      * @param headline a string representing the headline of an annotation.
     717     * @param headline the headline of an annotation.
    721718     * @return the list of internal database id-s of all the annotations with this headline.
    722719     */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambda.java

    r6004 r6042  
    2222
    2323/**
    24  * This is a help interface used in wrapper methods for REST requests, see RequestWrappers.java;
    25  * "R" may stay for resource, e.g. Annotation.
     24 * This is a help interface used in wrapper methods for REST requests, see {@link RequestWrappers}.
    2625 * @author olhsha
    2726 */
     
    3029    /**
    3130     *
    32      * @param params list of pairs parameter->value, e.g. such map can contain the external Id of a resource, e.g. an annotation.
     31     * @param params list of pairs parameter->value; e.g. such map can contain "externalId"->"aaaaaaaaaa".
    3332     * @return an instance of "R" corresponding to these parameter values,e.g. an annotation if R is instantiated as "Annotation".
    3433     * @throws NotInDataBaseException see various implementations in REST resource classes.
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambdaPrincipal.java

    r6004 r6042  
    2222
    2323/**
    24  * This is a help interface used in wrapper methods for REST requests, see RequestWrappers.java;
     24 * This is a help interface used in wrapper methods for REST requests, see {@link RequestWrappers}.
    2525 * @author olhsha
    2626 */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/NotebookDao.java

    r6004 r6042  
    2727
    2828/**
    29  * Created on : Jun 12, 2013, 1:40:09 PM
    30  *
    31  * @author Peter Withers <peter.withers@mpi.nl>
     29 *
     30 *
     31 * @author olhsha@mpi.nl
    3232 */
    3333
     
    5454     *
    5555     * @param principalID the internal database id of some principal.
    56      * @param acessMode {@link Access} object, representing one of the access modes:
     56     * @param acessMode an {@link Access} object, representing one of the access modes:
    5757     * "all", "write", "read" or "none".
    58      * @return the list of internal database id's of the notebooks for which "principalID" has ""accessMode" access.
    59      */
    60     List<Number> getNotebookIDs(Number principalID, Access acessMode);
     58     * @return the list of internal database id's of the notebooks for which "principalID" has "accessMode" access.
     59     */
     60    List<Number> getNotebookIDs(Number principalID, Access accessMode);
    6161   
    6262   /**
     
    7171     *
    7272     * @param notebookID the internal database id of a notebook.
    73      * @return the {@link NotebookInfo} object built for the notebook with notebookID upon the corresponding row
     73     * @return the {@link NotebookInfo} object representing the notebook with notebookID, built on the corresponding row
    7474     * in the "notebook" table.
    7575     */
     
    8080     *
    8181     * @param notebookID the internal database id of a notebook.
    82      * @return the {@link Notebook} object built for the notebook with notebookID upon the corresponding row
    83      * in the "notebook" table.
     82     * @return the {@link Notebook} object representing the notebook with notebookID.
    8483     */
    8584    Notebook getNotebookWithoutAnnotationsAndAccesssAndOwner(Number notebookID);
     
    102101     * @param notebookID the internal database id of a notebook.
    103102     * @param title a new title for the notebook.
    104      * @param ownerID the internal database id of the owner principal of the notebook.
    105      * @return true if the title "notebookID" is updated to "title", false otherwise.
     103     * @param ownerID the internal database id of the owner principal (or possibly, a new owner principal) of the notebook.
     104     * @return true if the notebook metadata are updated, false otherwise.
    106105     */
    107106    boolean updateNotebookMetadata(Number notebookID, String title, Number ownerID);
     
    137136     * @param ownerID the internal database id of the owner principal.
    138137     * @return the internal id of the created notebook.
    139      * @throws NotInDataBaseException if creation the notebook fails.
     138     * @throws NotInDataBaseException if creating the notebook fails.
    140139     */
    141140    public Number createNotebookWithoutAccesssAndAnnotations(Notebook notebook, Number ownerID) throws NotInDataBaseException;
     
    145144     * @param notebookID the internal database ID of a notebook.
    146145     * @param annotationID the internal database ID of an annotation.
    147      * @return  true if the row for the (ntebookID,annotationID) has been added to the junction table
     146     * @return  true if the row for the (notebookID,annotationID) has been added to the junction table
    148147     * "notebooks_annotations".
    149148     */
     
    172171     *
    173172     * @param notebookID the internal database ID of a notebook.
    174      * @param annotationID annotationID the internal database ID of an annotation.
     173     * @param annotationID the internal database ID of an annotation.
    175174     * @return  true iff the row for the (notebookID,annotationID) has been deleted from the junction table
    176175     * "notebooks_annotations".
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/PrincipalDao.java

    r6004 r6042  
    3636     *
    3737     * @param internalID the internal database ID of a principal.
    38      * @return the {@link Principal} object with the internal database id "internalID".
     38     * @return the {@link Principal} object that represents the principal with the internal database id "internalID".
    3939     */
    4040     public Principal getPrincipal(Number internalID);
     
    4242     /**
    4343      *
    44       * @param eMail an e-mail string.
    45       * @return the {@link Principal} object with th e-mail "email".
    46       * @throws NotInDataBaseException, if such a principal is not found.
     44      * @param eMail an e-mail.
     45      * @return the {@link Principal} object representing the principal with the e-mail "eMail".
     46      * @throws NotInDataBaseException if such a principal is not found.
    4747      */
    4848     public Principal getPrincipalByInfo(String  eMail) throws NotInDataBaseException;
     
    6363     /**
    6464      *
    65       * @param remoteID the string representing the remote id of a principal.
     65      * @param remoteID the remote id of a principal.
    6666      * @return true iff a principal with "remoteID" exists in the table "principal".
    6767      */
     
    7878      *
    7979      * @param internalID the internal database id of a principal.
    80       * @return the string representing the remote id of the principal.
     80      * @return the remote id of the principal.
    8181      */
    8282     public String getRemoteID(Number internalID);
     
    8585     /**
    8686      *
    87       * @param remoteID the string representing the remote id of a principal.
    88       * @return the interna ld database id of the principal with "remotedID".
     87      * @param remoteID the remote id of a principal.
     88      * @return the internal database id of the principal with "remotedID".
    8989      * @throws NotInDataBaseException if there is no principal with "remoteID".
    9090      */
     
    9393     /**
    9494      *
    95       * @param remoteID the string representing the remote id of a principal.
     95      * @param remoteID the remote id of a principal.
    9696      * @return the external UUID of the principal with "remotedID".
    9797      * @throws NotInDataBaseException  if there is no principal with "remoteID".
     
    101101     /**
    102102      *
    103       * @param fullName the string representing the full name of a principal.
     103      * @param fullName the full name of a principal.
    104104      * @return the external UUID of the principal with "fullName.
    105105      * @throws NotInDataBaseException if there is no principal with "fullName".
     
    119119   *
    120120   * @param externalID the external UUID of a principal.
    121    * @param account a string representing the type of an account: admin, developer, user.
    122    * @return true, if the account of "externalId" has been updated to "account".
     121   * @param account the type of an account: admin, developer, user.
     122   * @return true, iff the account of "externalId" has been updated to "account".
    123123   * @throws NotInDataBaseException iff no principal with "externalId" is found.
    124124   */
     
    127127     /**
    128128      *
    129       * @param principal a {@link Principal} object which must update the principal referred by "externakId" given in this object.
    130       * @return the internal id of a principal which has been updated.
    131       * @throws NotInDataBaseException if principal with the externalId given in the "principal" is not found.
     129      * @param principal a {@link Principal} object which must update the principal referred by "externalId" given in this object.
     130      * @return the internal id of the principal which has been updated.
     131      * @throws NotInDataBaseException if a principal with the externalId given in the "principal" parameter is not found.
    132132      */
    133133     public Number updatePrincipal(Principal principal) throws NotInDataBaseException;
     
    136136      *
    137137      * @param principal a {@link Principal} object to be added to the database.
    138       * @param remoteID a string representing the remote of of the principal to be added.
     138      * @param remoteID the remote of of the principal to be added.
    139139      * @return the internal id of the just added principal.
    140140      * @throws NotInDataBaseException if adding the principal fails.
     
    148148      * @param strength the strength of a password.
    149149      * @param salt
    150       * @return a number of added rows in "users" table; must be 1 of the user is added.
     150      * @return the number of added rows in "users" table; must be 1 if the user is added.
    151151      */
    152152     public int addSpringUser(String username, String password, int strength, String salt);
     
    155155      *
    156156      * @param username the name of a user for spring basic authentication.
    157       * @return the amount of rows added o "authorities" tables; "1" if "username" is added with the default "ROLE_USER"; 0 otherwise.
     157      * @return the amount of rows added to "authorities" table; "1" if "username" is added with the default "ROLE_USER"; 0 otherwise.
    158158      */
    159159     public int addSpringAuthorities(String username);
     
    162162      *
    163163      * @param intenralID the internal ID of a principal to be deleted,
    164       * @return the amount f deleted rows; "1" if deleted, "0" otherwise.
     164      * @return the amount of deleted rows; "1" if deleted, "0" otherwise.
    165165      * @throws PrincipalCannotBeDeleted if the principal is in use, i.e. mentioned in one of the junction tables.
    166166      */
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ResourceDao.java

    r6004 r6042  
    2525
    2626/**
    27  * This interfaces describes signatures common for all resources: Annotation, Target, Cached Representation, Principal, Notebook;
    28  * the implementation must contain field "resourceTableName" whose value is one of the five names of resource tables:
     27 * This interface defines methods common for all dao's: Annotation, Target, Cached Representation, Principal, Notebook.
     28 * An implementation must set a non-null value for the field "resourceTableName". It is one of the five names of resource tables:
    2929 * "annotation", "target", "cached_representation", "principal", "notebook".
    3030 * @author olhsha
     
    4040    /**
    4141     *
    42      * @param externalId the external UUId of a resource.
     42     * @param externalId the external UUID of a resource.
    4343     * @return the internal ID of the resource.
    4444     * @throws NotInDataBaseException if the resource with this id is not found.
     
    5555    /**
    5656     *
    57      * @param oldIdentifier the current external UUId of a resource.
    58      * @param newIdentifier the new external ID of the resource.
    59      * @return true iff the external id of the resource have been updated to the value of "newIDentifier".
     57     * @param oldIdentifier the current external UUID of a resource.
     58     * @param newIdentifier the new external UUID of the resource.
     59     * @return true iff the external id of the resource has been updated to the value of "newIdentifier".
    6060     */
    6161    boolean updateResourceIdentifier(UUID oldIdentifier, UUID newIdentifier);
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/TargetDao.java

    r6008 r6042  
    2121import eu.dasish.annotation.schema.Target;
    2222import eu.dasish.annotation.schema.TargetInfo;
    23 import java.sql.SQLException;
    2423import java.util.List;
    2524import java.util.Map;
     
    3837     *
    3938     * @param inernalID the internal database id of a target.
    40      * @return the {@link Target} object with the intrenal Id "internalID".
     39     * @return the {@link Target} object representing the target with the internal id "internalID".
    4140     */
    4241    public Target getTarget(Number internalID);
     
    4544     *
    4645     * @param targets the list of internal database ids of targets.
    47      * @return the list of {@link TargetInfo} objects corresponding to the targets with the internalIds from the list "targets".
     46     * @return the list of {@link TargetInfo} objects representing the targets with the internal id-s from the list "targets".
    4847     */
    4948    public List<TargetInfo> getTargetInfos(List<Number> targets);
     
    6766    /**
    6867     *
    69      * @param link a string representing a link (uri) to a target source.
    70      * @return the list of internal database target ID's whose link-fields is exactly "link".
     68     * @param link a link (uri) to a target source.
     69     * @return the list of internal database target id-s whose link-fields is exactly "link".
    7170     */
    7271    public List<Number> getTargetsForLink(String link);
     
    7574   *
    7675   * @param cachedID the internal database id of a cached representation.
    77    * @return true iff "cachedID" is referred to for some target in "targets_cached_representations" table.
     76   * @return true iff "cachedID" is connected  to some target in "targets_cached_representations" table.
    7877   */
    7978    boolean cachedIsInUse(Number cachedID);
     
    9190     */
    9291
    93    
     92   /**
     93    *
     94    * @param target a {@link Target} object representing the target to add.
     95    * @return the internal database id of the target if it is added to the database.
     96    * @throws NotInDataBaseException if adding fails.
     97    */
    9498    public Number addTarget(Target target)  throws NotInDataBaseException;
    9599
     
    100104     * @param cachedID the internal database id of a cached representation.
    101105     * @param fragmentDescription a string representing the location of the target in the cached representation.
    102      * @return # added rows to the table "targets_cached_representations"; should be "1" if the pair (targetID, cachedID) has been added.
     106     * @return # of updated rows in the table "targets_cached_representations"; should be "1" if the row with (targetID, cachedID) has been updated.
    103107     */
    104108    public int updateTargetCachedRepresentationFragment(Number targetID, Number cachedID, String fragmentDescription);
    105109
    106    
    107     public int addTargetCachedRepresentation(Number TargetID, Number cachedID, String fragmentDescription);
     110    /**
     111     *
     112     * @param targetID the internal database id of a target.
     113     * @param cachedID the internal database id of a cached representation.
     114     * @param fragmentDescription a string representing the location of the target in the cached representation.
     115     * @return # of added rows in the table "targets_cached_representations"; should be "1" if the row with (targetID, cachedID, fragmentDescriptor) is added.
     116     */
     117    public int addTargetCachedRepresentation(Number targetID, Number cachedID, String fragmentDescription);
    108118
    109119    /**
     
    114124     *
    115125     * @param internalID the internal database id of a target.
    116      * @return # deleted rows in "target" table. Should be "1" if the target hasbeen deleted.
     126     * @return # deleted rows in "target" table. Should be "1" if the target has been removed.
    117127     */
    118128    public int deleteTarget(Number internalID);
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDao.java

    r5838 r6042  
    256256    };
    257257
    258     /////////////////////////////////////////////////
    259     /**
    260      *
    261      * @param annotationIDs
    262      * @return list of annotation references corresponding to the annotation-ids
    263      * from the input list if the input list is null or empty (zero elements)
    264      * returns an empty list there may be annotationIDs which are not in the DB
    265      * (so that's why we need this method).
    266      */
     258   
    267259    @Override
    268260    public List<String> getAnnotationREFs(List<Number> annotationIDs) {
Note: See TracChangeset for help on using the changeset viewer.