empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1352885 - in /empire-db/trunk: empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/ empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/ empire-db-examples/empire-db-example-jsf2/src/main/weba...
Date Fri, 22 Jun 2012 13:39:28 GMT
Author: doebele
Date: Fri Jun 22 13:39:26 2012
New Revision: 1352885

URL: http://svn.apache.org/viewvc?rev=1352885&view=rev
Log:
EMPIREDB-140
jsf-example improved css

Added:
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/buttonBar.xhtml
  (with props)
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formButtonRow.xhtml
  (with props)
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formInputRow.xhtml
  (with props)
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanel.xhtml
  (with props)
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanelRow.xhtml
  (with props)
Removed:
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/column.xhtml
Modified:
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/common.css
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/TitleTag.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java
    empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinitions.java

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_de.properties
Fri Jun 22 13:39:26 2012
@@ -48,6 +48,7 @@ login_title = Anmeldung
 login_login = anmelden
 login_field_name = Benutzername
 login_field_password = Passwort
+login_hint=Hinweis: Geben Sie einen beliebigen Benutzernamen und Kennwort an.
 
 employeeSearch_title = Mitarbeitersuche
 employeeSearch_field_employeeId = Mitarbeiter ID
@@ -101,7 +102,6 @@ label.user.Name=Name
 label.user.Pwd=Passwort
 
 page.label.login=Anmelden
-page.label.loginHint=Hinweis: Geben Sie einen beliebigen Benutzernamen und Kennwort an.
 page.label.logininfo=Sie sind angemeldet als:
 page.label.search=Mitarbeiter suchen
 page.label.list=Mitarbeiter auswählen

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/resources/lang/messages_en.properties
Fri Jun 22 13:39:26 2012
@@ -42,11 +42,13 @@ application_logout = Logout
 
 global_list_result_empty=No employee(s) found
 
+
 #pages
 login_title = Login
 login_login = login
 login_field_name = User name
 login_field_password = Password
+login_hint=Hint: enter any non null username and password.
 
 employeeSearch_title=Search employee
 employeeSearch_search=Search

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/header.xhtml
Fri Jun 22 13:39:26 2012
@@ -20,16 +20,12 @@
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:f="http://java.sun.com/jsf/core">
 
-	<!-- title & logo line -->
-	<h:panelGroup id="titleLogoLine">	
-		
-		<!-- title box -->
-		<h:panelGroup id="titleBox">	
-			<h1>
-				<h:outputText value="#{msg.application_title} - #{pageTitle}" />
-			</h1>
-		</h:panelGroup>
-
+	<!-- application title -->
+	<h:panelGroup layout="block" styleClass="titleDiv">
+		<h:outputText value="#{msg.application_title}" />	
 	</h:panelGroup>
+		
+	<!-- page box -->
+	<h1><h:outputText value="#{pageTitle}" /></h1>
 
 </h:panelGroup>
\ No newline at end of file

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/WEB-INF/facelets/templates/layout.xhtml
Fri Jun 22 13:39:26 2012
@@ -62,17 +62,15 @@
 		<ui:include src="header.xhtml" />
 
 		<!-- (error) messages -->
-		<h:messages />
+		<h:panelGroup id="messages" layout="block">
+			<h:messages />
+		</h:panelGroup>
 
 		<!-- content -->
-		<h:panelGroup id="content" styleClass="#{contentStyle}">
+		<h:panelGroup id="content" layout="block">
 			<ui:insert name="content" />
 		</h:panelGroup>
 
-		<!-- content footer -->
-		<h:panelGroup id="contentFooter" rendered="#{contentFooter}">
-			<ui:insert name="contentFooter" />
-		</h:panelGroup>
 	</f:view>
 </h:body>
 </html>

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/common.css
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/common.css?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/common.css
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/common.css
Fri Jun 22 13:39:26 2012
@@ -17,8 +17,9 @@
  * under the License.
  */
 html, body  {
+	width: 800px;
     margin-left: 10px;
-    margin-right: 10px;
+    margin-right: auto;
     margin-bottom: 5px;
     color: black;
     background-color: white;
@@ -39,49 +40,33 @@ h1 { font-weight:bold; color: brown; fon
 
 td { font-size:12px; padding-right:10px; }
 th { text-align:left; font-weight:bold; font-size:13px; padding-right:10px; }
-.tdLabel { font-weight: bold; white-space:nowrap; vertical-align:top;}
 
 A:link { text-decoration:none;}
 A:visited { text-decoration:none;}
 A:hover { text-decoration:underline;}
 
+.even { background-color: #EFEFFB; 	text-align:left;}
+.odd { background-color:  #FFFFFF; 	text-align:left; }
 
-.buttonRow{
-    padding: 5px 10px;
-}
-
-.borderAll {
-    border: 1px solid #000000;
-    padding: 2px;
-    width: 540px;
-}
-.searchResult {
-	padding: 5px 10px;
-	width: 540px;
-	text-align:center;
-}
+.nowrap { white-space:nowrap; }
 
-.butStnd {
-    font-family: ARIAL, SANS-SERIF;
-    font-size:11px;
-    font-weight:bold;
-    padding: 2px;
-    color:#000000;
-    border:1px solid #DCDFFA;
-}
 
-.error {
-    color: red;
-    font-weight: bold;
-}
-.errorSection {
-    padding-left:18px;
+#messages ul {
+    background-color: #FBF0F0;
+    border:2px solid #8F99EF;
+	list-style-type: square;
+	padding: 8px;
+	padding-left: 24px;
+}
+#messages ul li {
+	padding: 4px 0;
+/*
+	padding-left:18px;
     padding-top:2px;
     padding-bottom:10px;
     padding-right:5px;
+*/    
+	color: #922727;
+    font-weight: bold;
 }
 
-.even { background-color: #EFEFFB; 	text-align:left;}
-.odd { background-color:  #FFFFFF; 	text-align:left; }
-
-.nowrap { white-space:nowrap; }

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/css/content.css
Fri Jun 22 13:39:26 2012
@@ -16,33 +16,67 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+ 
+form {
+}
 
-.sampleForm {
-	color: #000000;
-	border: 1px #E4E4E5 solid;
+div.formPanel {
+	border: 1px #8F99EF solid;
 	background-color: #F8F8F8;
-	padding: 7px 7px;
-	width: 784px;
+	padding: 8px 4px;
+}
+table.inputForm {
+	width: 100%;
+}
+table.inputForm td.eCtlLabel {
+	font-weight: bold; 
+	white-space:nowrap; 
+	vertical-align:top;
+	width: 140px;
+}
+table.inputForm td.buttonBar {
+	padding-top: 8px;
+}
+
+div.buttonBar {
+	margin: 12px 0;
 }
 
-a.sampleButton,
-a.sampleButton:visited 
-{
+.buttonBar a,
+.buttonBar a:visited {
 	display: inline-block;
-	border: 1px #A8ADB3 solid;
-	margin: 0 12px 0 0;
-	padding: 3px;
-	background-color: white;
-	color: #000000;
-	font-weight: bold; 
+	border: 1px gray solid;
+	padding: 4px 12px;
+	color: black;
 	text-decoration: none;
+	margin-right: 16px;
+	background-color: white;
 }
-
-<!--[if gt IE 7]><!-->
-a.sampleButton,
-a.sampleButton:visited 
-{
-	display: inline !important;
+.buttonBar a:hover {
+	background-color: #EFFBEF;
 }
-<!--<![endif]-->
 
+div.searchResult,
+span.searchResult {
+	display: block;
+	margin: 12px 0;
+	padding: 4px 0;
+}
+.searchResult table {
+	width: 100%;
+	border: 1px gray solid;
+	border-collapse: collapse;
+}
+.searchResult table tr th,
+.searchResult table tr td {
+	padding: 4px;
+}
+.searchResult table tr th {
+	background-color: #EFFBEF;
+	border-bottom: 1px gray solid;
+}
+.searchResult table a.eLink,
+.searchResult table a.eLink:visited {
+	color: brown;
+	font-weight: bold;
+}

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeDetailPage.xhtml
Fri Jun 22 13:39:26 2012
@@ -21,6 +21,7 @@
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:e="http://java.sun.com/jsf/composite/empire"
+	xmlns:sample="http://java.sun.com/jsf/composite/components"
 	xmlns:h="http://java.sun.com/jsf/html">
 	<f:metadata>
 		<f:viewParam name="action" value="#{page.action}" />
@@ -34,30 +35,27 @@
 	<!-- content -->
 	<ui:define name="content">
 			<e:record value="#{page.employeeRecord}">
+			<!-- input form -->
+			
 			<h:form id="employeeDetail">
-				<h:panelGrid >
-					<h:panelGrid id="panel" border="0"  >
-						<e:control column="#{db.EMPLOYEES.SALUTATION}" />
-						<e:control column="#{db.EMPLOYEES.FIRST_NAME}" />
-						<e:control column="#{db.EMPLOYEES.LAST_NAME}" />
-						<e:control column="#{db.EMPLOYEES.DATE_OF_BIRTH}" />
-						<e:control column="#{db.EMPLOYEES.DEPARTMENT_ID}" />
-						<e:control column="#{db.EMPLOYEES.GENDER}"   /> 
-						<e:control column="#{db.EMPLOYEES.PHONE_NUMBER}" />
-						<e:control column="#{db.EMPLOYEES.EMAIL}" />
-						<e:control column="#{db.EMPLOYEES.RETIRED}" />
-						<e:control column="#{db.EMPLOYEES.UPDATE_TIMESTAMP}" readonly="true" rendered="#{page.idParam
!= null}" /> 
-					</h:panelGrid>
-					<h:panelGrid columns="4" styleClass="buttonRow">
-						<h:commandLink styleClass="butStnd" value="#{msg.employeeDetail_back}"
-								action="#{page.doCancel}" immediate="true" />
-						<h:commandLink styleClass="butStnd" value="#{msg.employeeDetail_save}"
-								action="#{page.doSave}" />
-						<h:commandLink styleClass="butStnd" value="#{msg.employeeDetail_delete}"
-								action="#{page.doDelete}" immediate="true" rendered="#{page.idParam != null}" />
-						<h:outputLink value="pages/loginPage.iface?logout=true" styleClass="butStnd">#{msg.application_logout}</h:outputLink>
-					</h:panelGrid>
-				</h:panelGrid>
+				<sample:formPanel>
+					<tr><e:control column="#{db.EMPLOYEES.SALUTATION}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.FIRST_NAME}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.LAST_NAME}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.DATE_OF_BIRTH}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.DEPARTMENT_ID}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.GENDER}"   /> </tr>
+					<tr><e:control column="#{db.EMPLOYEES.PHONE_NUMBER}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.EMAIL}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.RETIRED}" /></tr>
+					<tr><e:control column="#{db.EMPLOYEES.UPDATE_TIMESTAMP}" readonly="true" rendered="#{page.idParam
!= null}" /></tr> 
+				</sample:formPanel>
+				<!-- button bar -->
+				<h:panelGroup styleClass="buttonBar" layout="block">
+					<h:commandLink value="#{msg.employeeDetail_back}" action="#{page.doCancel}" immediate="true"
/>
+					<h:commandLink value="#{msg.employeeDetail_delete}" action="#{page.doDelete}" immediate="true"
rendered="#{page.idParam != null}" />
+					<h:commandLink value="#{msg.employeeDetail_save}" action="#{page.doSave}" />
+				</h:panelGroup>
 			</h:form>
 		
 		</e:record>

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
Fri Jun 22 13:39:26 2012
@@ -34,37 +34,38 @@
 	<!-- content -->
 	<ui:define name="content">
 		<h:form id="employeeListFilter">
-			<h:panelGrid styleClass="borderAll" >
+			<sample:formPanel>
 				<!-- search settings -->
-				<h:panelGrid id="panel" columns="2" border="0">
-					<e:control column="#{db.EMPLOYEES.FIRST_NAME}"	    value="#{page.searchFilter.firstName}"
/>
-					<e:control column="#{db.EMPLOYEES.LAST_NAME}" 	    value="#{page.searchFilter.lastName}"
/>
-					<e:control column="#{db.EMPLOYEES.DEPARTMENT_ID}"	value="#{page.searchFilter.departmentId}"
+				<sample:formPanelRow>
+					<e:control column="#{db.EMPLOYEES.FIRST_NAME}" value="#{page.searchFilter.firstName}"
/>
+					<e:control column="#{db.EMPLOYEES.LAST_NAME}" value="#{page.searchFilter.lastName}"
/>
+				</sample:formPanelRow>
+				<sample:formPanelRow>
+					<e:control column="#{db.EMPLOYEES.DEPARTMENT_ID}" value="#{page.searchFilter.departmentId}"
 						       options="#{page.departmentOptions}" />
-					<e:control column="#{db.EMPLOYEES.GENDER}" 			value="#{page.searchFilter.gender}"
/>
-				</h:panelGrid>
-				<!-- button bar -->
-				<h:panelGrid columns="3" styleClass="buttonRow">
-					<h:commandLink styleClass="butStnd" action="#{page.doResetSearch}"              value="#{msg.employeeList_resetSearch}"
/>
-					<h:commandLink styleClass="butStnd" action="#{page.doSearch}" 	                value="#{msg.employeeList_search}"
/>
-					<e:link        styleClass="butStnd" page="#{pages.EmployeeDetailPage.doCreate}" value="#{msg.employeeList_create}"
/>
-				</h:panelGrid>
-			</h:panelGrid>
+					<e:control column="#{db.EMPLOYEES.GENDER}" value="#{page.searchFilter.gender}" />
+				</sample:formPanelRow>
+				<sample:formButtonRow>
+					<h:commandLink action="#{page.doResetSearch}" value="#{msg.employeeList_resetSearch}"
/>
+					<h:commandLink action="#{page.doSearch}" value="#{msg.employeeList_search}" />
+				</sample:formButtonRow>
+			</sample:formPanel>
 		</h:form>
 
 		<h:form id="employeeList">
-			<h:panelGroup rendered="#{page.employees.resultEmpty}" styleClass="searchResult">
+			<h:panelGroup rendered="#{page.employees.resultEmpty}" styleClass="searchResult" layout="block">
 				<h:outputText value="#{msg.global_list_result_empty}" />
 			</h:panelGroup>
-			<h:panelGroup rendered="#{page.employees.valid}" styleClass="searchResult">
+			<!-- list -->
+			<h:panelGroup styleClass="searchResult" layout="block" rendered="#{page.employees.valid}">
 				<h:dataTable id="employeeTable" value="#{page.employees.items}" var="item" rowClasses="odd,even">
 					<h:column>
 						<f:facet name="header">
-							<e:title column="#{db.EMPLOYEES.EMPLOYEE_ID}" />
+							<e:title column="#{db.EMPLOYEES.EMPLOYEE_ID}" value="ID" />
 						</f:facet>
 						<e:value record="#{item}" column="#{db.EMPLOYEES.EMPLOYEE_ID}"/>
 					</h:column>
-					<h:column>
+					<h:column styleClass="item">
 						<f:facet name="header">
 							<h:outputText value="#{msg.employeeList_field_name}" />
 						</f:facet>
@@ -92,8 +93,10 @@
 			</h:panelGroup>
 		</h:form>
 		
-		<h:panelGroup styleClass="buttonBar">
-			<e:link page="#{pages.LoginPage.doLogout}" styleClass="butStnd" value="#{msg.application_logout}"/>
+		<!-- button bar -->
+		<h:panelGroup styleClass="buttonBar" layout="block">
+			<e:link page="#{pages.LoginPage.doLogout}" value="#{msg.application_logout}"/>
+			<e:link page="#{pages.EmployeeDetailPage.doCreate}" value="#{msg.employeeList_create}"
/>
 		</h:panelGroup>
 		
 	</ui:define>

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/loginPage.xhtml
Fri Jun 22 13:39:26 2012
@@ -22,6 +22,7 @@
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:e="http://java.sun.com/jsf/composite/empire"
+	xmlns:sample="http://java.sun.com/jsf/composite/components"
 	xmlns:h="http://java.sun.com/jsf/html">
 	<f:metadata>
 		<f:viewParam name="action" value="#{page.action}" />
@@ -34,15 +35,21 @@
 
 	<!-- content -->
 	<ui:define name="content">
-		<h:form id="login" method="post">
-			<h:panelGrid id="panel" columns="2" border="0">
-				<h:outputLabel for="name" value="#{msg.login_field_name}" />
-				<h:inputText id="name" value="#{sampleUser.userName}" required="true"/>
-				<h:outputLabel for="name" value="#{msg.login_field_password}" />
-				<h:inputSecret id="password" value="#{sampleUser.password}" required="true" />
-				
-				<h:commandLink styleClass="butStnd" action="#{page.doLogin}" value="#{msg.login_title}"
/>
-			</h:panelGrid>
+		<h:form id="loginForm" method="post">
+			<p><h:outputText value="#{msg.login_hint}"/></p>
+			<!-- input form -->
+			<sample:formPanel>
+				<sample:formInputRow for="name" label="#{msg.login_field_name}">
+					<h:inputText id="name" value="#{sampleUser.userName}" required="true"/>
+				</sample:formInputRow>
+				<sample:formInputRow for="password" label="#{msg.login_field_password}">
+					<h:inputSecret id="password" value="#{sampleUser.password}" required="true" />
+				</sample:formInputRow>
+				<!-- button bar -->
+				<sample:formButtonRow>
+					<h:commandLink action="#{page.doLogin}" value="#{msg.login_title}" />
+				</sample:formButtonRow>
+			</sample:formPanel>
 		</h:form>
 	</ui:define>
 	

Added: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/buttonBar.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/buttonBar.xhtml?rev=1352885&view=auto
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/buttonBar.xhtml
(added)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/buttonBar.xhtml
Fri Jun 22 13:39:26 2012
@@ -0,0 +1,37 @@
+<!-- 
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:c="http://java.sun.com/jsp/jstl/core"
+  	xmlns:cc="http://java.sun.com/jsf/composite">
+
+	<!-- Interface -->
+	<cc:interface>
+		<cc:attribute name="columns" default="1" />
+	</cc:interface>
+	
+	<!-- Implementation -->
+	<cc:implementation>
+		<h:panelGroup styleClass="buttonBar" layout="block">
+			<cc:insertChildren />
+		</h:panelGroup>
+	</cc:implementation>
+	
+</html>

Propchange: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/buttonBar.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formButtonRow.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formButtonRow.xhtml?rev=1352885&view=auto
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formButtonRow.xhtml
(added)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formButtonRow.xhtml
Fri Jun 22 13:39:26 2012
@@ -0,0 +1,36 @@
+<!-- 
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml"
+  	xmlns:cc="http://java.sun.com/jsf/composite">
+
+	<!-- Interface -->
+	<cc:interface>
+	</cc:interface>
+	
+	<!-- Implementation -->
+	<cc:implementation>
+		<tr class="formButtonRow">
+			<td><!-- empty --></td>
+			<td class="buttonBar" colspan="3">
+				<cc:insertChildren/>
+			</td>
+		</tr>
+	</cc:implementation>
+	
+</html>

Propchange: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formButtonRow.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formInputRow.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formInputRow.xhtml?rev=1352885&view=auto
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formInputRow.xhtml
(added)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formInputRow.xhtml
Fri Jun 22 13:39:26 2012
@@ -0,0 +1,41 @@
+<!-- 
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml"
+  	xmlns:cc="http://java.sun.com/jsf/composite"
+	xmlns:h="http://java.sun.com/jsf/html">
+
+	<!-- Interface -->
+	<cc:interface>
+		<cc:attribute name="label" />
+		<cc:attribute name="for" />
+	</cc:interface>
+	
+	<!-- Implementation -->
+	<cc:implementation>
+		<tr class="formButtonRow">
+			<td class="eCtlLabel">
+				<h:outputLabel for="#{cc.attrs.for}" value="#{cc.attrs.label}" />:
+			</td>
+			<td class="eCtlInput">
+				<cc:insertChildren/>
+			</td>
+		</tr>
+	</cc:implementation>
+	
+</html>

Propchange: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formInputRow.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanel.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanel.xhtml?rev=1352885&view=auto
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanel.xhtml
(added)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanel.xhtml
Fri Jun 22 13:39:26 2012
@@ -0,0 +1,39 @@
+<!-- 
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:h="http://java.sun.com/jsf/html"
+	xmlns:ice="http://www.icesoft.com/icefaces/component"
+	xmlns:c="http://java.sun.com/jsp/jstl/core"
+  	xmlns:cc="http://java.sun.com/jsf/composite">
+
+	<!-- Interface -->
+	<cc:interface>
+		<cc:attribute name="columns" default="1" />
+	</cc:interface>
+	
+	<!-- Implementation -->
+	<cc:implementation>
+		<h:panelGroup styleClass="formPanel" layout="block">
+			<table class="inputForm">
+				<cc:insertChildren />
+			</table>
+		</h:panelGroup>
+	</cc:implementation>
+	
+</html>

Propchange: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanel.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanelRow.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanelRow.xhtml?rev=1352885&view=auto
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanelRow.xhtml
(added)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanelRow.xhtml
Fri Jun 22 13:39:26 2012
@@ -0,0 +1,34 @@
+<!-- 
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml"
+  	xmlns:cc="http://java.sun.com/jsf/composite">
+
+	<!-- Interface -->
+	<cc:interface>
+		<cc:attribute name="styleClass" />
+	</cc:interface>
+	
+	<!-- Implementation -->
+	<cc:implementation>
+		<tr class="#{cc.attrs.styleClass}">
+			<cc:insertChildren />
+		</tr>
+	</cc:implementation>
+	
+</html>

Propchange: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/resources/components/formPanelRow.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/TitleTag.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/TitleTag.java?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/TitleTag.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/TitleTag.java
Fri Jun 22 13:39:26 2012
@@ -77,7 +77,7 @@ public class TitleTag extends UIOutput i
     /* Helpers */
     protected void renderTitle(Column column, ResponseWriter writer) throws IOException
     {
-        String title=null;
+        String title=StringUtils.toString(getValue());
         // Check for short form    
         if (helper.hasFormat("short"))
         {

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinition.java
Fri Jun 22 13:39:26 2012
@@ -18,6 +18,8 @@
  */
 package org.apache.empire.jsf2.pages;
 
+import java.io.Serializable;
+
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.jsf2.app.FacesUtils;
 import org.apache.empire.jsf2.utils.ParameterMap;
@@ -25,16 +27,20 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-public class PageDefinition
+public class PageDefinition implements Serializable
 {
-    private static final Logger log = LoggerFactory.getLogger(PageDefinitions.class);
+	private static final long serialVersionUID = 1L;
+
+	private static final Logger log = LoggerFactory.getLogger(PageDefinitions.class);
 
     private static final String ACTION_PARAMETER_TYPE = "ACTION";
     
-    private String path;
-    private String pageBeanName;
-    private Class<? extends Page> pageBeanClass;
-    private PageDefinition parent = null;
+    private final String path;
+    private final String fileExtension;
+
+	private final String pageBeanName;
+    private final Class<? extends Page> pageBeanClass;
+    private final PageDefinition parent;
 
     /*
     private static Hashtable<String, String> actionCodeMap = new Hashtable<String,
String>();
@@ -76,28 +82,81 @@ public class PageDefinition
         return action;
     }
     
-    public PageDefinition(String path, Class<? extends Page> pageBeanClass)
+    /**
+     * Constructs a page definition
+     * @param path	the path of the view associated with this page
+     * @param pageBeanClass the page bean class associated with this page
+     * @param parent the parent page (if any). May be null
+     * @param pageBeanName the page bean name. If null this will be calculated from the path
+     */
+    public PageDefinition(String path, Class<? extends Page> pageBeanClass, PageDefinition
parent, String pageBeanName)
     { 
         this.path = path;
         this.pageBeanClass = pageBeanClass;
-        // beanName 
-        int lastSlash = path.lastIndexOf('/');
-        String name = path.substring(lastSlash + 1);
-        pageBeanName = name.replace(".xhtml", "Page");
+        this.parent = parent;
+        // extension
+        int ext = path.lastIndexOf('.');
+        fileExtension = (ext>0) ? path.substring(ext) : null;
+        // beanName
+        if (pageBeanName==null) 
+        	this.pageBeanName = getPageBeanNameFromPath(path, fileExtension);
+        else
+        	this.pageBeanName = pageBeanName;
         // add this view
         PageDefinitions.registerPage(this);
     }
+
+    /**
+     * Constructs a page definition
+     * @param path	the path of the view associated with this page
+     * @param pageBeanClass the page bean class associated with this page
+     * @param pageBeanName the page bean name. If null this will be calculated from the path
+     */
+    public PageDefinition(String path, Class<? extends Page> pageBeanClass, String
pageBeanName)
+    {
+        this(path, pageBeanClass, null, pageBeanName);
+    }
+
+    /**
+     * Constructs a page definition
+     * @param path	the path of the view associated with this page
+     * @param pageBeanClass the page bean class associated with this page
+     * @param parent the parent page (if any). May be null
+     */
+    public PageDefinition(String path, Class<? extends Page> pageBeanClass, PageDefinition
parent)
+    {
+        this(path, pageBeanClass, parent, null);
+    }
+
+    /**
+     * Constructs a page definition
+     * @param path	the path of the view associated with this page
+     * @param pageBeanClass the page bean class associated with this page
+     */
+    public PageDefinition(String path, Class<? extends Page> pageBeanClass)
+    {
+        this(path, pageBeanClass, null, null);
+    }
     
-    public PageDefinition(String path, Class<? extends Page> pageClass, PageDefinition
parent)
+    protected String getPageBeanNameFromPath(String path, String extension)
     {
-        this(path, pageClass);
-        this.parent = parent;
+        // beanName 
+        int lastSlash = path.lastIndexOf('/');
+        String name = path.substring(lastSlash + 1);
+        if (extension!=null)
+        	name = name.substring(0,(name.length()-extension.length()));
+        return name;
     }
     
     public String getPath()
     {
         return path;
     }
+
+    public String getFileExtension() 
+    {
+		return fileExtension;
+	}
     
     public String getPageBeanName()
     {
@@ -118,10 +177,7 @@ public class PageDefinition
     
     public PageOutcome getOutcome()
     {
-    	String uri = path;
-    	String extension = PageDefinitions.getInstance().getPageUriExtension();
-    	if (extension!=null)
-    		uri = path.replace(".xhtml", extension);
+    	String uri = PageDefinitions.getInstance().getPageUri(this);
         return new PageOutcome(uri);
     }
     

Modified: empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinitions.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinitions.java?rev=1352885&r1=1352884&r2=1352885&view=diff
==============================================================================
--- empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinitions.java
(original)
+++ empire-db/trunk/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/pages/PageDefinitions.java
Fri Jun 22 13:39:26 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.empire.jsf2.pages;
 
+import java.io.Serializable;
 import java.util.LinkedHashMap;
 
 import org.apache.empire.commons.StringUtils;
@@ -28,9 +29,11 @@ import com.sun.faces.mgbean.BeanManager;
 import com.sun.faces.mgbean.ManagedBeanInfo;
 
 
-public abstract class PageDefinitions
+public abstract class PageDefinitions implements Serializable
 {
-    private static final Logger log = LoggerFactory.getLogger(PageDefinitions.class);
+	private static final long serialVersionUID = 1L;
+
+	private static final Logger log = LoggerFactory.getLogger(PageDefinitions.class);
 
     private static LinkedHashMap<String,PageDefinition> pageMap = new LinkedHashMap<String,PageDefinition>();
     
@@ -41,9 +44,9 @@ public abstract class PageDefinitions
         return instance;
     }
     
-    protected String pageUriExtension = null; // ".jsf";  
+    protected String pageUriExtension;  
 	
-    protected PageDefinitions()
+    protected PageDefinitions(String pageUriExtension)
     {
         if (instance!=null) 
         {
@@ -51,13 +54,15 @@ public abstract class PageDefinitions
         }
         // init
         instance = this;
+        // set extension
+        this.pageUriExtension = pageUriExtension;
         log.info("PageDefintions class created");
     }
-    
-    public String getPageUriExtension() 
+
+    protected PageDefinitions()
     {
-		return pageUriExtension;
-	}
+    	this(null);
+    }
     
     /**
      * Register page beans with the BeanManager
@@ -90,6 +95,29 @@ public abstract class PageDefinitions
     }
     
     /**
+     * returns the page uri extension
+     * @return
+     */
+    public String getPageUriExtension() 
+    {
+		return pageUriExtension;
+	}
+
+    /**
+     * returns the page uri (without contextRoot!) for given page definition
+     * @param pageDef the page definition
+     * @return the page uri
+     */
+    public String getPageUri(PageDefinition pageDef)
+    {
+    	String uri = pageDef.getPath();
+    	String fileExt = pageDef.getFileExtension();
+    	if (pageUriExtension!=null && fileExt!=null)
+    		uri = uri.replace(fileExt, pageUriExtension);
+        return uri;
+    }
+    
+    /**
      * returns true if the view exists in the page map or false otherwise
      * @param viewId
      * @return true if the view exists in the page map or false otherwise



Mime
View raw message