- Timestamp:
- 02/24/15 16:08:22 (9 years ago)
- 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 19 19 20 20 /** 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. 22 23 * @author olhsha 23 24 */ -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/MyResource.java
r4603 r6042 23 23 import javax.ws.rs.Produces; 24 24 25 /** Example re Target class hosted at the URI path "/myreTarget"25 /** Example resource class hosted at the URI path "/myresource" 26 26 */ 27 27 @Path("/myresource") -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/Resource.java
r4603 r6042 19 19 20 20 /** 21 * 21 * Represents five kinds of DASISH resources: a principal, an annotation, a target, a cached representation and a notebook. 22 22 * @author olhsha 23 23 */ -
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); -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/CachedRepresentationDao.java
r5998 r6042 37 37 * 38 38 * @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". 40 41 */ 41 42 public CachedRepresentationInfo getCachedRepresentationInfo(Number internalID); … … 43 44 /** 44 45 * 45 * @param internalID 46 * @param internalID the internal database Id of a target. 46 47 * @return the Blob of the cached representation with the internal database id "internalID". 47 48 */ 48 49 public InputStream getCachedRepresentationBlob(Number internalID); 49 50 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". 53 54 */ 54 55 public List<Number> getCachedRepresentationsForTarget(Number targetID); … … 59 60 /** 60 61 * 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. 62 63 * @param cachedBlob the content of the cached representation, considered as BLOB. 63 * @return the internal ID of the just added "cached", or throws theexception if adding fails.64 * @return the internal ID of the just added cached representation, or throws an exception if adding fails. 64 65 * @throws NotInDataBaseException if there is no object with the generated for the new cached representation external id. 65 66 * @throws IOException if reading blob fails. … … 74 75 /** 75 76 * 76 * @param internalID the internal database id of thecached representation.77 * @param cachedInfo thenew metadata for it.77 * @param internalID the internal database id of a cached representation. 78 * @param cachedInfo new metadata for it. 78 79 * @return # of updated rows in the table "cached_representation". Must be 1 if updated, and 0 otherwise. 79 80 */ … … 82 83 /** 83 84 * 84 * @param internalID the internal database id of thecached representation.85 * @param internalID the internal database id of a cached representation. 85 86 * @param cachedBlob the new content considered as BLOB. 86 87 * @return # of updated rows in the table "cached_representation". Must be 1 if updated, and 0 otherwise. … … 94 95 /** 95 96 * 96 * @param internalID the internal database id of thecached representation.97 * @param internalID the internal database id of a cached representation. 97 98 * @return # deleted rows on the table "cached_representation". 98 99 */ -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/DBDispatcher.java
r6021 r6042 46 46 47 47 /** 48 * This class does not implement access to the database directly but dispatch49 * the requests to the corresponding dao implementations; each defined in the50 * interface method implements a request; if the request addresses more then one51 * table in the database then the request is split up in abasic per-table52 * requests wh ich are ordered so that there will not beconstraint 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; 53 53 * e.g when a target is to be deleted then first it is checked if no annotation 54 * refers to it, and if notit is deleted from "target" table.54 * refers to it, and if this is the case then it is deleted from "target" table. 55 55 * 56 56 * @author olhsha … … 60 60 61 61 /** 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. 64 64 * 65 65 */ … … 73 73 * 74 74 * @param externalID the external UUID of the resource. 75 * @param resource the type of resource (annotation, principal, cached representation, target, notebook)76 * which tellin 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. 77 77 * @return the internal database id of the resource. 78 78 * @throws NotInDataBaseException … … 83 83 * 84 84 * @param resourceID the internal database identifier of the resource, 85 * @param resource the type of resource (annotation, principal, cached representation, target, notebook)86 * which tellin 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. 87 87 * @return the external UUID of the resource. 88 88 */ … … 92 92 * 93 93 * @param resourceID the internal database identifier of the resource. 94 * @param resource the type of resource (annotation, principal, cached representation, target, notebook)95 * which tellin 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; 97 97 * currently makes sense only for annotations and notebooks. 98 98 */ … … 101 101 /** 102 102 * 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". 105 130 * @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, 108 133 * endsWith or be exact match of the "link" parameter above. 109 134 * @param text that must be in the body of the requested annotations; no limitations when null. 110 135 * @param inloggedPrincipalID the internal database id of the inlogged principal. 111 * @param accessMode the access mode that relate dthe inlogged principal to the requested annotations.136 * @param accessMode the access mode that relate the inlogged principal to the requested annotations. 112 137 * @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) 142 141 * of the annotations satisfying the criteria defined by the parameters. 143 142 * @throws NotInDataBaseException if getFileteredAnnotationIDs throws this exception. … … 149 148 /** 150 149 * 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". 153 152 */ 154 153 CachedRepresentationInfo getCachedRepresentationInfo(Number internalID); … … 157 156 * 158 157 * @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". 160 159 * 161 160 */ … … 179 178 * 180 179 * @param annotationID an internal database annotation identifier. 181 * @return the {@link ReferenceList} object containing the references of alltargets of the annotationID.180 * @return the {@link ReferenceList} object containing the h-references of all the targets of the annotationID. 182 181 */ 183 182 ReferenceList getAnnotationTargets(Number annotationID); … … 193 192 * 194 193 * @param annotationID an internal database annotation identifier. 195 * @return the list of h-references of the principals which are mentionedin196 * 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" 197 196 * and for which principal's name and / or principal's e-mail is missing. 198 197 */ … … 202 201 * 203 202 * @param targetID an internal database target identifier. 204 * @return the list of the external ID -s that refersto the same source (link) as targetID203 * @return the list of the external ID of targets that refer to the same source (link) as targetID 205 204 */ 206 205 ReferenceList getTargetsForTheSameLinkAs(Number targetID); … … 208 207 /** 209 208 * 210 * @param cachedID an internal database cached 211 * @return BLOB of the cached representation.209 * @param cachedID an internal database cached-representation identifier. 210 * @return the BLOB of the cached representation. 212 211 */ 213 212 InputStream getCachedRepresentationBlob(Number cachedID); … … 216 215 * 217 216 * @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". 219 218 */ 220 219 Target getTarget(Number internalID); … … 223 222 * 224 223 * @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". 226 225 */ 227 226 Principal getPrincipal(Number principalID) ; … … 231 230 * 232 231 * @param eMail an email address. 233 * @return {@link Principal} objectwith e-mail "eMail".232 * @return a {@link Principal} object representing a principal with e-mail "eMail". 234 233 * @throws NotInDataBaseException if an principal with such eMail is not found. 235 234 */ … … 238 237 /** 239 238 * 240 * @param internalID the databaseinternalId of a principal.241 * @return {@link Principal} object with this internalID; will throw runtime239 * @param internalID the internal database Id of a principal. 240 * @return a {@link Principal} object with this internalID; will throw runtime 242 241 * "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 internalId244 * 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. 245 244 */ 246 245 String getPrincipalRemoteID(Number internalID); … … 266 265 * @param annotationID the internal database id of an annotation. 267 266 * @param principalID the internal database id of a principal. 268 * @return access of the principalID w.r.t. annotationID, which is a maximal access267 * @return access of the principalID w.r.t. annotationID, computed is a maximum 269 268 * 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". 271 270 */ 272 271 Access getAccess(Number annotationID, Number principalID) ; … … 275 274 * 276 275 * @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". 279 277 */ 280 278 Access getPublicAttribute(Number annotationID); … … 283 281 * 284 282 * @param principalID the internal database id of a principal. 285 * @return user, developer, or admin.283 * @return "user" or "developer" or "admin". 286 284 */ 287 285 String getTypeOfPrincipalAccount(Number principalID); … … 289 287 /** 290 288 * 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. 292 290 */ 293 291 Principal getDataBaseAdmin() ; … … 295 293 /** 296 294 * 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. 298 296 * @param principalID the internal Id of the principal who wants to perform "action". 299 * @param resourceID the internal id of the resource on which actionmust be performed.297 * @param resourceID the internal id of the resource on which "action" must be performed. 300 298 * @param resource a type of resource (annotation, notebook, cached representation, target, 301 * principal) 299 * principal). 302 300 * @return true iff "principalId" is allowed to perform "action" on "resourceID"; false 303 * otherwise false; currently is implemented only for "annotation" and return "true" on304 * all other type sof resources.301 * otherwise; currently is implemented only for "annotation" and return "true" on 302 * all other type of resources. 305 303 */ 306 304 boolean canDo(Access action, Number principalID, Number resourceID, Resource resource); … … 311 309 * 312 310 * @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 which311 * @param access an {@link Access} object. 312 * @return a {@link NotebookInfoList} object containing the list of all notebooks to which 315 313 * "principalID" has "access". 316 314 */ … … 330 328 * @param principalID the internal database id of a principal. 331 329 * @return a {@link ReferenceList} object containing hrefs of notebooks owned 332 * by "principlaID" 330 * by "principlaID". 333 331 */ 334 332 ReferenceList getNotebooksOwnedBy(Number principalID); … … 338 336 * @param notebookID the internal database id of a notebook. 339 337 * @param access an {@link Access} object. 340 * @return a{@link ReferenceList} object containing hrefs of principals338 * @return the {@link ReferenceList} object containing hrefs of principals 341 339 * which have "access" to "notebookID". 342 340 */ … … 345 343 * 346 344 * @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". 348 346 */ 349 347 Notebook getNotebook(Number notebookID); … … 352 350 * 353 351 * @param notebookID the internal database id of a notebook. 354 * @return aninternal database Id of the owner of the "notebookID".352 * @return the internal database Id of the owner of the "notebookID". 355 353 */ 356 354 Number getNotebookOwner(Number notebookID); … … 360 358 * @param notebookID the internal database id of a notebook. 361 359 * @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. 363 361 * @param orderedBy SQL "orderedBy" string value, must be one of the fields in the table "annotation". 364 362 * @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". 367 365 */ 368 366 ReferenceList getAnnotationsForNotebook(Number notebookID, int startAnnotation, int maximumAnnotations, String orderedBy, boolean desc); … … 377 375 * @param oldIdentifier the external UUD of the resource. 378 376 * @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 oldIdentifier377 * @return # of updated rows in the corresponding table. Must be 1 if the resource with "oldIdentifier" 380 378 * gets the external identifier updated by "newIdentifier", and 0 otherwise. 381 379 * @throws NotInDataBaseException if the resource with "oldIdentifier" is not found. … … 386 384 * 387 385 * @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). 389 387 * @return "true" if the account gets updated, and "false" otherwise. 390 388 * @throws NotInDataBaseException if the principal with the external UUD of a principle. … … 396 394 * 397 395 * @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, 401 399 * or the remote user are not found in the database. 402 400 * @throws ForbiddenException if the "remoteUser" does not have "all" rights for the annotation with the external id, … … 407 405 /** 408 406 * 409 * @param internalID the internal database id of an annotation whose body tobe updated.410 * @param annotationBody an {@link Annotation } object.411 * @return # of rows in "annotation" table."1" if the annotation body gets updated by407 * @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 412 410 * "annotationBody" gets updated, and "0" otherwise. 413 411 */ … … 416 414 /** 417 415 * 418 * @param internalID the internal database id of an annotation whose body tobe 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", 421 419 * and "0" otherwise. 422 420 */ … … 427 425 * @param annotationID the internal database id of an annotation. 428 426 * @param principalID the internal database id of a principal. 429 * @param access c430 * @return # rows updated to the table "annotations_principals_access."1" if427 * @param access an {@link Access} object representing an access level. 428 * @return # rows updated in the table "annotations_principals_access: "1" if 431 429 * "access" is assigned to the "principlaID" for the "ammotationID". 432 430 */ … … 436 434 * 437 435 * @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". 440 438 * @throws NotInDataBaseException if one of the principals mentioned in the list, is not found. 441 439 */ … … 447 445 * @param publicAttribute an {@link Access} object. 448 446 * @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". 450 448 */ 451 449 int updatePublicAttribute(Number annotationID, Access publicAttribute); … … 453 451 /** 454 452 * 455 * @param principal a {@link Principal} project.453 * @param principal a {@link Principal} object. 456 454 * @return the internal database id of the updated principal. 457 455 * @throws NotInDataBaseException if the principal with the external id declared in "principal" … … 471 469 /** 472 470 * 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. 474 472 * @return # of updated rows in the table "cached_representation"; must be 1 if the 475 * row with the external id declared in "cachedInfo" has gotupdated.473 * row with the external id declared in "cachedInfo" has been updated. 476 474 * @throws NotInDataBaseException if the cached representation with the external id declared in the 477 * "cachedInfo" is n it found.475 * "cachedInfo" is not found. 478 476 */ 479 477 int updateCachedMetada(CachedRepresentationInfo cachedInfo) throws NotInDataBaseException; … … 484 482 * @param cachedBlob a new BLOB for the cached representation. 485 483 * @return # of updated rows in "cached_representations_table"; must be "1" if the row with 486 * "internalID" gotupdated.484 * "internalID" has been updated. 487 485 * @throws IOException if reading BLOB fails. 488 486 */ … … 494 492 * @param notebookID the internal database id of a notebook. 495 493 * @param upToDateNotebookInfo a {@link NotebookInfo} object. 496 * @return true if the "notebooks" table has gotupdated, namely the row with "notebookID" updated497 * 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. 498 496 * @throws NotInDataBaseException if the notebook with "internalID" is not found. 499 497 */ … … 504 502 * @param notebookID the internal database id of a notebook. 505 503 * @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). 507 505 */ 508 506 boolean addAnnotationToNotebook(Number notebookID, Number annotationID); … … 515 513 * 516 514 * @param targetID the internal database id of a target. 517 * @param fragmentDescriptor a string that locate dthe target within the cached representation.515 * @param fragmentDescriptor a string that locates the target within the cached representation. 518 516 * @param cachedInfo a {@link CachedRepresentationInfo} object representing the metadata of the cached representation. 519 * @param cachedBlob a BLOB, representing the content of acached representation.517 * @param cachedBlob a BLOB, representing the content of the cached representation. 520 518 * @return result[0] = # updated rows in the table "targets_cached_representations" (must be 1 or 0). result[1] = the 521 519 * internal ID of the added cached (a new one if "cached" was new for the database). … … 528 526 * 529 527 * @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. 533 530 * @return a map "temporary targetID |--> target externalID"; its domain is the 534 531 * temporary IDs of all the new targets; while adding a new target, a new 535 532 * external ID is generated for it and it becomes the value of the map; the 536 * targetIDs which are already present in the DBare not in the domain. If533 * targetIDs which are already present in the database are not in the domain. If 537 534 * all targets are old, then the map is empty. 538 535 * @throws NotInDataBaseException if adding of one of fresh targets fails. … … 565 562 * @param strength 566 563 * @param salt 567 * @return the total of updated rows in the tables related to the Spring authentication; must be564 * @return the total # of updated rows in the tables related to the Spring authentication; must be 568 565 * 2=1+1, where 1 is for the table "users", and 1 is for the table "roles". 569 566 */ … … 585 582 * @param annotation an {@link Annotation} object representing an annotation to be added. 586 583 * @param ownerID the internal database id of the notebook's owner (principal). 587 * @return true if anew 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. 588 585 * @throws NotInDataBaseException if adding annotation to the database fails. 589 586 */ … … 647 644 /** 648 645 * 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. 650 647 * @return # of deleted rows in the table "target"; must be one if "internalID" is deleted. 651 648 */ … … 676 673 * @param annotationID the internal database id of an annotation. 677 674 * @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 thisannotation679 * 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. 680 677 */ 681 678 ResponseBody makeAnnotationResponseEnvelope(Number annotationID); … … 683 680 /** 684 681 * 685 * @param notebookID the internal database id of a n annotation.682 * @param notebookID the internal database id of a notebook. 686 683 * @return a {@link ResponseBody} object containing a notebook and a list of actions to do; 687 684 * actions are not specified yet. … … 696 693 * annotation, principal, notebook, target, cached_representation. 697 694 * @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 action695 * if information about a principal (e.g. an e-mail) is missing then the action like "add_principal_info" 699 696 * is added to the list of actions. 700 697 */ … … 704 701 * 705 702 * @param fullName a string representing a full name of a principal. 706 * @return the external Id of the (first) principal with withfull name.703 * @return the external Id of the (first) principal with this full name. 707 704 * @throws NotInDataBaseException if such principal is not found. 708 705 */ … … 711 708 /** 712 709 * 713 * @param headline a string representingthe headline of an annotation.710 * @param headline the headline of an annotation. 714 711 * @return the list of UUID's of all the annotations with this headline. 715 712 */ … … 718 715 /** 719 716 * 720 * @param headline a string representingthe headline of an annotation.717 * @param headline the headline of an annotation. 721 718 * @return the list of internal database id-s of all the annotations with this headline. 722 719 */ -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ILambda.java
r6004 r6042 22 22 23 23 /** 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}. 26 25 * @author olhsha 27 26 */ … … 30 29 /** 31 30 * 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". 33 32 * @return an instance of "R" corresponding to these parameter values,e.g. an annotation if R is instantiated as "Annotation". 34 33 * @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 22 22 23 23 /** 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}. 25 25 * @author olhsha 26 26 */ -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/NotebookDao.java
r6004 r6042 27 27 28 28 /** 29 * Created on : Jun 12, 2013, 1:40:09 PM30 * 31 * @author Peter Withers <peter.withers@mpi.nl>29 * 30 * 31 * @author olhsha@mpi.nl 32 32 */ 33 33 … … 54 54 * 55 55 * @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: 57 57 * "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 ac essMode);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); 61 61 62 62 /** … … 71 71 * 72 72 * @param notebookID the internal database id of a notebook. 73 * @return the {@link NotebookInfo} object built for the notebook with notebookID upon the corresponding row73 * @return the {@link NotebookInfo} object representing the notebook with notebookID, built on the corresponding row 74 74 * in the "notebook" table. 75 75 */ … … 80 80 * 81 81 * @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. 84 83 */ 85 84 Notebook getNotebookWithoutAnnotationsAndAccesssAndOwner(Number notebookID); … … 102 101 * @param notebookID the internal database id of a notebook. 103 102 * @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. 106 105 */ 107 106 boolean updateNotebookMetadata(Number notebookID, String title, Number ownerID); … … 137 136 * @param ownerID the internal database id of the owner principal. 138 137 * @return the internal id of the created notebook. 139 * @throws NotInDataBaseException if creati onthe notebook fails.138 * @throws NotInDataBaseException if creating the notebook fails. 140 139 */ 141 140 public Number createNotebookWithoutAccesssAndAnnotations(Notebook notebook, Number ownerID) throws NotInDataBaseException; … … 145 144 * @param notebookID the internal database ID of a notebook. 146 145 * @param annotationID the internal database ID of an annotation. 147 * @return true if the row for the (n tebookID,annotationID) has been added to the junction table146 * @return true if the row for the (notebookID,annotationID) has been added to the junction table 148 147 * "notebooks_annotations". 149 148 */ … … 172 171 * 173 172 * @param notebookID the internal database ID of a notebook. 174 * @param annotationID annotationIDthe internal database ID of an annotation.173 * @param annotationID the internal database ID of an annotation. 175 174 * @return true iff the row for the (notebookID,annotationID) has been deleted from the junction table 176 175 * "notebooks_annotations". -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/PrincipalDao.java
r6004 r6042 36 36 * 37 37 * @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". 39 39 */ 40 40 public Principal getPrincipal(Number internalID); … … 42 42 /** 43 43 * 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. 47 47 */ 48 48 public Principal getPrincipalByInfo(String eMail) throws NotInDataBaseException; … … 63 63 /** 64 64 * 65 * @param remoteID the string representing theremote id of a principal.65 * @param remoteID the remote id of a principal. 66 66 * @return true iff a principal with "remoteID" exists in the table "principal". 67 67 */ … … 78 78 * 79 79 * @param internalID the internal database id of a principal. 80 * @return the string representing theremote id of the principal.80 * @return the remote id of the principal. 81 81 */ 82 82 public String getRemoteID(Number internalID); … … 85 85 /** 86 86 * 87 * @param remoteID the string representing theremote id of a principal.88 * @return the interna lddatabase 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". 89 89 * @throws NotInDataBaseException if there is no principal with "remoteID". 90 90 */ … … 93 93 /** 94 94 * 95 * @param remoteID the string representing theremote id of a principal.95 * @param remoteID the remote id of a principal. 96 96 * @return the external UUID of the principal with "remotedID". 97 97 * @throws NotInDataBaseException if there is no principal with "remoteID". … … 101 101 /** 102 102 * 103 * @param fullName the string representing thefull name of a principal.103 * @param fullName the full name of a principal. 104 104 * @return the external UUID of the principal with "fullName. 105 105 * @throws NotInDataBaseException if there is no principal with "fullName". … … 119 119 * 120 120 * @param externalID the external UUID of a principal. 121 * @param account a string representingthe 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". 123 123 * @throws NotInDataBaseException iff no principal with "externalId" is found. 124 124 */ … … 127 127 /** 128 128 * 129 * @param principal a {@link Principal} object which must update the principal referred by "externa kId" given in this object.130 * @return the internal id of aprincipal 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. 132 132 */ 133 133 public Number updatePrincipal(Principal principal) throws NotInDataBaseException; … … 136 136 * 137 137 * @param principal a {@link Principal} object to be added to the database. 138 * @param remoteID a string representingthe remote of of the principal to be added.138 * @param remoteID the remote of of the principal to be added. 139 139 * @return the internal id of the just added principal. 140 140 * @throws NotInDataBaseException if adding the principal fails. … … 148 148 * @param strength the strength of a password. 149 149 * @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. 151 151 */ 152 152 public int addSpringUser(String username, String password, int strength, String salt); … … 155 155 * 156 156 * @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. 158 158 */ 159 159 public int addSpringAuthorities(String username); … … 162 162 * 163 163 * @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. 165 165 * @throws PrincipalCannotBeDeleted if the principal is in use, i.e. mentioned in one of the junction tables. 166 166 */ -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/ResourceDao.java
r6004 r6042 25 25 26 26 /** 27 * This interface s describes signatures common for all resources: Annotation, Target, Cached Representation, Principal, Notebook;28 * the implementation must contain field "resourceTableName" whose valueis 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: 29 29 * "annotation", "target", "cached_representation", "principal", "notebook". 30 30 * @author olhsha … … 40 40 /** 41 41 * 42 * @param externalId the external UUI dof a resource.42 * @param externalId the external UUID of a resource. 43 43 * @return the internal ID of the resource. 44 44 * @throws NotInDataBaseException if the resource with this id is not found. … … 55 55 /** 56 56 * 57 * @param oldIdentifier the current external UUI dof a resource.58 * @param newIdentifier the new external ID of the resource.59 * @return true iff the external id of the resource ha ve 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". 60 60 */ 61 61 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 21 21 import eu.dasish.annotation.schema.Target; 22 22 import eu.dasish.annotation.schema.TargetInfo; 23 import java.sql.SQLException;24 23 import java.util.List; 25 24 import java.util.Map; … … 38 37 * 39 38 * @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". 41 40 */ 42 41 public Target getTarget(Number internalID); … … 45 44 * 46 45 * @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". 48 47 */ 49 48 public List<TargetInfo> getTargetInfos(List<Number> targets); … … 67 66 /** 68 67 * 69 * @param link a string representing alink (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". 71 70 */ 72 71 public List<Number> getTargetsForLink(String link); … … 75 74 * 76 75 * @param cachedID the internal database id of a cached representation. 77 * @return true iff "cachedID" is referred to forsome target in "targets_cached_representations" table.76 * @return true iff "cachedID" is connected to some target in "targets_cached_representations" table. 78 77 */ 79 78 boolean cachedIsInUse(Number cachedID); … … 91 90 */ 92 91 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 */ 94 98 public Number addTarget(Target target) throws NotInDataBaseException; 95 99 … … 100 104 * @param cachedID the internal database id of a cached representation. 101 105 * @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. 103 107 */ 104 108 public int updateTargetCachedRepresentationFragment(Number targetID, Number cachedID, String fragmentDescription); 105 109 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); 108 118 109 119 /** … … 114 124 * 115 125 * @param internalID the internal database id of a target. 116 * @return # deleted rows in "target" table. Should be "1" if the target has been deleted.126 * @return # deleted rows in "target" table. Should be "1" if the target has been removed. 117 127 */ 118 128 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 256 256 }; 257 257 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 267 259 @Override 268 260 public List<String> getAnnotationREFs(List<Number> annotationIDs) {
Note: See TracChangeset
for help on using the changeset viewer.