Changeset 5203
- Timestamp:
- 05/15/14 17:35:14 (10 years ago)
- Location:
- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/CHANGES.txt
r4956 r5203 25 25 April 7/04. 1) Added automated generation of the default record for a shibollized principal, if his/her record not in DB yet. However, to customise the record, the principal has to ask the database admin. 2) Added attribute âpublicâ to permission lists. The database is changed so that the column âpublicâ is added to the table annotation. 3) Attribute and element banes, and the names of their values are simplified. The corresponding tables and columns are renamed. 4) Using ânullâ as the intended value when a resource is not found is replaced with throwing an exception. 26 26 27 April 11 2014. fixed bug: posting cached representations did now work. Added features: updating blob of the cached, updating its metadata, updating fragment connecting a target and its cached. 27 April 11 2014. fixed bug: posting cached representations did now work. Added features: updating blob of the cached, updating its metadata, 28 updating fragment connecting a target and its cached. 29 30 May 15, 2014. Added validation (via the schem on SCHEMAcat) of the xmls sent by client. Refactoring. 31 fixing busg with escape symbols and URL encoding of them. -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/UPDATE.txt
r4956 r5203 1 1. Placing tarball: as always, take the tar-ball of the new version 1. 3.2, and follow the1 1. Placing tarball: as always, take the tar-ball of the new version 1.4, and follow the 2 2 standard MPI deployment procedure. Consult the instructions from INSTALL.txt 3 3 about placing war file if you have forgotten. 4 4 5 2. Adjusting shhaa.xml, database, web.xml this time are not necessary this time. It was just an urgent bug fix in some posting request. 5 2. Adjusting shhaa.xml, database, web.xml this time are not necessary. OR if you want to reuse 6 this tarball to deploy shibbolized version you need to change web.xml 7 8 2.1. Comment <filter> 9 <filter-name>AAIFilter</filter-name> 10 <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class> 11 </filter> 12 <filter-mapping> 13 <filter-name>AAIFilter</filter-name> 14 <url-pattern>/*</url-pattern> 15 </filter-mapping> 16 17 and uncomment 18 19 <filter> 20 <filter-name>springSecurityFilterChain</filter-name> 21 <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> 22 </filter> 23 <filter-mapping> 24 <filter-name>springSecurityFilterChain</filter-name> 25 <url-pattern>/*</url-pattern> 26 </filter-mapping> 27 28 29 2.2. Comment <param-value>/ds/webannotator/j_spring_security_logout</param-value> and uncomment 30 <param-value>/ds/webannotator?shhaaDo=lO</param-value> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml
r5174 r5203 363 363 <netbeans.hint.license>gpl20</netbeans.hint.license> 364 364 <plugin.license.copyrightYear>2013</plugin.license.copyrightYear> 365 <project.version>1. 3.5</project.version>365 <project.version>1.4</project.version> 366 366 <shibboleth.version>1.0.4</shibboleth.version> 367 367 </properties> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/DBDispatcherImlp.java
r5186 r5203 211 211 212 212 213 // Filetring on accessMode 213 // Filetring on accessMode, the junction table 214 214 if (annotationIDs != null) { 215 215 if (!annotationIDs.isEmpty()) { … … 218 218 List<Number> annotationIDsAccess = annotationDao.getAnnotationIDsForPermission(inloggedPrincipalID, access); 219 219 List<Number> annotationIDsPublic = annotationDao.getAnnotationIDsForPublicAccess(access); 220 List<Number> annotationIDsOwned = annotationDao.getFilteredAnnotationIDs(inloggedPrincipalID, null, null, null, null);220 List<Number> annotationIDsOwned = annotationDao.getFilteredAnnotationIDs(inloggedPrincipalID, text, namespace, after, before); 221 221 int check1 = this.addAllNoRepetitions(annotationIDsAccess, annotationIDsPublic); 222 222 int check2 = this.addAllNoRepetitions(annotationIDsAccess, annotationIDsOwned); 223 annotationIDs.retainAll(annotationIDsAccess); 223 annotationIDs.retainAll(annotationIDsAccess);// intersection 224 224 } 225 225 } … … 238 238 if (!linkSubstring.isEmpty()) { 239 239 if (annotationIDs != null) { 240 String partiallyEncoded = this.encodeURLNoSlashEncoded(linkSubstring); 241 String urlEncoded = null; 242 try { 243 urlEncoded = URLEncoder.encode(linkSubstring, "UTF-8"); 244 } catch (UnsupportedEncodingException e) { 245 logger.debug(e.toString()); 246 } 247 240 248 List<Number> result = new ArrayList(); 241 249 for (Number annotationID : annotationIDs) { … … 244 252 if (!result.contains(annotationID)) { 245 253 String link = targetDao.getLink(targetID); 246 if (link.contains(linkSubstring) ) {254 if (link.contains(linkSubstring) || link.contains(partiallyEncoded)) { 247 255 result.add(annotationID); 248 256 } else { 249 try { 250 String urlEncoded = URLEncoder.encode(linkSubstring, "UTF-8"); 257 if (urlEncoded != null) { 251 258 if (link.contains(urlEncoded)) { 252 259 result.add(annotationID); 253 260 } 254 } catch (UnsupportedEncodingException e) {255 logger.debug(e.toString());256 261 } 257 262 } … … 284 289 } 285 290 return result; 291 } 292 293 private String encodeURLNoSlashEncoded(String string) { 294 String[] split = string.split("/"); 295 StringBuilder result = new StringBuilder(split[0]); 296 for (int i = 1; i < split.length; i++) { 297 try { 298 result.append("/").append(URLEncoder.encode(split[i], "UTF-8")); 299 } catch (UnsupportedEncodingException e) { 300 result.append("/").append(split[i]); 301 logger.debug(e.toString()); 302 } 303 } 304 return result.toString(); 286 305 } 287 306 … … 648 667 // TODO: optimize (not chnanged targets should not be deleted) 649 668 // TODO: unit test 669 650 670 @Override 651 671 public int updateAnnotation(Annotation annotation) throws NotInDataBaseException { -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcTargetDao.java
r5138 r5203 22 22 import eu.dasish.annotation.schema.Target; 23 23 import eu.dasish.annotation.schema.TargetInfo; 24 import java.io.UnsupportedEncodingException;25 import java.net.URLEncoder;26 24 import java.sql.ResultSet; 27 25 import java.sql.SQLException; … … 44 42 45 43 private final Logger loggerTargetDao = LoggerFactory.getLogger(JdbcTargetDao.class); 46 private final String encoding = "ISO-8859-1"; 47 44 48 45 public JdbcTargetDao(DataSource dataTarget) { 49 46 setDataSource(dataTarget); -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
r5174 r5203 47 47 <param-name>eu.dasish.annotation.backend.logout</param-name> 48 48 <!-- <param-value>/ds/webannotator?shhaaDo=lO</param-value>--> 49 <!-- <param-value>/ds/webannotator/j_spring_security_logout</param-value>-->50 <param-value>/annotator-backend/j_spring_security_logout</param-value>49 <param-value>/ds/webannotator/j_spring_security_logout</param-value> 50 <!-- <param-value>/annotator-backend/j_spring_security_logout</param-value> --> 51 51 </context-param> 52 52 … … 107 107 </security-role> --> 108 108 109 <!-- Spring security -->109 <!-- Spring security --> 110 110 <filter> 111 111 <filter-name>springSecurityFilterChain</filter-name> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/DBDispatcherTest.java
r5186 r5203 305 305 306 306 final List<Number> mockAnnotationIDsOwned = new ArrayList<Number>(); 307 mockAnnotationIDsOwned.add(3);307 //mockAnnotationIDsOwned.add(3); 308 308 309 309 final List<Number> mockAnnotationIDsRead = new ArrayList<Number>(); … … 342 342 will(returnValue(mockAnnotationIDsPublicRead)); 343 343 344 oneOf(annotationDao).getFilteredAnnotationIDs(loggedIn, null, null, null, null);344 oneOf(annotationDao).getFilteredAnnotationIDs(loggedIn, "some html 1", null, after, before); 345 345 will(returnValue(mockAnnotationIDsOwned)); 346 346 … … 374 374 375 375 final List<Number> mockAnnotationIDsOwned = new ArrayList<Number>(); 376 mockAnnotationIDsOwned.add(3);376 //mockAnnotationIDsOwned.add(3); 377 377 378 378 final List<Number> mockAnnotationIDsWrite = new ArrayList<Number>(); … … 409 409 will(returnValue(mockAnnotationIDsPublicWrite)); 410 410 411 oneOf(annotationDao).getFilteredAnnotationIDs(loggedIn, null, null, null, null);411 oneOf(annotationDao).getFilteredAnnotationIDs(loggedIn, "some html 1", null, after, before); 412 412 will(returnValue(mockAnnotationIDsOwned)); 413 413 … … 538 538 539 539 final List<Number> mockAnnotationIDsOwned = new ArrayList<Number>(); 540 mockAnnotationIDsOwned.add(3);540 //mockAnnotationIDsOwned.add(3); 541 541 542 542 final List<Number> mockAnnotationIDsRead = new ArrayList<Number>(); … … 578 578 579 579 580 581 580 oneOf(annotationDao).getFilteredAnnotationIDs(1, "some html 1", null, after, before); 582 581 will(returnValue(mockAnnotationIDs1)); … … 589 588 590 589 591 oneOf(annotationDao).getFilteredAnnotationIDs( loggedIn, null, null, null, null);590 oneOf(annotationDao).getFilteredAnnotationIDs(3, "some html 1", null, after, before); 592 591 will(returnValue(mockAnnotationIDsOwned)); 593 592 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java
r5174 r5203 182 182 */ 183 183 @Test 184 @Ignore185 184 public void testCreateAnnotation() throws NotInDataBaseException, IOException{ 186 185
Note: See TracChangeset
for help on using the changeset viewer.