- Timestamp:
- 11/05/14 14:32:51 (10 years ago)
- Location:
- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/CHANGES.txt
r5755 r5774 61 61 class is corrected (cachedRepresentatinons --> cachedRepresentations). 62 62 63 October 31, 2014. This is a package for webannotator of shibbolized version for lux17, 64 sych with the basic authenticated version. 63 65 66 67 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/UPDATE.txt
r5755 r5774 1 1 2 Placing tarball: take the tar-ball of the new version 1.5.4- basic, and follow the2 Placing tarball: take the tar-ball of the new version 1.5.4-shibboleth, and follow the 3 3 standard MPI deployment procedure. 4 4 5 This is is a simple update due to fixing a spelling error in the DASISHschema. 5 This is synchronisation of the shibbolized-authenticated version of the backend 6 to the basic-authnticated, so both versions are complyiant with the same schema. 7 8 6 9 7 10 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml
r5755 r5774 5 5 <groupId>eu.dasish.annotation</groupId> 6 6 <artifactId>annotator-backend</artifactId> 7 <version>1.5.4- basic</version>7 <version>1.5.4-shibboleth</version> 8 8 <packaging>war</packaging> 9 9 <name>annotator-backend Jersey Webapp</name> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/Helpers.java
r5393 r5774 106 106 + remoteID + ".<br>" 107 107 + "<h3>Welcome to DASISH Webannotator (DWAN)</h3><br>" 108 + "<a href=\"" + baseUri + "\"> To DWAN 's test jsppage</a>"108 + "<a href=\"" + baseUri + "\"> To DWAN REST overview page</a>" 109 109 + "</body>"; 110 110 return welcome; -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/DBDispatcher.java
r5686 r5774 226 226 * @return 1 of the annotation if it is updated 227 227 */ 228 int updateAnnotation(Annotation annotation ) throws NotInDataBaseException;228 int updateAnnotation(Annotation annotation, String remoteUser) throws NotInDataBaseException; 229 229 230 230 /** -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/DBDispatcherImlp.java
r5755 r5774 697 697 698 698 @Override 699 public int updateAnnotation(Annotation annotation ) throws NotInDataBaseException {699 public int updateAnnotation(Annotation annotation, String remoteUser) throws NotInDataBaseException { 700 700 Number annotationID = annotationDao.getInternalID(UUID.fromString(annotation.getId())); 701 int updatedAnnotations = annotationDao.updateAnnotation(annotation, annotationID, principalDao.getInternalIDFromHref(annotation.getOwnerHref())); 701 Number ownerID = principalDao.getInternalIDFromHref(annotation.getOwnerHref()); 702 int updatedAnnotations = annotationDao.updateAnnotation(annotation, annotationID, ownerID); 702 703 int deletedTargets = annotationDao.deleteAllAnnotationTarget(annotationID); 703 int deletedPrinsipalsAccesss = annotationDao.deleteAnnotationPermissions(annotationID);704 704 int addedTargets = this.addTargets(annotation, annotationID); 705 int addedPrincipalsAccesss = this.addPermissions(annotation.getPermissions().getPermission(), annotationID); 706 int updatedPublicAttribute = annotationDao.updatePublicAttribute(annotationID, annotation.getPermissions().getPublic()); 705 706 Number remoteUserID = principalDao.getPrincipalInternalIDFromRemoteID(remoteUser); 707 708 if (ownerID.equals(remoteUserID)) { 709 int deletedPrinsipalsAccesss = annotationDao.deleteAnnotationPermissions(annotationID); 710 int addedPrincipalsAccesss = this.addPermissions(annotation.getPermissions().getPermission(), annotationID); 711 int updatedPublicAttribute = annotationDao.updatePublicAttribute(annotationID, annotation.getPermissions().getPublic()); 712 }; 707 713 return updatedAnnotations; 708 714 } -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java
r5686 r5774 345 345 try { 346 346 Map params = new HashMap(); 347 347 348 params.put("annotation", annotation); 348 ResponseBody result = (ResponseBody) (new RequestWrappers(this)).wrapRequestResource(params, new UpdateAnnotation(), Resource.ANNOTATION, ResourceAction.WRITE_W_METAINFO, externalId); 349 params.put("remoteUser",httpServletRequest.getRemoteUser()); 350 ResponseBody result = (ResponseBody) (new RequestWrappers(this)).wrapRequestResource(params, new UpdateAnnotation(), Resource.ANNOTATION, ResourceAction.WRITE, externalId); 349 351 if (result != null) { 350 352 return (new ObjectFactory()).createResponseBody(result); 351 } else { 353 } 354 else { 352 355 return (new ObjectFactory()).createResponseBody(new ResponseBody()); 353 356 } … … 368 371 Annotation annotation = (Annotation) params.get("annotation"); 369 372 Number annotationID = (Number) params.get("internalID"); 370 int updatedRows = dbDispatcher.updateAnnotation(annotation); 373 String remoteUser = (String) params.get("remoteUser"); 374 int updatedRows = dbDispatcher.updateAnnotation(annotation, remoteUser); 371 375 return dbDispatcher.makeAnnotationResponseEnvelope(annotationID); 372 376 } -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AutheticationResource.java
r5385 r5774 81 81 httpServletRequest.getSession().invalidate(); 82 82 boolean isShibboleth = Boolean.parseBoolean(context.getInitParameter("eu.dasish.annotation.backend.isShibbolethSession")); 83 String redirect = isShibboleth ? context.getInitParameter("eu.dasish.annotation.backend.logout ") :84 httpServletRequest.getContextPath() + context.getInitParameter("eu.dasish.annotation.backend.logout ");83 String redirect = isShibboleth ? context.getInitParameter("eu.dasish.annotation.backend.logout.shibboleth") : 84 httpServletRequest.getContextPath() + context.getInitParameter("eu.dasish.annotation.backend.logout.basic"); 85 85 httpServletResponse.sendRedirect(redirect); 86 86 } -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/shhaa.xml
r4969 r5774 38 38 <username>anonymous</username> 39 39 </fallback> 40 <sso action="lI">https://lux1 6.mpi.nl/Shibboleth.sso/Login</sso>41 <slo action="lO">https://lux1 6.mpi.nl/Shibboleth.sso/Logout</slo>40 <sso action="lI">https://lux17.mpi.nl/Shibboleth.sso/Login</sso> 41 <slo action="lO">https://lux17.mpi.nl/Shibboleth.sso/Logout</slo> 42 42 </authentication> 43 43 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
r5755 r5774 40 40 <context-param> 41 41 <param-name>eu.dasish.annotation.backend.isShibbolethSession</param-name> 42 <param-value> false</param-value>42 <param-value>true</param-value> 43 43 </context-param> 44 44 <context-param> 45 <param-name>eu.dasish.annotation.backend.logout </param-name>45 <param-name>eu.dasish.annotation.backend.logout.basic</param-name> 46 46 <param-value>/j_spring_security_logout</param-value> 47 47 </context-param> 48 48 <context-param> 49 <param-name>eu.dasish.annotation.backend.logout.shibboleth</param-name> 50 <param-value>https://lux17.mpi.nl/Shibboleth.sso/Logout</param-value> 51 </context-param> 49 52 50 53 <listener> … … 108 111 109 112 <!-- Spring security --> 110 < filter>113 <!-- <filter> 111 114 <filter-name>springSecurityFilterChain</filter-name> 112 115 <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> … … 115 118 <filter-name>springSecurityFilterChain</filter-name> 116 119 <url-pattern>/*</url-pattern> 117 </filter-mapping> 120 </filter-mapping> --> 118 121 119 120 < !--<filter>122 <!-- Shibboleth filter --> 123 <filter> 121 124 <filter-name>AAIFilter</filter-name> 122 125 <filter-class>de.mpg.aai.shhaa.AuthFilter</filter-class> … … 125 128 <filter-name>AAIFilter</filter-name> 126 129 <url-pattern>/*</url-pattern> 127 </filter-mapping> -->130 </filter-mapping> 128 131 129 132 </web-app> -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/DBDispatcherTest.java
r5686 r5774 2114 2114 2115 2115 2116 /// adding the first target, n t foind in the DB2116 /// adding the first target, not found in the DB 2117 2117 2118 2118 oneOf(targetDao).getInternalIDFromHref(annotation.getTargets().getTargetInfo().get(0).getHref()); … … 2134 2134 oneOf(annotationDao).addAnnotationTarget(1, 2); 2135 2135 will(returnValue(1)); 2136 2137 ///// 2138 2139 oneOf(principalDao).getPrincipalInternalIDFromRemoteID("userello"); 2140 will(returnValue(1)); 2136 2141 2137 2142 ///// … … 2162 2167 } 2163 2168 }); 2164 assertEquals(1, dbDispatcher.updateAnnotation(annotation ));2169 assertEquals(1, dbDispatcher.updateAnnotation(annotation, "userello")); 2165 2170 } 2166 2171 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationResourceTest.java
r5685 r5774 276 276 will(returnValue(1)); 277 277 278 oneOf(mockDbDispatcher).canDo(ResourceAction.WRITE _W_METAINFO, 1, 1, Resource.ANNOTATION);278 oneOf(mockDbDispatcher).canDo(ResourceAction.WRITE, 1, 1, Resource.ANNOTATION); 279 279 will(returnValue(true)); 280 280 281 oneOf(mockDbDispatcher).updateAnnotation(annotation );281 oneOf(mockDbDispatcher).updateAnnotation(annotation, "twagoo@mpi.nl"); 282 282 will(returnValue(1)); 283 283 -
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java
r5385 r5774 252 252 assertEquals("text/plain", entityA.getBody().getTextBody().getMimeType()); 253 253 assertEquals("updated annotation 1", entityA.getHeadline()); 254 assertEquals( 2, entityA.getPermissions().getPermission().size());255 assertEquals(Access.READ, entityA.getPermissions().getPublic());256 assertEquals(_relativePath + "/principals/00000000-0000-0000-0000-000000000111", entityA.getOwnerHref());257 assertEquals("http://nl.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#de_Opdracht", entityA.getTargets().getTargetInfo().get(0).getLink());258 assertEquals(_relativePath+ "/targets/00000000-0000-0000-0000-000000000031", entityA.getTargets().getTargetInfo().get(0).getHref());259 254 assertEquals(3, entityA.getPermissions().getPermission().size()); 255 // assertEquals(Access.READ, entityA.getPermissions().getPublic()); 256 // assertEquals(_relativePath + "/principals/00000000-0000-0000-0000-000000000111", entityA.getOwnerHref()); 257 // assertEquals("http://nl.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#de_Opdracht", entityA.getTargets().getTargetInfo().get(0).getLink()); 258 // assertEquals(_relativePath+ "/targets/00000000-0000-0000-0000-000000000031", entityA.getTargets().getTargetInfo().get(0).getHref()); 259 // 260 260 } 261 261
Note: See TracChangeset
for help on using the changeset viewer.