Skip to content
Snippets Groups Projects
Commit 19e0ad4f authored by Barbara B. Frosik's avatar Barbara B. Frosik
Browse files

modified data base

parent a968cd04
No related branches found
No related tags found
No related merge requests found
Showing
with 504 additions and 227 deletions
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gov.anl.aps.dm.portal.controllers;
import gov.anl.aps.dm.portal.exceptions.DmPortalException;
import gov.anl.aps.dm.portal.exceptions.MissingProperty;
import gov.anl.aps.dm.portal.exceptions.ObjectAlreadyExists;
import gov.anl.aps.dm.portal.model.beans.PolicyPropertyFacade;
import gov.anl.aps.dm.portal.model.entities.PolicyProperty;
import gov.anl.aps.dm.portal.model.entities.PolicyType;
import java.util.List;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import javax.inject.Named;
import org.apache.log4j.Logger;
/**
*
* @author bfrosik
*/
@Named("policyPropertyController")
@SessionScoped
public class PolicyPropertyController extends CrudEntityController<PolicyProperty, PolicyPropertyFacade>
{
private PolicyType policyType;
private int rows;
private static final Logger logger = Logger.getLogger(PolicyPropertyController.class.getName());
@EJB
private PolicyPropertyFacade policyPropertyFacade;
class PolicyPropertyInfoTable extends DataTableController<PolicyProperty> {
@Override
public String getClassName() {
return "PolicyProperty";
}
@Override
public List<PolicyProperty> findAll() {
return policyPropertyFacade.findByPolicyTypeId(policyType.getId());
}
}
private PolicyPropertyInfoTable policyPropertyInfoTable = new PolicyPropertyInfoTable();
public PolicyPropertyController() {
}
public PolicyPropertyInfoTable getPolicyPropertyInfoTable() {
return policyPropertyInfoTable;
}
public void setPolicyPropertyInfoTable(PolicyPropertyInfoTable policyPropertyInfoTable) {
this.policyPropertyInfoTable = policyPropertyInfoTable;
}
@Override
protected PolicyPropertyFacade getFacade() {
return policyPropertyFacade;
}
@Override
protected PolicyProperty createEntityInstance() {
return new PolicyProperty();
}
@Override
public String getCurrentEntityInstanceName() {
if (getCurrent() != null) {
return getCurrent().getName();
}
return "";
}
@Override
public DataModel createListDataModel() {
return new ListDataModel((List) policyPropertyFacade.findByPolicyTypeId(policyType.getId()));
}
@Override
public List<PolicyProperty> getAvailableItems() {
return (List<PolicyProperty>) policyPropertyFacade.findByPolicyTypeId(policyType.getId());
}
@Override
public String prepareEdit(PolicyProperty policyProperty) {
return super.prepareEdit(policyProperty);
}
@Override
public void prepareEntityInsert(PolicyProperty policyProperty) throws ObjectAlreadyExists, MissingProperty {
current.setPolicyType(policyType);
if ((policyProperty.getName() == null) || (policyProperty.getName().length() == 0)) {
throw new MissingProperty("Name is missing.");
}
PolicyProperty existingPolicyProperty = policyPropertyFacade.findByName(policyProperty.getName());
if (existingPolicyProperty != null) {
throw new ObjectAlreadyExists("policy property " + policyProperty.getName() + " already exists.");
}
logger.debug("Inserting new policy property " + policyProperty.getName());
}
@Override
public void prepareEntityUpdate(PolicyProperty policyProperty) throws DmPortalException {
current.setPolicyType(policyType);
if ((policyProperty.getName() == null) || (policyProperty.getName().length() == 0)) {
throw new MissingProperty("Name is missing.");
}
}
@Override
protected String getObjectAlreadyExistMessage(PolicyProperty policyProperty) {
if (policyProperty == null) {
return null;
}
return "Policy Property " + policyProperty.getName() + " already exists.";
}
@Override
public String getEntityTypeName() {
return "PolicyProperty";
}
@Override
public void clear() {
policyPropertyInfoTable.resetList();
resetList();
}
@Override
public String prepareCreate() {
super.prepareCreate();
// return "create?faces-redirect=true";
return "/views/policyProperty/create.xhtml";
}
@Override
public String create() {
super.create();
return "/views/policyType/view.xhtml";
}
@Override
public String prepareList() {
logger.debug("Preparing list");
resetListDataModel();
return "/views/policyType/view.xhtml";
}
@Override
public String destroy() {
String s = super.destroy();
return s;
}
public PolicyType getPolicyType() {
return policyType;
}
public void setPolicyType(PolicyType policyType) {
logger.info("setting policy type ");
clear();
this.policyType = policyType;
}
public int getRows() {
return rows;
}
public void setRows(int rows) {
this.rows = rows;
}
@FacesConverter(forClass = PolicyProperty.class)
public static class PolicyPropertyControllerConverter implements Converter
{
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0) {
return null;
}
PolicyPropertyController controller = (PolicyPropertyController) facesContext.getApplication().getELResolver().
getValue(facesContext.getELContext(), null, "policyPropertyController");
return controller.getEntity(getKey(value));
}
java.lang.Integer getKey(String value) {
java.lang.Integer key;
key = Integer.valueOf(value);
return key;
}
String getStringKey(java.lang.Integer value) {
StringBuilder sb = new StringBuilder();
sb.append(value);
return sb.toString();
}
@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null) {
return null;
}
if (object instanceof PolicyProperty) {
PolicyProperty o = (PolicyProperty) object;
return getStringKey(o.getId());
}
else {
throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName() + "; expected type: " + PolicyProperty.class.getName());
}
}
}
}
\ No newline at end of file
...@@ -74,20 +74,24 @@ public class PolicyTypeController extends CrudEntityController<PolicyType, Polic ...@@ -74,20 +74,24 @@ public class PolicyTypeController extends CrudEntityController<PolicyType, Polic
logger.debug("Inserting new experiment type " + policyType.getName()); logger.debug("Inserting new experiment type " + policyType.getName());
} }
// @Override @Override
// public void prepareEntityUpdate(PolicyType policyType) throws DmPortalException { public void prepareEntityUpdate(PolicyType policyType) throws DmPortalException {
// if ((policyType.getName() == null) || (policyType.getName().length() == 0)) { if ((policyType.getName() == null) || (policyType.getName().length() == 0)) {
// throw new MissingProperty("Name is missing."); throw new MissingProperty("Name is missing.");
// } }
// } }
@Override @Override
protected String getObjectAlreadyExistMessage(PolicyType policyType) { protected String getObjectAlreadyExistMessage(PolicyType policyType) {
if (policyType == null) { if (policyType == null) {
return null; return null;
} }
return "Experiment Policy " + policyType.getName() + " already exists."; return "Experiment Policy " + policyType.getName() + " already exists.";
} }
public String prepareView() {
return super.prepareView(current);
}
@FacesConverter(forClass = PolicyType.class) @FacesConverter(forClass = PolicyType.class)
public static class PolicyTypeControllerConverter implements Converter public static class PolicyTypeControllerConverter implements Converter
......
...@@ -27,6 +27,13 @@ public class PolicyPropertyFacade extends AbstractFacade<PolicyProperty> ...@@ -27,6 +27,13 @@ public class PolicyPropertyFacade extends AbstractFacade<PolicyProperty>
protected EntityManager getEntityManager() { protected EntityManager getEntityManager() {
return em; return em;
} }
@Override
public void remove(PolicyProperty entity) {
Object o = em.merge(entity);
em.remove(o);
}
public PolicyPropertyFacade() { public PolicyPropertyFacade() {
super(PolicyProperty.class); super(PolicyProperty.class);
......
...@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlTransient; ...@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlTransient;
* @author bfrosik * @author bfrosik
*/ */
@Entity @Entity
@Table(name = "policy_type") @Table(name = "policy_property")
@XmlRootElement @XmlRootElement
@NamedQueries({ @NamedQueries({
@NamedQuery(name = "PolicyProperty.findAll", query = "SELECT p FROM PolicyProperty p"), @NamedQuery(name = "PolicyProperty.findAll", query = "SELECT p FROM PolicyProperty p"),
......
...@@ -12,20 +12,22 @@ ...@@ -12,20 +12,22 @@
<ui:composition template="../../templates/dmViewTemplate.xhtml"> <ui:composition template="../../templates/dmViewTemplate.xhtml">
<ui:define name="middleCenter"> <ui:define name="middleCenter">
<div class="pageTitle"> <div class="pageTitle">
<h1>Add Allowed Policy Value</h1> <h1>Add Policy Property for #{policyPropertyController.policyType.name}</h1>
</div> </div>
<h:form id="addAllowedPolicyValueForm"> <h:form id="addPolicyPropertyForm">
<ui:include src="allowedPolicyValueCreatePanelGrid.xhtml"/> <ui:include src="policyPropertyCreatePanelGrid.xhtml"/>
<p/> <p/>
<div class="actionButton"> <div class="actionButton">
<p:commandButton action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" actionListener="#{allowedPolicyValueController.create()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/> <p:commandButton action="#{policyPropertyController.create()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/>
<p:commandButton action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" immediate="true" value="Cancel" alt="Cancel" icon="ui-icon-cancel"/> <p:commandButton action="#{policyPropertyController.prepareList()}" immediate="true" value="Cancel" alt="Cancel" icon="ui-icon-cancel"/>
</div> </div>
</h:form> </h:form>
</ui:define> </ui:define>
</ui:composition> </ui:composition>
</ui:composition> </ui:composition>
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TODO supply a title</title>
<meta name="viewport" content="width=device-width"/>
</head>
<body>
<div>TODO write content</div>
</body>
</html>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:param name="policyPropertyObject" value="#{policyPropertyController.selected}"/>
<p:panelGrid columns="2" styleClass="createEntityDetails">
<h:outputLabel for="name" value="Name" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="name" value="#{policyPropertyObject.name}" title="Name" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="units" value="Units" styleClass="entityDataLabel"/>
<h:inputText id="units" value="#{policyPropertyObject.units}" title="Units" styleClass="entityDataText"/>
<h:outputLabel for="defaultValue" value="Default Value" styleClass="entityDataLabel"/>
<h:inputText id="defaultValue" value="#{policyPropertyObject.defaultValue}" title="Default Value" styleClass="entityDataText"/>
<h:outputLabel for="lowerLimit" value="Lower Limit" styleClass="entityDataLabel"/>
<h:inputText id="lowerLimit" value="#{policyPropertyObject.lowerLimit}" title="Lower Limit" styleClass="entityDataText"/>
<h:outputLabel for="upperLimit" value="Upper Limit" styleClass="entityDataLabel"/>
<h:inputText id="upperLimit" value="#{policyPropertyObject.upperLimit}" title="Upper Limit" styleClass="entityDataText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{policyPropertyObject.description}" title="Description" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
xmlns:p="http://primefaces.org/ui" xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<p:confirmDialog id="allowedPolicyValueDestroyDialog" message="Delete experiment type #{allowedPolicyValueController.getCurrentEntityInstanceName()}?" <p:confirmDialog id="policyPropertyDestroyDialog" message="Delete policy property #{policyPropertyController.getCurrentEntityInstanceName()}?"
header="Delete Allowed Policy Value" severity="alert" widgetVar="allowedPolicyValueDestroyDialogWidget" header="Delete Policy Property" severity="alert" widgetVar="policyPropertyDestroyDialogWidget"
styleClass="dialog"> styleClass="dialog">
<p:commandButton value="Yes" oncomplete="allowedPolicyValueDestroyDialogWidget.hide()" action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" actionListener="#{allowedPolicyValueController.destroy()}"/> <p:commandButton value="Yes" oncomplete="policyPropertyDestroyDialogWidget.hide()" action="#{policyPropertyController.destroy()}"/>
<p:commandButton value="No" onclick="PF('allowedPolicyValueDestroyDialogWidget').hide()" type="button" /> <p:commandButton value="No" onclick="PF('policyPropertyDestroyDialogWidget').hide()" type="button" />
</p:confirmDialog> </p:confirmDialog>
</ui:composition> </ui:composition>
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<div class="actionButton">
<p:commandButton id="policyPropertyViewResetFiltersButton" action="#{policyTypeController.prepareView()}" actionListener="#{policyPropertyController.policyPropertyInfoTable.resetList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight">
<p:tooltip for="policyPropertyViewResetFiltersButton" value="Reset list filters."/>
</p:commandButton>
<p:commandButton id="policyPropertyNoOp" style="visibility:hidden" value="NoOp"/>
<p:defaultCommand target="policyPropertyNoOp"/>
</div>
<p:dataTable id="policyPropertyListViewDataTable"
var="policyPropertyViewObject"
value="#{policyPropertyController.policyPropertyInfoTable.listDataModel}"
filteredValue="#{policyPropertyController.policyPropertyInfoTable.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="#{policyPropertyController.rows}"
binding="#{policyPropertyController.policyPropertyInfoTable.listDataTable}"
widgetVar="policyPropertyViewListWidget"
emptyMessage="No policy properties found." >
<p:column sortBy="#{policyPropertyViewObject.id}" headerText="Id" >
<h:outputText value="#{policyPropertyViewObject.id}"/>
</p:column>
<p:column sortBy="#{policyPropertyViewObject.name}" headerText="Property Name"
filterBy="#{policyPropertyViewObject.name}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyViewObject.name}"/>
</p:column>
<p:column sortBy="#{policyPropertyViewObject.defaultValue}" headerText="Default Value"
filterBy="#{policyPropertyViewObject.defaultValue}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyViewObject.defaultValue}"/>
</p:column>
<p:column sortBy="#{policyPropertyViewObject.units}" headerText="Units"
filterBy="#{policyPropertyViewObject.units}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyViewObject.units}"/>
</p:column>
<p:column sortBy="#{policyPropertyViewObject.lowerLimit}" headerText="Lower Limit"
filterBy="#{policyPropertyViewObject.lowerLimit}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyViewObject.lowerLimit}"/>
</p:column>
<p:column sortBy="#{policyPropertyViewObject.upperLimit}" headerText="Upper Limit"
filterBy="#{policyPropertyViewObject.upperLimit}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyViewObject.upperLimit}"/>
</p:column>
<p:column sortBy="#{policyPropertyViewObject.description}" headerText="Description"
filterBy="#{policyPropertyViewObject.description}" filterMatchMode="contains">
<h:outputText value="#{policyPropertyViewObject.description}"/>
</p:column>
<p:column headerText="Actions" >
<div class="actionLink">
<p:commandLink action="#{policyPropertyController.prepareView(policyPropertyViewObject)}" styleClass="ui-icon ui-icon-info" title="View"/>
<p:commandLink action="#{policyPropertyController.prepareEdit(policyPropertyViewObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
</div>
</p:column>
</p:dataTable>
</ui:composition>
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<div class="actionButton">
<p:commandButton id="policyPropertyAddButton" action="#{policyPropertyController.prepareCreate()}" rendered="#{loginController.admin}" value="Add" alt="Add new Policy Property" icon="ui-icon-plus">
<p:tooltip for="policyPropertyAddButton" value="Create new Policy Property."/>
</p:commandButton>
<p:commandButton id="policyPropertyResetFiltersButton" action="#{policyTypeController.prepareView()}" actionListener="#{policyPropertyController.resetList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight">
<p:tooltip for="policyPropertyResetFiltersButton" value="Reset list filters."/>
</p:commandButton>
<p:commandButton id="policyPropertyNoOp" style="visibility:hidden" value="NoOp"/>
<p:defaultCommand target="policyPropertyNoOp"/>
</div>
<p:dataTable id="policyPropertyListDataTable"
var="policyPropertyObject"
value="#{policyPropertyController.listDataModel}"
filteredValue="#{policyPropertyController.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="#{policyPropertyController.rows}"
binding="#{policyPropertyController.listDataTable}"
widgetVar="policyPropertyListWidget"
emptyMessage="No policy properties found." >
<p:column sortBy="#{policyPropertyObject.id}" headerText="Id" >
<h:outputText value="#{policyPropertyObject.id}"/>
</p:column>
<p:column sortBy="#{policyPropertyObject.name}" headerText="Property Name"
filterBy="#{policyPropertyObject.name}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyObject.name}"/>
</p:column>
<p:column sortBy="#{policyPropertyObject.defaultValue}" headerText="Default Value"
filterBy="#{policyPropertyObject.defaultValue}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyObject.defaultValue}"/>
</p:column>
<p:column sortBy="#{policyPropertyObject.units}" headerText="Units"
filterBy="#{policyPropertyObject.units}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyObject.units}"/>
</p:column>
<p:column sortBy="#{policyPropertyObject.lowerLimit}" headerText="Lower Limit"
filterBy="#{policyPropertyObject.lowerLimit}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyObject.lowerLimit}"/>
</p:column>
<p:column sortBy="#{policyPropertyObject.upperLimit}" headerText="Upper Limit"
filterBy="#{policyPropertyObject.upperLimit}" filterMatchMode="contains" >
<h:outputText value="#{policyPropertyObject.upperLimit}"/>
</p:column>
<p:column sortBy="#{policyPropertyObject.description}" headerText="Description"
filterBy="#{policyPropertyObject.description}" filterMatchMode="contains">
<h:outputText value="#{policyPropertyObject.description}"/>
</p:column>
<p:column headerText="Actions" >
<div class="actionLink">
<p:commandLink action="#{policyPropertyController.prepareView(policyPropertyObject)}" styleClass="ui-icon ui-icon-info" title="View"/>
<p:commandLink action="#{policyPropertyController.prepareEdit(policyPropertyObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
<p:commandLink oncomplete="PF('policyPropertyDestroyDialogWidget').show()" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-trash" title="Delete" update="@form">
<f:setPropertyActionListener value="#{policyPropertyObject}" target="#{policyPropertyController.current}"/>
</p:commandLink>
</div>
</p:column>
</p:dataTable>
<ui:include src="policyPropertyDestroyDialog.xhtml"/>
</ui:composition>
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TODO supply a title</title>
<meta name="viewport" content="width=device-width"/>
</head>
<body>
<div>TODO write content</div>
</body>
</html>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<c:set var="allowedPolicyValueObject" value="#{allowedPolicyValueController.selected}"/>
<p:panelGrid columns="2" styleClass="createEntityDetails">
<h:outputLabel for="policyValue" value="Policy Value" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="policyValue" value="#{allowedPolicyValueObject.policyValue}" title="Policy Value" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{allowedPolicyValueObject.description}" title="Description" styleClass="entityDataText"/>
<h:outputLabel for="policyType" value="Policy Type" styleClass="entityDataLabel"/>
<h:outputText id="policyType" value="#{allowedPolicyValueController.policyType.name}" title="Policy Type" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<ui:param name="allowedPolicyValueObject" value="#{allowedPolicyValueController.current}"/>
<p:panelGrid columns="2" styleClass="editEntityDetails">
<h:outputLabel for="policyValue" value="Policy Value" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="policyValue" value="#{allowedPolicyValueObject.policyValue}" title="Policy Value" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{allowedPolicyValueObject.description}" title="Description" styleClass="entityDataText"/>
<h:outputLabel for="policyType" value="Policy Type" styleClass="entityDataLabel"/>
<h:outputText id="policyType" value="#{allowedPolicyValueController.policyType.name}" title="Policy Type" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<div class="actionButton">
<p:commandButton id="AllowedPolicyValueAddButton" action="#{allowedPolicyValueController.prepareCreate()}" rendered="#{loginController.admin}" value="Add" alt="Add new AllowedPolicyValue" icon="ui-icon-plus">
<p:tooltip for="AllowedPolicyValueAddButton" value="Create new AllowedPolicyValue."/>
</p:commandButton>
<p:commandButton id="AllowedPolicyValueResetFiltersButton" action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" actionListener="#{allowedPolicyValueController.resetList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight">
<p:tooltip for="AllowedPolicyValueResetFiltersButton" value="Reset list filters."/>
</p:commandButton>
<p:commandButton id="AllowedPolicyValueNoOp" style="visibility:hidden" value="NoOp"/>
<p:defaultCommand target="AllowedPolicyValueNoOp"/>
</div>
<p:dataTable id="allowedPolicyValueListDataTable"
var="allowedPolicyValueObject"
value="#{allowedPolicyValueController.listDataModel}"
filteredValue="#{allowedPolicyValueController.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="25"
binding="#{allowedPolicyValueController.listDataTable}"
widgetVar="allowedPolicyValueListWidget"
emptyMessage="No experiment types found.">
<p:column sortBy="#{allowedPolicyValueObject.id}" headerText="Id" >
<h:outputText value="#{allowedPolicyValueObject.id}"/>
</p:column>
<p:column sortBy="#{allowedPolicyValueObject.policyValue}" headerText="Allowed Policy Value"
filterBy="#{allowedPolicyValueObject.policyValue}" filterMatchMode="contains" >
<h:outputText value="#{allowedPolicyValueObject.policyValue}"/>
</p:column>
<p:column sortBy="#{allowedPolicyValueObject.description}" headerText="Description"
filterBy="#{allowedPolicyValueObject.description}" filterMatchMode="contains">
<h:outputText value="#{allowedPolicyValueObject.description}"/>
</p:column>
<p:column headerText="Actions" >
<div class="actionLink">
<h:commandLink action="#{allowedPolicyValueController.prepareView(allowedPolicyValueObject)}" styleClass="ui-icon ui-icon-info" title="View"/>
<h:commandLink action="#{allowedPolicyValueController.prepareEdit(allowedPolicyValueObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
<p:commandLink oncomplete="PF('allowedPolicyValueDestroyDialogWidget').show()" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-trash" title="Delete" update="@form">
<f:setPropertyActionListener value="#{allowedPolicyValueObject}" target="#{allowedPolicyValueController.current}"/>
</p:commandLink>
</div>
</p:column>
</p:dataTable>
</ui:composition>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:param name="allowedPolicyValueObject" value="#{allowedPolicyValueController.selected}"/>
<p:panelGrid columns="2" styleClass="viewEntityDetails">
<h:outputLabel for="allowedPolicyValue" value="Policy Value" styleClass="entityDataEmphasizedLabel"/>
<h:outputText id="allowedPolicyValue" value="#{allowedPolicyValueObject.policyValue}" title="Allowed Policy Value" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="policyType" value="Policy Type" styleClass="entityDataLabel"/>
<h:outputText id="policyType" value="#{allowedPolicyValueObject.policyType.name}" title="Policy Type" styleClass="entityDataText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:outputText id="description" value="#{allowedPolicyValueObject.description}" title="Description" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
<ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/> <ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/>
<p:accordionPanel multiple="true" activeIndex="0,1" > <p:accordionPanel multiple="true" activeIndex="0,1" >
<p:tab title="Policy Type Properties"> <p:tab title="Policy Type Description">
<div class="middleCenterLeftContent"> <div class="middleCenterLeftContent">
<ui:include src="policyTypeEditPanelGrid.xhtml"/> <ui:include src="policyTypeEditPanelGrid.xhtml"/>
</div> </div>
</p:tab> </p:tab>
<p:tab title="Allowed Policy Values"> <p:tab title="Properties">
<ui:include src="allowedPolicyValueListDataTable.xhtml"/> <ui:include src="../policyProperty/policyPropertyListEditDataTable.xhtml"/>
</p:tab> </p:tab>
</p:accordionPanel> </p:accordionPanel>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<h:outputScript library="js/common" name="forwardNotLoggedin.js" rendered="#{!loginController.loggedIn}"/>
<h:outputScript library="js/common" name="forwardNotAuthorized.js" rendered="#{!loginController.admin}"/>
<ui:composition template="../../templates/dmViewTemplate.xhtml">
<ui:define name="middleCenter">
<h:form id="editAllowedPolicyValueForm">
<div class="middleCenterLeftContent">
<div class="pageTitle">
<h1>Edit Policy</h1>
</div>
<ui:include src="allowedPolicyValueEditPanelGrid.xhtml"/>
<p/>
<div class="actionButton">
<p:commandButton action="#{allowedPolicyValueController.update()}" value="Save" alt="Save" icon="ui-icon-check"/>
<p:commandButton action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" immediate="true" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/>
</div>
</div>
</h:form>
</ui:define>
</ui:composition>
</ui:composition>
...@@ -35,8 +35,8 @@ ...@@ -35,8 +35,8 @@
<p:column headerText="Actions" > <p:column headerText="Actions" >
<div class="actionLink"> <div class="actionLink">
<p:commandLink action="#{policyTypeController.prepareView(policyTypeObject)}" actionListener="#{allowedPolicyValueController.setPolicyType(policyTypeObject)}" styleClass="ui-icon ui-icon-info" title="View"/> <p:commandLink action="#{policyTypeController.prepareView(policyTypeObject)}" actionListener="#{policyPropertyController.setPolicyType(policyTypeObject)}" styleClass="ui-icon ui-icon-info" title="View"/>
<p:commandLink action="#{policyTypeController.prepareEdit(policyTypeObject)}" actionListener="#{allowedPolicyValueController.setPolicyType(policyTypeObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/> <p:commandLink action="#{policyTypeController.prepareEdit(policyTypeObject)}" actionListener="#{policyPropertyController.setPolicyType(policyTypeObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
</div> </div>
</p:column> </p:column>
</p:dataTable> </p:dataTable>
......
...@@ -19,25 +19,24 @@ ...@@ -19,25 +19,24 @@
<ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/> <ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/>
<p:accordionPanel multiple="true" activeIndex="0,1" > <p:accordionPanel multiple="true" activeIndex="0,1" >
<p:tab title="Policy Type Properties"> <p:tab title="Policy Type Description">
<div class="middleCenterLeftContent"> <div class="middleCenterLeftContent">
<ui:include src="policyTypeViewPanelGrid.xhtml"/> <ui:include src="policyTypeViewPanelGrid.xhtml"/>
</div> </div>
</p:tab> </p:tab>
<p:tab title="Allowed Policy Values"> <p:tab title="Properties">
<ui:include src="allowedPolicyValueListDataTable.xhtml"/> <ui:include src="../policyProperty/policyPropertyListDataTable.xhtml"/>
</p:tab> </p:tab>
</p:accordionPanel> </p:accordionPanel>
<p/> <p/>
<div class="actionButton"> <div class="actionButton">
<p:commandButton action="#{policyTypeController.prepareEdit(policyTypeObject)}" actionListener="#{allowedPolicyValueController.clear()}" rendered="#{loginController.admin}" value="Edit" alt="Edit" icon="ui-icon-pencil"/> <p:commandButton action="#{policyTypeController.prepareEdit(policyTypeObject)}" rendered="#{loginController.admin}" value="Edit" alt="Edit" icon="ui-icon-pencil"/>
<p:commandButton action="#{policyTypeController.prepareList()}" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/> <p:commandButton action="#{policyTypeController.prepareList()}" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/>
</div> </div>
</div> </div>
<ui:include src="allowedPolicyValueDestroyDialog.xhtml"/>
</h:form> </h:form>
</ui:define> </ui:define>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<h:outputScript library="js/common" name="forwardNotLoggedin.js" rendered="#{!loginController.loggedIn}"/>
<ui:composition template="../../templates/dmViewTemplate.xhtml">
<ui:define name="middleCenter">
<h:form id="viewAllowedPolicyValueForm">
<div class="middleCenterLeftContent">
<div class="pageTitle">
<h1>Policy Details</h1>
</div>
<ui:include src="allowedPolicyValueViewPanelGrid.xhtml"/>
<p/>
<ui:param name="allowedPolicyValueObject" value="#{allowedPolicyValueController.selected}"/>
<div class="actionButton">
<p:commandButton action="#{allowedPolicyValueController.prepareEdit(allowedPolicyValueObject)}" rendered="#{loginController.admin}" value="Edit" alt="Edit" icon="ui-icon-pencil"/>
<p:commandButton onclick="PF('allowedPolicyValueDestroyDialogWidget').show();" rendered="#{loginController.admin}" value="Delete" alt="Delete" icon="ui-icon-trash">
<f:setPropertyActionListener value="#{allowedPolicyValueObject}" target="#{allowedPolicyValueController.current}"/>
</p:commandButton>
<p:commandButton action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/>
</div>
<ui:include src="allowedPolicyValueDestroyDialog.xhtml"/>
</div>
</h:form>
</ui:define>
</ui:composition>
</ui:composition>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment