From 4f7b90c99b961be538d9b2db1d1badd1d7268aa0 Mon Sep 17 00:00:00 2001 From: "Barbara B. Frosik" <bfrosik@aps.anl.gov> Date: Fri, 6 Mar 2015 16:37:55 +0000 Subject: [PATCH] added policies pages --- .../AllowedPolicyValueController.java | 127 +++++++++++++++++- .../controllers/PolicyPropertyController.java | 43 ++++-- .../model/beans/AllowedPolicyValueFacade.java | 2 +- .../ExperimentPolicyPropertyValue.java | 2 +- .../portal/model/entities/PolicyProperty.java | 2 +- src/java/DmWebPortal/web/WEB-INF/web.xml | 8 ++ .../allowedPolicyValueCreatePanelGrid.xhtml | 22 +++ .../allowedPolicyValueDestroyDialog.xhtml | 13 ++ .../allowedPolicyValueEditPanelGrid.xhtml | 22 +++ .../allowedPolicyValueListDataTable.xhtml | 52 +++++++ .../allowedPolicyValueListEditDataTable.xhtml | 58 ++++++++ .../allowedPolicyValueViewPanelGrid.xhtml | 22 +++ .../web/views/allowedPolicyValue/create.xhtml | 35 +++++ .../web/views/allowedPolicyValue/edit.xhtml | 35 +++++ .../web/views/allowedPolicyValue/view.xhtml | 39 ++++++ .../web/views/policyProperty/create.xhtml | 2 +- .../web/views/policyProperty/edit.xhtml | 63 ++++++--- .../policyPropertyDestroyDialog.xhtml | 2 +- .../policyPropertyEditPanelGrid.xhtml | 31 +++++ .../policyPropertyListDataTable.xhtml | 4 +- .../policyPropertyListEditDataTable.xhtml | 8 +- .../policyPropertyViewPanelGrid.xhtml | 31 +++++ .../web/views/policyProperty/view.xhtml | 62 ++++++--- .../web/views/policyType/edit.xhtml | 4 +- .../web/views/policyType/view.xhtml | 2 +- .../userInfo/userInfoViewPanelGrid.xhtml | 4 +- 26 files changed, 629 insertions(+), 66 deletions(-) create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueCreatePanelGrid.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueDestroyDialog.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueEditPanelGrid.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListDataTable.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListEditDataTable.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueViewPanelGrid.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/create.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/edit.xhtml create mode 100644 src/java/DmWebPortal/web/views/allowedPolicyValue/view.xhtml create mode 100644 src/java/DmWebPortal/web/views/policyProperty/policyPropertyEditPanelGrid.xhtml create mode 100644 src/java/DmWebPortal/web/views/policyProperty/policyPropertyViewPanelGrid.xhtml diff --git a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/AllowedPolicyValueController.java b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/AllowedPolicyValueController.java index e5761e72..7da23562 100644 --- a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/AllowedPolicyValueController.java +++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/AllowedPolicyValueController.java @@ -5,9 +5,13 @@ import gov.anl.aps.dm.portal.exceptions.MissingProperty; import gov.anl.aps.dm.portal.exceptions.ObjectAlreadyExists; import gov.anl.aps.dm.portal.model.entities.AllowedPolicyValue; import gov.anl.aps.dm.portal.model.beans.AllowedPolicyValueFacade; +import gov.anl.aps.dm.portal.model.entities.PolicyProperty; +import java.util.List; import javax.ejb.EJB; import javax.inject.Named; import javax.enterprise.context.SessionScoped; +import javax.faces.model.DataModel; +import javax.faces.model.ListDataModel; import org.apache.log4j.Logger; @@ -20,14 +24,66 @@ public class AllowedPolicyValueController extends CrudEntityController<AllowedPo @EJB private AllowedPolicyValueFacade allowedPolicyValueFacade; + class AllowedPolicyValueInfoTable extends DataTableController<AllowedPolicyValue> { + + @Override + public String getClassName() { + return "AllowedPolicyValue"; + } + + @Override + public List<AllowedPolicyValue> findAll() { + return allowedPolicyValueFacade.findByPolicyPropertyId(getPolicyProperty().getId()); + } + } + + private AllowedPolicyValueInfoTable allowedPolicyValueInfoTable = new AllowedPolicyValueInfoTable(); + private PolicyProperty policyProperty; + private int rows = 25; + public AllowedPolicyValueController() { } + public AllowedPolicyValueInfoTable getAllowedPolicyValueInfoTable() { + return allowedPolicyValueInfoTable; + } + + public void setAllowedPolicyValueInfoTable(AllowedPolicyValueInfoTable allowedPolicyValueInfoTable) { + this.allowedPolicyValueInfoTable = allowedPolicyValueInfoTable; + } + + public PolicyProperty getPolicyProperty() { + return policyProperty; + } + + public void setPolicyProperty(PolicyProperty policyProperty) { + clear(); + this.policyProperty = policyProperty; + } + + public int getRows() { + return rows; + } + + public void setRows(int rows) { + this.rows = rows; + } + @Override protected AllowedPolicyValueFacade getFacade() { return allowedPolicyValueFacade; } + @Override + public DataModel createListDataModel() { + return new ListDataModel((List) allowedPolicyValueFacade.findByPolicyPropertyId(policyProperty.getId())); + } + + @Override + public List<AllowedPolicyValue> getAvailableItems() { + return (List<AllowedPolicyValue>) allowedPolicyValueFacade.findByPolicyPropertyId(policyProperty.getId()); + } + @Override protected AllowedPolicyValue createEntityInstance() { return new AllowedPolicyValue(); @@ -48,24 +104,87 @@ public class AllowedPolicyValueController extends CrudEntityController<AllowedPo @Override public String prepareEdit(AllowedPolicyValue allowedPolicyValue) { - super.resetListDataModel(); super.prepareEdit(allowedPolicyValue); - return "editAllowedPolicyValue?faces-redirect=true"; + // return "editAllowedPolicyValue?faces-redirect=true"; + return "/views/allowedPolicyValue/edit?faces-redirect=true"; + } + @Override + public String prepareView(AllowedPolicyValue allowedPolicyValue) { + current = allowedPolicyValue; + super.prepareView(allowedPolicyValue); + // return "editAllowedPolicyValue?faces-redirect=true"; + return "/views/allowedPolicyValue/view?faces-redirect=true"; } @Override - public void prepareEntityInsert(AllowedPolicyValue allowedPolicyValue) throws ObjectAlreadyExists, MissingProperty { - logger.debug("Inserting new experiment allowed policy value " ); + public String prepareCreate() { + super.prepareCreate(); +// return "create?faces-redirect=true"; + return "/views/allowedPolicyValue/create?faces-redirect=true"; + } + + @Override + public String create() { + if (super.create() == null) { + return null; + } + allowedPolicyValueInfoTable.resetList(); + return "/views/policyProperty/view?faces-redirect=true"; + } + + @Override + public String destroy() { + String view = super.destroy(); + clear(); + return view; } + @Override + public void prepareEntityInsert(AllowedPolicyValue allowedPolicyValue) throws ObjectAlreadyExists, MissingProperty { + current.setPolicyProperty(policyProperty); + if ((allowedPolicyValue.getPolicyValue() == null) || (allowedPolicyValue.getPolicyValue().length() == 0)) { + throw new MissingProperty("Policy Value is missing."); + } + List<AllowedPolicyValue> propertyAllowedPolicyValueList = allowedPolicyValueFacade.findByPolicyPropertyId(policyProperty.getId()); + for (AllowedPolicyValue policyValue : propertyAllowedPolicyValueList) { + if ((allowedPolicyValue.getPolicyValue().equals(policyValue.getPolicyValue()))) { + throw new ObjectAlreadyExists("allowed policy value " + allowedPolicyValue.getPolicyValue() + " already exists for this property."); + } + } + } + @Override public void prepareEntityUpdate(AllowedPolicyValue allowedPolicyValue) throws DmPortalException { + current.setPolicyProperty(policyProperty); + if ((allowedPolicyValue.getPolicyValue() == null) || (allowedPolicyValue.getPolicyValue().length() == 0)) { + throw new MissingProperty("Policy Value is missing."); + } + List<AllowedPolicyValue> propertyAllowedPolicyValueList = allowedPolicyValueFacade.findByPolicyPropertyId(policyProperty.getId()); + for (AllowedPolicyValue policyValue : propertyAllowedPolicyValueList) { + if ((allowedPolicyValue.getPolicyValue().equals(policyValue.getPolicyValue()))) { + throw new ObjectAlreadyExists("allowed policy value " + allowedPolicyValue.getPolicyValue() + " already exists for this property."); + } } + } + @Override + public String prepareList() { + logger.debug("Preparing list"); + resetListDataModel(); + return "/views/policyProperty/view?faces-redirect=true"; + } + @Override protected String getObjectAlreadyExistMessage(AllowedPolicyValue entity) { return null; } + + @Override + public void clear() { + allowedPolicyValueInfoTable.resetList(); + resetList(); } + +} \ No newline at end of file diff --git a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyPropertyController.java b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyPropertyController.java index 85e35c35..67e42f6d 100644 --- a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyPropertyController.java +++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyPropertyController.java @@ -10,6 +10,7 @@ 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.AllowedPolicyValue; import gov.anl.aps.dm.portal.model.entities.PolicyProperty; import gov.anl.aps.dm.portal.model.entities.PolicyType; import java.util.List; @@ -90,14 +91,25 @@ public class PolicyPropertyController extends CrudEntityController<PolicyPropert return new ListDataModel((List) policyPropertyFacade.findByPolicyTypeId(policyType.getId())); } - @Override + @Override public List<PolicyProperty> getAvailableItems() { return (List<PolicyProperty>) policyPropertyFacade.findByPolicyTypeId(policyType.getId()); } @Override public String prepareEdit(PolicyProperty policyProperty) { - return super.prepareEdit(policyProperty); + super.prepareEdit(policyProperty); + return "/views/policyProperty/edit?faces-redirect=true"; + } + + @Override + public String prepareView(PolicyProperty policyProperty) { + super.prepareView(policyProperty); + return "/views/policyProperty/view?faces-redirect=true"; + } + + public String prepareView() { + return super.prepareView(current); } @Override @@ -106,9 +118,11 @@ public class PolicyPropertyController extends CrudEntityController<PolicyPropert 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."); + List<PolicyProperty> policyPropertyList = policyPropertyFacade.findByPolicyTypeId(policyType.getId()); + for (PolicyProperty property : policyPropertyList) { + if ((property.getName().equals(policyProperty.getName()))) { + throw new ObjectAlreadyExists("policy property " + policyProperty.getName() + " already exists for this policy type."); + } } logger.debug("Inserting new policy property " + policyProperty.getName()); } @@ -116,9 +130,6 @@ public class PolicyPropertyController extends CrudEntityController<PolicyPropert @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 @@ -144,26 +155,30 @@ public class PolicyPropertyController extends CrudEntityController<PolicyPropert public String prepareCreate() { super.prepareCreate(); // return "create?faces-redirect=true"; - return "/views/policyProperty/create.xhtml"; + return "/views/policyProperty/create?faces-redirect=true"; } @Override public String create() { - super.create(); - return "/views/policyType/view.xhtml"; + if (super.create() == null) { + return null; + } + policyPropertyInfoTable.resetList(); + return "/views/policyType/view?faces-redirect=true"; } @Override public String prepareList() { logger.debug("Preparing list"); resetListDataModel(); - return "/views/policyType/view.xhtml"; + return "/views/policyType/view?faces-redirect=true"; } @Override public String destroy() { - String s = super.destroy(); - return s; + String view = super.destroy(); + clear(); + return view; } public PolicyType getPolicyType() { diff --git a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/AllowedPolicyValueFacade.java b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/AllowedPolicyValueFacade.java index ad890b5d..5e325004 100644 --- a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/AllowedPolicyValueFacade.java +++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/AllowedPolicyValueFacade.java @@ -52,7 +52,7 @@ public class AllowedPolicyValueFacade extends AbstractFacade<AllowedPolicyValue> return null; } - public List<AllowedPolicyValue> findByPolicyProperty(int id) { + public List<AllowedPolicyValue> findByPolicyPropertyId(int id) { try { return (List<AllowedPolicyValue>) em.createNamedQuery("AllowedPolicyValue.findByPolicyPropertyId") .setParameter("policyPropertyId", id) diff --git a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/ExperimentPolicyPropertyValue.java b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/ExperimentPolicyPropertyValue.java index d103a6ce..9ee078b9 100644 --- a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/ExperimentPolicyPropertyValue.java +++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/ExperimentPolicyPropertyValue.java @@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlRootElement; * @author bfrosik */ @Entity -@Table(name = "experiment_policy") +@Table(name = "experiment_policy_property_value") @XmlRootElement @NamedQueries({ @NamedQuery(name = "ExperimentPolicyPropertyValue.findAll", query = "SELECT e FROM ExperimentPolicyPropertyValue e"), diff --git a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/PolicyProperty.java b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/PolicyProperty.java index e00876a5..8e463dbe 100644 --- a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/PolicyProperty.java +++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/entities/PolicyProperty.java @@ -49,7 +49,7 @@ public class PolicyProperty extends CloneableEntity private Integer id; @Basic(optional = false) @NotNull - @Size(min = 1, max = 2147483647) + @Size(max = 2147483647) @Column(name = "name") private String name; @Size(max = 2147483647) diff --git a/src/java/DmWebPortal/web/WEB-INF/web.xml b/src/java/DmWebPortal/web/WEB-INF/web.xml index 086dcfb7..b142afb3 100644 --- a/src/java/DmWebPortal/web/WEB-INF/web.xml +++ b/src/java/DmWebPortal/web/WEB-INF/web.xml @@ -25,4 +25,12 @@ <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/login.xhtml</location> </error-page> +<!-- <navigation-rule> + <from-view-id>/views/policyType/view.xhtml</from-view-id> + <navigation-case> + <from-outcome>/views/policyType/view</from-outcome> + <to-view-id>/views/policyProperty/view.xhtml</to-view-id> + <redirect /> + </navigation-case> +</navigation-rule>--> </web-app> diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueCreatePanelGrid.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueCreatePanelGrid.xhtml new file mode 100644 index 00000000..e684aa68 --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueCreatePanelGrid.xhtml @@ -0,0 +1,22 @@ +<?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="createEntityDetails"> + + <h:outputLabel for="policyValue" value="Policy Value" styleClass="entityDataLabel"/> + <h:inputText id="policyValue" value="#{allowedPolicyValueObject.policyValue}" title="Policy Value" styleClass="entityDataText"/> + + <h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/> + <h:inputText id="description" value="#{allowedPolicyValueObject.description}" title="Description" styleClass="entityDataText"/> + + </p:panelGrid> + +</ui:composition> + + diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueDestroyDialog.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueDestroyDialog.xhtml new file mode 100644 index 00000000..5831cf2d --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueDestroyDialog.xhtml @@ -0,0 +1,13 @@ +<?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:p="http://primefaces.org/ui" + xmlns:ui="http://xmlns.jcp.org/jsf/facelets"> + + <p:confirmDialog id="allowedPolicyValueDestroyDialog" message="Delete policy property #{allowedPolicyValueController.getCurrentEntityInstanceName()}?" + header="Delete Allowed Policy Value" severity="alert" widgetVar="allowedPolicyValueDestroyDialogWidget" + styleClass="dialog"> + <p:commandButton value="Yes" oncomplete="allowedPolicyValueDestroyDialogWidget.hide()" action="#{allowedPolicyValueController.destroy()}" update="@form"/> + <p:commandButton value="No" onclick="PF('allowedPolicyValueDestroyDialogWidget').hide()" type="button" /> + </p:confirmDialog> +</ui:composition> diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueEditPanelGrid.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueEditPanelGrid.xhtml new file mode 100644 index 00000000..70978919 --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueEditPanelGrid.xhtml @@ -0,0 +1,22 @@ +<?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.current}"/> + + <p:panelGrid columns="2" styleClass="createEntityDetails"> + + <h:outputLabel for="policyValue" value="Policy Value" styleClass="entityDataLabel"/> + <h:inputText id="policyValue" value="#{allowedPolicyValueObject.policyValue}" title="Policy Value" styleClass="entityDataText"/> + + <h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/> + <h:inputText id="description" value="#{allowedPolicyValueObject.description}" title="Description" styleClass="entityDataText"/> + + </p:panelGrid> + +</ui:composition> + + diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListDataTable.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListDataTable.xhtml new file mode 100644 index 00000000..36e12ebb --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListDataTable.xhtml @@ -0,0 +1,52 @@ +<?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="allowedPolicyValueViewResetFiltersButton" action="#{policyPropertyController.prepareView()}" actionListener="#{allowedPolicyValueController.allowedPolicyValueInfoTable.resetList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight"> + <p:tooltip for="allowedPolicyValueViewResetFiltersButton" value="Reset list filters."/> + </p:commandButton> + <p:commandButton id="allowedPolicyValueNoOp" style="visibility:hidden" value="NoOp"/> + <p:defaultCommand target="allowedPolicyValueNoOp"/> + </div> + + <p:dataTable id="allowedPolicyValueListViewDataTable" + var="allowedPolicyValueViewObject" + value="#{allowedPolicyValueController.allowedPolicyValueInfoTable.listDataModel}" + filteredValue="#{allowedPolicyValueController.allowedPolicyValueInfoTable.filteredObjectList}" + paginator="true" + paginatorAlwaysVisible="false" + rows="#{allowedPolicyValueController.rows}" + binding="#{allowedPolicyValueController.allowedPolicyValueInfoTable.listDataTable}" + widgetVar="allowedPolicyValueViewListWidget" + emptyMessage="No allowed values found for this policy property." > + + <p:column sortBy="#{allowedPolicyValueViewObject.policyValue}" headerText="Policy Value" + filterBy="#{allowedPolicyValueViewObject.policyValue}" filterMatchMode="contains" > + <h:outputText value="#{allowedPolicyValueViewObject.policyValue}"/> + </p:column> + + <p:column sortBy="#{allowedPolicyValueViewObject.description}" headerText="Description" + filterBy="#{allowedPolicyValueViewObject.description}" filterMatchMode="contains"> + <h:outputText value="#{allowedPolicyValueViewObject.description}"/> + </p:column> + + <p:column headerText="Actions" > + <div class="actionLink"> + <p:commandLink action="#{allowedPolicyValueController.prepareView(allowedPolicyValueViewObject)}" styleClass="ui-icon ui-icon-info" title="View"/> + <p:commandLink action="#{allowedPolicyValueController.prepareEdit(allowedPolicyValueViewObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/> + </div> + </p:column> + </p:dataTable> + +</ui:composition> diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListEditDataTable.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListEditDataTable.xhtml new file mode 100644 index 00000000..1bcbbfbd --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueListEditDataTable.xhtml @@ -0,0 +1,58 @@ +<?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="allowedPolicyValueAddButton" action="#{allowedPolicyValueController.prepareCreate()}" rendered="#{loginController.admin}" value="Add" alt="Add new Policy Property" icon="ui-icon-plus"> + <p:tooltip for="allowedPolicyValueAddButton" value="Create new Policy Property."/> + </p:commandButton> + <p:commandButton id="allowedPolicyValueResetFiltersButton" action="#{policyPropertyController.prepareView()}" 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="#{allowedPolicyValueController.rows}" + binding="#{allowedPolicyValueController.listDataTable}" + widgetVar="allowedPolicyValueListWidget" + emptyMessage="No allowed values found for this policy property." > + + <p:column sortBy="#{allowedPolicyValueObject.policyValue}" headerText="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"> + <p:commandLink action="#{allowedPolicyValueController.prepareView(allowedPolicyValueObject)}" styleClass="ui-icon ui-icon-info" title="View"/> + <p: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:include src="allowedPolicyValueDestroyDialog.xhtml"/> +</ui:composition> diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueViewPanelGrid.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueViewPanelGrid.xhtml new file mode 100644 index 00000000..48afdd96 --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/allowedPolicyValueViewPanelGrid.xhtml @@ -0,0 +1,22 @@ +<?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.current}"/> + + <p:panelGrid columns="2" styleClass="createEntityDetails"> + + <h:outputLabel for="policyValue" value="Policy Value" styleClass="entityDataLabel"/> + <h:outputText id="policyValue" value="#{allowedPolicyValueObject.policyValue}" title="Policy Value" 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> + + diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/create.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/create.xhtml new file mode 100644 index 00000000..ffca85f0 --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/create.xhtml @@ -0,0 +1,35 @@ +<?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"> + <div class="pageTitle"> + <h1>Policy Type: #{policyTypeController.current.name} <br/> + Policy Property: #{policyPropertyController.current.name} <br/> + Add Allowed Policy Value</h1> + </div> + + <h:form id="addAllowedPolicyValueForm"> + + <ui:include src="allowedPolicyValueCreatePanelGrid.xhtml"/> + + <p/> + <div class="actionButton"> + <p:commandButton action="#{allowedPolicyValueController.create()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/> + <p:commandButton action="#{allowedPolicyValueController.prepareList()}" immediate="true" value="Cancel" alt="Cancel" icon="ui-icon-cancel"/> + </div> + </h:form> + + </ui:define> + </ui:composition> +</ui:composition> + + diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/edit.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/edit.xhtml new file mode 100644 index 00000000..06f82e82 --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/edit.xhtml @@ -0,0 +1,35 @@ +<?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>Policy Type: #{policyTypeController.current.name}<br/> + Policy Property: #{policyPropertyController.current.name}<br/> + Allowed Policy Value</h1> + </div> + + <ui:include src="allowedPolicyValueEditPanelGrid.xhtml"/> + <p/> + <div class="actionButton"> + <p:commandButton action="#{allowedPolicyValueController.update()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/> + <p:commandButton action="#{allowedPolicyValueController.prepareList()}" immediate="true" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/> + </div> + </div> + + </h:form> + + </ui:define> + </ui:composition> +</ui:composition> diff --git a/src/java/DmWebPortal/web/views/allowedPolicyValue/view.xhtml b/src/java/DmWebPortal/web/views/allowedPolicyValue/view.xhtml new file mode 100644 index 00000000..b9efe9d4 --- /dev/null +++ b/src/java/DmWebPortal/web/views/allowedPolicyValue/view.xhtml @@ -0,0 +1,39 @@ +<?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 Type: #{policyTypeController.current.name}<br/> + Policy Property: #{policyPropertyController.current.name}<br/> + Allowed Policy Value Details</h1> + </div> + + <ui:include src="allowedPolicyValueViewPanelGrid.xhtml"/> + + <p/> + <ui:param name="allowedPolicyValueObject" value="#{allowedPolicyValueController.current}"/> + <div class="actionButton"> + <p:commandButton action="#{allowedPolicyValueController.prepareEdit(allowedPolicyValueObject)}" rendered="#{loginController.admin}" value="Edit" alt="Edit" icon="ui-icon-pencil"/> + <p:commandButton action="#{allowedPolicyValueController.prepareList()}" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/> + </div> + </div> + + </h:form> + + </ui:define> + </ui:composition> + +</ui:composition> + + diff --git a/src/java/DmWebPortal/web/views/policyProperty/create.xhtml b/src/java/DmWebPortal/web/views/policyProperty/create.xhtml index fa595bbe..69a970dc 100644 --- a/src/java/DmWebPortal/web/views/policyProperty/create.xhtml +++ b/src/java/DmWebPortal/web/views/policyProperty/create.xhtml @@ -12,7 +12,7 @@ <ui:composition template="../../templates/dmViewTemplate.xhtml"> <ui:define name="middleCenter"> <div class="pageTitle"> - <h1>Add Policy Property for #{policyPropertyController.policyType.name}</h1> + <h1>Add Policy Property for Policy Type: #{policyTypeController.current.name}</h1> </div> <h:form id="addPolicyPropertyForm"> diff --git a/src/java/DmWebPortal/web/views/policyProperty/edit.xhtml b/src/java/DmWebPortal/web/views/policyProperty/edit.xhtml index b8c165b9..ce871bc1 100644 --- a/src/java/DmWebPortal/web/views/policyProperty/edit.xhtml +++ b/src/java/DmWebPortal/web/views/policyProperty/edit.xhtml @@ -1,16 +1,47 @@ -<?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: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="editPolicyPropertyForm"> + + <div class="middleCenterLeftContent"> + <div class="pageTitle"> + <h1>Policy Type: #{policyTypeController.current.name} <br/> + Policy Property: #{policyPropertyController.current.name}</h1> + </div> + + <ui:param name="policyPropertyObject" value="#{policyPropertyController.selected}"/> + <p:accordionPanel multiple="true" activeIndex="0,1" > + <p:tab title="Policy Property Description"> + <div class="middleCenterLeftContent"> + <ui:include src="policyPropertyEditPanelGrid.xhtml"/> + </div> + </p:tab> + + <p:tab title="Allowed Policy Values"> + <ui:include src="../allowedPolicyValue/allowedPolicyValueListEditDataTable.xhtml"/> + </p:tab> + </p:accordionPanel> + + <p/> + + <div class="actionButton"> + <p:commandButton action="#{policyPropertyController.update()}" actionListener="#{allowedPolicyValueController.clear()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/> + <p:commandButton action="#{policyPropertyController.prepareList()}" immediate="true" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/> + </div> + </div> + + </h:form> + + </ui:define> + </ui:composition> +</ui:composition> \ No newline at end of file diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml index 44d0105c..ae6877f2 100644 --- a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml +++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml @@ -7,7 +7,7 @@ <p:confirmDialog id="policyPropertyDestroyDialog" message="Delete policy property #{policyPropertyController.getCurrentEntityInstanceName()}?" header="Delete Policy Property" severity="alert" widgetVar="policyPropertyDestroyDialogWidget" styleClass="dialog"> - <p:commandButton value="Yes" oncomplete="policyPropertyDestroyDialogWidget.hide()" action="#{policyPropertyController.destroy()}"/> + <p:commandButton value="Yes" oncomplete="policyPropertyDestroyDialogWidget.hide()" action="#{policyPropertyController.destroy()}" update="@form"/> <p:commandButton value="No" onclick="PF('policyPropertyDestroyDialogWidget').hide()" type="button" /> </p:confirmDialog> </ui:composition> diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyEditPanelGrid.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyEditPanelGrid.xhtml new file mode 100644 index 00000000..a8ffa0b1 --- /dev/null +++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyEditPanelGrid.xhtml @@ -0,0 +1,31 @@ +<?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.current}"/> + + <p:panelGrid columns="2" styleClass="editEntityDetails"> + + <h:outputLabel for="name" value="Name" styleClass="entityDataEmphasizedLabel"/> + <h:outputText 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="entityDatadLabel"/> + <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> \ No newline at end of file diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml index 430bfd6f..f13feb68 100644 --- a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml +++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml @@ -68,8 +68,8 @@ and open the template in the editor. <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"/> + <p:commandLink action="#{policyPropertyController.prepareView(policyPropertyViewObject)}" actionListener="#{allowedPolicyValueController.setPolicyProperty(policyPropertyViewObject)}" styleClass="ui-icon ui-icon-info" title="View"/> + <p:commandLink action="#{policyPropertyController.prepareEdit(policyPropertyViewObject)}" actionListener="#{allowedPolicyValueController.setPolicyProperty(policyPropertyViewObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/> </div> </p:column> </p:dataTable> diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml index 91916b12..fb107d21 100644 --- a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml +++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml @@ -13,10 +13,10 @@ and open the template in the editor. 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:commandButton id="policyPropertyAddButton" action="#{policyPropertyController.prepareCreate()}" rendered="#{loginController.admin}" value="Add" alt="Add new Policy Property" icon="ui-icon-plus" update="@form"> <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:commandButton id="policyPropertyResetFiltersButton" action="#{policyTypeController.prepareEdit(policyTypeController.current)}" 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"/> @@ -71,8 +71,8 @@ and open the template in the editor. <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 action="#{policyPropertyController.prepareView(policyPropertyObject)}" actionListener="#{allowedPolicyValueController.setPolicyProperty(policyPropertyObject)}" styleClass="ui-icon ui-icon-info" title="View"/> + <p:commandLink action="#{policyPropertyController.prepareEdit(policyPropertyObject)}" actionListener="#{allowedPolicyValueController.setPolicyProperty(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> diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyViewPanelGrid.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyViewPanelGrid.xhtml new file mode 100644 index 00000000..e48f532e --- /dev/null +++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyViewPanelGrid.xhtml @@ -0,0 +1,31 @@ +<?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.current}"/> + + <p:panelGrid columns="2" styleClass="editEntityDetails"> + + <h:outputLabel for="name" value="Name" styleClass="entityDataEmphasizedLabel"/> + <h:outputText id="name" value="#{policyPropertyObject.name}" title="Name" styleClass="entityDataEmphasizedText"/> + + <h:outputLabel for="units" value="Units" styleClass="entityDataLabel"/> + <h:outputText id="units" value="#{policyPropertyObject.units}" title="Units" styleClass="entityDataText"/> + + <h:outputLabel for="defaultValue" value="Default Value" styleClass="entityDataLabel"/> + <h:outputText id="defaultValue" value="#{policyPropertyObject.defaultValue}" title="Default Value" styleClass="entityDataText"/> + + <h:outputLabel for="lowerLimit" value="Lower Limit" styleClass="entityDataLabel"/> + <h:outputText id="lowerLimit" value="#{policyPropertyObject.lowerLimit}" title="Lower Limit" styleClass="entityDataText"/> + + <h:outputLabel for="upperLimit" value="Upper Limit" styleClass="entityDataLabel"/> + <h:outputText id="upperLimit" value="#{policyPropertyObject.upperLimit}" title="Upper Limit" styleClass="entityDataText"/> + + <h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/> + <h:outputText id="description" value="#{policyPropertyObject.description}" title="Description" styleClass="entityDataText"/> + + </p:panelGrid> +</ui:composition> \ No newline at end of file diff --git a/src/java/DmWebPortal/web/views/policyProperty/view.xhtml b/src/java/DmWebPortal/web/views/policyProperty/view.xhtml index b8c165b9..623129de 100644 --- a/src/java/DmWebPortal/web/views/policyProperty/view.xhtml +++ b/src/java/DmWebPortal/web/views/policyProperty/view.xhtml @@ -1,16 +1,46 @@ -<?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: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="viewPolicyPropertyForm"> + + <div class="middleCenterLeftContent"> + <div class="pageTitle"> + <h1>Policy Type: #{policyTypeController.current.name} <br/> + Policy Property: #{policyPropertyController.current.name}</h1> + </div> + + <ui:param name="policyPropertyObject" value="#{policyPropertyController.selected}"/> + <p:accordionPanel multiple="true" activeIndex="0,1" > + <p:tab title="Policy Property Description"> + <div class="middleCenterLeftContent"> + <ui:include src="policyPropertyViewPanelGrid.xhtml"/> + </div> + </p:tab> + + <p:tab title="Allowed Policy Values"> + <ui:include src="/views/allowedPolicyValue/allowedPolicyValueListDataTable.xhtml"/> + </p:tab> + </p:accordionPanel> + + <p/> + + <div class="actionButton"> + <p:commandButton action="#{policyPropertyController.prepareEdit(policyPropertyObject)}" rendered="#{loginController.admin}" value="Edit" alt="Edit" icon="ui-icon-pencil"/> + <p:commandButton action="#{policyPropertyController.prepareList()}" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/> + </div> + </div> + </h:form> + + </ui:define> + </ui:composition> + +</ui:composition> diff --git a/src/java/DmWebPortal/web/views/policyType/edit.xhtml b/src/java/DmWebPortal/web/views/policyType/edit.xhtml index 8cba82bd..32594af3 100644 --- a/src/java/DmWebPortal/web/views/policyType/edit.xhtml +++ b/src/java/DmWebPortal/web/views/policyType/edit.xhtml @@ -28,14 +28,14 @@ </p:tab> <p:tab title="Properties"> - <ui:include src="../policyProperty/policyPropertyListEditDataTable.xhtml"/> + <ui:include src="/views/policyProperty/policyPropertyListEditDataTable.xhtml"/> </p:tab> </p:accordionPanel> <p/> <div class="actionButton"> - <p:commandButton action="#{policyTypeController.update()}" actionListener="#{allowedPolicyValueController.clear()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/> + <p:commandButton action="#{policyTypeController.update()}" actionListener="#{policyPropertyController.clear()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/> <p:commandButton action="#{policyTypeController.prepareList()}" immediate="true" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/> </div> </div> diff --git a/src/java/DmWebPortal/web/views/policyType/view.xhtml b/src/java/DmWebPortal/web/views/policyType/view.xhtml index b5cd5e98..d6f8147a 100644 --- a/src/java/DmWebPortal/web/views/policyType/view.xhtml +++ b/src/java/DmWebPortal/web/views/policyType/view.xhtml @@ -14,7 +14,7 @@ <div class="middleCenterLeftContent"> <div class="pageTitle"> - <h1>#{policyTypeController.current.name} Policy Type Details</h1> + <h1>Policy Type: #{policyTypeController.current.name}</h1> </div> <ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/> diff --git a/src/java/DmWebPortal/web/views/userInfo/userInfoViewPanelGrid.xhtml b/src/java/DmWebPortal/web/views/userInfo/userInfoViewPanelGrid.xhtml index 44b80ecd..456d95e9 100644 --- a/src/java/DmWebPortal/web/views/userInfo/userInfoViewPanelGrid.xhtml +++ b/src/java/DmWebPortal/web/views/userInfo/userInfoViewPanelGrid.xhtml @@ -26,8 +26,8 @@ <h:outputLabel for="email" value="Email" styleClass="entityDataLabel"/> <h:outputText id="email" value="#{userInfoObject.email}" title="Email" styleClass="entityDataText"/> - <h:outputLabel for="uglobusUsername" value="Globus Username" styleClass="entityDataEmphasizedLabel"/> - <h:outputText id="globusUsername" value="#{userInfoObject.globusUsername}" title="Globus Username" styleClass="entityDataEmphasizedText"/> + <h:outputLabel for="uglobusUsername" value="Globus Username" styleClass="entityDataLabel"/> + <h:outputText id="globusUsername" value="#{userInfoObject.globusUsername}" title="Globus Username" styleClass="entityDataText"/> <h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/> <h:outputText id="description" value="#{userInfoObject.description}" title="Description" styleClass="entityDataText"/> -- GitLab