myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkien...@apache.org
Subject svn commit: r523880 - in /myfaces/tomahawk/trunk/sandbox/examples/src/main: java/org/apache/myfaces/examples/convertStringUtils/ webapp/ webapp/WEB-INF/
Date Thu, 29 Mar 2007 23:47:10 GMT
Author: mkienenb
Date: Thu Mar 29 16:47:10 2007
New Revision: 523880

URL: http://svn.apache.org/viewvc?view=rev&rev=523880
Log:
TOMAHAWK-420 - String Case Converter
Adding documentation and example.
Thanks to Julian Ray.

Added:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/ConvertStringUtilsBean.java
  (with props)
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/convertStringUtils.jsp   (with
props)
Modified:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/ConvertStringUtilsBean.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/ConvertStringUtilsBean.java?view=auto&rev=523880
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/ConvertStringUtilsBean.java
(added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/ConvertStringUtilsBean.java
Thu Mar 29 16:47:10 2007
@@ -0,0 +1,15 @@
+package org.apache.myfaces.examples.convertStringUtils;
+
+public class ConvertStringUtilsBean {
+
+	private String text;
+
+	public String getText() {
+		return text;
+	}
+
+	public void setText(String text) {
+		this.text = text;
+	}
+	
+}

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/ConvertStringUtilsBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/convertStringUtils/ConvertStringUtilsBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml?view=diff&rev=523880&r1=523879&r2=523880
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml Thu
Mar 29 16:47:10 2007
@@ -12,6 +12,14 @@
        <!--<phase-listener>org.apache.myfaces.examples.debug.DebugPhaseListener</phase-listener>
     --></lifecycle>
 
+    <!-- managed bean for convertStringUtils -->
+
+    <managed-bean>
+        <managed-bean-name>convertStringUtilsBean</managed-bean-name>
+        <managed-bean-class>org.apache.myfaces.examples.convertStringUtils.ConvertStringUtilsBean</managed-bean-class>
+        <managed-bean-scope>request</managed-bean-scope>
+    </managed-bean>
+
     <!-- managed bean for notifierBean-->
 
     <managed-bean>

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/convertStringUtils.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/convertStringUtils.jsp?view=auto&rev=523880
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/convertStringUtils.jsp (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/convertStringUtils.jsp Thu Mar
29 16:47:10 2007
@@ -0,0 +1,71 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+<%@ taglib uri="http://myfaces.apache.org/sandbox" prefix="s"%>
+<html>
+
+<!--
+/*
+ * Copyright 2004-2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+//-->
+
+<%@include file="inc/head.inc" %>
+
+<body>
+
+<f:view>
+
+    <h:form>
+	    <f:verbatim>
+	    This component demonstrates use of the convertStringUtils converter. The converter can
operate on strings and perform
+	    some basic manipulation including change to upper and lower case, capitalize the string,
trim the string and truncate
+	    a string at a fixed length.
+	    </f:verbatim>
+	    <t:htmlTag value="br"/>
+	    <t:htmlTag value="br"/>
+        <h:outputText value="Input a long line of text: "/>
+        <h:inputText value="#{convertStringUtilsBean.text}" size="48" />        
+        <h:commandButton value="Submit" action="none"/>        
+	    <t:htmlTag value="br"/>
+	    <t:htmlTag value="br"/>
+	    <t:htmlTag value="br"/>
+	    <t:htmlTag value="br"/>
+	    <h:outputText value="Raw text: " />
+	    <h:outputText value="#{convertStringUtilsBean.text}" />
+	    <t:htmlTag value="br"/>
+	    <h:outputText value="Changed to upper case: " />
+	    <h:outputText value="#{convertStringUtilsBean.text}" >
+	    	<s:convertStringUtils format="uppercase" trim="true" />
+	    </h:outputText>
+	    <t:htmlTag value="br"/>
+	    <h:outputText value="Changed to lower case: " />
+	    <h:outputText value="#{convertStringUtilsBean.text}" >
+	    	<s:convertStringUtils format="lowercase" trim="true" />
+	    </h:outputText>
+	    <t:htmlTag value="br"/>
+	    <h:outputText value="Truncated to 40 chars: " />
+	    <h:outputText value="#{convertStringUtilsBean.text}" >
+	    	<s:convertStringUtils trim="true" maxLength="40" appendEllipsesDuringOutput="true"/>
+	    </h:outputText>	    
+    </h:form>
+</f:view>
+
+<%@include file="inc/page_footer.jsp" %>
+
+</body>
+
+</html>

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/convertStringUtils.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/convertStringUtils.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp?view=diff&rev=523880&r1=523879&r2=523880
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp Thu Mar 29 16:47:10 2007
@@ -26,12 +26,7 @@
                 <f:verbatim><a href="#imageLoop">Image loop - slide show component</a></f:verbatim>
                 <f:verbatim><a href="#partialPageRendering">Partial Page Rendering</a></f:verbatim>
                 <f:verbatim><a href="#filterTable">Filter Table</a></f:verbatim>
-                <h:outputText value="Client Side Validation"/>
-	            <h:panelGrid style="padding-left:25px">
-   		            <h:outputLink value="clientValidationWithStandardForm.jsf"><f:verbatim>Conversion&Validation
with Standart Form</f:verbatim></h:outputLink>
- 		            <h:outputLink value="clientValidationWithExtForm.jsf"><f:verbatim>Conversion&Validation
with Extended Form</f:verbatim></h:outputLink>
-	            	<h:outputLink value="clientValidation.jsf"><f:verbatim>Conversion&Validation
with ValidationScript Component</f:verbatim></h:outputLink>
-	            </h:panelGrid>
+                <f:verbatim><a href="#ClientSideValidation">Client-Side Validation</a></f:verbatim>
             </h:panelGrid>
 
             <f:verbatim><a name="partialPageRendering" /></f:verbatim>
@@ -60,16 +55,30 @@
             	<h:outputLink value="stateChangedNotifier.jsf"><f:verbatim>stateChangedNotifier
- Shows a confirmation message if some of the fields in the form have changed</f:verbatim></h:outputLink>
             	<h:outputLink value="timedNotifier.jsf"><f:verbatim>timedNotifier
- Shows a time triggered notification dialog</f:verbatim></h:outputLink>
 
-	            <h:outputLink value="dateTimeConverter.jsf"><f:verbatim>DateTimeConverter
- a datetime converter that uses system timezone as default</f:verbatim></h:outputLink>
 	            <h:outputLink value="valueChangeNotifier.jsf"><f:verbatim>valueChangeNotifier
- Calls a custom valueChangeEvent method during MODEL_UPDATE Phase of the Faces Lifecycle</f:verbatim></h:outputLink>
 	            <h:outputLink value="form.jsf"><f:verbatim>Form component. Standard
form vs. Tomahawk/Sandbox form</f:verbatim></h:outputLink>
 
+	            <h:outputText value="Conversion"/>
+	            <h:panelGrid style="padding-left:25px">
+	                <h:outputLink value="dateTimeConverter.jsf"><f:verbatim>convertDateTime
- a datetime converter that uses system timezone as default</f:verbatim></h:outputLink>
+                    <h:outputLink value="typedNumberConvert.jsf"><f:verbatim>convertNumber
- automatically convert the number to the correct type</f:verbatim></h:outputLink>
+	                <h:outputLink value="convertStringUtils.jsf"><f:verbatim>convertStringUtils
- a datetime converter that uses system timezone as default</f:verbatim></h:outputLink>
+	            </h:panelGrid>
+
 	            <h:outputText value="Validation"/>
 	            <h:panelGrid style="padding-left:25px">
 	            	<h:outputLink value="validateUrl.jsf" ><f:verbatim>Validation example
2 - including URL validator</f:verbatim></h:outputLink>
 	            	<h:outputLink value="validateCompareTo.jsf" ><f:verbatim>validateCompareTo
- Compare values on two different components</f:verbatim></h:outputLink>
 	            	<h:outputLink value="subForm.jsf"><f:verbatim>SubForm - Partial
validation and model update with SubForms</f:verbatim></h:outputLink>
 	            	<h:outputLink value="validateCSV.jsf"><f:verbatim>CSVValidator
- validate comma separated values with a given (sub)validator</f:verbatim></h:outputLink>
+	                
+            		<f:verbatim><a name="ClientSideValidation" /></f:verbatim>
+	                <h:outputText value="Client Side Validation"/>
+		            <h:panelGrid style="padding-left:25px">
+	   		            <h:outputLink value="clientValidationWithStandardForm.jsf"><f:verbatim>Conversion&Validation
with Standart Form</f:verbatim></h:outputLink>
+	 		            <h:outputLink value="clientValidationWithExtForm.jsf"><f:verbatim>Conversion&Validation
with Extended Form</f:verbatim></h:outputLink>
+		            	<h:outputLink value="clientValidation.jsf"><f:verbatim>Conversion&Validation
with ValidationScript Component</f:verbatim></h:outputLink>
+		            </h:panelGrid>
 	            </h:panelGrid>
 
             </h:panelGrid>
@@ -121,7 +130,6 @@
            		<h:outputLink value="effect.jsf" ><f:verbatim>Effect - DOJO and
script.aculo.us effects</f:verbatim></h:outputLink>
                 <f:verbatim><a name="imageLoop" /></f:verbatim><h:outputLink
value="imageloop.jsf" ><f:verbatim>Image loop/slide show with fading effects based
on Dojo</f:verbatim></h:outputLink>
 	            <h:outputLink value="killSession.jsf"><f:verbatim>Kill Session -
refreshes state</f:verbatim></h:outputLink>
-                <h:outputLink value="typedNumberConvert.jsf"><f:verbatim>automatically
convert the number to the correct type</f:verbatim></h:outputLink>
 
             </h:panelGrid>
             <h:panelGrid style="padding-left:25px">



Mime
View raw message