Ignore:
Timestamp:
08/22/13 12:17:19 (11 years ago)
Author:
olhsha
Message:

replacing DaishIdentifier?-based classes with simply UUID. tested. Works, excpet that UUID seems not be be serailizable, see e.g. getAllAnnotations in NotebookResource? where I have to use Peter's workoaroun to put UUID in JAXBElement<UUID>

File:
1 edited

Legend:

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

    r3413 r3455  
    1818package eu.dasish.annotation.backend.dao;
    1919
    20 import eu.dasish.annotation.backend.identifiers.AnnotationIdentifier;
    2120import eu.dasish.annotation.schema.Annotation;
    2221import eu.dasish.annotation.schema.AnnotationInfo;
     
    3938public interface AnnotationDao extends ResourceDao{
    4039   
    41      /**
    42      *
    43      * @param internalId
    44      * @return the external identifier for the annotation with internalId
    45      */
    46     public AnnotationIdentifier getExternalID(Number internalId);
     40    ////////////// GETTERS //////////////////////////
     41   
    4742   
    4843   
     
    5146     * @param annotationID
    5247     * @return the Annotation object with empty list of sources
    53      * constructing a complete Annotation object from there sult and "retrieveSourceIDs" is done in "DaoDispatchter"
     48     * constructing a complete Annotation object from the result and "retrieveSourceIDs" is done in "DaoDispatchter"
    5449     *
    5550     */
    5651    public Annotation getAnnotationWithoutSources(Number annotationID) throws SQLException;
    5752   
     53   
     54     /**
     55     *
     56     * @param annotationIDs optional
     57     * @param text optional
     58     * @param access optional
     59     * @param namespace optional TODO: do not know what to do with it
     60     * @param ownerID optional
     61     * @param after optional
     62     * @param before optional
     63     * @return the sub-list of internal annotation identifiers from the list "internalIDs" for annotations
     64     * -- bodies of which contain the "text",
     65     * -- to which inlogged user has "access",
     66     * -- owned by "owner",
     67     * -- added to the database between "before" and "after" time-dates.
     68     *
     69     *
     70     * The first step for GET api/annotations?<filters>
     71     */
     72    public List<Number> getFilteredAnnotationIDs(List<Number> annotationIDs, String text, String access, String namespace, Number ownerID, Timestamp after, Timestamp before);
     73       
     74      /**
     75     *
     76     * @param annotationIDs
     77     * @return the list of annotationInfos (owner, headline, target sources, external_id) for the internal Ids from the  input list
     78     * used on the second step for GET api/annotations?<filters>
     79     */
     80    public List<AnnotationInfo> getAnnotationInfos(List<Number> annotationIDs);   
     81     
     82   
     83    /**
     84     *
     85     * @param annotationIDs
     86     * @return list of resource references where an i-th reference is constructed from
     87     */
     88    public List<ResourceREF> getAnnotationREFs(List<Number> annotationIDs);
     89   
     90    /**
     91     *
     92     * @param sourceIDs
     93     * @return the list of annotationdIDs of the annotations that are having target sources from "sourceIDs" list
     94     */
     95    public List<Number> retrieveAnnotationList(List<Number> sourceIDs);
     96   
     97   
     98       /**
     99     *
     100     * @param annotationID
     101     * @return the list of the source's internal IDs of all the target sources of annotationID
     102     */
     103    public List<Number> retrieveSourceIDs(Number annotationID);   
     104   
     105   
     106       /**
     107     *
     108     * @param annotationId
     109     * @return retrieves all the pairs (user-permission) for "annotationId" from the table annotations_principals permissions
     110     */
     111    public List<Map<Number, String>>  retrievePermissions(Number annotationId);
     112   
     113   
     114   
     115    ///////////// ADDERS /////////////////////
     116   
     117     public int addAnnotationSourcePair(Number annotationID, Number sourceID) throws SQLException;
     118   
     119   
     120    /**
     121     *
     122     * @param annotationID
     123     * @param userID
     124     * @param permission
     125     * @return the amount of rows added to the table annotations_principals_permissions
     126     */
     127    public int addAnnotationPrincipalPermission(Number annotationID, Number userID, Permission permission) throws SQLException;
     128   
     129   
     130 
     131     /**
     132     *
     133     * @param annotation added to the table with annotations
     134     * @return  internal Id of the added annotation
     135     **/
     136   
     137    public Number addAnnotation(Annotation annotation, Number ownerID) throws SQLException;
     138 
     139     
     140    /////// UPDATERS //////////////////
     141   
     142    public int updateBody(Number annotationID, String serializedNewBody);
     143   
     144   
     145    //////////// DELETERS ///////////////////////
    58146   
    59147    /**
     
    63151     */
    64152   
     153   
     154   
    65155    public int deleteAnnotation(Number annotationId) throws SQLException;
    66156   
     
    74164   
    75165   
    76     /**
    77      *
    78      * @param annotation added to the table with annotations
    79      * @return  internal Id of the added annotation
    80      **/
    81    
    82     public Number addAnnotation(Annotation annotation, Number ownerID) throws SQLException;
    83  
    84      
    85     /**
    86      *
    87      * @param link optional
    88      * @param text optional
    89      * @param access optional
    90      * @param namespace optional TODO: do not know what to do with it
    91      * @param owner optional
    92      * @param after optional
    93      * @param before optional
    94      * @return the list of internal annotation identifiers for annotations
    95      * -- referring to the "link",
    96      * -- bodies of which contain the "text",
    97      * -- to which inlogged user has "access",
    98      * -- owned by "owner",
    99      * -- added to the database between "before" and "after" time-dates.
    100      *
    101      *
    102      * The first step for GET api/annotations?<filters>
    103      */
    104     public List<Number> getFilteredAnnotationIDs(List<Number> annotationIDs, String text, String access, String namespace, Number ownerID, Timestamp after, Timestamp before);
    105        
    106     /**
    107      *
    108      * @param annotationIDs
    109      * @return the list of annotationInfos (owner, headline, target sources, external_id) for the internal Ids from the  input list
    110      * used on the second step for GET api/annotations?<filters>
    111      */
    112     public List<AnnotationInfo> getAnnotationInfos(List<Number> annotationIDs);   
    113      
    114166   
    115    
    116     public List<ResourceREF> getAnnotationREFs(List<Number> annotationIDs);
    117    
    118     /**
    119      *
    120      * @param sourceIDs
    121      * @return the list of annotationdIDs of the annotations that are having target sources from "sourceIDs" list
    122      */
    123     public List<Number> retrieveAnnotationList(List<Number> sourceIDs);
    124    
    125    
    126     // NOT TESTED
    127     public int updateBody(Number annotationID, String serializedNewBody);
    128    
    129      /**
    130      *
    131      * @param annotationID
    132      * @return the list of the source's internal IDs of all the target sources of annotationID
    133      */
    134     public List<Number> retrieveSourceIDs(Number annotationID);
    135    
    136     public int addAnnotationSourcePair(Number annotationID, Number sourceID) throws SQLException;
    137    
    138167    public int deleteAnnotationPrincipalPermissions(Number annotationID) throws SQLException ;
    139168
    140     /**
    141      *
    142      * @param annotationID
    143      * @param userID
    144      * @param permission
    145      * @return the amount of rows added to the table annotations_principals_permissions
    146      */
    147     public int addAnnotationPrincipalPermission(Number annotationID, Number userID, Permission permission) throws SQLException;
    148    
    149        /**
    150      *
    151      * @param annotationId
    152      * @return retrieves all the pairs (user-permission) for "annotationId" from the table annotations_principals permissions
    153      */
    154     public List<Map<Number, String>>  retrievePermissions(Number annotationId);
     169 
     170 
    155171   
    156172}
Note: See TracChangeset for help on using the changeset viewer.