Changeset 3455 for DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/AnnotationDao.java
- Timestamp:
- 08/22/13 12:17:19 (11 years ago)
- 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 18 18 package eu.dasish.annotation.backend.dao; 19 19 20 import eu.dasish.annotation.backend.identifiers.AnnotationIdentifier;21 20 import eu.dasish.annotation.schema.Annotation; 22 21 import eu.dasish.annotation.schema.AnnotationInfo; … … 39 38 public interface AnnotationDao extends ResourceDao{ 40 39 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 47 42 48 43 … … 51 46 * @param annotationID 52 47 * @return the Annotation object with empty list of sources 53 * constructing a complete Annotation object from the result and "retrieveSourceIDs" is done in "DaoDispatchter"48 * constructing a complete Annotation object from the result and "retrieveSourceIDs" is done in "DaoDispatchter" 54 49 * 55 50 */ 56 51 public Annotation getAnnotationWithoutSources(Number annotationID) throws SQLException; 57 52 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 /////////////////////// 58 146 59 147 /** … … 63 151 */ 64 152 153 154 65 155 public int deleteAnnotation(Number annotationId) throws SQLException; 66 156 … … 74 164 75 165 76 /**77 *78 * @param annotation added to the table with annotations79 * @return internal Id of the added annotation80 **/81 82 public Number addAnnotation(Annotation annotation, Number ownerID) throws SQLException;83 84 85 /**86 *87 * @param link optional88 * @param text optional89 * @param access optional90 * @param namespace optional TODO: do not know what to do with it91 * @param owner optional92 * @param after optional93 * @param before optional94 * @return the list of internal annotation identifiers for annotations95 * -- 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 annotationIDs109 * @return the list of annotationInfos (owner, headline, target sources, external_id) for the internal Ids from the input list110 * used on the second step for GET api/annotations?<filters>111 */112 public List<AnnotationInfo> getAnnotationInfos(List<Number> annotationIDs);113 114 166 115 116 public List<ResourceREF> getAnnotationREFs(List<Number> annotationIDs);117 118 /**119 *120 * @param sourceIDs121 * @return the list of annotationdIDs of the annotations that are having target sources from "sourceIDs" list122 */123 public List<Number> retrieveAnnotationList(List<Number> sourceIDs);124 125 126 // NOT TESTED127 public int updateBody(Number annotationID, String serializedNewBody);128 129 /**130 *131 * @param annotationID132 * @return the list of the source's internal IDs of all the target sources of annotationID133 */134 public List<Number> retrieveSourceIDs(Number annotationID);135 136 public int addAnnotationSourcePair(Number annotationID, Number sourceID) throws SQLException;137 138 167 public int deleteAnnotationPrincipalPermissions(Number annotationID) throws SQLException ; 139 168 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 155 171 156 172 }
Note: See TracChangeset
for help on using the changeset viewer.