-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d2d20e
commit ef89fe1
Showing
5 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
src/main/java/org/jlab/jam/presentation/controller/inventory/AuthorizersController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.jlab.jam.presentation.controller.inventory; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
import javax.ejb.EJB; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import org.jlab.jam.business.session.AbstractFacade; | ||
import org.jlab.jam.business.session.FacilityFacade; | ||
import org.jlab.jam.persistence.entity.Facility; | ||
|
||
/** | ||
* @author ryans | ||
*/ | ||
@WebServlet( | ||
name = "AuthorizersController", | ||
urlPatterns = {"/inventory/authorizers"}) | ||
public class AuthorizersController extends HttpServlet { | ||
|
||
@EJB FacilityFacade facilityFacade; | ||
|
||
/** | ||
* Handles the HTTP <code>GET</code> method. | ||
* | ||
* @param request servlet request | ||
* @param response servlet response | ||
* @throws ServletException if a servlet-specific error occurs | ||
* @throws IOException if an I/O error occurs | ||
*/ | ||
@Override | ||
protected void doGet(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
|
||
List<Facility> facilityList = | ||
facilityFacade.findAll(new AbstractFacade.OrderDirective("weight")); | ||
|
||
request.setAttribute("facilityList", facilityList); | ||
|
||
request | ||
.getRequestDispatcher("/WEB-INF/views/inventory/authorizers.jsp") | ||
.forward(request, response); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/org/jlab/jam/presentation/controller/inventory/VerifiersController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.jlab.jam.presentation.controller.inventory; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
import javax.ejb.EJB; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import org.jlab.jam.business.session.AbstractFacade; | ||
import org.jlab.jam.business.session.CreditedControlFacade; | ||
import org.jlab.jam.persistence.entity.CreditedControl; | ||
|
||
/** | ||
* @author ryans | ||
*/ | ||
@WebServlet( | ||
name = "VerifiersController", | ||
urlPatterns = {"/inventory/verifiers"}) | ||
public class VerifiersController extends HttpServlet { | ||
|
||
@EJB CreditedControlFacade controlFacade; | ||
|
||
/** | ||
* Handles the HTTP <code>GET</code> method. | ||
* | ||
* @param request servlet request | ||
* @param response servlet response | ||
* @throws ServletException if a servlet-specific error occurs | ||
* @throws IOException if an I/O error occurs | ||
*/ | ||
@Override | ||
protected void doGet(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
|
||
List<CreditedControl> controlList = | ||
controlFacade.findAll(new AbstractFacade.OrderDirective("weight")); | ||
|
||
request.setAttribute("controlList", controlList); | ||
|
||
request | ||
.getRequestDispatcher("/WEB-INF/views/inventory/verifiers.jsp") | ||
.forward(request, response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<%@page contentType="text/html" pageEncoding="UTF-8"%> | ||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> | ||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
<%@taglib prefix="s" uri="http://jlab.org/jsp/smoothness"%> | ||
<%@taglib prefix="t" tagdir="/WEB-INF/tags"%> | ||
<c:set var="title" value="Authorizers"/> | ||
<t:inventory-page title="${title}"> | ||
<jsp:attribute name="stylesheets"> | ||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/v${initParam.releaseNumber}/css/systems.css"/> | ||
</jsp:attribute> | ||
<jsp:attribute name="scripts"> | ||
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/v${initParam.releaseNumber}/js/systems.js"></script> | ||
</jsp:attribute> | ||
<jsp:body> | ||
<section> | ||
<h2 class="page-header-title"><c:out value="${title}"/></h2> | ||
<div class="message-box"><c:out value="${selectionMessage}"/></div> | ||
<div id="chart-wrap" class="chart-wrap-backdrop"> | ||
<c:set var="readonly" value="${!pageContext.request.isUserInRole('jaws-admin')}"/> | ||
<c:if test="${not readonly}"> | ||
<s:editable-row-table-controls> | ||
</s:editable-row-table-controls> | ||
</c:if> | ||
<table class="data-table stripped-table ${readonly ? '' : 'uniselect-table editable-row-table'}"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Operations Type</th> | ||
<th>Facility</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<c:forEach items="${facilityList}" var="facility"> | ||
<tr data-id="${facility.facilityId}"> | ||
<td><c:out value="John Doe (jdoe)"/></td> | ||
<td><c:out value="RF"/></td> | ||
<td><c:out value="${facility.name}"/></td> | ||
</tr> | ||
<tr data-id="${facility.facilityId}"> | ||
<td><c:out value="John Doe (jdoe)"/></td> | ||
<td><c:out value="BEAM"/></td> | ||
<td><c:out value="${facility.name}"/></td> | ||
</tr> | ||
</c:forEach> | ||
</tbody> | ||
</table> | ||
</div> | ||
</section> | ||
<s:editable-row-table-dialog> | ||
<form id="row-form"> | ||
<ul class="key-value-list"> | ||
<li> | ||
<div class="li-key"> | ||
<label for="row-name">Name</label> | ||
</div> | ||
<div class="li-value"> | ||
<input type="text" required="required" id="row-name"/> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="li-key"> | ||
<label for="row-team">Team</label> | ||
</div> | ||
<div class="li-value"> | ||
<select id="row-team" required="required"> | ||
<option value=""> </option> | ||
<c:forEach items="${teamList}" var="team"> | ||
<option value="${team.teamId}"> | ||
<c:out value="${team.name}"/></option> | ||
</c:forEach> | ||
</select> | ||
</div> | ||
</li> | ||
</ul> | ||
</form> | ||
</s:editable-row-table-dialog> | ||
</jsp:body> | ||
</t:inventory-page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<%@page contentType="text/html" pageEncoding="UTF-8"%> | ||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> | ||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | ||
<%@taglib prefix="s" uri="http://jlab.org/jsp/smoothness"%> | ||
<%@taglib prefix="t" tagdir="/WEB-INF/tags"%> | ||
<c:set var="title" value="Verifiers"/> | ||
<t:inventory-page title="${title}"> | ||
<jsp:attribute name="stylesheets"> | ||
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/v${initParam.releaseNumber}/css/systems.css"/> | ||
</jsp:attribute> | ||
<jsp:attribute name="scripts"> | ||
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/v${initParam.releaseNumber}/js/systems.js"></script> | ||
</jsp:attribute> | ||
<jsp:body> | ||
<section> | ||
<h2 class="page-header-title"><c:out value="${title}"/></h2> | ||
<div class="message-box"><c:out value="${selectionMessage}"/></div> | ||
<div id="chart-wrap" class="chart-wrap-backdrop"> | ||
<c:set var="readonly" value="${!pageContext.request.isUserInRole('jaws-admin')}"/> | ||
<c:if test="${not readonly}"> | ||
<s:editable-row-table-controls> | ||
</s:editable-row-table-controls> | ||
</c:if> | ||
<table class="data-table stripped-table ${readonly ? '' : 'uniselect-table editable-row-table'}"> | ||
<thead> | ||
<tr> | ||
<th>Team Name</th> | ||
<th>Members</th> | ||
<th>Credited Control</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<c:forEach items="${controlList}" var="control"> | ||
<tr data-id="${control.creditedControlId}"> | ||
<td><c:out value="SSG"/></td> | ||
<td><c:out value="John Doe (jdoe), Jane Doe (janed)"/></td> | ||
<td><c:out value="${control.name}"/></td> | ||
</tr> | ||
</c:forEach> | ||
</tbody> | ||
</table> | ||
</div> | ||
</section> | ||
<s:editable-row-table-dialog> | ||
<form id="row-form"> | ||
<ul class="key-value-list"> | ||
<li> | ||
<div class="li-key"> | ||
<label for="row-name">Name</label> | ||
</div> | ||
<div class="li-value"> | ||
<input type="text" required="required" id="row-name"/> | ||
</div> | ||
</li> | ||
<li> | ||
<div class="li-key"> | ||
<label for="row-team">Team</label> | ||
</div> | ||
<div class="li-value"> | ||
<select id="row-team" required="required"> | ||
<option value=""> </option> | ||
<c:forEach items="${teamList}" var="team"> | ||
<option value="${team.teamId}"> | ||
<c:out value="${team.name}"/></option> | ||
</c:forEach> | ||
</select> | ||
</div> | ||
</li> | ||
</ul> | ||
</form> | ||
</s:editable-row-table-dialog> | ||
</jsp:body> | ||
</t:inventory-page> |