]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5564: Added '/published/' path for anonymous access to published resources.
authorRichard Millet <remillet@berkeley.edu>
Sat, 19 Jan 2013 20:11:12 +0000 (12:11 -0800)
committerRichard Millet <remillet@berkeley.edu>
Sat, 19 Jan 2013 20:11:12 +0000 (12:11 -0800)
services/JaxRsServiceProvider/src/main/webapp/WEB-INF/applicationContext-security.xml
services/article/client/src/test/java/org/collectionspace/services/client/test/ArticleServiceTest.java
services/article/service/src/main/java/org/collectionspace/services/article/ArticleResource.java

index b00593d77f0fde9ab1ef982d8a84ca1a6565c48f..c118918de02d6a23afab3e930dbe542f4b7c9315 100644 (file)
@@ -27,7 +27,7 @@
           class="org.springframework.security.web.FilterChainProxy">
         <sec:filter-chain-map path-type="ant">
                        <!-- Exclude the "PublishedResourcesServlet" paths from AuthN and AuthZ.  Let's us publish resources with anonymous access. -->
-                       <sec:filter-chain pattern="/articles/**"
+                       <sec:filter-chain pattern="/articles/published/**"
                               filters="none"/>
             <sec:filter-chain pattern="/**"
                               filters="securityContextPersistenceFilter,basicAuthenticationFilter,logoutFilter,exTranslationFilter,filterInvocationInterceptor"/>
index 9a87e87a844417edb7c1ae338d3145ee2076190f..e7861f0c41003755f11570ae9784faab49bfbde9 100644 (file)
@@ -585,17 +585,17 @@ public class ArticleServiceTest extends
         * @return the multipart output
         */
        private PoxPayloadOut createArticleInstance(String identifier) {
-               return createArticleInstance("loaninNumber-" + identifier,
-                               "returnDate-" + identifier);
+               return createArticleInstance("articleNumber-" + identifier,
+                               "articleJobId-" + identifier);
        }
 
        /**
-        * Creates the article instance.
+        * Creates the Article instance.
         * 
-        * @param loaninNumber
+        * @param articleNumber
         *            the article number
-        * @param returnDate
-        *            the return date
+        * @param articleJobId
+        *            the article asynch job ID
         * @return the multipart output
         */
        private PoxPayloadOut createArticleInstance(String articleNumber,
index 168420ecfece330de7ac0073456a7d674e1130ed..be01fd433b1e8a2ecd056efdcd130d35931e5c1b 100644 (file)
@@ -32,8 +32,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
 import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Request;
+import javax.ws.rs.core.UriInfo;
 
 @Path(ArticleClient.SERVICE_PATH)
 @Consumes("application/xml")
@@ -63,10 +68,17 @@ public class ArticleResource extends ResourceBase {
                        ResourceMethod method) {
                return true;
        }
+       
+    @GET
+    @Path("/published/{csid}")
+    @Produces("text/plain")
+    public byte[] getPublishedResource(
+            @Context Request request,                  
+            @Context UriInfo uriInfo,
+            @PathParam("csid") String csid) {
+       return get(request, uriInfo, csid);
+    }
 }
 
 
 
-
-
-