Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • DM/dm-docs
  • hammonds/dm-docs
  • hparraga/dm-docs
3 results
Show changes
Showing
with 1002 additions and 0 deletions
<?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">
<div>
<p:commandButton id="ResetFiltersButton" action="#{userInfoController.userExperimentsListTable.resetList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight" oncomplete="PF('userExperimentsListWidget').clearFilters()" update="userExperimentsListDataTable">
<p:tooltip for="ResetFiltersButton" value="Reset filters."/>
</p:commandButton>
<p:commandButton id="#{entityTypeName}NoOp" style="visibility:hidden" value="NoOp"/>
<p:defaultCommand target="#{entityTypeName}NoOp"/>
</div>
<p:dataTable id="userExperimentsListDataTable"
var="userExperimentObject"
value="#{userInfoController.userExperimentsListTable.listDataModel}"
filteredValue="#{userInfoController.userExperimentsListTable.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="#{userInfoController.rows}"
binding="#{userInfoController.userExperimentsListTable.listDataTable}"
widgetVar="userExperimentsListWidget"
emptyMessage="No experiments found.">
<p:column sortBy="#{userExperimentObject.experimentName}" headerText="Experiment Name"
filterBy="#{userExperimentObject.experimentName}" filterMatchMode="contains" >
<h:outputText value="#{userExperimentObject.experimentName}"/>
</p:column>
<p:column sortBy="#{userExperimentObject.description}" headerText="Description"
filterBy="#{userExperimentObject.description}" filterMatchMode="contains" >
<h:outputText value="#{userExperimentObject.description}"/>
</p:column>
<p:column sortBy="#{!userExperimentObject.isManager}" headerText="Manager">
<h:outputText value="" styleClass="ui-icon ui-icon-check" rendered="#{userExperimentObject.isManager}" />
</p:column>
<p:column sortBy="#{!userExperimentObject.isPI}" headerText="Principal Investigator">
<h:outputText value="" styleClass="ui-icon ui-icon-check" rendered="#{userExperimentObject.isPI}" />
</p:column>
<p:column sortBy="#{!userExperimentObject.isUser}" headerText="User">
<h:outputText value="" styleClass="ui-icon ui-icon-check" rendered="#{userExperimentObject.isUser}" />
</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="userInfoObject" value="#{userInfoController.selected}"/>
<p:panelGrid columns="2" styleClass="createEntityDetails">
<h:outputLabel for="badge" value="Badge" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="badge" value="#{userInfoObject.badge}" title="Badge" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="username" value="Username" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="username" value="#{userInfoObject.username}" title="Username" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="lastName" value="Last Name" styleClass="entityDataLabel"/>
<h:inputText id="lastName" value="#{userInfoObject.lastName}" title="Last Name" styleClass="entityDataText"/>
<h:outputLabel for="firstName" value="First Name" styleClass="entityDataLabel"/>
<h:inputText id="firstName" value="#{userInfoObject.firstName}" title="First Name" styleClass="entityDataText"/>
<h:outputLabel for="middleName" value="Middle Name" styleClass="entityDataLabel"/>
<h:inputText id="middleName" value="#{userInfoObject.middleName}" title="Middle Name" styleClass="entityDataText"/>
<h:outputLabel for="email" value="Email" styleClass="entityDataLabel"/>
<h:inputText id="email" value="#{userInfoObject.email}" title="Email" styleClass="entityDataText"/>
<h:outputLabel for="password" value="Password" styleClass="entityDataLabel"/>
<p:password id="password" value="#{userInfoController.passwordEntry}" title="Password" feedback="true" styleClass="entityDataText"/>
<h:outputLabel for="globusUsername" value="Globus Username" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="globusUsername" value="#{userInfoObject.globusUsername}" title="Globus Username" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{userInfoObject.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:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<p:confirmDialog id="userInfoDestroyDialog" message="Delete user #{userInfoController.getCurrentEntityInstanceName()}?"
header="Delete User" severity="alert" widgetVar="userInfoDestroyDialogWidget"
styleClass="dialog">
<p:commandButton value="Yes" oncomplete="userInfoDestroyDialogWidget.hide()" action="#{userInfoController.destroy()}"/>
<p:commandButton value="No" onclick="PF('userInfoDestroyDialogWidget').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">
<ui:param name="userInfoObject" value="#{userInfoController.selected}"/>
<ui:param name="isFieldWriteable" value="#{loginController.loggedIn}"/>
<p:panelGrid columns="2" styleClass="editEntityDetails">
<h:outputLabel for="badge" value="Badge" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="badge" value="#{userInfoObject.badge}" title="Badge" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="username" value="Username" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="username" value="#{userInfoObject.username}" rendered="#{isFieldWriteable}" title="Username" styleClass="entityDataEmphasizedText"/>
<h:outputText id="usernameOutput" value="#{userInfoObject.username}" rendered="#{!isFieldWriteable}" title="Username" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="lastName" value="Last Name" styleClass="entityDataLabel"/>
<h:inputText id="lastName" value="#{userInfoObject.lastName}" rendered="#{isFieldWriteable}" title="Last Name" styleClass="entityDataText"/>
<h:outputText id="lastNameOutput" value="#{userInfoObject.lastName}" rendered="#{!isFieldWriteable}" title="Last Name" styleClass="entityDataText"/>
<h:outputLabel for="firstName" value="First Name" styleClass="entityDataLabel"/>
<h:inputText id="firstName" value="#{userInfoObject.firstName}" rendered="#{isFieldWriteable}" title="First Name" styleClass="entityDataText"/>
<h:outputText id="firstNameOutput" value="#{userInfoObject.firstName}" rendered="#{!isFieldWriteable}" title="First Name" styleClass="entityDataText"/>
<h:outputLabel for="middleName" value="Middle Name" styleClass="entityDataLabel"/>
<h:inputText id="middleName" value="#{userInfoObject.middleName}" title="Middle Name" rendered="#{isFieldWriteable}" styleClass="entityDataText"/>
<h:outputText id="middleNameOutput" value="#{userInfoObject.middleName}" title="Middle Name" rendered="#{!isFieldWriteable}" styleClass="entityDataText"/>
<h:outputLabel for="email" value="Email" styleClass="entityDataLabel"/>
<h:inputText id="email" value="#{userInfoObject.email}" title="Email" styleClass="entityDataText"/>
<h:outputLabel for="password" value="Password" styleClass="entityDataLabel"/>
<p:password id="password" value="#{userInfoController.passwordEntry}" title="Password" feedback="true" styleClass="entityDataText"/>
<h:outputLabel for="globusUsername" value="Globus Username" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="globusUsername" value="#{userInfoObject.globusUsername}" title="Globus Username" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{userInfoObject.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="userInfoListDataTable"
var="userInfoObject"
value="#{userInfoController.listDataModel}"
filteredValue="#{userInfoController.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="#{userInfoController.rows}"
binding="#{userInfoController.listDataTable}"
widgetVar="userInfoListWidget"
emptyMessage="No users found.">
<p:column sortBy="#{userInfoObject.id}" headerText="Id" >
<h:outputText value="#{userInfoObject.id}"/>
</p:column>
<p:column sortBy="#{userInfoObject.badge}" headerText="ANL Badge"
filterBy="#{userInfoObject.badge}" filterMatchMode="contains" >
<h:outputText value="#{userInfoObject.badge}"/>
</p:column>
<p:column sortBy="#{userInfoObject.username}" headerText="Username"
filterBy="#{userInfoObject.username}" filterMatchMode="contains" >
<h:outputText value="#{userInfoObject.username}"/>
</p:column>
<p:column sortBy="#{userInfoObject.lastName}" headerText="Last Name"
filterBy="#{userInfoObject.lastName}" filterMatchMode="contains" >
<h:outputText value="#{userInfoObject.lastName}"/>
</p:column>
<p:column sortBy="#{userInfoObject.firstName}" headerText="First, middle Name"
filterBy="#{userInfoObject.firstName}" filterMatchMode="contains" >
<h:outputText value="#{userInfoObject.firstName}, #{userInfoObject.middleName}"/>
</p:column>
<p:column sortBy="#{userInfoObject.email}" headerText="Email"
filterBy="#{userInfoObject.email}" filterMatchMode="contains" >
<h:outputText value="#{userInfoObject.email}"/>
</p:column>
<p:column sortBy="#{userInfoObject.globusUsername}" headerText="Globus username"
filterBy="#{userInfoObject.globusUsername}" filterMatchMode="contains">
<h:outputText value="#{userInfoObject.globusUsername}"/>
</p:column>
<p:column sortBy="#{userInfoObject.description}" headerText="Description"
filterBy="#{userInfoObject.description}" filterMatchMode="contains">
<h:outputText value="#{userInfoObject.description}"/>
</p:column>
<p:column headerText="Actions" >
<div class="actionLink">
<p:commandLink action="#{userInfoController.prepareView(userInfoObject)}" styleClass="ui-icon ui-icon-info" title="View">
<f:setPropertyActionListener value="#{userInfoObject}" target="#{userInfoController.current}"/>
</p:commandLink>
<p:commandLink action="#{userInfoController.prepareEdit(userInfoObject)}" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
<p:commandLink oncomplete="PF('userInfoDestroyDialogWidget').show()" rendered="#{loginController.admin}" styleClass="ui-icon ui-icon-trash" title="Delete" update="@form">
<f:setPropertyActionListener value="#{userInfoObject}" target="#{userInfoController.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="userInfoObject" value="#{userInfoController.selected}"/>
<p:panelGrid columns="2" styleClass="viewEntityDetails">
<h:outputLabel for="badge" value="Badge" styleClass="entityDataEmphasizedLabel"/>
<h:outputText id="badge" value="#{userInfoObject.badge}" title="Badge" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="username" value="Username" styleClass="entityDataEmphasizedLabel"/>
<h:outputText id="username" value="#{userInfoObject.username}" title="Username" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="lastName" value="Last Name" styleClass="entityDataLabel"/>
<h:outputText id="lastName" value="#{userInfoObject.lastName}" title="Last Name" styleClass="entityDataText"/>
<h:outputLabel for="firstName" value="First Name" styleClass="entityDataLabel"/>
<h:outputText id="firstName" value="#{userInfoObject.firstName}" title="First Name" styleClass="entityDataText"/>
<h:outputLabel for="middleName" value="Middle Name" styleClass="entityDataLabel"/>
<h:outputText id="middleName" value="#{userInfoObject.middleName}" title="Middle Name" styleClass="entityDataText"/>
<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="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"/>
</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">
<title>User View</title>
<h:outputScript library="js/common" name="forwardNotLoggedin.js" rendered="#{!loginController.loggedIn}"/>
<h:outputScript library="js/common" name="noBack.js" rendered="#{userInfoController.notSelected()}" />
<ui:composition template="../../templates/dmViewTemplate.xhtml">
<ui:define name="middleCenter">
<h:form id="viewUserInfoForm">
<div class="pageTitle">
<h1>User #{userInfoController.current.username}</h1>
</div>
<ui:param name="userInfoObject" value="#{userInfoController.current}"/>
<p:accordionPanel multiple="true" activeIndex="0,1" >
<p:tab title="User Properties">
<div class="middleCenterLeftContent">
<ui:include src="private/userInfoViewPanelGrid.xhtml"/>
</div>
</p:tab>
<p:tab title="User Experiments">
<ui:include src="private/userExperimentsListDataTable.xhtml"/>
</p:tab>
</p:accordionPanel>
<p/>
<div class="actionButton">
<p:commandButton action="#{userInfoController.prepareEdit(userInfoObject)}" rendered="#{loginController.admin}" value="Edit" alt="Edit" icon="ui-icon-pencil"/>
<p:commandButton onclick="PF('userInfoDestroyDialogWidget').show();" rendered="#{loginController.admin}" value="Delete" alt="Delete" icon="ui-icon-trash">
<f:setPropertyActionListener value="#{userInfoObject}" target="#{userInfoController.current}"/>
</p:commandButton>
<p:commandButton action="#{userInfoController.prepareList()}" value="Return" alt="Return" icon="ui-icon-arrowreturnthick-1-w"/>
</div>
<ui:include src="private/userInfoDestroyDialog.xhtml"/>
</h:form>
</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">
<title>User System Roles List</title>
<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>Administrators</h1>
</div>
<h:form id="adminListForm">
<div class="actionButton">
<p:commandButton id="systemRoleAddButton" value="Add" onclick="PF('systemRoleAddDialogWidget').show();" rendered="#{loginController.admin}" icon="ui-icon-plus" >
<p:tooltip for="systemRoleAddButton" value="Add new Administrators."/>
</p:commandButton>
<p:commandButton id="ResetFiltersButton" action="#{userSystemRoleController.resetSystemRoleUserList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight">
<p:tooltip for="ResetFiltersButton" value="Reset list filters."/>
</p:commandButton>
<p:commandButton id="#{entityTypeName}NoOp" style="visibility:hidden" value="NoOp"/>
<p:defaultCommand target="#{entityTypeName}NoOp"/>
</div>
<h:panelGroup>
<ui:include src="private/systemRoleListDataTable.xhtml"/>
</h:panelGroup>
<ui:include src="private/systemRoleRemoveDialog.xhtml" />
<ui:include src="private/systemRoleAddDialog.xhtml"/>
</h:form>
</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:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<p:dialog id="adminAddDialog"
header="Add Administrators" widgetVar="systemRoleAddDialogWidget" dynamic="true" styleClass="dialog" width="800">
<div class="actionButton">
<p:commandButton id="ResetFilters" actionListener="#{userSystemRoleController.noSystemRoleTable.resetFilterList()}" alt="Clear Filters" icon="ui-icon-refresh" styleClass="actionButtonRight" oncomplete="PF('systemRoleAddDialogWidget').show()" update="adminAddDialog" >
<p:tooltip for="ResetFilters" value="Reset list filters."/>
</p:commandButton>
<p:commandButton id="systemRoleNoOp" style="visibility:hidden" value="SNoOp"/>
</div>
<div>
<p:dataTable id="addSystemRoleList"
var="adminUser"
value="#{userSystemRoleController.noSystemRoleTable.listDataModel}"
filteredValue="#{userSystemRoleController.noSystemRoleTable.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="#{userSystemRoleController.rows}"
binding="#{userSystemRoleController.noSystemRoleTable.listDataTable}"
selection="#{userSystemRoleController.noSystemRoleTable.selectedObjectList}"
rowKey="#{adminUser.username}"
widgetVar="systemRoleAddTableWidgetVar"
emptyMessage="No users to add."
rowSelectMode="true"
selectionMode="multiple" >
<p:column sortBy="#{systemUserObject.badge}" headerText="ANL badge"
filterBy="#{systemUserObject.badge}" filterMatchMode="contains" >
<h:outputText value="#{systemUserObject.badge}"/>
</p:column>
<p:column sortBy="#{adminUser.username}" headerText="Username"
filterBy="#{adminUser.username}" filterMatchMode="contains" >
<h:outputText value="#{adminUser.username}"/>
</p:column>
<p:column sortBy="#{adminUser.lastName}" headerText="Last Name"
filterBy="#{adminUser.lastName}" filterMatchMode="contains" >
<h:outputText value="#{adminUser.lastName}"/>
</p:column>
<p:column sortBy="#{adminUser.firstName}" headerText="First Name"
filterBy="#{adminUser.firstName}" filterMatchMode="contains" >
<h:outputText value="#{adminUser.firstName}"/>
</p:column>
<p:column sortBy="#{adminUser.email}" headerText="Email"
filterBy="#{adminUser.email}" filterMatchMode="contains" >
<h:outputText value="#{adminUser.email}"/>
</p:column>
<f:facet name="footer">
<p:commandButton value="Add" action="#{userSystemRoleController.addSystemRole()}" oncomplete="PF('systemRoleAddDialogWidget').hide()" />
<p:commandButton value="Clear Selection" onclick="PF('systemRoleAddTableWidgetVar').unselectAllRows()" />
</f:facet>
</p:dataTable>
</div>
</p:dialog>
</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="systemRoleListDataTable"
var="systemUserObject"
value="#{userSystemRoleController.systemRoleTable.listDataModel}"
filteredValue="#{userSystemRoleController.systemRoleTable.filteredObjectList}"
paginator="true"
paginatorAlwaysVisible="false"
rows="#{userSystemRoleController.rows}"
binding="#{userSystemRoleController.systemRoleTable.listDataTable}"
widgetVar="systemRoleListWidget"
emptyMessage="No users found."
tableStyleClass="systemRoleTable">
<p:column sortBy="#{systemUserObject.id}" headerText="Id" >
<h:outputText value="#{systemUserObject.id}"/>
</p:column>
<p:column sortBy="#{systemUserObject.badge}" headerText="ANL badge"
filterBy="#{systemUserObject.badge}" filterMatchMode="contains" >
<h:outputText value="#{systemUserObject.badge}"/>
</p:column>
<p:column sortBy="#{systemUserObject.username}" headerText="Username"
filterBy="#{systemUserObject.username}" filterMatchMode="contains" >
<h:outputText value="#{systemUserObject.username}"/>
</p:column>
<p:column sortBy="#{systemUserObject.lastName}" headerText="Last Name"
filterBy="#{systemUserObject.lastName}" filterMatchMode="contains" >
<h:outputText value="#{systemUserObject.lastName}"/>
</p:column>
<p:column sortBy="#{systemUserObject.firstName}" headerText="First Name"
filterBy="#{systemUserObject.firstName}" filterMatchMode="contains" >
<h:outputText value="#{systemUserObject.firstName}"/>
</p:column>
<p:column sortBy="#{systemUserObject.email}" headerText="Email"
filterBy="#{systemUserObject.email}" filterMatchMode="contains" >
<h:outputText value="#{systemUserObject.email}"/>
</p:column>
<p:column headerText="Actions" >
<div class="actionLink" >
<p:commandLink oncomplete="PF('systemRoleRemoveDialogWidget').show()" rendered="#{loginController.admin and (loginController.username != systemUserObject.username)}" styleClass="ui-icon ui-icon-trash" title="Remove" update="@form" >
<f:setPropertyActionListener value="#{systemUserObject}" target="#{userSystemRoleController.systemRoleTable.currentObject}" />
</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:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<p:confirmDialog id="systemRoleRemoveDialog" message="Remove #{userSystemRoleController.getSystemRoleName()} Role for user #{userSystemRoleController.systemRoleTable.currentObject.username}?"
header="Remove System Role" severity="alert" widgetVar="systemRoleRemoveDialogWidget"
styleClass="dialog">
<p:commandButton value="Yes" oncomplete="systemRoleRemoveDialogWidget.hide()" action="#{userSystemRoleController.removeSystemRole()}"/>
<p:commandButton value="No" onclick="PF('systemRoleRemoveDialogWidget').hide()" type="button" />
</p:confirmDialog>
</ui:composition>
TOP = ../..
SUBDIRS = DmWebPortal
include $(TOP)/tools/make/RULES_DM
TOP=../../..
all install: dist
clean clean-all clean-install distclean: pyc-clean
.PHONY: pyc-clean
pyc-clean:
rm -f `find . -name '*.pyc'`
# For compiling from command line, we have to use generic build properties file
.PHONY: dist
dist:
__version__ = "Development Snapshot (2015.03.31)"
#!/usr/bin/env python
import json
from dm.common.exceptions.dmException import DmException
from dm.common.utility.loggingManager import LoggingManager
class DmApi(object):
""" Base dm api class. """
def __init__(self, username = None, password = None):
self.logger = LoggingManager.getInstance().getLogger(self.__class__.__name__)
@classmethod
def getLogger(cls):
logger = LoggingManager.getInstance().getLogger(cls.__name__)
return logger
@classmethod
def toDmObjectList(cls, dictList, dmObjectClass):
dmObjectList = []
for dict in dictList:
dmObjectList.append(dmObjectClass(dict))
return dmObjectList
# Exception decorator for all api calls
@classmethod
def execute(cls, func):
def decorate(*args, **kwargs):
try:
response = func(*args, **kwargs)
return response
except DmException, ex:
raise
except Exception, ex:
cls.getLogger().exception('%s' % ex)
raise DmException(exception=ex)
return decorate
#!/usr/bin/env python
import socket
import json
from dm.common.utility.loggingManager import LoggingManager
from dm.common.client.sessionManager import SessionManager
from dm.common.utility.configurationManager import ConfigurationManager
from dm.common.exceptions.authorizationError import AuthorizationError
from dm.common.api.dmApi import DmApi
class DmRestApi(DmApi):
""" Base dm REST api class. """
def __init__(self, username=None, password=None, host=None, port=None, protocol=None):
DmApi.__init__(self)
self.configurationManager = ConfigurationManager.getInstance()
if protocol == None:
protocol = self.configurationManager.getServiceProtocol()
self.username = username
self.password = password
self.host = host
self.port = port
self.protocol = protocol
self.sessionManager = None
@classmethod
def toJson(cls, o):
return json.dumps(o)
@classmethod
def fromJson(cls, s):
return json.loads(s)
def __getWebServiceUrl(self, url):
if url.find('://') < 0:
return '%s://%s:%s' % (self.protocol, socket.gethostbyname(self.host), self.port)
# Break the URL down into component pieces
from urlparse import urlparse
o = urlparse(url)
wsUrl = '%s://%s' % (o[0], o[1])
return wsUrl
def getContextRoot(self):
return self.configurationManager.getContextRoot()
def setUsername(self, username):
self.username = username
def getUsername(self):
return self.username
def setPassword(self, password):
self.password = password
def getPassword(self):
return self.password
def setHost(self, host):
self.host = host
def getHost(self):
return self.host
def setPort(self, port):
self.port = port
def getPort(self):
return self.port
def setProtocol(self, protocol):
self.protocol = protocol
def getProtocol(self):
return self.protocol
def getSessionManager(self):
if not self.sessionManager:
self.sessionManager = SessionManager()
return self.sessionManager
def getConfigManager(self):
return self.configurationManager
def sendSessionRequest(self, url, method, contentType='html', data={}):
""" Send authorized session request. """
sm = self.getSessionManager()
if not sm.hasSession():
#if self.username == None:
# raise AuthorizationError('Username not supplied.')
#if self.password == None:
# raise AuthorizationError('Password not supplied.')
wsUrl = self.__getWebServiceUrl(url)
# establishSession() sets the 'wsUrl' so the explicit call
# to setHost() is not required
sm.establishSession(wsUrl, self.username, self.password)
(response, responseData) = sm.sendSessionRequest(url, method, contentType, data)
return json.loads(responseData)
def sendRequest(self, url, method, contentType='html', data={}):
""" Send non-authorized request. """
sm = self.getSessionManager()
# Because there's no call to establishSession(), explicitly call
# setHost()
sm.setHost(self.__getWebServiceUrl(url))
(response, responseData) = self.getSessionManager().sendRequest(url, method, contentType, data)
return json.loads(responseData)
#######################################################################
# Testing.
if __name__ == '__main__':
api = DmRestApi('sveseli', 'sveseli')
#api.sendRequest('https://zagreb.svdev.net:10232/dm/directory/list', 'GET', data='')
import urllib
from dm.common.utility.configurationManager import ConfigurationManager
cm = ConfigurationManager.getInstance()
cm.setSessionCacheFile('/tmp/session')
#print 'Non-session request'
#print api.sendRequest('https://zagreb.svdev.net:10232/dm/directory/list?path=/tmp', 'GET')
print 'Session request'
data = { 'path' : '/tmp/xyz' }
#print api.sendSessionRequest('https://zagreb.svdev.net:10232/dm/file/write?path=/tmp/xyz&content=xyz', 'POST', contentType='application/x-www-form-urlencoded', data=urllib.urlencode(data))
#print api.sendSessionRequest('https://zagreb.svdev.net:10232/dm/file/write', 'POST', data=data)
postdata='path=/tmp/xyz'
postdata+='&content=%s' % urllib.quote_plus('Hey there')
print api.sendSessionRequest('https://zagreb.svdev.net:10232/dm/file/write', 'POST', contentType='application/x-www-form-urlencoded', data=postdata)
#!/usr/bin/env python
import sys
import os
import os.path
import stat
from optparse import OptionGroup
import dm
from dm.common.utility.loggingManager import LoggingManager
from dm.common.utility.configurationManager import ConfigurationManager
from dm.common.utility.osUtility import OsUtility
from dm.common.objects.dmObject import DmObject
from dm.common.exceptions.dmException import DmException
from dm.common.exceptions.invalidRequest import InvalidRequest
from dm.common.exceptions.invalidArgument import InvalidArgument
from dm.common.exceptions.internalError import InternalError
from dm.common.cli.dmOptionParser import DmOptionParser
from dm.common.constants import dmStatus
class DmCli(object):
""" Base dm command line interface class. """
DEFAULT_SESSION_CACHE_FILE = OsUtility.getUserHomeDir() + '/.dm/.session.cache'
def __init__(self, validArgCount=0):
self.logger = LoggingManager.getInstance().getLogger(self.__class__.__name__)
# Do not log into a file for CLIs
LoggingManager.getInstance().setFileLogLevel('CRITICAL')
LoggingManager.getInstance().setConsoleLogLevel('CRITICAL')
self.parser = DmOptionParser()
self.options = {}
self.args = []
self.validArgCount = validArgCount
self.serviceHost = None
self.servicePort = None
self.optionGroupDict = {}
commonGroup = 'Common Options'
self.addOptionGroup(commonGroup, None)
self.addOptionToGroup(commonGroup, '-h', '--help', action='help', help='Show this help message and exit.')
self.addOptionToGroup(commonGroup, '-?', '', action='help', help='Show this help message and exit.')
self.addOptionToGroup(commonGroup, '-v', '--version', action='store_true', dest='version', default=False, help='Print version and exit.')
self.addOptionToGroup(commonGroup, '-d', '--debug', dest='consoleLogLevel', help='Set debug level (valid values: CRITICAL, ERROR, WARNING, INFO, DEBUG). Console log level can also be set via DM_CONSOLE_LOG_LEVEL environment variable,')
self.addOptionToGroup(commonGroup, '', '--display-format', dest='displayFormat', default=DmObject.TEXT_DISPLAY_FORMAT, help='Display format for output objects. Possible options are: %s, %s, and %s (default: %s).' % (DmObject.TEXT_DISPLAY_FORMAT, DmObject.DICT_DISPLAY_FORMAT, DmObject.JSON_DISPLAY_FORMAT, DmObject.TEXT_DISPLAY_FORMAT))
self.addOptionToGroup(commonGroup, '', '--display-keys', dest='displayKeys', default=DmObject.DEFAULT_KEYS, help='List of output object keys to display. Possible options are: %s, %s, and string containing comma-separated keys (default: %s, represents class default keys).' % (DmObject.DEFAULT_KEYS, DmObject.ALL_KEYS, DmObject.DEFAULT_KEYS))
serviceGroup = 'Service Options'
self.addOptionGroup(serviceGroup, None)
# These will be set via env variables
self.addOptionToGroup(serviceGroup, '', '--service-host', dest='serviceHost', default=self.getDefaultServiceHost(), help='Service host (default: %s, can be set via DM_SERVICE_HOST environment variable).' % self.getDefaultServiceHost())
self.addOptionToGroup(serviceGroup, '', '--service-port', dest='servicePort', default=self.getDefaultServicePort(), help='Service port (default: %s, can be set via DM_SERVICE_PORT environment variable).' % self.getDefaultServicePort())
self.addOptionToGroup(serviceGroup, '', '--service-protocol', dest='serviceProtocol', default=self.getDefaultServiceProtocol(), help='Service protocol (default: %s, can be set via DM_SERVICE_PROTOCOL environment variable).' % self.getDefaultServiceProtocol())
# SSL options, disabled for now.
#self.addOptionToGroup(commonGroup, '', '--ssl-key', dest='sslKeyFile', help='SSL key file (needed if service requires peer verification, can be set via DM_SSL_KEY_FILE environment variable).')
#self.addOptionToGroup(commonGroup, '', '--ssl-cert', dest='sslCertFile', help='SSL certificate file (needed if service requires peer verification, can be set via DM_SSL_CERT_FILE environment variable).')
#self.addOptionToGroup(commonGroup, '', '--ssl-ca-cert', dest='sslCaCertFile', help='SSL CA certificate file (needed if client requires peer verification, can be set via DM_SSL_CA_CERT_FILE environment variable).')
def getDefaultServiceHost(self):
return ConfigurationManager.getInstance().getServiceHost()
def getDefaultServicePort(self):
return ConfigurationManager.getInstance().getServicePort()
def getDefaultServiceProtocol(self):
return ConfigurationManager.getInstance().getServiceProtocol()
def getUsername(self):
return None
def getPassword(self):
return None
def getDisplayFormat(self):
return self.options.displayFormat
def getDisplayKeys(self):
return self.options.displayKeys
def getLogger(self):
return self.logger
def getParser(self):
return self.parser
def addOption(self, *args, **kwargs):
self.parser.add_option(*args, **kwargs)
def addOptionToGroup(self, groupName, *args, **kwargs):
""" Add group option. Group must be created using addOptionGroup(). """
group = self.optionGroupDict.get(groupName)
group.add_option(*args, **kwargs)
def addOptionGroup(self, groupName, desc):
group = OptionGroup(self.parser, groupName, desc)
self.parser.add_option_group(group)
self.optionGroupDict[groupName] = group
def processArgs(self):
pass
def parseArgs(self, usage=None):
if usage:
self.parser.usage = usage
try:
(self.options, self.args) = self.parser.parse_args()
self.processArgs()
except SystemExit, rc:
sys.stdout.flush()
sys.stderr.flush()
sys.exit(int(str(rc)))
if self.validArgCount < len(self.args):
# Positional args are not enabled and we have some
msg = 'Invalid positional argument(s):'
for arg in self.args[self.validArgCount:]:
msg += ' ' + arg
msg += ' (This command allows %s positional arguments.)' % self.validArgCount
raise InvalidArgument(msg)
optDict = self.options.__dict__
if optDict.get('version'):
print 'DM Software Version: %s' % (dm.__version__)
sys.exit(0)
# Logging level. First try from command line, then from env variable.
consoleLogLevel = optDict.get('consoleLogLevel', None)
if consoleLogLevel:
LoggingManager.getInstance().setConsoleLogLevel(consoleLogLevel)
else:
consoleLogLevel = ConfigurationManager.getInstance().getConsoleLogLevelFromEnvVar()
if consoleLogLevel:
LoggingManager.getInstance().setConsoleLogLevel(consoleLogLevel)
# Service host, port, etc.
configManager = ConfigurationManager.getInstance()
self.serviceHost = self.options.serviceHost
configManager.setServiceHost(self.serviceHost)
self.servicePort = self.options.servicePort
configManager.setServicePort(self.servicePort)
self.serviceProtocol = self.options.serviceProtocol
configManager.setServiceProtocol(self.serviceProtocol)
# SSL options, comment out for now
#self.sslCaCertFile = self.options.sslCaCertFile
#if self.sslCaCertFile:
# configManager.setSslCaCertFile(self.sslCaCertFile)
#self.sslCertFile = self.options.sslCertFile
#if self.sslCertFile:
# configManager.setSslCertFile(self.sslCertFile)
#self.sslKeyFile = self.options.sslKeyFile
#if self.sslKeyFile:
# configManager.setSslKeyFile(self._sslKeyFile)
# Check session cache.
try:
self.checkSessionCache()
except Exception, ex:
self.logger.warn('Disabling session cache: %s' % ex)
configManager.setSessionCacheFile(None)
return (self.options, self.args)
def checkSessionCache(self):
configManager = ConfigurationManager.getInstance()
sessionCacheFile = configManager.getSessionCacheFile()
if sessionCacheFile is None:
sessionCacheFile = DmCli.DEFAULT_SESSION_CACHE_FILE
sessionCacheFile = sessionCacheFile.strip()
if len(sessionCacheFile):
sessionCacheDir = os.path.dirname(sessionCacheFile)
OsUtility.createDir(sessionCacheDir, stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR)
configManager.setSessionCacheFile(sessionCacheFile)
configManager.setRequireSessionCredentials(True)
def usage(self, s=None):
""" Print help provided by optparse. """
if s:
print >>sys.stderr, 'Error: ', s, '\n'
self.parser.print_help()
sys.exit(dmStatus.DM_ERROR)
def getOptions(self):
return self.options
def getNArgs(self):
""" Returns the number of command line arguments. """
return len(self.args)
def getArgs(self):
""" Returns the command line argument list. """
return self.args
def getArg(self, i):
""" Returns the i-th command line argument. """
return self.args[i]
def getServiceHost(self):
#return self.serviceHost
return ConfigurationManager.getInstance().getServiceHost()
def getServicePort(self):
#return self.servicePort
return ConfigurationManager.getInstance().getServicePort()
def getServiceProtocol(self):
#return self.serviceProtocol
return ConfigurationManager.getInstance().getServiceProtocol()
def getSslCaCertFile(self):
return self.sslCaCertFile
def getSslCertFile(self):
return self.sslCertFile
def getSslKeyFile(self):
return self.sslKeyFile
def displayDmObject(self, dmObject):
if isinstance(dmObject, dmObject):
return '%s' % dmObject.getJsonRep()
else:
return '%s' % dmObject
def runCommand(self):
""" This method must be implemented by the derived class. """
raise InternalError('Method runCommand() must be overriden in the derived class.')
def run(self):
""" This method invokes runCommand() and handles any exceptions. """
try:
self.runCommand()
except DmException, ex:
self.logger.exception('%s' % ex)
print '%s' % ex.getErrorMessage()
raise SystemExit(ex.getErrorCode())
except SystemExit, ex:
raise
except Exception, ex:
self.logger.exception('%s' % ex)
print >>sys.stderr, '%s' % ex
raise SystemExit(dmStatus.DM_ERROR)
def getId(self):
id = self.options.id
if id == None:
raise InvalidRequest('Missing id.')
return id
def displayDmObject(self, dmObject):
optDict = self._options.__dict__
if isinstance(dmObject, DmObject):
if optDict.get('dict'):
return '%s' % dmObject
else:
return dmObject.display()
else:
return '%s' % dmObject
#######################################################################
# Testing
if __name__ == '__main__':
cli = DmCli(3)
cli.addOption("-f", "--file", dest="filename", help="write report to FILE", metavar="FILE")
cli.addOption("-q", "--quiet", action="store_false", dest="verbose", default=True, help="don't print log messages to stdout")
(options, args) = cli.parseArgs()
print 'After parse:'
print 'OPTIONS: ', options
print 'ARGS: ', args
print 'From CLI'
print 'OPTIONS: ', cli.getOptions()
print 'ARGS: ', cli.getArgs()
print
print 'FILENAME'
print 'options.filename', options.filename
print 'cli.getOptions().filename', cli.getOptions().filename
o = cli.getOptions()
print 'o.filename', o.filename
print 'cli.getArgs()', cli.getArgs()
print 'len(cli.getArgs())', len(cli.getArgs())
for a in cli.getArgs():
print 'arg', a
first_arg = cli.getArg(0)
print 'first_arg', first_arg
second_arg = cli.getArg(1)
print 'second_arg', second_arg
try:
third_arg = cli.getArg(2)
print 'third_arg', third_arg
except:
print 'no third arg'