diff options
Diffstat (limited to 'WebContent')
| -rw-r--r-- | WebContent/META-INF/MANIFEST.MF | 3 | ||||
| -rw-r--r-- | WebContent/WEB-INF/faces-config.xml | 211 | ||||
| -rw-r--r-- | WebContent/WEB-INF/web.xml | 47 | ||||
| -rw-r--r-- | WebContent/index.jsp | 10 | ||||
| -rw-r--r-- | WebContent/pages/categories.xhtml | 54 | ||||
| -rw-r--r-- | WebContent/pages/category.xhtml | 23 | ||||
| -rw-r--r-- | WebContent/pages/contact.xhtml | 23 | ||||
| -rw-r--r-- | WebContent/pages/greeting.xhtml | 22 | ||||
| -rw-r--r-- | WebContent/pages/home.xhtml | 28 | ||||
| -rw-r--r-- | WebContent/pages/login.xhtml | 41 | ||||
| -rw-r--r-- | WebContent/pages/product.xhtml | 44 | ||||
| -rw-r--r-- | WebContent/pages/products.xhtml | 62 | ||||
| -rw-r--r-- | WebContent/stylesheets/form.css | 16 | ||||
| -rw-r--r-- | WebContent/stylesheets/navigation.css | 25 | ||||
| -rw-r--r-- | WebContent/stylesheets/twocolumn.css | 53 | ||||
| -rw-r--r-- | WebContent/templates/common.xhtml | 60 | ||||
| -rw-r--r-- | WebContent/templates/loggedin.xhtml | 60 |
17 files changed, 782 insertions, 0 deletions
diff --git a/WebContent/META-INF/MANIFEST.MF b/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/WebContent/WEB-INF/faces-config.xml b/WebContent/WEB-INF/faces-config.xml new file mode 100644 index 0000000..06265ca --- /dev/null +++ b/WebContent/WEB-INF/faces-config.xml @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE faces-config PUBLIC + "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" + "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> + +<faces-config> + +<managed-bean> + <managed-bean-name>UserManager</managed-bean-name> + <managed-bean-class>beans.UserManager</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> +</managed-bean> + +<managed-bean> + <managed-bean-name>CategoryManager</managed-bean-name> + <managed-bean-class>beans.CategoryManager</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> +</managed-bean> + +<managed-bean> + <managed-bean-name>ContactManager</managed-bean-name> + <managed-bean-class>beans.ContactManager</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> +</managed-bean> + +<managed-bean> + <managed-bean-name>ProductManager</managed-bean-name> + <managed-bean-class>beans.ProductManager</managed-bean-class> + <managed-bean-scope>session</managed-bean-scope> +</managed-bean> + +<navigation-rule> + + <from-view-id>/pages/home.xhtml</from-view-id> + + <navigation-case> + <from-outcome>contact</from-outcome> + <to-view-id>/pages/contact.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>login</from-outcome> + <to-view-id>/pages/login.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>categories</from-outcome> + <to-view-id>/pages/categories.xhtml</to-view-id> + </navigation-case> + +</navigation-rule> + +<navigation-rule> + + <from-view-id>/pages/login.xhtml</from-view-id> + + <navigation-case> + <from-outcome>contact</from-outcome> + <to-view-id>/pages/contact.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>login</from-outcome> + <to-view-id>/pages/login.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>categories</from-outcome> + <to-view-id>/pages/categories.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>failure</from-outcome> + <to-view-id>/pages/login.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>success</from-outcome> + <to-view-id>/pages/greeting.xhtml</to-view-id> + </navigation-case> + +</navigation-rule> + + +<navigation-rule> + + <from-view-id>/pages/categories.xhtml</from-view-id> + + <navigation-case> + <from-outcome>contact</from-outcome> + <to-view-id>/pages/contact.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>login</from-outcome> + <to-view-id>/pages/login.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>categories</from-outcome> + <to-view-id>/pages/categories.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>select</from-outcome> + <to-view-id>/pages/products.xhtml</to-view-id> + </navigation-case> + +</navigation-rule> + +<navigation-rule> + + <from-view-id>/pages/greeting.xhtml</from-view-id> + + <navigation-case> + <from-outcome>contact</from-outcome> + <to-view-id>/pages/contact.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>categories</from-outcome> + <to-view-id>/pages/categories.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>home</from-outcome> + <to-view-id>/pages/home.xhtml</to-view-id> + </navigation-case> + +</navigation-rule> + +<navigation-rule> + + <from-view-id>/pages/contact.xhtml</from-view-id> + + <navigation-case> + <from-outcome>contact</from-outcome> + <to-view-id>/pages/contact.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>categories</from-outcome> + <to-view-id>/pages/categories.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>login</from-outcome> + <to-view-id>/pages/login.xhtml</to-view-id> + </navigation-case> + +</navigation-rule> + +<navigation-rule> + + <from-view-id>/pages/products.xhtml</from-view-id> + + <navigation-case> + <from-outcome>contact</from-outcome> + <to-view-id>/pages/contact.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>categories</from-outcome> + <to-view-id>/pages/categories.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>login</from-outcome> + <to-view-id>/pages/login.xhtml</to-view-id> + </navigation-case> + +</navigation-rule> + +<navigation-rule> + + <from-view-id>/pages/product.xhtml</from-view-id> + + <navigation-case> + <from-outcome>products</from-outcome> + <to-view-id>/pages/products.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>contact</from-outcome> + <to-view-id>/pages/contact.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>categories</from-outcome> + <to-view-id>/pages/categories.xhtml</to-view-id> + </navigation-case> + + <navigation-case> + <from-outcome>login</from-outcome> + <to-view-id>/pages/login.xhtml</to-view-id> + </navigation-case> + +</navigation-rule> + +<application> + + <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> + + <locale-config> + <default-locale>de_DE</default-locale> + </locale-config> </application> + +<factory/> +<lifecycle/> + +</faces-config>
\ No newline at end of file diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..ee62240 --- /dev/null +++ b/WebContent/WEB-INF/web.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + <description>Facelets JCatalog Application</description> + <context-param> + <param-name>javax.faces.DEFAULT_SUFFIX</param-name> + <param-value>.xhtml</param-value> + </context-param> + <context-param> + <param-name>facelets.REFRESH_PERIOD</param-name> + <param-value>2</param-value> + </context-param> + <context-param> + <param-name>facelets.DEVELOPMENT</param-name> + <param-value>true</param-value> + </context-param> + <context-param> + <param-name>javax.faces.STATE_SAVING_METHOD</param-name> + <param-value>client</param-value> + </context-param> + <context-param> + <param-name>com.sun.faces.validateXml</param-name> + <param-value>true</param-value> + </context-param> + <context-param> + <param-name>com.sun.faces.verifyObjects</param-name> + <param-value>true</param-value> + </context-param> + <servlet> + <servlet-name>Faces Servlet</servlet-name> + <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>Faces Servlet</servlet-name> + <url-pattern>*.jsf</url-pattern> + </servlet-mapping> + <display-name> + JCatalog</display-name> + <welcome-file-list> + <welcome-file>index.html</welcome-file> + <welcome-file>index.htm</welcome-file> + <welcome-file>index.jsp</welcome-file> + <welcome-file>default.html</welcome-file> + <welcome-file>default.htm</welcome-file> + <welcome-file>default.jsp</welcome-file> + </welcome-file-list> +</web-app> diff --git a/WebContent/index.jsp b/WebContent/index.jsp new file mode 100644 index 0000000..fa6ee7d --- /dev/null +++ b/WebContent/index.jsp @@ -0,0 +1,10 @@ +<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> +<html> +<head></head> + <body> + <% response.sendRedirect("pages/home.jsf"); %> + <!-- + <jsp:forward page="pages/home.jsf" /> + --> + </body> +</html>
\ No newline at end of file diff --git a/WebContent/pages/categories.xhtml b/WebContent/pages/categories.xhtml new file mode 100644 index 0000000..4a7532e --- /dev/null +++ b/WebContent/pages/categories.xhtml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:c="http://java.sun.com/jstl/core"> + + <ui:composition template="/templates/common.xhtml"> + + <ui:define name="pageTitle">JCatalog Application</ui:define> + + <ui:define name="pageHeader">JCatalog Categories</ui:define> + + <ui:define name="body"> + <h:form id="categories"> + <h:dataTable style="border: 1px;" id="categoriestable" value="#{CategoryManager.categories}" + var="category"> + <h:column> + <f:facet name="header"> + <h:outputText value="Id" /> + </f:facet> + <h:outputText value="#{category.id}" /> + </h:column> + <h:column> + <f:facet name="header"> + <h:outputText value="Name" /> + </f:facet> + <h:outputText value="#{category.name}" /> + </h:column> + <h:column> + <f:facet name="header"> + <h:outputText value="Description" /> + </f:facet> + <h:outputText value="#{category.description}" /> + </h:column> + <h:column> + <f:facet name="header"> + <h:outputText value="" /> + </f:facet> + <h:commandLink value="View Details ..." immediate="true" + actionListener="#{CategoryManager.select}" action="select"> + <f:param name="selectedId" value="#{category.id}" /> + </h:commandLink> + </h:column> + </h:dataTable> + </h:form> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + + </ui:composition> + +</html> diff --git a/WebContent/pages/category.xhtml b/WebContent/pages/category.xhtml new file mode 100644 index 0000000..b5313a3 --- /dev/null +++ b/WebContent/pages/category.xhtml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:c="http://java.sun.com/jstl/core"> + + <ui:composition template="/templates/common.xhtml"> + + <ui:define name="pageTitle">JCatalog Application</ui:define> + + <ui:define name="pageHeader">JCatalog Application</ui:define> + + <ui:define name="body"> + <h2>Welcome to the JCatalog Demo Application <h:outputText id="category" value="#{CategoryManager.current.name}" /></h2> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + + </ui:composition> + +</html> diff --git a/WebContent/pages/contact.xhtml b/WebContent/pages/contact.xhtml new file mode 100644 index 0000000..b51f1dd --- /dev/null +++ b/WebContent/pages/contact.xhtml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:c="http://java.sun.com/jstl/core"> + + <ui:composition template="/templates/common.xhtml"> + + <ui:define name="pageTitle">JCatalog Application</ui:define> + + <ui:define name="pageHeader">JCatalog Application</ui:define> + + <ui:define name="body"> + <h2>Contact Page</h2> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + + </ui:composition> + +</html> diff --git a/WebContent/pages/greeting.xhtml b/WebContent/pages/greeting.xhtml new file mode 100644 index 0000000..73e1d62 --- /dev/null +++ b/WebContent/pages/greeting.xhtml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core"> + + <ui:composition template="/templates/loggedin.xhtml"> + + <ui:define name="pageTitle">JCatalog Welcome</ui:define> + + <ui:define name="pageHeader">JCatalog Application</ui:define> + + <ui:define name="body"> + <h2>Welcome to the JCatalog Demo Application <h:outputText id="username" value="#{UserManager.username}" /></h2> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + + </ui:composition> + +</html> diff --git a/WebContent/pages/home.xhtml b/WebContent/pages/home.xhtml new file mode 100644 index 0000000..735c734 --- /dev/null +++ b/WebContent/pages/home.xhtml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core"> + + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> + </head> + + <ui:composition template="/templates/common.xhtml"> + + <ui:define name="pageTitle">JCatalog Application</ui:define> + + <ui:define name="pageHeader">JCatalog Application</ui:define> + + <ui:define name="body"> + <h2>Welcome to the JCatalog Demo Application</h2> + <p>Please make your choice.</p> + <p>Bitte eine Option auswählen.</p> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + + </ui:composition> + +</html> diff --git a/WebContent/pages/login.xhtml b/WebContent/pages/login.xhtml new file mode 100644 index 0000000..2e94421 --- /dev/null +++ b/WebContent/pages/login.xhtml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:c="http://java.sun.com/jstl/core"> + +<ui:composition template="/templates/common.xhtml"> + + <ui:define name="pageTitle">JCatalog Login</ui:define> + + <ui:define name="pageHeader">Login</ui:define> + + <ui:define name="body"> + <div style="width: 500px; padding: 5px; margin: 0px auto; float: left;"> + <h:form id="loginForm"> + <h:inputHidden id="action" value="login" /> + <div class="row"> + <label for="username"><u>U</u>sername:</label> + <span class="formw"><h:inputText id="username" value="#{UserManager.username}" accesskey="u" size="40" /></span> + </div> + <div class="row"> + <label for="password"><u>P</u>assword:</label> + <span class="formw"><h:inputSecret id="password" value="#{UserManager.password}" accesskey="p" size="32" /></span> + </div> + <div class="row"> + <span class="formw"> + <h:commandButton action="#{UserManager.login}" id="submit" value="Submit" type="submit" accesskey="s" /> + </span> + </div> + <div class="spacer" /> + </h:form> + </div> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + +</ui:composition> + +</html> diff --git a/WebContent/pages/product.xhtml b/WebContent/pages/product.xhtml new file mode 100644 index 0000000..06c4a8d --- /dev/null +++ b/WebContent/pages/product.xhtml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:c="http://java.sun.com/jstl/core"> + +<ui:composition template="/templates/common.xhtml"> + + <ui:define name="pageTitle">JCatalog Application</ui:define> + + <ui:define name="pageHeader">Login</ui:define> + + <ui:define name="body"> + <div style="width: 500px; padding: 5px; margin: 0px auto; float: left;"> + <h:form> + <div class="row"> + <label for="name">Name:</label> + <span class="formw"><h:inputText id="name" disabled="true" value="#{ProductManager.current.name}" accesskey="n" size="40" /></span> + </div> + <div class="row"> + <label for="price">Price:</label> + <span class="formw"><h:inputText id="price" disabled="true" value="#{ProductManager.current.price}" accesskey="p" size="40" /></span> + </div> + <div class="row"> + <label for="description">Description:</label> + <span class="formw"><h:inputTextarea rows="20" cols="40" id="description" disabled="true" value="#{ProductManager.current.description}" accesskey="d" /></span> + </div> + <div class="row"> + <span class="formw"> + <h:commandButton action="products" id="back" value="Back" type="submit" accesskey="b" /> + </span> + </div> + <div class="spacer" /> + </h:form> + </div> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + +</ui:composition> + +</html> diff --git a/WebContent/pages/products.xhtml b/WebContent/pages/products.xhtml new file mode 100644 index 0000000..f833c1d --- /dev/null +++ b/WebContent/pages/products.xhtml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core" + xmlns:c="http://java.sun.com/jstl/core"> + + <ui:composition template="/templates/common.xhtml"> + + <ui:define name="pageTitle">JCatalog Application</ui:define> + + <ui:define name="pageHeader">List of Products</ui:define> + + <ui:define name="body"> + + <h:form id="products"> + + <h2> + <f:verbatim>List of Products in Category </f:verbatim> + <h:outputText value="#{CategoryManager.current.name}" /> + </h2> + + <h:dataTable style="border: 1px;" id="producttable" value="#{CategoryManager.current.products}" + var="product"> + <h:column> + <f:facet name="header"> + <h:outputText value="Id" /> + </f:facet> + <h:outputText value="#{product.id}" /> + </h:column> + <h:column> + <f:facet name="header"> + <h:outputText value="Name" /> + </f:facet> + <h:outputText value="#{product.name}" /> + </h:column> + <h:column> + <f:facet name="header"> + <h:outputText value="Price" /> + </f:facet> + <h:outputText value="#{product.price}" /> + </h:column> + <h:column> + <f:facet name="header"> + <h:outputText value="" /> + </f:facet> + <h:commandLink value="View Details ..." immediate="true" + actionListener="#{ProductManager.select}" action="select"> + <f:param name="selectedId" value="#{product.id}" /> + </h:commandLink> + </h:column> + </h:dataTable> + + </h:form> + </ui:define> + + <ui:define name="pageFooter">JCatalog Footer</ui:define> + + </ui:composition> + +</html> diff --git a/WebContent/stylesheets/form.css b/WebContent/stylesheets/form.css new file mode 100644 index 0000000..8667f07 --- /dev/null +++ b/WebContent/stylesheets/form.css @@ -0,0 +1,16 @@ +div.row { + clear: both; + padding-top: 10px; +} + +div.row label { + float: left; + width: 100px; + text-align: right; +} + +div.row span.formw { + float: right; + width: 335px; + text-align: left; +} diff --git a/WebContent/stylesheets/navigation.css b/WebContent/stylesheets/navigation.css new file mode 100644 index 0000000..1ec153b --- /dev/null +++ b/WebContent/stylesheets/navigation.css @@ -0,0 +1,25 @@ +#navcontainer ul +{ +margin: 0; +padding: 0; +list-style-type: none; +} + +#navcontainer li { margin: 0 0 .2em 0; } + +#navcontainer a +{ +display: block; +color: black; +background-color: #ddd; +width: 6em; +padding: .2em .8em; +text-decoration: none; +} + +#navcontainer a:hover +{ +background-color: #bbb; +color: #FFF; +} + diff --git a/WebContent/stylesheets/twocolumn.css b/WebContent/stylesheets/twocolumn.css new file mode 100644 index 0000000..e5b8e84 --- /dev/null +++ b/WebContent/stylesheets/twocolumn.css @@ -0,0 +1,53 @@ +@CHARSET "ISO-8859-1"; + +#container +{ +width: 90%; +margin: 10px auto; +background-color: #fff; +color: #333; +border: 1px solid gray; +line-height: 130%; +} + +#top +{ +padding: .5em; +background-color: #ddd; +border-bottom: 1px solid gray; +} + +#top h1 +{ +padding: 0; +margin: 0; +} + +#leftnav +{ +float: left; +width: 160px; +margin: 0; +padding: 1em; +} + +#content +{ +margin-left: 200px; +border-left: 1px solid gray; +padding: 1em; +max-width: 36em; +} + +#footer +{ +clear: both; +margin: 0; +padding: .5em; +color: #333; +background-color: #ddd; +border-top: 1px solid gray; +} + +#leftnav p { margin: 0 0 1em 0; } +#content h2 { margin: 0 0 .5em 0; } diff --git a/WebContent/templates/common.xhtml b/WebContent/templates/common.xhtml new file mode 100644 index 0000000..151411f --- /dev/null +++ b/WebContent/templates/common.xhtml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core"> + + <head> + <title><ui:insert name="pageTitle">Page Title</ui:insert></title> + <link rel="stylesheet" type="text/css" href="../stylesheets/twocolumn.css" /> + <link rel="stylesheet" type="text/css" href="../stylesheets/navigation.css" /> + <link rel="stylesheet" type="text/css" href="../stylesheets/form.css" /> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> + </head> + + <body> + + <div id="container"> + + <div id="top"> + <ui:insert name="pageHeader">Page Header</ui:insert> + </div> + + <div id="leftnav"> + <ui:insert name="leftnav"> + <h:form id="navcontainer"> + <ul> + <li> + <h:commandLink action="contact"> + <h:outputText id="contact" value="Cont@ct" /> + </h:commandLink> + </li> + <li> + <h:commandLink action="categories"> + <h:outputText id="catalog" value="Catalog" /> + </h:commandLink> + </li> + <li> + <h:commandLink action="login" id="loginLink"> + <h:outputText id="login" value="Login" /> + </h:commandLink> + </li> + </ul> + </h:form> + </ui:insert> + </div> + + <div id="content"> + <ui:insert name="body">Page Body</ui:insert> + </div> + + <div id="footer"> + <ui:insert name="footer">Page Footer</ui:insert> + </div> + + </div> <!-- id="container" --> + + </body> + +</html> diff --git a/WebContent/templates/loggedin.xhtml b/WebContent/templates/loggedin.xhtml new file mode 100644 index 0000000..3ac57ca --- /dev/null +++ b/WebContent/templates/loggedin.xhtml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> +<!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:h="http://java.sun.com/jsf/html" + xmlns:f="http://java.sun.com/jsf/core"> + + <head> + <title><ui:insert name="pageTitle">Page Title</ui:insert></title> + <link rel="stylesheet" type="text/css" href="../stylesheets/twocolumn.css" /> + <link rel="stylesheet" type="text/css" href="../stylesheets/navigation.css" /> + <link rel="stylesheet" type="text/css" href="../stylesheets/form.css" /> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> + </head> + + <body> + + <div id="container"> + + <div id="top"> + <ui:insert name="pageHeader">Page Header</ui:insert> + </div> + + <div id="leftnav"> + <ui:insert name="leftnav"> + <h:form id="navcontainer"> + <ul> + <li> + <h:commandLink action="contact"> + <h:outputText id="contact" value="Cont@ct" /> + </h:commandLink> + </li> + <li> + <h:commandLink action="categories"> + <h:outputText id="catalog" value="Catalog" /> + </h:commandLink> + </li> + <li> + <h:commandLink action="#{UserManager.logout}" id="logoutLink"> + <h:outputText id="logout" value="Logout" /> + </h:commandLink> + </li> + </ul> + </h:form> + </ui:insert> + </div> + + <div id="content"> + <ui:insert name="body">Page Body</ui:insert> + </div> + + <div id="footer"> + <ui:insert name="footer">Page Footer</ui:insert> + </div> + + </div> <!-- id="container" --> + + </body> + +</html> |
