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

abc

parent a6d9bc3d
No related branches found
No related tags found
No related merge requests found
Showing
with 170 additions and 342 deletions
......@@ -6,17 +6,23 @@ import gov.anl.aps.dm.portal.exceptions.DmPortalException;
import gov.anl.aps.dm.portal.exceptions.ObjectAlreadyExists;
import gov.anl.aps.dm.portal.exceptions.InvalidDate;
import gov.anl.aps.dm.portal.exceptions.MissingProperty;
import gov.anl.aps.dm.portal.model.beans.AllowedPolicyValueFacade;
import gov.anl.aps.dm.portal.model.entities.Experiment;
import gov.anl.aps.dm.portal.model.beans.ExperimentFacade;
import gov.anl.aps.dm.portal.model.beans.PolicyTypeFacade;
import gov.anl.aps.dm.portal.model.beans.RoleTypeFacade;
import gov.anl.aps.dm.portal.model.beans.UserExperimentRoleFacade;
import gov.anl.aps.dm.portal.model.beans.UserInfoFacade;
import gov.anl.aps.dm.portal.model.entities.AllowedPolicyValue;
import gov.anl.aps.dm.portal.model.entities.CloneableEntity;
import gov.anl.aps.dm.portal.model.entities.ExperimentPolicy;
import gov.anl.aps.dm.portal.model.entities.PolicyType;
import gov.anl.aps.dm.portal.model.entities.RoleType;
import gov.anl.aps.dm.portal.model.entities.UserExperimentRole;
import gov.anl.aps.dm.portal.model.entities.UserInfo;
import gov.anl.aps.dm.portal.utilities.SessionUtility;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -46,9 +52,48 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
@EJB
private RoleTypeFacade roleTypeFacade;
@EJB
private PolicyTypeFacade policyTypeFacade;
@EJB
private AllowedPolicyValueFacade allowedPolicyValueFacade;
@EJB
private UserExperimentRoleFacade userExperimentRoleFacade;
public class ExperimentPolicyType extends CloneableEntity {
PolicyType type;
private ExperimentPolicy policy;
public ExperimentPolicyType(PolicyType type) {
this.type= type;
}
public ExperimentPolicy getPolicy() {
return policy;
}
public void setPolicy(ExperimentPolicy policy) {
this.policy = policy;
}
public PolicyType getPolicyType() {
return type;
}
public ExperimentPolicy getPolicyValue() {
return policy;
}
public String getPolicyName() {
if (policy == null) {
return "none";
}
return policy.getPolicyValue();
}
}
public class ExperimentUser extends CloneableEntity {
String name;
......@@ -125,6 +170,59 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
}
}
class ExperimentPoliciesTable extends DataTableController<ExperimentPolicy> {
@Override
public String getClassName() {
return "ExperimentPolicy";
}
@Override
public List<ExperimentPolicy> findAll() {
return getCurrent().getExperimentPolicyList();
}
@Override
public String getTableName() {
return "experimentPoliciesTable";
}
}
class ExperimentPoliciesTypeTable extends DataTableController<ExperimentPolicyType> {
@Override
public String getClassName() {
return "ExperimentPolicyType";
}
@Override
public List<ExperimentPolicyType> findAll() {
if (!initialized) {
initializeTables();
}
Collection<PolicyType> list = policies.keySet();
return convertExperimentPolicyTypes(list);
}
List<ExperimentPolicyType> convertExperimentPolicyTypes(Collection<PolicyType> list) {
List<ExperimentPolicyType> newList = new ArrayList<>();
ExperimentPolicyType experimentPolicyType;
ExperimentPolicy policy;
for (PolicyType type : list) {
experimentPolicyType = new ExperimentPolicyType(type);
newList.add(experimentPolicyType);
policy = getCurrent().getPolicyForType(type);
experimentPolicyType.setPolicy(policy);
}
return newList;
}
@Override
public String getTableName() {
return "experimentPoliciesTable";
}
}
class ExperimentUsersTable extends DataTableController<ExperimentUser> {
@Override
......@@ -140,7 +238,7 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
List<ExperimentUser> convertExperimentUsers(List<UserInfo> list) {
if (!initialized) {
initializeRoleTypes();
initializeTables();
}
logger.debug("converting ExperimentUser ");
ExperimentUser experimentUser;
......@@ -186,8 +284,12 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
private ExperimentController.ExperimentUsersTable experimentUsersListTable = new ExperimentController.ExperimentUsersTable();
private ExperimentController.ExperimentUsersTable experimentUsersEditTable = new ExperimentController.ExperimentUsersTable();
private ExperimentController.NoExperimentUsersTypeTable noExperimentUsersTypeTable = new ExperimentController.NoExperimentUsersTypeTable();
private ExperimentController.ExperimentPoliciesTable experimentPoliciesTable = new ExperimentPoliciesTable();
private ExperimentController.ExperimentPoliciesTypeTable experimentPoliciesTypeTable = new ExperimentPoliciesTypeTable();
final private Map<UserInfo, ExperimentUser> experimentUsers = new HashMap<>();
final private Map<String, RoleType> experimentRoles = new HashMap<>();
final private Map<PolicyType, List<AllowedPolicyValue>> policies = new HashMap<>();
int maxExperimentRoleTypeId = 0;
boolean initialized = false;
......@@ -229,12 +331,12 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
public String prepareEdit(Experiment experiment) {
clear();
if (!initialized) {
initializeRoleTypes();
initializeTables();
}
return super.prepareEdit(experiment);
}
private void initializeRoleTypes() {
private void initializeTables() {
List<RoleType> roleTypesList = roleTypeFacade.findAll();
for (RoleType roleType : roleTypesList) {
if (!roleType.isIsSystemRole()) {
......@@ -244,6 +346,13 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
}
}
}
for (PolicyType policyType : policyTypeFacade.findAll()) {
List<AllowedPolicyValue> list = new ArrayList<>();
for (AllowedPolicyValue allowedPolicyValue : (List<AllowedPolicyValue>) allowedPolicyValueFacade.findByPolicyType(policyType.getId())) {
list.add(allowedPolicyValue);
}
policies.put(policyType, list);
}
initialized = true;
}
......@@ -296,6 +405,7 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
experimentUsersEditTable.resetList();
experimentUsers.clear();
noExperimentUsersTypeTable.resetList();
experimentPoliciesTable.resetList();
}
public ExperimentController.ExperimentUsersTable getExperimentUsersListTable() {
......@@ -322,6 +432,26 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
this.noExperimentUsersTypeTable = noExperimentUsersTypeTable;
}
public ExperimentPoliciesTable getExperimentPoliciesTable() {
return experimentPoliciesTable;
}
public void setExperimentPoliciesTable(ExperimentPoliciesTable experimentPoliciesTable) {
this.experimentPoliciesTable = experimentPoliciesTable;
}
public ExperimentPoliciesTypeTable getExperimentPoliciesTypeTable() {
return experimentPoliciesTypeTable;
}
public void setExperimentPoliciesTypeTable(ExperimentPoliciesTypeTable experimentPoliciesTypeTable) {
this.experimentPoliciesTypeTable = experimentPoliciesTypeTable;
}
public List<AllowedPolicyValue> getAllowedPolicies(PolicyType policyType) {
return policies.get(policyType);
}
public void updateRemovedExperimentRoles() {
UserExperimentRole userExperimentRole;
for (UserInfo user : experimentUsers.keySet()) {
......@@ -426,7 +556,7 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
public boolean canEditExperiment(int experimentId) {
if (!initialized) {
initializeRoleTypes();
initializeTables();
}
// user that is Manager or PI can edit experiment
int managerRoleId = experimentRoles.get(RoleTypeName.MANAGER).getId();
......@@ -447,7 +577,7 @@ public class ExperimentController extends CrudEntityController<Experiment, Exper
public boolean canDeleteExperiment(int experimentId) {
if (!initialized) {
initializeRoleTypes();
initializeTables();
}
int managerRoleId = experimentRoles.get(RoleTypeName.MANAGER).getId();
UserInfo logged = (UserInfo) SessionUtility.getUser();
......
......@@ -160,8 +160,17 @@ public class Experiment extends CloneableEntity
public void setExperimentType(ExperimentType experimentType) {
this.experimentType = experimentType;
}
public ExperimentPolicy getPolicyForType(PolicyType type) {
for (ExperimentPolicy experimentPolicy : experimentPolicyList) {
if (experimentPolicy.getPolicyType().getId() == type.getId()) {
return experimentPolicy;
}
}
return null;
}
@Override
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
......
......@@ -25,6 +25,10 @@
</div>
</p:tab>
<p:tab title="Experiment Policies">
<ui:include src="experimentPoliciesEditSelection.xhtml"/>
</p:tab>
<p:tab title="Experiment Users" id="usersTab">
<ui:include src="experimentUsersEditDataTable.xhtml"/>
......
......@@ -23,10 +23,10 @@
</div>
</p:tab>
<!-- <p:tab title="Experiment Policies">
<ui:include src="experimentPoliciesViewPanelGrid.xhtml"/>
<p:tab title="Experiment Policies">
<ui:include src="experimentPoliciesViewListDataTable.xhtml"/>
</p:tab>
-->
<p:tab title="Experiment Users">
<ui:include src="experimentUsersListDataTable.xhtml"/>
</p:tab>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<c:set var="allowedPolicyValueObject" value="#{allowedPolicyValueController.selected}"/>
<p:panelGrid columns="2" styleClass="createEntityDetails">
<h:outputLabel for="policyValue" value="Policy Value" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="policyValue" value="#{allowedPolicyValueObject.policyValue}" title="Policy Value" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{allowedPolicyValueObject.description}" title="Description" styleClass="entityDataText"/>
<h:outputLabel for="policyType" value="Policy Type" styleClass="entityDataLabel"/>
<h:outputText id="policyType" value="#{allowedPolicyValueController.policyType.name}" title="Policy Type" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns: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>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<ui:param name="allowedPolicyValueObject" value="#{allowedPolicyValueController.current}"/>
<p:panelGrid columns="2" styleClass="editEntityDetails">
<h:outputLabel for="policyValue" value="Policy Value" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="policyValue" value="#{allowedPolicyValueObject.policyValue}" title="Policy Value" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{allowedPolicyValueObject.description}" title="Description" styleClass="entityDataText"/>
<h:outputLabel for="policyType" value="Policy Type" styleClass="entityDataLabel"/>
<h:outputText id="policyType" value="#{allowedPolicyValueController.policyType.name}" title="Policy Type" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<div class="actionButton">
<p:commandButton id="AllowedPolicyValueAddButton" action="#{allowedPolicyValueController.prepareCreate()}" rendered="#{loginController.admin}" value="Add" alt="Add new AllowedPolicyValue" icon="ui-icon-plus">
<p:tooltip for="AllowedPolicyValueAddButton" value="Create new AllowedPolicyValue."/>
</p:commandButton>
<p:commandButton id="AllowedPolicyValueResetFiltersButton" action="#{policyTypeController.prepareView(allowedPolicyValueController.policyType)}" actionListener="#{allowedPolicyValueController.resetList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight">
<p:tooltip for="AllowedPolicyValueResetFiltersButton" value="Reset list filters."/>
</p:commandButton>
<p:commandButton id="AllowedPolicyValueNoOp" style="visibility:hidden" value="NoOp"/>
<p:defaultCommand target="AllowedPolicyValueNoOp"/>
</div>
<p:dataTable id="allowedPolicyValueListDataTable"
var="allowedPolicyValueObject"
value="#{allowedPolicyValueController.listDataModel}"
filteredValue="#{allowedPolicyValueController.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="25"
binding="#{allowedPolicyValueController.listDataTable}"
widgetVar="allowedPolicyValueListWidget"
emptyMessage="No experiment types found.">
<p:column sortBy="#{allowedPolicyValueObject.id}" headerText="Id" >
<h:outputText value="#{allowedPolicyValueObject.id}"/>
</p:column>
<p:column sortBy="#{allowedPolicyValueObject.policyValue}" headerText="Allowed Policy Value"
filterBy="#{allowedPolicyValueObject.policyValue}" filterMatchMode="contains" >
<h:outputText value="#{allowedPolicyValueObject.policyValue}"/>
</p:column>
<p:column sortBy="#{allowedPolicyValueObject.description}" headerText="Description"
filterBy="#{allowedPolicyValueObject.description}" filterMatchMode="contains">
<h:outputText value="#{allowedPolicyValueObject.description}"/>
</p:column>
<p:column headerText="Actions" >
<div class="actionLink">
<h:commandLink action="#{allowedPolicyValueController.prepareView(allowedPolicyValueObject)}" styleClass="ui-icon ui-icon-info" title="View"/>
<h:commandLink action="#{allowedPolicyValueController.prepareEdit(allowedPolicyValueObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
<p:commandLink oncomplete="PF('allowedPolicyValueDestroyDialogWidget').show()" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-trash" title="Delete" update="@form">
<f:setPropertyActionListener value="#{allowedPolicyValueObject}" target="#{allowedPolicyValueController.current}"/>
</p:commandLink>
</div>
</p:column>
</p:dataTable>
</ui:composition>
<?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>
<?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>Add Allowed Policy Value</h1>
</div>
<h:form id="addAllowedPolicyValueForm">
<ui:include src="allowedPolicyValueCreatePanelGrid.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"/>
</div>
</h:form>
</ui:define>
</ui:composition>
</ui:composition>
......@@ -10,38 +10,24 @@
<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="editPolicyTypeForm">
<ui:define name="middleCenter">
<h:form id="editRoleTypeForm">
<div class="middleCenterLeftContent">
<div class="pageTitle">
<h1>Edit #{policyTypeController.current.name} Policy Type</h1>
</div>
<ui:param name="policyTypeObject" value="#{policyTypeController.selected}"/>
<p:accordionPanel multiple="true" activeIndex="0,1" >
<p:tab title="Policy Type Properties">
<div class="middleCenterLeftContent">
<ui:include src="policyTypeEditPanelGrid.xhtml"/>
</div>
</p:tab>
<p:tab title="Allowed Policy Values">
<ui:include src="allowedPolicyValueListDataTable.xhtml"/>
</p:tab>
</p:accordionPanel>
<p/>
<div class="middleCenterLeftContent">
<div class="pageTitle">
<h1>Edit Role Type</h1>
</div>
<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.prepareList()}" immediate="true" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/>
</div>
<ui:include src="roleTypeEditPanelGrid.xhtml"/>
<p/>
<div class="actionButton">
<p:commandButton action="#{roleTypeController.update()}" value="Save" alt="Save" icon="ui-icon-check" update="@form"/>
<p:commandButton action="#{roleTypeController.prepareList()}" immediate="true" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/>
</div>
</div>
</h:form>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<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>
......@@ -11,11 +11,11 @@
<ui:composition template="../../templates/dmViewTemplate.xhtml">
<ui:define name="middleCenter">
<div class="pageTitle">
<h1>Policy Types</h1>
<h1>Role Types</h1>
</div>
<h:form id="viewEntityTypeListForm">
<ui:param name="entityController" value="#{policyTypeController}"/>
<h:form id="viewRoleTypeListForm">
<ui:param name="entityController" value="#{roleTypeController}"/>
<div class="actionButton">
<p:commandButton id="#{entityTypeName}ResetFiltersButton" action="#{entityController.resetList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight">
......@@ -26,7 +26,7 @@
</div>
<h:panelGroup>
<ui:include src="policyTypeListDataTable.xhtml"/>
<ui:include src="roleTypeListDataTable.xhtml"/>
</h:panelGroup>
</h:form>
......
<?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="policyTypeObject" value="#{policyTypeController.current}"/>
<p:panelGrid columns="2" styleClass="editEntityDetails">
<h:outputLabel for="name" value="Name" styleClass="entityDataEmphasizedLabel"/>
<h:outputText id="name" value="#{policyTypeObject.name}" title="Name" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{policyTypeObject.description}" title="Description" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<p:dataTable id="policyTypeListDataTable"
var="policyTypeObject"
value="#{policyTypeController.listDataModel}"
filteredValue="#{policyTypeController.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="25"
binding="#{policyTypeController.listDataTable}"
widgetVar="policyTypeListWidget"
emptyMessage="No role types found." >
<p:column sortBy="#{policyTypeObject.id}" headerText="Id" >
<h:outputText value="#{policyTypeObject.id}"/>
</p:column>
<p:column sortBy="#{policyTypeObject.name}" headerText="Policy Type"
filterBy="#{policyTypeObject.name}" filterMatchMode="contains" >
<h:outputText value="#{policyTypeObject.name}"/>
</p:column>
<p:column sortBy="#{policyTypeObject.description}" headerText="Description"
filterBy="#{policyTypeObject.description}" filterMatchMode="contains">
<h:outputText value="#{policyTypeObject.description}"/>
</p:column>
<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"/>
</div>
</p:column>
</p:dataTable>
</ui:composition>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:param name="policyTypeObject" value="#{policyTypeController.current}"/>
<p:panelGrid columns="2" styleClass="viewEntityDetails">
<h:outputLabel for="name" value="Name" styleClass="entityDataEmphasizedLabel"/>
<h:outputText id="name" value="#{policyTypeObject.name}" title="Name" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:outputText id="description" value="#{policyTypeObject.description}" title="Description" styleClass="entityDataText"/>
</p:panelGrid>
</ui:composition>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment