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 437 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"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<c:set var="userInfoObject" value="#{userInfoController.selected}"/>
<p:panelGrid columns="3" styleClass="createEntityDetails">
<h:outputLabel for="username" value="Username" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="username" value="#{userInfoObject.username}" title="Username" required="true" styleClass="entityDataEmphasizedText"/>
<p:message for="username"/>
<h:outputLabel for="lastName" value="Last Name" styleClass="entityDataLabel"/>
<h:inputText id="lastName" value="#{userInfoObject.lastName}" title="Last Name" required="true" styleClass="entityDataText"/>
<p:message for="lastName"/>
<h:outputLabel for="firstName" value="First Name" styleClass="entityDataLabel"/>
<h:inputText id="firstName" value="#{userInfoObject.firstName}" title="First Name" required="true" styleClass="entityDataText"/>
<p:message for="firstName"/>
<h:outputLabel for="middleName" value="Middle Name" styleClass="entityDataLabel"/>
<h:inputText id="middleName" value="#{userInfoObject.middleName}" title="Middle Name" styleClass="entityDataText"/>
<p:message for="middleName"/>
<h:outputLabel for="email" value="Email" styleClass="entityDataLabel"/>
<h:inputText id="email" value="#{userInfoObject.email}" title="Email" styleClass="entityDataText"/>
<p:message for="email"/>
<h:outputLabel for="password" value="Password" styleClass="entityDataLabel"/>
<p:password id="password" value="#{userInfoObject.password}" title="Password" feedback="true" styleClass="entityDataText"/>
<p:message for="password"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{userInfoObject.description}" title="Description" styleClass="entityDataText"/>
<p:message for="description"/>
</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="Destroy user #{userInfoController.getCurrentEntityInstanceName()}?"
header="Destroy User" severity="alert" widgetVar="userInfoDestroyDialogWidget"
styleClass="dialog">
<p:commandButton value="Yes" oncomplete="userInfoDestroyDialogWidget.hide()" action="#{userInfoController.destroy()}"/>
<p:commandButton value="No" onclick="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"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<c:set var="userInfoObject" value="#{userInfoController.selected}"/>
<c:set var="isFieldWriteable" value="#{loginController.loggedIn}"/>
<p:panelGrid columns="3" styleClass="editEntityDetails">
<h:outputLabel for="username" value="Username" styleClass="entityDataEmphasizedLabel"/>
<h:inputText id="username" value="#{userInfoObject.username}" rendered="#{isFieldWriteable}" title="Username" required="true" styleClass="entityDataEmphasizedText"/>
<h:outputText id="usernameOutput" value="#{userInfoObject.username}" rendered="#{!isFieldWriteable}" title="Username" styleClass="entityDataEmphasizedText"/>
<p:message for="username"/>
<h:outputLabel for="id" value="Id" styleClass="entityDataLabel"/>
<h:outputText id="id" value="#{userInfoObject.id}" title="Id" styleClass="entityDataText"/>
<p:message for="id"/>
<h:outputLabel for="lastName" value="Last Name" styleClass="entityDataLabel"/>
<h:inputText id="lastName" value="#{userInfoObject.lastName}" rendered="#{isFieldWriteable}" title="Last Name" required="true" styleClass="entityDataText"/>
<h:outputText id="lastNameOutput" value="#{userInfoObject.lastName}" rendered="#{!isFieldWriteable}" title="Last Name" styleClass="entityDataText"/>
<p:message for="lastName"/>
<h:outputLabel for="firstName" value="First Name" styleClass="entityDataLabel"/>
<h:inputText id="firstName" value="#{userInfoObject.firstName}" rendered="#{isFieldWriteable}" title="First Name" required="true" styleClass="entityDataText"/>
<h:outputText id="firstNameOutput" value="#{userInfoObject.firstName}" rendered="#{!isFieldWriteable}" title="First Name" styleClass="entityDataText"/>
<p:message for="firstName"/>
<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"/>
<p:message for="middleName"/>
<h:outputLabel for="email" value="Email" styleClass="entityDataLabel"/>
<h:inputText id="email" value="#{userInfoObject.email}" title="Email" styleClass="entityDataText"/>
<p:message for="email"/>
<h:outputLabel for="password" value="Password" styleClass="entityDataLabel"/>
<p:password id="password" value="#{userInfoController.passwordEntry}" title="Password" feedback="true" styleClass="entityDataText"/>
<p:message for="password"/>
<h:outputLabel for="description" value="Description" styleClass="entityDataLabel"/>
<h:inputText id="description" value="#{userInfoObject.description}" title="Description" styleClass="entityDataText"/>
<p:message for="description"/>
</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="25"
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.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 Name"
filterBy="#{userInfoObject.firstName}" filterMatchMode="contains">
<h:outputText value="#{userInfoObject.firstName}"/>
</p:column>
<p:column sortBy="#{userInfoObject.middleName}" rendered="false" headerText="Middle Name"
filterBy="#{userInfoObject.middleName}" filterMatchMode="contains">
<h:outputText value="#{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.description}" headerText="Description"
filterBy="#{userInfoObject.description}" filterMatchMode="contains">
<h:outputText value="#{userInfoObject.description}"/>
</p:column>
<c:set var="isEntityWriteable" value="#{loginController.isUserWriteable(userInfoObject)}"/>
<p:column headerText="Actions">
<div class="actionLink">
<p:commandLink action="#{userInfoController.prepareView(userInfoObject)}" styleClass="ui-icon ui-icon-info" title="View"/>
<p:commandLink action="#{userInfoController.prepareEdit(userInfoObject)}" rendered="#{isEntityWriteable}" styleClass="ui-icon ui-icon-pencil" title="Edit"/>
<p:commandLink oncomplete="userInfoDestroyDialogWidget.show()" rendered="#{loginController.loggedIn}" 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"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<c:set var="userInfoObject" value="#{userInfoController.selected}"/>
<p:panelGrid columns="2" styleClass="viewEntityDetails">
<h:outputLabel for="username" value="Username" styleClass="entityDataEmphasizedLabel"/>
<h:outputText id="username" value="#{userInfoObject.username}" title="Username" styleClass="entityDataEmphasizedText"/>
<h:outputLabel for="id" value="Id" styleClass="entityDataLabel"/>
<h:outputText id="id" value="#{userInfoObject.id}" title="Id" styleClass="entityDataText"/>
<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="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"
template="../../templates/contentViewTemplate4x3.xhtml">
<ui:define name="middleCenter">
<h:form id="viewUserInfoForm">
<div class="middleCenterLeftContent">
<div class="pageTitle">
<h1>User Details</h1>
</div>
<ui:include src="userInfoViewPanelGrid.xhtml"/>
<p/>
<c:set var="userInfoObject" value="#{userInfoController.selected}"/>
<c:set var="isEntityWriteable" value="#{loginController.isUserWriteable(userInfoObject)}"/>
<div class="actionButton">
<p:commandButton action="#{userInfoController.prepareEdit(userInfoObject)}" rendered="#{isEntityWriteable}" value="Edit" alt="Edit" icon="ui-icon-pencil"/>
<p:commandButton onclick="PF('userInfoDestroyDialogWidget').show();" rendered="#{loginController.loggedIn}" value="Delete" alt="Delete" icon="ui-icon-trash">
<f:setPropertyActionListener value="#{userInfoObject}" target="#{userInfoController.current}"/>
</p:commandButton>
<p:commandButton action="#{userInfoController.prepareList()}" value="Done" alt="Done" icon="ui-icon-arrowreturnthick-1-w"/>
</div>
<ui:include src="userInfoDestroyDialog.xhtml"/>
</div>
</h:form>
</ui:define>
</ui:composition>
TOP = ../..
SUBDIRS = DmWebPortal
include $(TOP)/tools/make/RULES_DM
#!/usr/bin/env python
#######################################################################
DM_SESSION_ROLE_HTTP_HEADER = 'Dm-Session-Role'
DM_STATUS_CODE_HTTP_HEADER = 'Dm-Status-Code'
DM_STATUS_MESSAGE_HTTP_HEADER = 'Dm-Status-Message'
DM_EXCEPTION_TYPE_HTTP_HEADER = 'Dm-Exception-Type'
#!/usr/bin/env python
#######################################################################
DM_ADMIN_ROLE = 'admin'
DM_USER_ROLE = 'user'
#!/usr/bin/env python
#######################################################################
DM_SERVICE_PROTOCOL_HTTP = 'http'
DM_SERVICE_PROTOCOL_HTTPS = 'https'
#!/usr/bin/env python
#######################################################################
DM_OK = 0
DM_ERROR = 1
DM_CONFIGURATION_ERROR = 2
DM_INTERNAL_ERROR = 3
DM_INVALID_ARGUMENT_ERROR = 4
DM_INVALID_REQUEST_ERROR = 5
DM_COMMAND_FAILED_ERROR = 6
#!/usr/bin/env python
#
# Command failed exception class.
#
#######################################################################
from dm.common.constants import dmStatus
from dm.common.exceptions.dmException import DmException
#######################################################################
class CommandFailed(DmException):
def __init__ (self, error='', **kwargs):
DmException.__init__(self, error, dmStatus.DM_COMMAND_FAILED_ERROR, **kwargs)
#!/usr/bin/env python
#
# Configuration error class.
#
#######################################################################
from dm.common.constants import dmStatus
from dm.common.exceptions.dmException import DmException
#######################################################################
class ConfigurationError(DmException):
def __init__ (self, error='', **kwargs):
DmException.__init__(self, error, dmStatus.DM_CONFIGURATION_ERROR, **kwargs)
#!/usr/bin/env python
#
# Base DM exception class.
#
#######################################################################
import exceptions
import json
from dm.common.constants import dmStatus
#######################################################################
class DmException(exceptions.Exception):
"""
Base DM exception class.
Usage:
DmException(errorMessage, errorCode)
DmException(args=errorMessage)
DmException(exception=exceptionObject)
"""
def __init__(self, error='', code=dmStatus.DM_ERROR, **kwargs):
args = error
if args == '':
args = kwargs.get('args', '')
ex = kwargs.get('exception', None)
if ex != None:
if isinstance(ex, exceptions.Exception):
exArgs = '%s' % (ex)
if args == '':
args = exArgs
else:
args = "%s (%s)" % (args, exArgs)
exceptions.Exception.__init__(self, args)
self._code = code
def getArgs(self):
return self.args
def getErrorCode(self):
return self._code
def getErrorMessage(self):
return '%s' % (self.args)
def getClassName(self):
return '%s' % (self.__class__.__name__)
def getExceptionType(self):
return '%s' % (self.__class__.__name__).split('.')[-1]
def getJsonRep(self):
return json.dumps({
'errorMessage' : self.getErrorMessage(),
'errorCode' : self.getErrorCode(),
'exceptionType' : self.getExceptionType(),
})
#!/usr/bin/env python
#
# DM exception map
#
#######################################################################
from dm.common.constants import dmStatus
exceptionMap = {
dmStatus.DM_ERROR : 'dmException.DmException',
dmStatus.DM_CONFIGURATION_ERROR : 'configurationError.ConfigurationError',
dmStatus.DM_INTERNAL_ERROR : 'internalError.InternalError',
dmStatus.DM_INVALID_ARGUMENT_ERROR : 'invalidArgument.InvalidArgument',
dmStatus.DM_INVALID_REQUEST_ERROR : 'invalidRequest.InvalidRequest',
dmStatus.DM_COMMAND_FAILED_ERROR : 'commandFailed.CommandFailed',
}
#######################################################################
# Testing
if __name__ == '__main__':
for item in exceptionMap.items():
print item
#!/usr/bin/env python
#
# Internal error class.
#
#######################################################################
from dm.common.constants import dmStatus
from dm.common.exceptions.dmException import DmException
#######################################################################
class InternalError(DmException):
def __init__ (self, error='', **kwargs):
DmException.__init__(self, error, dmStatus.DM_INTERNAL_ERROR, **kwargs)