diff --git a/src/java/DmWebPortal/web/WEB-INF/web.xml b/src/java/DmWebPortal/web/WEB-INF/web.xml index c5e7c7381b8565920988ba7607cf0d319cb2eb37..5d426f413e5c4ffb74dc6d098bf6187401a24fbd 100644 --- a/src/java/DmWebPortal/web/WEB-INF/web.xml +++ b/src/java/DmWebPortal/web/WEB-INF/web.xml @@ -11,7 +11,7 @@ </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> - <url-pattern>/faces/*</url-pattern> + <url-pattern>*.xhtml</url-pattern> </servlet-mapping> <session-config> <session-timeout> @@ -19,6 +19,6 @@ </session-timeout> </session-config> <welcome-file-list> - <welcome-file>faces/index.xhtml</welcome-file> + <welcome-file>index.xhtml</welcome-file> </welcome-file-list> </web-app> diff --git a/src/java/DmWebPortal/web/index.xhtml b/src/java/DmWebPortal/web/index.xhtml index ae4c3713ee9f411313b1650e1c8439eabc0377d0..4f1c258efa1140856622f91d2e869d0a23a4aea0 100644 --- a/src/java/DmWebPortal/web/index.xhtml +++ b/src/java/DmWebPortal/web/index.xhtml @@ -2,12 +2,8 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"> - <h:head> - <title>Facelet Title</title> - <h:outputStylesheet name="css/jsfcrud.css"/> - </h:head> <h:body> - Hello from Facelets + <meta http-equiv="Refresh" content="0; URL=views/home.xhtml"/> </h:body> </html> diff --git a/src/java/DmWebPortal/web/resources/css/portal.css b/src/java/DmWebPortal/web/resources/css/portal.css index 3b1ac1361852be76840c017705963ae78b491dd8..e26007c802a62e80f7154106398d0ebc1c307524 100644 --- a/src/java/DmWebPortal/web/resources/css/portal.css +++ b/src/java/DmWebPortal/web/resources/css/portal.css @@ -1,5 +1,5 @@ body { - background-color: #f2f4f7; + background-color: #b2d5d6; font-size: 12px; font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; color: #000000; diff --git a/src/java/DmWebPortal/web/templates/contentViewTemplate4x3.xhtml b/src/java/DmWebPortal/web/templates/contentViewTemplate4x3.xhtml index 4519d47c05a44a0d1b9a1d215fb3df06b77211cf..08393f72b5101bfbcea7595448961a53248208be 100644 --- a/src/java/DmWebPortal/web/templates/contentViewTemplate4x3.xhtml +++ b/src/java/DmWebPortal/web/templates/contentViewTemplate4x3.xhtml @@ -17,7 +17,7 @@ <div id="top" class="topContent"> <div id="topLeft" class="topLeftContent"> <ui:insert name="topLeft"> - <h:graphicImage alt="ANL Logo" url="../../resources/images/AnlLogo167x75.png"/> + <h:graphicImage alt="ANL Logo" url="/resources/images/AnlLogo167x75.png"/> </ui:insert> </div> <div> @@ -54,9 +54,9 @@ <ui:insert name="menuCenter"> <h:form prependId="false"> <p:menubar> - <p:menuitem value="Home" url="/faces/views/home.xhtml" icon="ui-icon-home"/> - <p:menuitem value="Experiment Types" url="/faces/views/experimentType/list.xhtml"/> - <p:menuitem value="Users" url="/faces/views/userInfo/list.xhtml"/> + <p:menuitem value="Home" url="/views/home.xhtml" icon="ui-icon-home"/> + <p:menuitem value="Experiment Types" url="/views/experimentType/list.xhtml"/> + <p:menuitem value="Users" url="/views/userInfo/list.xhtml"/> <p:menuitem value="Login" onclick="loginDialog.show()" rendered="#{!loginController.loggedIn}" icon="ui-icon-person"/> <p:menuitem value="Logout" action="#{loginController.logout()}" rendered="#{loginController.loggedIn}" icon="ui-icon-close"/> </p:menubar> </h:form> @@ -113,4 +113,4 @@ </h:form> </h:body> -</html> +</html> \ No newline at end of file diff --git a/src/java/DmWebPortal/web/templates/homeViewTemplate.xhtml b/src/java/DmWebPortal/web/templates/homeViewTemplate.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..334daabd2a081729180d78a44bc25451dbb45128 --- /dev/null +++ b/src/java/DmWebPortal/web/templates/homeViewTemplate.xhtml @@ -0,0 +1,117 @@ +<?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"> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:ui="http://java.sun.com/jsf/facelets" + xmlns:p="http://primefaces.org/ui" + xmlns:h="http://java.sun.com/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core"> + + <h:head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <link href="../resources/css/portal.css" rel="stylesheet" type="text/css" /> +<!-- <link href="../../resources/css/portal.css" rel="stylesheet" type="text/css" />--> + <title>Data Management System Portal</title> + </h:head> + + <h:body> + + <div id="top" class="topContent"> + <div id="topLeft" class="topLeftContent"> + <ui:insert name="topLeft"> + <h:graphicImage alt="ANL Logo" url="/resources/images/AnlLogo167x75.png"/> + </ui:insert> + </div> + <div> + <div id="topRight" class="topRightContent"> + <ui:insert name="topRight"> + <h:outputText value="Username: #{loginController.displayUsername()}"/> + <br/> + + <h:outputText value="Role: #{loginController.displayRole()}"/> + + </ui:insert> + </div> + <div id="topCenter" class="topCenterContent"> + <ui:insert name="topCenter"> + <h1>Data Management System Portal</h1> + </ui:insert> + </div> + </div> + </div> + + <ui:fragment> + <div id="menu" class="menuContent"> + <div id="menuLeft" class="menuLeftContent"> + <ui:insert name="menuLeft"> + <p:menubar/> + </ui:insert> + </div> + <div> + <div id="menuRight" class="menuRightContent"> + <ui:insert name="menuRight"> + </ui:insert> + </div> + <div id="menuCenter" class="menuCenterContent"> + <ui:insert name="menuCenter"> + <h:form prependId="false"> + <p:menubar> + <p:menuitem value="Home" url="/views/home.xhtml" icon="ui-icon-home"/> + <p:menuitem value="Experiment Types" url="/views/experimentType/list.xhtml"/> + <p:menuitem value="Users" url="/views/userInfo/list.xhtml"/> + <p:menuitem value="Login" onclick="loginDialog.show()" rendered="#{!loginController.loggedIn}" icon="ui-icon-person"/> + <p:menuitem value="Logout" action="#{loginController.logout()}" rendered="#{loginController.loggedIn}" icon="ui-icon-close"/> </p:menubar> + </h:form> + </ui:insert> + </div> + </div> + </div> + + <div id="middle" class="middleContent"> + <div id="middleLeft" class="middleLeftContent"> + <ui:insert name="middleLeft"> + </ui:insert> + </div> + <div> + <div id="middleRight" class="middleRightContent"> + <ui:insert name="middleRight"> + </ui:insert> + </div> + <div id="middleCenter" class="middleCenterContent"> + <ui:insert name="middleCenter"> + </ui:insert> + </div> + </div> + </div> + </ui:fragment> + + <ui:fragment> + <div id="bottom" class="bottomContent"> + <ui:insert name="bottom"> + <h:form prependId="false"> + <p:growl id="messages" showDetail="true" autoUpdate="true"/> + </h:form> + </ui:insert> + </div> + </ui:fragment> + + <h:form id="loginForm"> + <p:dialog id="loginDialog" styleClass="dialog" header="Login" widgetVar="loginDialog"> + <h:panelGrid styleClass="loginInput"> + <div class="dialog"> + <div> + <p:inputText id="username" value="#{loginController.username}" title="Username"/> + <p:watermark for="username" value="Username"/> + <p:password id="password" value="#{loginController.password}" title="Password"/> + <p:watermark for="password" value="Password"/> + </div> + + <f:facet name="footer"> + <p:commandButton id="loginButton" value="Login" action="#{loginController.login}" oncomplete="loginDialog.hide()"/> + </f:facet> + </div> + </h:panelGrid> + </p:dialog> + </h:form> + </h:body> + +</html> \ No newline at end of file diff --git a/src/java/DmWebPortal/web/views/home.xhtml b/src/java/DmWebPortal/web/views/home.xhtml index 320a192381592e22c97e640d21370cc3f28cc7b8..dc831f7e9854fbb5373643311278579b70223caa 100644 --- a/src/java/DmWebPortal/web/views/home.xhtml +++ b/src/java/DmWebPortal/web/views/home.xhtml @@ -6,7 +6,7 @@ xmlns:p="http://primefaces.org/ui" xmlns:f="http://xmlns.jcp.org/jsf/core"> - <ui:composition template="../templates/contentViewTemplate4x3.xhtml"> + <ui:composition template="../templates/homeViewTemplate.xhtml"> <ui:define name="middleCenter"> <div class="homePage">