You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/11/13 04:58:42 UTC
svn commit: r1034639 - in /myfaces/commons/trunk/examples:
myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/
myfaces-commons-examples/src/main/java/org/apache/myfaces/examples/
myfaces-commons-examples/src/main/webapp...
Author: lu4242
Date: Sat Nov 13 03:58:42 2010
New Revision: 1034639
URL: http://svn.apache.org/viewvc?rev=1034639&view=rev
Log:
move beans to commons package
Added:
myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/
myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java
myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java
myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java
Removed:
myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/examples/
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/examples/
Modified:
myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/ (props changed)
myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml
Added: myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java?rev=1034639&view=auto
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java (added)
+++ myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java Sat Nov 13 03:58:42 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.examples.validate;
+
+public enum EducationLevel
+{
+ NONE,
+ PRIMARY,
+ SECUNDARY,
+ UNIVERSITY,
+ MASTER,
+ DOCTOR
+}
\ No newline at end of file
Added: myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java?rev=1034639&view=auto
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java (added)
+++ myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java Sat Nov 13 03:58:42 2010
@@ -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.
+ */
+package org.apache.myfaces.examples.validate;
+
+public class ValidateEnum
+{
+
+ private EducationLevel level;
+
+ public EducationLevel getLevel()
+ {
+ return level;
+ }
+
+ public void setLevel(EducationLevel level)
+ {
+ this.level = level;
+ }
+
+}
Added: myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java?rev=1034639&view=auto
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java (added)
+++ myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java Sat Nov 13 03:58:42 2010
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.examples.validate;
+
+/**
+ * @author mwessendorf
+ * @version $Revision: 673801 $ $Date: 2008-07-03 15:58:48 -0500 (Jue, 03 Jul 2008) $
+ */
+public class ValidateForm {
+
+ private String email = null;
+ private String email2 = null;
+ private String creditCardNumber = null;
+ private String url = null;
+ private String regExpr = null;
+
+ private String equal = null;
+ private String equal2 = null;
+
+ private String isbn =null;
+
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String string) {
+ email = string;
+ }
+
+ public String submit(){
+ System.out.println("Action was called.");
+ return ("valid");
+ }
+
+ public String getCreditCardNumber() {
+ return creditCardNumber;
+ }
+ public String getUrl(){
+ return url;
+ }
+ public void setCreditCardNumber(String string) {
+ creditCardNumber = string;
+ }
+ public void setUrl(String string) {
+ url = string;
+ }
+
+ public String getEmail2() {
+ return email2;
+ }
+
+ public void setEmail2(String string) {
+ email2 = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getRegExpr() {
+ return regExpr;
+ }
+
+ /**
+ * @param string
+ */
+ public void setRegExpr(String string) {
+ regExpr = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getEqual2() {
+ return equal2;
+ }
+
+ /**
+ * @param string
+ */
+ public void setEqual2(String string) {
+ equal2 = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getEqual() {
+ return equal;
+ }
+
+ /**
+ * @param string
+ */
+ public void setEqual(String string) {
+ equal = string;
+ }
+
+ public String getIsbn() {
+ return isbn;
+ }
+ public void setIsbn(String isbn) {
+ this.isbn = isbn;
+ }
+}
Modified: myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml?rev=1034639&r1=1034638&r2=1034639&view=diff
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/commons/trunk/examples/myfaces-commons-examples/src/main/webapp/WEB-INF/faces-config.xml Sat Nov 13 03:58:42 2010
@@ -10,12 +10,12 @@
<!-- validation -->
<managed-bean>
<managed-bean-name>validateForm</managed-bean-name>
- <managed-bean-class>org.apache.myfaces.examples.validate.ValidateForm</managed-bean-class>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>validateEnum</managed-bean-name>
- <managed-bean-class>org.apache.myfaces.examples.validate.ValidateEnum</managed-bean-class>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateEnum</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
Added: myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java?rev=1034639&view=auto
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java (added)
+++ myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java Sat Nov 13 03:58:42 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.examples.validate;
+
+public enum EducationLevel
+{
+ NONE,
+ PRIMARY,
+ SECUNDARY,
+ UNIVERSITY,
+ MASTER,
+ DOCTOR
+}
\ No newline at end of file
Added: myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java?rev=1034639&view=auto
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java (added)
+++ myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java Sat Nov 13 03:58:42 2010
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.examples.validate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+/**
+ * @author mwessendorf
+ * @version $Revision: 673801 $ $Date: 2008-07-03 22:58:48 +0200 (Thu, 03 Jul 2008) $
+ */
+public class ValidateCreditCard {
+
+ private String creditCardNumber = null;
+
+ private String creditCardType = "MASTERCARD";
+
+ private List<SelectItem> types = null;
+
+ public List<SelectItem> getCreditCardTypes()
+ {
+ if (types == null)
+ {
+ types = new ArrayList<SelectItem>();
+ types.add(new SelectItem("MASTERCARD"));
+ types.add(new SelectItem("VISA"));
+ types.add(new SelectItem("DISCOVER"));
+ types.add(new SelectItem("AMEX"));
+ }
+ return types;
+ }
+
+ public String submit(){
+ System.out.println("Action was called.");
+ return ("valid");
+ }
+
+ public String getCreditCardNumber() {
+ return creditCardNumber;
+ }
+
+ public void setCreditCardNumber(String string) {
+ creditCardNumber = string;
+ }
+
+ public String getCreditCardType()
+ {
+ return creditCardType;
+ }
+
+ public void setCreditCardType(String creditCardType)
+ {
+ this.creditCardType = creditCardType;
+ }
+
+ public boolean isAmex()
+ {
+ return "AMEX".equalsIgnoreCase(creditCardType);
+ }
+
+ public boolean isVisa()
+ {
+ return "VISA".equalsIgnoreCase(creditCardType);
+ }
+
+ public boolean isMastercard()
+ {
+ return "MASTERCARD".equalsIgnoreCase(creditCardType);
+ }
+
+ public boolean isDiscover()
+ {
+ return "DISCOVER".equalsIgnoreCase(creditCardType);
+ }
+}
Added: myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java?rev=1034639&view=auto
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java (added)
+++ myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java Sat Nov 13 03:58:42 2010
@@ -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.
+ */
+package org.apache.myfaces.examples.validate;
+
+public class ValidateEnum
+{
+
+ private EducationLevel level;
+
+ public EducationLevel getLevel()
+ {
+ return level;
+ }
+
+ public void setLevel(EducationLevel level)
+ {
+ this.level = level;
+ }
+
+}
Added: myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java?rev=1034639&view=auto
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java (added)
+++ myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java Sat Nov 13 03:58:42 2010
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.examples.validate;
+
+/**
+ * @author mwessendorf
+ * @version $Revision: 673801 $ $Date: 2008-07-03 22:58:48 +0200 (Thu, 03 Jul 2008) $
+ */
+public class ValidateForm {
+
+ private String email = null;
+ private String email2 = null;
+ private String creditCardNumber = null;
+ private String url = null;
+ private String regExpr = null;
+
+ private String equal = null;
+ private String equal2 = null;
+
+ private String isbn =null;
+
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String string) {
+ email = string;
+ }
+
+ public String submit(){
+ System.out.println("Action was called.");
+ return ("valid");
+ }
+
+ public String getCreditCardNumber() {
+ return creditCardNumber;
+ }
+ public String getUrl(){
+ return url;
+ }
+ public void setCreditCardNumber(String string) {
+ creditCardNumber = string;
+ }
+ public void setUrl(String string) {
+ url = string;
+ }
+
+ public String getEmail2() {
+ return email2;
+ }
+
+ public void setEmail2(String string) {
+ email2 = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getRegExpr() {
+ return regExpr;
+ }
+
+ /**
+ * @param string
+ */
+ public void setRegExpr(String string) {
+ regExpr = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getEqual2() {
+ return equal2;
+ }
+
+ /**
+ * @param string
+ */
+ public void setEqual2(String string) {
+ equal2 = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getEqual() {
+ return equal;
+ }
+
+ /**
+ * @param string
+ */
+ public void setEqual(String string) {
+ equal = string;
+ }
+
+ public String getIsbn() {
+ return isbn;
+ }
+ public void setIsbn(String isbn) {
+ this.isbn = isbn;
+ }
+}
Propchange: myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Nov 13 03:58:42 2010
@@ -0,0 +1 @@
+.faces-config.xml.jsfdia
Modified: myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml?rev=1034639&r1=1034638&r2=1034639&view=diff
==============================================================================
--- myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/commons/trunk/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml Sat Nov 13 03:58:42 2010
@@ -21,12 +21,12 @@
<!-- validation -->
<managed-bean>
<managed-bean-name>validateForm</managed-bean-name>
- <managed-bean-class>org.apache.myfaces.examples.validate.ValidateForm</managed-bean-class>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>validateEnum</managed-bean-name>
- <managed-bean-class>org.apache.myfaces.examples.validate.ValidateEnum</managed-bean-class>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateEnum</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
@@ -41,7 +41,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>validateCreditCard</managed-bean-name>
- <managed-bean-class>org.apache.myfaces.examples.validate.ValidateCreditCard</managed-bean-class>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateCreditCard</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>