Commit 1a670a35 authored by Michael Ritter's avatar Michael Ritter
Browse files

fix formatting/typos

parent aa374600
......@@ -95,7 +95,7 @@ public class StatusServlet extends EntityManagerServlet {
collections.add(csb);
// if param_collection was supplied as a parameter see if this bean
// hsould be set as working/details bean
// should be set as working/details bean
if ( Strings.isValidLong(request.getParameter(PARAM_COLLECTION_ID)) && col.getId() == Long.parseLong(request.getParameter(
PARAM_COLLECTION_ID)) ) {
request.getSession().setAttribute(SESSION_WORKINGCOLLECTION, csb);
......
......@@ -109,9 +109,9 @@ public class MonitoredItem implements Serializable, Comparable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, columnDefinition = "VARCHAR(512) COLLATE latin1_bin")
@Column(nullable = false, columnDefinition = "VARCHAR(255) COLLATE utf8")
private String path; // path relative to base directory
@Column(columnDefinition = "VARCHAR(512) COLLATE latin1_bin")
@Column(columnDefinition = "VARCHAR(255) COLLATE utf8")
private String parentPath;
@Column(nullable = false)
private boolean directory; // true if directory
......
......@@ -11,6 +11,9 @@ import edu.umiacs.ace.monitor.audit.AuditThreadFactory;
import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.monitor.core.MonitoredItem;
import edu.umiacs.ace.util.PersistUtil;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.annotation.security.RolesAllowed;
......@@ -23,10 +26,12 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.GenericEntity;
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.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
......@@ -90,23 +95,23 @@ public class CollectionManagement {
// - storage
// - directory
// - group
// - general settings (audit period, etc_
// - general settings (audit period, etc)
EntityManager em = PersistUtil.getEntityManager();
Collection orig = em.find(Collection.class, id);
if ( !orig.getName().equals(coll.getName()) ) {
return Response.status(Status.BAD_REQUEST).build();
}
if (null != coll.getStorage()) {
if (null != coll.getStorage() ) {
orig.setStorage(coll.getStorage());
}
if ( null != coll.getDirectory()) {
if ( null != coll.getDirectory() ) {
orig.setDirectory(coll.getDirectory());
}
// TODO: Make sure no collection is contained in the group first
if ( null != coll.getGroup()) {
if ( null != coll.getGroup() ) {
orig.setGroup(coll.getGroup());
}
......@@ -134,7 +139,7 @@ public class CollectionManagement {
Query q = em.createNamedQuery("Collection.getCollectionByName");
q.setParameter("name", coll.getName());
List<Collection> colls = q.getResultList();
if ( checkGroupCollision(colls, coll)) {
if ( checkGroupCollision(colls, coll) ) {
em.close();
return Response.status(Status.BAD_REQUEST).build();
}
......@@ -197,7 +202,7 @@ public class CollectionManagement {
if ( collGroup == null ) {
// Check if what we want is also null
// Note: Nested if to avoid NPE in the following statement
if ( group == null || group.isEmpty()) {
if ( group == null || group.isEmpty() ) {
return c;
}
} else if (collGroup.equals(group)) {
......
......@@ -734,7 +734,6 @@
<role-name>Collection Modify</role-name>
<role-name>Browse</role-name>
</auth-constraint>
M
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
......
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