Commit 6e8c4d72 authored by Michael Ritter's avatar Michael Ritter
Browse files

Add warning when removing items from the report summary

parent a05795ef
......@@ -31,14 +31,15 @@
package edu.umiacs.ace.monitor.core;
import edu.umiacs.ace.util.EntityManagerServlet;
import edu.umiacs.ace.util.PersistUtil;
import edu.umiacs.ace.monitor.log.LogEventManager;
import edu.umiacs.ace.monitor.access.browse.BrowseServlet;
import edu.umiacs.ace.monitor.access.browse.DirectoryTree;
import edu.umiacs.ace.monitor.log.LogEnum;
import edu.umiacs.ace.monitor.log.LogEventManager;
import edu.umiacs.ace.util.EntityManagerServlet;
import edu.umiacs.ace.util.PersistUtil;
import edu.umiacs.util.Strings;
import org.apache.log4j.Logger;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.servlet.RequestDispatcher;
......@@ -46,7 +47,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
* Remove an item from list of actively monitored items. This will not remove
......@@ -74,27 +75,7 @@ public class RemoveItemServlet extends EntityManagerServlet {
if ( itemId > 0 ) {
item = em.getReference(MonitoredItem.class, itemId);
removeItem(item, em, dt);
/*if ( item != null ) {
LogEventManager lem =
new LogEventManager(System.currentTimeMillis(), item.getParentCollection());
lem.persistItemEvent(LogEnum.REMOVE_ITEM, item.getPath(), null, em);
if ( !item.isDirectory() ) {
String parent = item.getParentPath();
Collection c = item.getParentCollection();
EntityTransaction trans = em.getTransaction();
if ( item.getToken() != null ) {
reloadTree(dt, parent, c, em);
} else {
new MyDeleteThread(item, dt).start();
itemIds = getParameterList(request,REMOVAL, 0);
if(itemIds != null){
for(long l:itemIds){
......@@ -19,9 +19,16 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Collection Errors</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="jquery-1.7.1.min.js" type="text/javascript"></script>
<jsp:include page="imports.jsp"/>
<!--<script src="jquery-1.7.1.min.js" type="text/javascript"></script> -->
<style type="text/css">
body {
width: 752px !important;
margin-top: 8px !important;
padding-right: 0px !important;
#summaryTable {
margin-left: 50px;
margin-right: auto;
......@@ -42,7 +49,7 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library.
border-right: 1px solid #000000;
border-top: 1px solid #000000;
border-bottom: 1px solid #000000;
border-collapse: separate;
#reportTable thead {
border-bottom: 1px solid #000000;
......@@ -90,7 +97,7 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library.
<span>Select All:&nbsp;</span> <input type="checkbox" id="selectall" />
<span>Select All:&nbsp;</span> <input type="checkbox" id="selectall"/>
<form method="GET" action="RemoveItem">
<input type="hidden" name="redirect" value="Report"/>
......@@ -108,7 +115,7 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library.
<c:forEach var="item" items="${items}">
<input type="checkbox" name="removal" value="${}" />
<input type="checkbox" name="removal" id="removal" value="${}" />
......@@ -160,18 +167,56 @@ on Libraries node in Projects view can be used to add the JSTL 1.1 library.
<input type="submit" value="Remove Selected Items" onclick="document.location = 'report.jsp';"/>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" style="width: 25%">
Remove Selected
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Confirmation</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
<h6 class="modal-body">
Submitting will remove all selected items and their tokens from tracking in ACE.
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" onclick="docment.location = 'report.jsp">Submit</button>
<jsp:include page="footer.jsp" />
<script src="" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
<script type="text/javascript">
$("#selectall").click(function() {
$("input[name=removal]").prop('checked', $(this).prop("checked"));
if ($("#selectall").is(":checked")) {
} else {
$('input[name="removal"]').attr('checked', 'checked');
<jsp:include page="footer.jsp" />
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