Commit d2169778 authored by Michael Ritter's avatar Michael Ritter
Browse files

Initial state of 'NEVER' for new collections

parent dbd41711
...@@ -12,6 +12,7 @@ import edu.umiacs.ace.driver.StorageDriverFactory; ...@@ -12,6 +12,7 @@ import edu.umiacs.ace.driver.StorageDriverFactory;
import edu.umiacs.ace.monitor.access.CollectionCountContext; import edu.umiacs.ace.monitor.access.CollectionCountContext;
import edu.umiacs.ace.monitor.audit.AuditThreadFactory; import edu.umiacs.ace.monitor.audit.AuditThreadFactory;
import edu.umiacs.ace.monitor.core.Collection; import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.monitor.core.CollectionState;
import edu.umiacs.ace.monitor.core.MonitoredItem; import edu.umiacs.ace.monitor.core.MonitoredItem;
import edu.umiacs.ace.util.PersistUtil; import edu.umiacs.ace.util.PersistUtil;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
...@@ -150,6 +151,7 @@ public class CollectionManagement { ...@@ -150,6 +151,7 @@ public class CollectionManagement {
// Check against the name collection name in the group. This could // Check against the name collection name in the group. This could
// make things very confusing in the interface // make things very confusing in the interface
// TODO: Why not just query name + group?
Query q = em.createNamedQuery("Collection.getCollectionByName"); Query q = em.createNamedQuery("Collection.getCollectionByName");
q.setParameter("name", coll.getName()); q.setParameter("name", coll.getName());
List<Collection> colls = q.getResultList(); List<Collection> colls = q.getResultList();
...@@ -157,7 +159,8 @@ public class CollectionManagement { ...@@ -157,7 +159,8 @@ public class CollectionManagement {
em.close(); em.close();
return Response.status(Status.BAD_REQUEST).build(); return Response.status(Status.BAD_REQUEST).build();
} }
coll.setState(CollectionState.NEVER);
EntityTransaction trans = em.getTransaction(); EntityTransaction trans = em.getTransaction();
trans.begin(); trans.begin();
em.persist(coll); em.persist(coll);
......
Markdown is supported
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