Commit 5eaacb1b authored by Michael Ritter's avatar Michael Ritter
Browse files

Add collection and group name to the browse servlet

parent a352b9ea
......@@ -33,17 +33,16 @@ package edu.umiacs.ace.monitor.access.browse;
import edu.umiacs.ace.hashtree.Proof;
import edu.umiacs.ace.hashtree.ProofValidator;
import edu.umiacs.ace.monitor.core.MonitoredItem;
import edu.umiacs.ace.util.EntityManagerServlet;
import edu.umiacs.ace.monitor.access.browse.DirectoryTree.DirectoryNode;
import edu.umiacs.ace.monitor.audit.AuditThreadFactory;
import edu.umiacs.ace.monitor.audit.AuditTokens;
import edu.umiacs.ace.monitor.access.browse.DirectoryTree.DirectoryNode;
import edu.umiacs.ace.monitor.core.Collection;
import edu.umiacs.ace.monitor.core.MonitoredItem;
import edu.umiacs.ace.util.EntityManagerServlet;
import edu.umiacs.ace.util.HashValue;
import edu.umiacs.ace.util.TokenUtil;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.log4j.Logger;
import javax.persistence.EntityManager;
import javax.persistence.EntityNotFoundException;
import javax.servlet.RequestDispatcher;
......@@ -51,7 +50,9 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Servlet to manage browsing a collection. This will store a directorytree in
......@@ -102,6 +103,7 @@ public class BrowseServlet extends EntityManagerServlet {
isRunning = true;
}
dt = new DirectoryTree(c);
request.setAttribute("collection", c);
session.setAttribute(SESSION_DIRECTORY_TREE, dt);
} else if ( itemId > 0 ) {
LOG.trace("Toggling item: " + itemId);
......@@ -114,6 +116,8 @@ public class BrowseServlet extends EntityManagerServlet {
AuditThreadFactory.isQueued(c)) {
isRunning = true;
}
request.setAttribute("collection", c);
session.setAttribute(SESSION_FILE,
loadFileBean(dt.getDirectoryNode(itemId), em,c));
if ( dt.getDirectoryNode(itemId).isDirectory() ) {
......@@ -131,7 +135,12 @@ public class BrowseServlet extends EntityManagerServlet {
dispatcher.forward(request, response);
}
private FileBean loadFileBean( DirectoryNode node, EntityManager em,Collection c ) {
private FileBean loadFileBean( DirectoryNode node, EntityManager em, Collection c ) {
// avoid possible null references below
if (node == null) {
return null;
}
FileBean retBean = new FileBean();
try {
......
......@@ -79,12 +79,55 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library.
.badreplica {
}
#collectionHeader {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: -1px;
border-bottom: 1px solid black;
}
.container {
flex: 1 1 0%;
}
.heading {
letter-spacing: 1px;
font-size: 11px;
margin-bottom: 5px;
text-transform: uppercase;
color: #868686;
}
.subheading {
font-size: 16px;
line-height: 1;
font-weight: 300;
margin-top: 0px;
}
.is-centered {
text-align: center;
}
</style>
</head>
<body>
<jsp:include page="header.jsp" />
<div id="collectionHeader">
<div class="container">
<p class="heading is-centered">Group</p>
<p class="subheading is-centered">${collection.group}</p>
<%--<h2 style="font-size: 1.5em; margin-bottom: 2px">${collection.group}</h2>--%>
</div>
<div class="container">
<p class="heading is-centered">Collection</p>
<p class="subheading is-centered">${collection.name}</p>
<%--<h3 style="font-size: 1.25em; font-weight: 100; margin-top: 2px">${collection.name}</h3>--%>
</div>
</div>
<div id="scrollContainer">
<div id="scrollDirectory">
<c:forEach var="dir" items="${directoryTree.roots}">
......
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