Changeset 6042 for DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/AnnotationDao.java
- Timestamp:
- 02/24/15 16:08:22 (9 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
r5998 r6042 28 28 29 29 /** 30 * Created on : Jun 27, 2013, 10:34:13 AM 31 * 32 * @author Peter Withers <peter.withers@mpi.nl> 30 * @author olhsha@mpi.nl 33 31 */ 34 32 … … 57 55 * 58 56 * @param annotationID the internal (database) identifier of an annotation. 59 * @return the {@link Annotation} object whose fields are filled inpartially,57 * @return the {@link Annotation} object whose fields are filled partially, 60 58 * only with the information accessible from the table "annotation". 61 * Constructing a complete {@link Annotation} object is done in the implementation of {@link DBDispatch ter}.)59 * Constructing a complete {@link Annotation} object is done in the implementation of {@link DBDispatcher}. 62 60 */ 63 61 public Annotation getAnnotationWithoutTargetsAndPemissionList(Number annotationID); … … 66 64 * 67 65 * @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 nowrequirements 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. 69 67 * @param namespace (search on the parameter is not implemented). 70 68 * @param after the earliest time of creating/last-update of annotations; if null then search "from the beginning of time". 71 69 * @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. 73 71 */ 74 72 public List<Number> getFilteredAnnotationIDs(Number ownerID, String text, String namespace, String after, String before); … … 76 74 /** 77 75 * 78 * @param principalID the internal database ID of a principal ( user or, in general, a group).79 * @param ac essaccess 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-ac esses".83 */ 84 public List<Number> getAnnotationIDsPermissionAtLeast(Number principalID, Access ac ess);85 86 /** 87 * 88 * @param access the value of public assessof an annotation.89 * @return The list of internal (database identifiers to which publichas 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; 90 88 * for instance on "write" the method should output annotations 91 89 * whose "public" value is "write" or "all". … … 97 95 /** 98 96 * 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. 101 99 */ 102 100 public List<Number> getAllAnnotationIDs(); … … 104 102 /** 105 103 * 106 * @param annotationIDs the list of internal annotationIDs.104 * @param annotationIDs the list of internal database annotation identifiers. 107 105 * @param offset the offset parameter for SELECT SQL request. 108 106 * @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). 110 108 * @param desc direction of ordering according to the SQL syntax. 111 109 * @return the SELECT response on the given parameters: i.e. the list of annotationID's starting from offset and to limit, … … 115 113 116 114 /** 117 * @param annotationIDs 118 * @return an notationInfofor 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: 119 117 * 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. 121 119 * 122 120 */ … … 125 123 /** 126 124 * 127 * @param annotationIDs 128 * @return list of targetreferences where the i-th reference is constructed from the external125 * @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 129 127 * identifier of the annotation with the i-th internal identifier from the list. 130 128 */ … … 134 132 /** 135 133 * 136 * @param annotationID 134 * @param annotationID the internal database identifier of an annotation. 137 135 * @return the internal database ID of the owner of the annotation. 138 136 */ … … 141 139 /** 142 140 * 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. 145 143 * @return access of the principalID w.r.t. annotationID, or Access.NONE if the access is not given. 146 144 */ … … 149 147 /** 150 148 * 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. 153 151 * @return true if there is triple (annotationID, principalID, access) for some access 154 152 * in the corresponding junction table; false otherwise. … … 158 156 /** 159 157 * 160 * @param annotationID 158 * @param annotationID the internal database identifier of an annotation. 161 159 * @return the value of the "public" field for annotationID; can be one of ACCESS values. 162 160 */ … … 166 164 /** 167 165 * 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. 170 168 */ 171 169 public List<Number> getAnnotations(Number notebookID); … … 173 171 /** 174 172 * 175 * @param targetID 176 * @return true if at least one annotation refers to th is 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. 177 175 */ 178 176 public boolean targetIsInUse(Number targetID); … … 184 182 /** 185 183 * 186 * @param annotationID 187 * @param targetID 188 * @return # updated rows in the jointtable "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". 189 187 * Connects the annotation to its target by adding the pair (annotationID, targetID) 190 188 * to the junction table. … … 195 193 /** 196 194 * 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". 201 199 * Sets the "access" for the "principalID" w.r.t. the annotation with "annotationID". 202 200 */ … … 207 205 /** 208 206 * 209 * @param annotation thethe 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. 211 209 * @return the internal ID of the added annotation, if it is added, or throws NotInDataBaseException otherwise. 212 * @throws NotInDataBaseException if the request onthe 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. 213 211 */ 214 212 public Number addAnnotation(Annotation annotation, Number newOwnerID) throws NotInDataBaseException; … … 222 220 * @param text the new body text. 223 221 * @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. 225 223 * @return # of updated rows in the table "annotation". 226 224 */ … … 245 243 * 246 244 * @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. 249 247 * @return # of updated rows in "annotation" table after this FULL updating the annotation. Should return 1 if update happens. 250 248 */ … … 254 252 /** 255 253 * 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". 260 258 * Sets the "access" for the "principalID" w.r.t. the annotation with "annotationID". 261 259 */ … … 266 264 * @param annotationID the internal database ID of the annotation to be updated. 267 265 * @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. 269 267 */ 270 268 public int updatePublicAccess(Number annotationID, Access access); … … 277 275 /** 278 276 * 279 * @param annotationI d280 * @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 annotationI d);286 287 /** 288 * 289 * @param annotationI d290 * @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". 291 289 */ 292 290 … … 296 294 /** 297 295 * 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". 300 298 */ 301 299 public int deletePermissions(Number annotationID); … … 303 301 /** 304 302 * 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". 308 306 * Should be "1" is removed and "0" otherwise. 309 307 */ … … 312 310 /** 313 311 * 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". 316 314 */ 317 315 public int deleteAnnotationFromAllNotebooks(Number annotationID); … … 323 321 /** 324 322 * 325 * @param annotationBody 326 * @return two string components of the annotationBody: the text /xml contentand 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. 327 325 */ 328 326 public String[] retrieveBodyComponents(AnnotationBody annotationBody);
Note: See TracChangeset
for help on using the changeset viewer.