You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2006/03/03 01:25:48 UTC
svn commit: r382587 - in /struts/shale/trunk/core-library: ./ src/conf/
src/designtime/org/apache/shale/component/
src/designtime/org/apache/shale/design/
src/designtime/org/apache/shale/validator/
src/java/org/apache/shale/component/ src/java/org/apac...
Author: craigmcc
Date: Thu Mar 2 16:25:46 2006
New Revision: 382587
URL: http://svn.apache.org/viewcvs?rev=382587&view=rev
Log:
Add static design time information (BeanInfo classes) for the three
nonvisual components and the converter. Doesn't import successfully
yet ... I get a wierd NoClassDefFoundError for LogFactory that I need
to investigate on multiple platforms.
Added:
struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java (with props)
struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java (with props)
struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java (with props)
struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java (with props)
struts/shale/trunk/core-library/src/test/org/apache/shale/design/
struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java (with props)
Modified:
struts/shale/trunk/core-library/build.xml
struts/shale/trunk/core-library/src/conf/complib-config.xml
struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/Bundle.properties
struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java
struts/shale/trunk/core-library/src/java/org/apache/shale/taglib/CommonsValidatorTag.java
struts/shale/trunk/core-library/src/java/org/apache/shale/validator/CommonsValidator.java
Modified: struts/shale/trunk/core-library/build.xml
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=382587&r1=382586&r2=382587&view=diff
==============================================================================
--- struts/shale/trunk/core-library/build.xml (original)
+++ struts/shale/trunk/core-library/build.xml Thu Mar 2 16:25:46 2006
@@ -136,8 +136,14 @@
<pathelement location="${spring-core.jar}"/>
<pathelement location="${spring-web.jar}"/>
<pathelement location="${build.home}/classes"/>
+ <pathelement location="${build.home}/creator2"/>
<pathelement location="${build.home}/test-classes"/>
<pathelement location="${tiles.jar}"/>
+ <pathelement location="${lib.dir}/creator2/com-sun-rave-designtime.jar"/>
+ <pathelement location="${lib.dir}/creator2/jsfcl.jar"/>
+ <pathelement location="${lib.dir}/creator2/jsfcl-dt.jar"/>
+ <pathelement location="${lib.dir}/creator2/openide.jar"/>
+ <pathelement location="${lib.dir}/creator2/propertyeditors.jar"/>
</path>
<!-- Conditional Processing Flags -->
@@ -446,6 +452,8 @@
<fileset dir="${build.home}/lib"
includes="shale-core.jar shale-designtime.jar shale-remoting.jar shale-doc.zip shale-src.zip"/>
</copy>
+ <copy todir="${build.home}/complib"
+ file="${commons-validator.jar}"/>
<mkdir dir="${build.home}/complib/META-INF"/>
<copy todir="${build.home}/complib/META-INF"
file="src/conf/complib-config.xml"/>
@@ -527,6 +535,8 @@
source="${platform.source}"
target="${platform.target}">
<classpath refid="test.classpath" />
+ <exclude name="org/apache/shale/design/**"
+ unless="creator2.present"/>
</javac>
<!-- Copy non-Java Sources -->
Modified: struts/shale/trunk/core-library/src/conf/complib-config.xml
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/conf/complib-config.xml?rev=382587&r1=382586&r2=382587&view=diff
==============================================================================
--- struts/shale/trunk/core-library/src/conf/complib-config.xml (original)
+++ struts/shale/trunk/core-library/src/conf/complib-config.xml Thu Mar 2 16:25:46 2006
@@ -30,6 +30,7 @@
<runtimePath>
<pathElement>shale-core.jar</pathElement>
<pathElement>shale-remoting.jar</pathElement>
+ <pathElement>commons-validator.jar</pathElement>
</runtimePath>
<designTimePath
prependRuntimePath="true">
Added: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java?rev=382587&view=auto
==============================================================================
--- struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java (added)
+++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java Thu Mar 2 16:25:46 2006
@@ -0,0 +1,72 @@
+/*
+ * Copyright 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.component;
+
+import com.sun.rave.designtime.Constants;
+import org.apache.shale.design.AbstractBeanInfo;
+import org.apache.shale.design.Categories;
+
+/**
+ * <p><code>BeanInfo</code> for the {@link Subview} component.</p>
+ */
+public class SubviewBeanInfo extends AbstractBeanInfo {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ /**
+ * <p>Create a new instance of <code>SubviewBeanInfo</code>.</p>
+ */
+ public SubviewBeanInfo() {
+
+ super(Subview.class);
+
+ }
+
+
+ // ------------------------------------------------------- Protected Methods
+
+
+ /**
+ * <p>Customize our <code>BeanDescriptor</code>.</p>
+ */
+ protected void initBeanDescriptor() throws Exception {
+
+ super.initBeanDescriptor();
+
+ beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
+ "subview");
+ beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
+ Boolean.TRUE);
+ beanDescriptor.setValue(Constants.BeanDescriptor.MARKUP_SECTION,
+ "FORM");
+ beanDescriptor.setValue(Constants.BeanDescriptor.PROPERTY_CATEGORIES,
+ Categories.CATEGORIES);
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
+ "subview");
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
+ "s");
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
+ "http://struts.apache.org/shale/core");
+
+ }
+
+
+}
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java?rev=382587&view=auto
==============================================================================
--- struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java (added)
+++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java Thu Mar 2 16:25:46 2006
@@ -0,0 +1,72 @@
+/*
+ * Copyright 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.component;
+
+import com.sun.rave.designtime.Constants;
+import org.apache.shale.design.AbstractBeanInfo;
+import org.apache.shale.design.Categories;
+
+/**
+ * <p><code>BeanInfo</code> for the {@link Token} component.</p>
+ */
+public class TokenBeanInfo extends AbstractBeanInfo {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ /**
+ * <p>Create a new instance of <code>TokenBeanInfo</code>.</p>
+ */
+ public TokenBeanInfo() {
+
+ super(Token.class);
+
+ }
+
+
+ // ------------------------------------------------------- Protected Methods
+
+
+ /**
+ * <p>Customize our <code>BeanDescriptor</code>.</p>
+ */
+ protected void initBeanDescriptor() throws Exception {
+
+ super.initBeanDescriptor();
+
+ beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
+ "token");
+ beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
+ Boolean.FALSE);
+ beanDescriptor.setValue(Constants.BeanDescriptor.MARKUP_SECTION,
+ "FORM");
+ beanDescriptor.setValue(Constants.BeanDescriptor.PROPERTY_CATEGORIES,
+ Categories.CATEGORIES);
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
+ "token");
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
+ "s");
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
+ "http://struts.apache.org/shale/core");
+
+ }
+
+
+}
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java?rev=382587&view=auto
==============================================================================
--- struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java (added)
+++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java Thu Mar 2 16:25:46 2006
@@ -0,0 +1,98 @@
+/*
+ * Copyright 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.component;
+
+import com.sun.rave.designtime.Constants;
+import com.sun.rave.designtime.markup.AttributeDescriptor;
+import java.beans.PropertyDescriptor;
+import org.apache.shale.design.AbstractBeanInfo;
+import org.apache.shale.design.Categories;
+
+/**
+ * <p><code>BeanInfo</code> for the {@link ValidatorScript} component.</p>
+ */
+public class ValidatorScriptBeanInfo extends AbstractBeanInfo {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ /**
+ * <p>Create a new instance of <code>ValidatorScriptBeanInfo</code>.</p>
+ */
+ public ValidatorScriptBeanInfo() {
+
+ super(ValidatorScript.class);
+
+ }
+
+
+ // ------------------------------------------------------- Protected Methods
+
+
+ /**
+ * <p>Customize our <code>BeanDescriptor</code>.</p>
+ */
+ protected void initBeanDescriptor() throws Exception {
+
+ super.initBeanDescriptor();
+
+ beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
+ "validatorScript");
+ beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
+ Boolean.FALSE);
+ beanDescriptor.setValue(Constants.BeanDescriptor.MARKUP_SECTION,
+ "FORM");
+ beanDescriptor.setValue(Constants.BeanDescriptor.PROPERTY_CATEGORIES,
+ Categories.CATEGORIES);
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAG_NAME,
+ "validatorScript");
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_PREFIX,
+ "s");
+ beanDescriptor.setValue(Constants.BeanDescriptor.TAGLIB_URI,
+ "http://struts.apache.org/shale/core");
+
+ }
+
+
+ /**
+ * <p>Customize our <code>PropertyDescriptor</code>s.</p>
+ */
+ protected void initPropertyDescriptors() throws Exception {
+
+ super.initPropertyDescriptors();
+
+ AttributeDescriptor ad = null;
+ PropertyDescriptor pd = null;
+
+ pd = new PropertyDescriptor("functionName", beanClass);
+ pd.setDisplayName(bundle.getString("ValidatorScript.functionName.displayName"));
+ pd.setShortDescription(bundle.getString("ValidatorScript.functionName.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ ad = new AttributeDescriptor("functionName", false, null, true);
+ pd.setValue(Constants.PropertyDescriptor.ATTRIBUTE_DESCRIPTOR, ad);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.JAVASCRIPT);
+ propDescriptorsList.add(pd);
+
+ }
+
+
+}
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/Bundle.properties
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/Bundle.properties?rev=382587&r1=382586&r2=382587&view=diff
==============================================================================
--- struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/Bundle.properties (original)
+++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/Bundle.properties Thu Mar 2 16:25:46 2006
@@ -172,4 +172,51 @@
Subview.shortDescription=Shale subview that supports ViewController callbacks
+# -----------------------------------------------------------------------------
+# org.apache.shale.component.Token
+# -----------------------------------------------------------------------------
+Token.displayName=Token
+Token.shortDescription=Generate token to catch duplicate submits
+
+
+# -----------------------------------------------------------------------------
+# org.apache.shale.component.ValidatorScript
+# -----------------------------------------------------------------------------
+
+ValidatorScript.displayName=Validator Script
+ValidatorScript.shortDescription=Generate javascript validations for the containing form
+
+ValidatorScript.functionName.displayName=Function Name
+ValidatorScript.functionName.shortDescription=Name of the JavaScript function to be created
+
+
+# -----------------------------------------------------------------------------
+# org.apache.shale.validator.CommonsValidator
+# -----------------------------------------------------------------------------
+
+CommonsValidator.displayName=Commons Validator
+CommonsValidator.shortDescription=Register a Commons Validator of the specified type
+
+CommonsValidator.arg.displayName=Failure Message Argument
+CommonsValidator.arg.shortDescription=Parameter for the failure message
+CommonsValidator.client.displayName=Client Side Validation Flag
+CommonsValidator.client.shortDescription=Flag to enable client side validation
+CommonsValidator.datePatternStrict.displayName=Strict Date Pattern Matching Flag
+CommonsValidator.datePatternStrict.shortDescription=Flag to enable strict date pattern matching
+CommonsValidator.message.displayName=Failure Message
+CommonsValidator.message.shortDescription=Error message to display when validation fails
+CommonsValidator.mask.displayName=Regular Expression Mask
+CommonsValidator.mask.shortDescription=Regular expression that must be matched
+CommonsValidator.max.displayName=Maximum Value
+CommonsValidator.max.shortDescription=Maximum numeric value to be allowed
+CommonsValidator.maxLength.displayName=Maximum Length
+CommonsValidator.maxLength.shortDescription=Maximum length to be allowed
+CommonsValidator.min.displayName=Minimum Value
+CommonsValidator.min.shortDescription=Minimum numeric value to be allowed
+CommonsValidator.minLength.displayName=Minimum Length
+CommonsValidator.minLength.shortDescription=Minimum length to be allowed
+CommonsValidator.server.displayName=Server Side Validation Flag
+CommonsValidator.server.shortDescription=Flag to enable server side validation
+CommonsValidator.type.displayName=Validator Type
+CommonsValidator.type.shortDescription=Commons Validator type to register
Added: struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java?rev=382587&view=auto
==============================================================================
--- struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java (added)
+++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java Thu Mar 2 16:25:46 2006
@@ -0,0 +1,171 @@
+/*
+ * Copyright 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.validator;
+
+import com.sun.rave.designtime.Constants;
+import java.beans.PropertyDescriptor;
+import org.apache.shale.design.AbstractBeanInfo;
+import org.apache.shale.design.Categories;
+
+/**
+ * <p><code>BeanInfo</code> for the {@link CommonsValidator} validator.</p>
+ */
+public class CommonsValidatorBeanInfo extends AbstractBeanInfo {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ /**
+ * <p>Create a new instance of <code>CommonsValidatorBeanInfo</code>.</p>
+ */
+ public CommonsValidatorBeanInfo() {
+
+ super(CommonsValidator.class);
+
+ }
+
+
+ // ------------------------------------------------------- Protected Methods
+
+
+ /**
+ * <p>Customize our <code>BeanDescriptor</code>.</p>
+ */
+ protected void initBeanDescriptor() throws Exception {
+
+ super.initBeanDescriptor();
+
+ beanDescriptor.setValue(Constants.BeanDescriptor.INSTANCE_NAME,
+ "commonsValidator");
+ beanDescriptor.setValue(Constants.BeanDescriptor.IS_CONTAINER,
+ Boolean.FALSE);
+ beanDescriptor.setValue(Constants.BeanDescriptor.PROPERTY_CATEGORIES,
+ Categories.CATEGORIES);
+ beanDescriptor.setValue(Constants.BeanDescriptor.TRAY_COMPONENT,
+ Boolean.TRUE);
+
+ }
+
+
+ /**
+ * <p>Customize our <code>PropertyDescriptor</code>s.</p>
+ */
+ protected void initPropertyDescriptors() throws Exception {
+
+ // This is not a JSF component class, so do *not* call
+ // our superclass initializer method here!
+ // super.initPropertyDescriptors();
+
+ PropertyDescriptor pd = null;
+
+ pd = new PropertyDescriptor("arg", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.arg.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.arg.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("client", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.client.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.client.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.ADVANCED);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("mask", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.mask.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.mask.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("max", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.max.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.max.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("maxLength", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.maxLength.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.maxLength.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("message", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.message.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.message.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("min", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.min.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.min.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("minLength", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.minLength.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.minLength.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("server", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.server.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.server.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.ADVANCED);
+ propDescriptorsList.add(pd);
+
+ pd = new PropertyDescriptor("type", beanClass);
+ pd.setDisplayName(bundle.getString("CommonsValidator.type.displayName"));
+ pd.setShortDescription(bundle.getString("CommonsValidator.type.shortDescription"));
+ pd.setExpert(false);
+ pd.setHidden(false);
+ pd.setPreferred(false);
+ pd.setValue(Constants.PropertyDescriptor.CATEGORY, Categories.DATA);
+ propDescriptorsList.add(pd);
+
+ }
+
+
+}
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java?rev=382587&r1=382586&r2=382587&view=diff
==============================================================================
--- struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java (original)
+++ struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java Thu Mar 2 16:25:46 2006
@@ -28,6 +28,7 @@
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.el.ValueBinding;
import org.apache.commons.validator.ValidatorAction;
import org.apache.shale.validator.CommonsValidator;
@@ -46,6 +47,12 @@
/**
+ * <p>The value of the <code>functionName</code> property.</p>
+ */
+ private String functionName;
+
+
+ /**
* <p>A map of validators, representing all of the Commons Validators
* attached to components in the current component hierarchy.
* The keys of the map are validator type names. The values are
@@ -73,7 +80,56 @@
}
- /**
+ /**
+ * <p>Return the value of the <code>functionName</code> property.</p>
+ */
+ public String getFunctionName() {
+ if (this.functionName != null) {
+ return functionName;
+ }
+ ValueBinding _vb = getValueBinding("functionName");
+ if (_vb != null) {
+ return (String) _vb.getValue(getFacesContext());
+ } else {
+ return null;
+ }
+ }
+
+
+ /**
+ * <p>Set the value of the <code>functionName</code> property.</p>
+ */
+ public void setFunctionName(String functionName) {
+ this.functionName = functionName;
+ }
+
+
+ /**
+ * <p>Restore the state of this component.</p>
+ */
+ public void restoreState(FacesContext context, Object state) {
+
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ this.functionName = (String) values[1];
+
+ }
+
+
+ /**
+ * <p>Save the state of this component.</p>
+ */
+ public Object saveState(FacesContext context) {
+
+ Object values[] = new Object[2];
+ values[0] = super.saveState(context);
+ values[1] = this.functionName;
+ return values;
+
+ }
+
+
+ /**
* <p>Registers a validator according to type and id.
*
* @param type The type of the validator
Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/taglib/CommonsValidatorTag.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/taglib/CommonsValidatorTag.java?rev=382587&r1=382586&r2=382587&view=diff
==============================================================================
--- struts/shale/trunk/core-library/src/java/org/apache/shale/taglib/CommonsValidatorTag.java (original)
+++ struts/shale/trunk/core-library/src/java/org/apache/shale/taglib/CommonsValidatorTag.java Thu Mar 2 16:25:46 2006
@@ -264,8 +264,8 @@
// parameters for specific validators
validator.setMin(tagUtils.evalDouble(min));
validator.setMax(tagUtils.evalDouble(max));
- validator.setMinlength(tagUtils.evalInteger(minlength));
- validator.setMaxlength(tagUtils.evalInteger(maxlength));
+ validator.setMinLength(tagUtils.evalInteger(minlength));
+ validator.setMaxLength(tagUtils.evalInteger(maxlength));
validator.setDatePatternStrict(tagUtils.evalString(
datePatternStrict));
validator.setMask(tagUtils.evalString(mask));
Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/validator/CommonsValidator.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/validator/CommonsValidator.java?rev=382587&r1=382586&r2=382587&view=diff
==============================================================================
--- struts/shale/trunk/core-library/src/java/org/apache/shale/validator/CommonsValidator.java (original)
+++ struts/shale/trunk/core-library/src/java/org/apache/shale/validator/CommonsValidator.java Thu Mar 2 16:25:46 2006
@@ -252,6 +252,13 @@
/**
+ * <p>The getter method for the <code>message</code> property. This property is
+ * passed through to the Commons Validator.</p>
+ */
+ public String getMessage() { return message; }
+
+
+ /**
* <p>The setter method for the <code>arg</code> property. This property is
* passed through to the Commons Validator.</p>
*
@@ -277,6 +284,13 @@
/**
+ * <p>The getter method for the <code>min</code> property. This property is
+ * passed through to the Commons Validator.</p>
+ */
+ public Double getMin() { return min; }
+
+
+ /**
* <p>The setter method for the <code>max</code> property. This property is
* passed through to the Commons Validator.</p>
*
@@ -286,12 +300,26 @@
/**
+ * <p>The getter method for the <code>max</code> property. This property is
+ * passed through to the Commons Validator.</p>
+ */
+ public Double getMax() { return max; }
+
+
+ /**
* <p>The setter method for the <code>minlength</code> property. This property is
* passed through to the Commons Validator.</p>
*
* @param newValue The new value for the <code>minlength</code> property.
*/
- public void setMinlength(Integer newValue) { minlength = newValue; }
+ public void setMinLength(Integer newValue) { minlength = newValue; }
+
+
+ /**
+ * <p>The getter method for the <code>minLength</code> property. This property is
+ * passed through to the Commons Validator.</p>
+ */
+ public Integer getMinLength() { return minlength; }
/**
@@ -300,7 +328,14 @@
*
* @param newValue The new value for the <code>maxlength</code> property.
*/
- public void setMaxlength(Integer newValue) { maxlength = newValue; }
+ public void setMaxLength(Integer newValue) { maxlength = newValue; }
+
+
+ /**
+ * <p>The getter method for the <code>maxLength</code> property. This property is
+ * passed through to the Commons Validator.</p>
+ */
+ public Integer getMaxLength() { return maxlength; }
/**
@@ -313,6 +348,13 @@
/**
+ * <p>The getter method for the <code>mask</code> property. This property is
+ * passed through to the Commons Validator.</p>
+ */
+ public String getMask() { return mask; }
+
+
+ /**
* <p>The setter method for the <code>datePatternStrict</code> property. This property is
* passed through to the Commons Validator.</p>
*
@@ -323,6 +365,13 @@
datePatternStrict = newValue;
}
+
+ /**
+ * <p>The getter method for the <code>datePatternStrict</code> property. This property is
+ * passed through to the Commons Validator.</p>
+ */
+ public String getDatePatternStrict() { return datePatternStrict; }
+
/**
* <p>Add a parameter for the specific validator being used.</p>
Added: struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java
URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java?rev=382587&view=auto
==============================================================================
--- struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java (added)
+++ struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java Thu Mar 2 16:25:46 2006
@@ -0,0 +1,94 @@
+/*
+ * Copyright 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.
+ *
+ * $Id$
+ */
+
+package org.apache.shale.design;
+
+import java.beans.BeanInfo;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import org.apache.shale.component.SubviewBeanInfo;
+import org.apache.shale.component.TokenBeanInfo;
+import org.apache.shale.component.ValidatorScriptBeanInfo;
+import org.apache.shale.validator.CommonsValidatorBeanInfo;
+
+/**
+ * <p>Unit tests for the Creator2 design time classes.</p>
+ */
+public class DesignTimeTestCase extends TestCase {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ // Construct a new instance of this test case.
+ public DesignTimeTestCase(String name) {
+ super(name);
+ }
+
+
+ // ---------------------------------------------------- Overall Test Methods
+
+
+ // Set up instance variables required by this test case.
+ public void setUp() {
+
+ }
+
+
+ // Return the tests included in this test case.
+ public static Test suite() {
+
+ return (new TestSuite(DesignTimeTestCase.class));
+
+ }
+
+ // Tear down instance variables required by this test case.
+ public void tearDown() {
+
+ }
+
+
+ // ------------------------------------------------------ Instance Variables
+
+
+
+ // ------------------------------------------------------------ Test Methods
+
+
+ public void testCommonsValidatorBeanInfo() {
+ BeanInfo bi = new CommonsValidatorBeanInfo();
+ }
+
+
+ public void testSubviewBeanInfo() {
+ BeanInfo bi = new SubviewBeanInfo();
+ }
+
+
+ public void testTokenBeanInfo() {
+ BeanInfo bi = new TokenBeanInfo();
+ }
+
+
+ public void testValidatorScriptBeanInfo() {
+ BeanInfo bi = new ValidatorScriptBeanInfo();
+ }
+
+
+}
Propchange: struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org