Changeset 4207 for DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/DBIntegrityServiceImlp.java
- Timestamp:
- 12/19/13 14:36:04 (10 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/impl/DBIntegrityServiceImlp.java
r4181 r4207 40 40 import eu.dasish.annotation.schema.User; 41 41 import eu.dasish.annotation.schema.UserWithPermission; 42 import java.io.IOException; 42 43 import java.io.InputStream; 43 44 import java.lang.Number; 45 import java.sql.SQLException; 44 46 import java.sql.Timestamp; 45 47 import java.util.ArrayList; … … 48 50 import java.util.Map; 49 51 import java.util.UUID; 52 import javax.xml.parsers.ParserConfigurationException; 50 53 import org.springframework.beans.factory.annotation.Autowired; 51 54 import org.slf4j.Logger; 52 55 import org.slf4j.LoggerFactory; 56 import org.springframework.transaction.annotation.Transactional; 53 57 54 58 /** … … 94 98 } 95 99 96 ///////////// GETTERS //////////////////////////100 97 101 @Override 98 102 public Number getTargetInternalIdentifier(UUID externalID) { … … 189 193 //////////////////////////////////////////////////////////////////////// 190 194 @Override 191 public List<Number> getFilteredAnnotationIDs(String link, String text, Number inloggedUserID, String access, String namespace, UUID owner, Timestamp after, Timestamp before) {192 193 if (access == null) {194 return null; 195 } 196 197 List<Number> annotationIDs = annotationDao.getAnnotationIDsForUserWithPermission(inloggedUserID, access );195 public List<Number> getFilteredAnnotationIDs(String link, String text, Number inloggedUserID, String[] accessModes, String namespace, UUID owner, Timestamp after, Timestamp before) { 196 197 if (accessModes == null) { 198 return null; 199 } 200 201 List<Number> annotationIDs = annotationDao.getAnnotationIDsForUserWithPermission(inloggedUserID, accessModes); 198 202 199 203 if (link != null) { … … 258 262 259 263 @Override 260 public AnnotationInfoList getFilteredAnnotationInfos(String word, String text, Number inloggedUserID, String access, String namespace, UUID owner, Timestamp after, Timestamp before) {261 List<Number> annotationIDs = getFilteredAnnotationIDs(word, text, inloggedUserID, access , namespace, owner, after, before);264 public AnnotationInfoList getFilteredAnnotationInfos(String word, String text, Number inloggedUserID, String[] accessModes, String namespace, UUID owner, Timestamp after, Timestamp before) { 265 List<Number> annotationIDs = getFilteredAnnotationIDs(word, text, inloggedUserID, accessModes, namespace, owner, after, before); 262 266 if (annotationIDs != null) { 263 267 AnnotationInfoList result = new AnnotationInfoList(); … … 388 392 @Override 389 393 public int updateAnnotationBody(Number internalID, AnnotationBody annotationBody) { 390 return annotationDao.updateAnnotationBody(internalID, annotationBody); 394 String[] body = annotationDao.retrieveBodyComponents(annotationBody); 395 return annotationDao.updateAnnotationBody(internalID, body[0], body[1], annotationBody.getXmlBody()!=null); 391 396 } 392 397 … … 518 523 String bodyText; 519 524 String newBodyText; 525 String mimeType; 520 526 if (annotationBody.getXmlBody() != null) { 521 527 bodyText = Helpers.elementToString(annotation.getBody().getXmlBody().getAny()); 528 mimeType = annotationBody.getXmlBody().getMimeType(); 522 529 } else { 523 530 if (annotation.getBody().getTextBody() != null) { 524 531 bodyText = annotation.getBody().getTextBody().getValue(); 525 532 mimeType = annotationBody.getTextBody().getMimeType(); 526 533 } else { 527 534 logger.error("The client has sent ill-formed annotation body."); … … 530 537 } 531 538 newBodyText = Helpers.replace(bodyText, targetIdPairs); 532 return annotationDao.updateAnnotationBody Text(annotationID, newBodyText);539 return annotationDao.updateAnnotationBody(annotationID, newBodyText, mimeType, annotationBody.getXmlBody() != null); 533 540 } 534 541
Note: See TracChangeset
for help on using the changeset viewer.