From 19e0ad4fe50a5af122fec9a9ceff4136d4138bd2 Mon Sep 17 00:00:00 2001
From: "Barbara B. Frosik" <bfrosik@aps.anl.gov>
Date: Wed, 4 Mar 2015 16:22:12 +0000
Subject: [PATCH] modified data base

---
 .../controllers/PolicyPropertyController.java | 228 ++++++++++++++++++
 .../controllers/PolicyTypeController.java     |  18 +-
 .../model/beans/PolicyPropertyFacade.java     |   7 +
 .../portal/model/entities/PolicyProperty.java |   2 +-
 .../create.xhtml}                             |  12 +-
 .../web/views/policyProperty/edit.xhtml       |  16 ++
 .../policyPropertyCreatePanelGrid.xhtml       |  34 +++
 .../policyPropertyDestroyDialog.xhtml         |  15 ++
 .../policyPropertyListDataTable.xhtml         |  77 ++++++
 .../policyPropertyListEditDataTable.xhtml     |  83 +++++++
 .../web/views/policyProperty/view.xhtml       |  16 ++
 .../allowedPolicyValueCreatePanelGrid.xhtml   |  25 --
 .../allowedPolicyValueDestroyDialog.xhtml     |  13 -
 .../allowedPolicyValueEditPanelGrid.xhtml     |  23 --
 .../allowedPolicyValueListDataTable.xhtml     |  59 -----
 .../allowedPolicyValueViewPanelGrid.xhtml     |  23 --
 .../web/views/policyType/edit.xhtml           |   6 +-
 .../policyType/editAllowedPolicyValue.xhtml   |  33 ---
 .../policyType/policyTypeListDataTable.xhtml  |   4 +-
 .../web/views/policyType/view.xhtml           |   9 +-
 .../policyType/viewAllowedPolicyValue.xhtml   |  41 ----
 .../roleType/viewAllowedPolicyValue.xhtml     |  43 ----
 22 files changed, 504 insertions(+), 283 deletions(-)
 create mode 100644 src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyPropertyController.java
 rename src/java/DmWebPortal/web/views/{policyType/createAllowedPolicyValue.xhtml => policyProperty/create.xhtml} (63%)
 create mode 100644 src/java/DmWebPortal/web/views/policyProperty/edit.xhtml
 create mode 100644 src/java/DmWebPortal/web/views/policyProperty/policyPropertyCreatePanelGrid.xhtml
 create mode 100644 src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml
 create mode 100644 src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml
 create mode 100644 src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml
 create mode 100644 src/java/DmWebPortal/web/views/policyProperty/view.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/policyType/allowedPolicyValueCreatePanelGrid.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/policyType/allowedPolicyValueDestroyDialog.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/policyType/allowedPolicyValueEditPanelGrid.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/policyType/allowedPolicyValueListDataTable.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/policyType/allowedPolicyValueViewPanelGrid.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/policyType/editAllowedPolicyValue.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/policyType/viewAllowedPolicyValue.xhtml
 delete mode 100644 src/java/DmWebPortal/web/views/roleType/viewAllowedPolicyValue.xhtml

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
new file mode 100644
index 00000000..85e35c35
--- /dev/null
+++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyPropertyController.java
@@ -0,0 +1,228 @@
+/*
+ * 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
diff --git a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyTypeController.java b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyTypeController.java
index 7e7600d7..6b11fa74 100644
--- a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyTypeController.java
+++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/controllers/PolicyTypeController.java
@@ -74,20 +74,24 @@ public class PolicyTypeController extends CrudEntityController<PolicyType, Polic
         logger.debug("Inserting new experiment type " + policyType.getName());
     }
 
-//    @Override
-//    public void prepareEntityUpdate(PolicyType policyType) throws DmPortalException {
-//        if ((policyType.getName() == null) || (policyType.getName().length() == 0)) {
-//            throw new MissingProperty("Name is missing.");
-//        }
-//    }
+    @Override
+    public void prepareEntityUpdate(PolicyType policyType) throws DmPortalException {
+        if ((policyType.getName() == null) || (policyType.getName().length() == 0)) {
+            throw new MissingProperty("Name is missing.");
+        }
+    }
     
-      @Override
+     @Override
      protected String getObjectAlreadyExistMessage(PolicyType policyType)  {
         if (policyType == null) {
             return null;
         }
         return "Experiment Policy " + policyType.getName() + " already exists."; 
     }
+     
+     public String prepareView() {
+         return super.prepareView(current);
+     }
 
     @FacesConverter(forClass = PolicyType.class)
     public static class PolicyTypeControllerConverter implements Converter
diff --git a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/PolicyPropertyFacade.java b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/PolicyPropertyFacade.java
index 32473fec..6c054c23 100644
--- a/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/PolicyPropertyFacade.java
+++ b/src/java/DmWebPortal/src/java/gov/anl/aps/dm/portal/model/beans/PolicyPropertyFacade.java
@@ -27,6 +27,13 @@ public class PolicyPropertyFacade extends AbstractFacade<PolicyProperty>
     protected EntityManager getEntityManager() {
         return em;
     }
+    
+    @Override
+    public void remove(PolicyProperty entity) {
+        Object o = em.merge(entity);
+        em.remove(o);
+    }
+
 
     public PolicyPropertyFacade() {
         super(PolicyProperty.class);
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 80dd823e..e00876a5 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
@@ -30,7 +30,7 @@ import javax.xml.bind.annotation.XmlTransient;
  * @author bfrosik
  */
 @Entity
-@Table(name = "policy_type")
+@Table(name = "policy_property")
 @XmlRootElement
 @NamedQueries({
     @NamedQuery(name = "PolicyProperty.findAll", query = "SELECT p FROM PolicyProperty p"),
diff --git a/src/java/DmWebPortal/web/views/policyType/createAllowedPolicyValue.xhtml b/src/java/DmWebPortal/web/views/policyProperty/create.xhtml
similarity index 63%
rename from src/java/DmWebPortal/web/views/policyType/createAllowedPolicyValue.xhtml
rename to src/java/DmWebPortal/web/views/policyProperty/create.xhtml
index de85f39c..fa595bbe 100644
--- a/src/java/DmWebPortal/web/views/policyType/createAllowedPolicyValue.xhtml
+++ b/src/java/DmWebPortal/web/views/policyProperty/create.xhtml
@@ -12,20 +12,22 @@
     <ui:composition template="../../templates/dmViewTemplate.xhtml">
     <ui:define name="middleCenter">
         <div class="pageTitle">
-            <h1>Add Allowed Policy Value</h1>
+            <h1>Add Policy Property for #{policyPropertyController.policyType.name}</h1>
         </div>
 
-        <h:form id="addAllowedPolicyValueForm">
+        <h:form id="addPolicyPropertyForm">
 
-            <ui:include src="allowedPolicyValueCreatePanelGrid.xhtml"/>
+            <ui:include src="policyPropertyCreatePanelGrid.xhtml"/>
 
             <p/>
             <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="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" immediate="true" value="Cancel" alt="Cancel" icon="ui-icon-cancel"/>
+                <p:commandButton action="#{policyPropertyController.create()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/>
+                <p:commandButton action="#{policyPropertyController.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/policyProperty/edit.xhtml b/src/java/DmWebPortal/web/views/policyProperty/edit.xhtml
new file mode 100644
index 00000000..b8c165b9
--- /dev/null
+++ b/src/java/DmWebPortal/web/views/policyProperty/edit.xhtml
@@ -0,0 +1,16 @@
+<?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>
diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyCreatePanelGrid.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyCreatePanelGrid.xhtml
new file mode 100644
index 00000000..178c21e3
--- /dev/null
+++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyCreatePanelGrid.xhtml
@@ -0,0 +1,34 @@
+<?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>
+
+
diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml
new file mode 100644
index 00000000..44d0105c
--- /dev/null
+++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyDestroyDialog.xhtml
@@ -0,0 +1,15 @@
+<?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="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="No" onclick="PF('policyPropertyDestroyDialogWidget').hide()" type="button" />
+    </p:confirmDialog>  
+</ui:composition>
+
+
diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml
new file mode 100644
index 00000000..430bfd6f
--- /dev/null
+++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListDataTable.xhtml
@@ -0,0 +1,77 @@
+<?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>
diff --git a/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml
new file mode 100644
index 00000000..91916b12
--- /dev/null
+++ b/src/java/DmWebPortal/web/views/policyProperty/policyPropertyListEditDataTable.xhtml
@@ -0,0 +1,83 @@
+<?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>
diff --git a/src/java/DmWebPortal/web/views/policyProperty/view.xhtml b/src/java/DmWebPortal/web/views/policyProperty/view.xhtml
new file mode 100644
index 00000000..b8c165b9
--- /dev/null
+++ b/src/java/DmWebPortal/web/views/policyProperty/view.xhtml
@@ -0,0 +1,16 @@
+<?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>
diff --git a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueCreatePanelGrid.xhtml b/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueCreatePanelGrid.xhtml
deleted file mode 100644
index 323b6d33..00000000
--- a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueCreatePanelGrid.xhtml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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>
-
diff --git a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueDestroyDialog.xhtml b/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueDestroyDialog.xhtml
deleted file mode 100644
index c6a50dd0..00000000
--- a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueDestroyDialog.xhtml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?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 experiment type #{allowedPolicyValueController.getCurrentEntityInstanceName()}?"
-                     header="Delete Allowed Policy Value" severity="alert" widgetVar="allowedPolicyValueDestroyDialogWidget"
-                     styleClass="dialog">
-        <p:commandButton value="Yes" oncomplete="allowedPolicyValueDestroyDialogWidget.hide()" action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" actionListener="#{allowedPolicyValueController.destroy()}"/>
-        <p:commandButton value="No" onclick="PF('allowedPolicyValueDestroyDialogWidget').hide()" type="button" />
-    </p:confirmDialog>  
-</ui:composition>
diff --git a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueEditPanelGrid.xhtml b/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueEditPanelGrid.xhtml
deleted file mode 100644
index 57ec214d..00000000
--- a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueEditPanelGrid.xhtml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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>
diff --git a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueListDataTable.xhtml b/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueListDataTable.xhtml
deleted file mode 100644
index 92446e26..00000000
--- a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueListDataTable.xhtml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?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
diff --git a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueViewPanelGrid.xhtml b/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueViewPanelGrid.xhtml
deleted file mode 100644
index 8f0e1ba7..00000000
--- a/src/java/DmWebPortal/web/views/policyType/allowedPolicyValueViewPanelGrid.xhtml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?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>
diff --git a/src/java/DmWebPortal/web/views/policyType/edit.xhtml b/src/java/DmWebPortal/web/views/policyType/edit.xhtml
index d3c325c6..8cba82bd 100644
--- a/src/java/DmWebPortal/web/views/policyType/edit.xhtml
+++ b/src/java/DmWebPortal/web/views/policyType/edit.xhtml
@@ -21,14 +21,14 @@
 
                     <ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/>
                     <p:accordionPanel multiple="true" activeIndex="0,1" >
-                        <p:tab title="Policy Type Properties">
+                        <p:tab title="Policy Type Description">
                             <div class="middleCenterLeftContent">
                                 <ui:include src="policyTypeEditPanelGrid.xhtml"/>
                             </div>
                         </p:tab>
 
-                        <p:tab title="Allowed Policy Values">                
-                            <ui:include src="allowedPolicyValueListDataTable.xhtml"/>
+                        <p:tab title="Properties">                
+                             <ui:include src="../policyProperty/policyPropertyListEditDataTable.xhtml"/>
                         </p:tab>
                     </p:accordionPanel>
 
diff --git a/src/java/DmWebPortal/web/views/policyType/editAllowedPolicyValue.xhtml b/src/java/DmWebPortal/web/views/policyType/editAllowedPolicyValue.xhtml
deleted file mode 100644
index 39361599..00000000
--- a/src/java/DmWebPortal/web/views/policyType/editAllowedPolicyValue.xhtml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?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>
diff --git a/src/java/DmWebPortal/web/views/policyType/policyTypeListDataTable.xhtml b/src/java/DmWebPortal/web/views/policyType/policyTypeListDataTable.xhtml
index 639c0882..e834cd87 100644
--- a/src/java/DmWebPortal/web/views/policyType/policyTypeListDataTable.xhtml
+++ b/src/java/DmWebPortal/web/views/policyType/policyTypeListDataTable.xhtml
@@ -35,8 +35,8 @@
 
         <p:column headerText="Actions" >
             <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.prepareEdit(policyTypeObject)}" actionListener="#{allowedPolicyValueController.setPolicyType(policyTypeObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
+                <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="#{policyPropertyController.setPolicyType(policyTypeObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
             </div>
         </p:column>
     </p:dataTable>
diff --git a/src/java/DmWebPortal/web/views/policyType/view.xhtml b/src/java/DmWebPortal/web/views/policyType/view.xhtml
index e8305196..b5cd5e98 100644
--- a/src/java/DmWebPortal/web/views/policyType/view.xhtml
+++ b/src/java/DmWebPortal/web/views/policyType/view.xhtml
@@ -19,25 +19,24 @@
 
                     <ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/>
                     <p:accordionPanel multiple="true" activeIndex="0,1" >
-                        <p:tab title="Policy Type Properties">
+                        <p:tab title="Policy Type Description">
                             <div class="middleCenterLeftContent">
                                 <ui:include src="policyTypeViewPanelGrid.xhtml"/>
                             </div>
                         </p:tab>
 
-                        <p:tab title="Allowed Policy Values">                
-                            <ui:include src="allowedPolicyValueListDataTable.xhtml"/>
+                        <p:tab title="Properties">                
+                            <ui:include src="../policyProperty/policyPropertyListDataTable.xhtml"/>
                         </p:tab>
                     </p:accordionPanel>
 
                     <p/>
 
                     <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"/>
                     </div>          
                 </div>
-            <ui:include src="allowedPolicyValueDestroyDialog.xhtml"/>
             </h:form>
 
         </ui:define>
diff --git a/src/java/DmWebPortal/web/views/policyType/viewAllowedPolicyValue.xhtml b/src/java/DmWebPortal/web/views/policyType/viewAllowedPolicyValue.xhtml
deleted file mode 100644
index 4cba9582..00000000
--- a/src/java/DmWebPortal/web/views/policyType/viewAllowedPolicyValue.xhtml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?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>
diff --git a/src/java/DmWebPortal/web/views/roleType/viewAllowedPolicyValue.xhtml b/src/java/DmWebPortal/web/views/roleType/viewAllowedPolicyValue.xhtml
deleted file mode 100644
index 3f440ec7..00000000
--- a/src/java/DmWebPortal/web/views/roleType/viewAllowedPolicyValue.xhtml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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>
-
-
-- 
GitLab