Commit 720545f4 authored by shake's avatar shake
Browse files

Added response code for collection upload

git-svn-id: https://subversion.umiacs.umd.edu/ace/trunk@184 f1b3a171-7291-4a19-a512-95ad0ad9394a
parent 81635da3
...@@ -17,6 +17,8 @@ import javax.ws.rs.Path; ...@@ -17,6 +17,8 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam; import javax.ws.rs.PathParam;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
/** /**
...@@ -42,13 +44,14 @@ public class CollectionManagement { ...@@ -42,13 +44,14 @@ public class CollectionManagement {
@POST @POST
@Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@RolesAllowed("Collection Modify") @RolesAllowed("Collection Modify")
public void addCollection(Collection coll){ public Response addCollection(Collection coll){
checkCollection(coll); checkCollection(coll);
EntityManager em = PersistUtil.getEntityManager(); EntityManager em = PersistUtil.getEntityManager();
EntityTransaction trans = em.getTransaction(); EntityTransaction trans = em.getTransaction();
trans.begin(); trans.begin();
em.persist(coll); em.persist(coll);
trans.commit(); trans.commit();
return Response.status(Status.OK).build();
} }
@GET @GET
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment