You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2006/10/15 15:33:54 UTC
svn commit: r464192 [1/4] - in /myfaces/tomahawk/trunk/sandbox15: core/
core/src/main/java/org/ core/src/main/java/org/apache/
core/src/main/java/org/apache/myfaces/
core/src/main/java/org/apache/myfaces/custom/
core/src/main/java/org/apache/myfaces/cu...
Author: imario
Date: Sun Oct 15 06:33:49 2006
New Revision: 464192
URL: http://svn.apache.org/viewvc?view=rev&rev=464192
Log:
finish sandbox15 setup, created environment for examples webapp.
Initial import of dynaForm - TOMAHAWK-741
Added:
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/GuiBuilder.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/Slipstream.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/jsf/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/jsf/JsfGuiBuilder.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/jsf/JsfGuiBuilderDecorator.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/jsf/JsfGuiBuilderFactory.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/jsf/JsfGuiElementBuilder.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/jsf/NewComponentListener.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/myfaces/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/myfaces/MyFacesCheck.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/impl/myfaces/MyFacesGuiBuilder.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/jsfext/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/jsfext/ComponentUtils.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/jsfext/EnumConverter.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/jsfext/UIComponentTagUtils.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/ConditionEnum.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/DefaultValueMap.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/DynaFormException.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/MatchModeEnum.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/NullObject.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/ObjectSerializationConverter.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/OrderDirectionEnum.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/SelectionSourceEnum.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/SelectionTypeEnum.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/lib/ViewType.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/Extractor.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/FieldInterface.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/MetaData.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/MetaDataInterface.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/RelationType.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/Selection.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/ejb/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/ejb/BcelHelper.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/ejb/ClassHelper.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/ejb/ClassHelperFactory.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/ejb/EjbExtractor.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/ejb/JavaHelper.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/hibernate/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/hibernate/HibernateExtractor.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/jsf/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/jsf/AbstractJsfExtractor.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/jsf/JsfExclusiveExtractor.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/jsf/JsfExtractor.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/impl/jsf/JsfRequestFieldExtractor.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/utils/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/metadata/utils/TypeInfos.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/uri/
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/uri/FacesUriResolver.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/uri/UriResolver.java (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/resources-facesconfig/
myfaces/tomahawk/trunk/sandbox15/core/src/main/resources-facesconfig/META-INF/
myfaces/tomahawk/trunk/sandbox15/core/src/main/resources-facesconfig/META-INF/dynaForm-default.xml (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/resources-facesconfig/META-INF/faces-config.xml (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/tld/
myfaces/tomahawk/trunk/sandbox15/core/src/main/tld/misc/
myfaces/tomahawk/trunk/sandbox15/core/src/main/tld/misc/resolve_entities.xsl (with props)
myfaces/tomahawk/trunk/sandbox15/core/src/main/tld/myfaces_sandbox15.tld
myfaces/tomahawk/trunk/sandbox15/examples/src/main/java/org/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/java/org/apache/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/java/org/apache/myfaces/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/java/org/apache/myfaces/examples/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/java/org/apache/myfaces/examples/dynaForm/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/java/org/apache/myfaces/examples/dynaForm/SimpleBean.java (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/java/org/apache/myfaces/examples/dynaForm/SimpleBeanBacking.java (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/resources/org/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/resources/org/apache/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/resources/org/apache/myfaces/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/resources/org/apache/myfaces/examples/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/resources/org/apache/myfaces/examples/resource/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/resources/org/apache/myfaces/examples/resource/build.properties (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/resources/org/apache/myfaces/examples/resource/example_messages.properties (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/css/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/css/basic.css (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/css/common.css (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/css/jscookmenu/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/css/jscookmenu/ThemeOffice/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/css/jscookmenu/ThemeOffice/theme.css (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/dynaForm/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/dynaForm/home.jsp (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/dynaForm/index.jsp (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/dynaForm/simpleBean.jsp (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/home.jsp (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/images/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/images/component.gif (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/images/logo_mini.jpg (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/images/myfaces.gif (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/inc/
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/inc/head.inc
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/inc/page_footer.jsp (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/inc/page_header.jsp (with props)
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/index.jsp (with props)
Modified:
myfaces/tomahawk/trunk/sandbox15/core/pom.xml
myfaces/tomahawk/trunk/sandbox15/examples/pom.xml
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/WEB-INF/examples-config.xml
myfaces/tomahawk/trunk/sandbox15/examples/src/main/webapp/WEB-INF/web.xml
Modified: myfaces/tomahawk/trunk/sandbox15/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/pom.xml?view=diff&rev=464192&r1=464191&r2=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/pom.xml (original)
+++ myfaces/tomahawk/trunk/sandbox15/core/pom.xml Sun Oct 15 06:33:49 2006
@@ -21,7 +21,7 @@
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/sandbox15/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/myfaces/tomahawk/trunk/sandbox15/core</url>
</scm>
-
+/
<dependencies>
<!-- compile -->
@@ -34,6 +34,19 @@
</dependency>
<dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-sandbox</artifactId>
+ <version>${version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>bcel</groupId>
+ <artifactId>bcel</artifactId>
+ <version>5.1</version>
+ </dependency>
+
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
@@ -68,20 +81,14 @@
<scope>compile</scope>
</dependency>
- <dependency>
- <groupId>portlet-api</groupId>
- <artifactId>portlet-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
-
<dependency>
- <groupId>poi</groupId>
- <artifactId>poi</artifactId>
- <version>2.5.1-final-20040804</version>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
<scope>compile</scope>
</dependency>
+
<!-- provided dependencies -->
<dependency>
@@ -150,6 +157,13 @@
</goals>
</execution>
</executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
</plugin>
</plugins>
</build>
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * do not render any input. e.g uses outputText instead
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value=RetentionPolicy.RUNTIME)
+public @interface DisplayOnly
+{
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/DisplayOnly.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Ignore (skip) this property so it will not appear on any gui
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface IgnoreProperty
+{
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/IgnoreProperty.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * set the minimum and maximum characters allowed for input
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface Length
+{
+ int min() default 0;
+ int max() default Integer.MAX_VALUE;
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Length.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * set the maximum allowed value
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface Max
+{
+ long value();
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Max.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * set the minimum allowed value
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface Min
+{
+ long value();
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Min.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * required field
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface NotNull
+{
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/NotNull.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * set the minimum and maximum allowed value
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface Range
+{
+ long min();
+ long max();
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Range.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * render a readonly element.
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value=RetentionPolicy.RUNTIME)
+public @interface ReadOnly
+{
+ /**
+ * set to true if you would like to render as disabled control
+ */
+ boolean disabled() default false;
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/ReadOnly.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.persistence.TemporalType;
+
+/**
+ * much like javax.persistence.Temporal but to allow to work with any date library
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value=RetentionPolicy.RUNTIME)
+public @interface Temporal
+{
+ /**
+ * set to true if you would like to render as disabled control
+ */
+ TemporalType value() default TemporalType.TIMESTAMP;
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/Temporal.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.annot.ui;
+
+import org.apache.myfaces.custom.dynaForm.guiBuilder.ComponentEnum;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * render the n:1 as select box
+ */
+@Target(value={ElementType.METHOD, ElementType.FIELD})
+@Retention(value=RetentionPolicy.RUNTIME)
+public @interface UIComponent
+{
+ ComponentEnum type() default ComponentEnum.OutputText;
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/annot/ui/UIComponent.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,191 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.component.dynaForm;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
+import org.apache.myfaces.custom.dynaForm.metadata.MetaData.FieldImpl;
+
+/**
+ * the dynaForm configuration component<br />
+ * handles overruled field setup
+ */
+public class DynaConfig extends UIComponentBase
+{
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.dynaForm.DynaConfig";
+ public static final String COMPONENT_FAMILY = "org.apache.myfaces.dynaForm.DynaConfig";
+
+ private String forProperty;
+ private Integer displaySize;
+ private Boolean displayOnly;
+ private Boolean readOnly;
+ private Boolean disabled;
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ /**
+ * @see #setDisplaySize(Integer)
+ */
+ public Integer getDisplaySize()
+ {
+ if (displaySize != null)
+ return displaySize;
+ ValueBinding vb = getValueBinding("displaySize");
+ return vb != null ? (Integer) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * a hint for the size the ui should use when rendering the field
+ */
+ public void setDisplaySize(Integer displaySize)
+ {
+ this.displaySize = displaySize;
+ }
+
+ /**
+ * @see #setDisplayOnly(Boolean)
+ */
+ public Boolean getDisplayOnly()
+ {
+ if (displayOnly != null)
+ return displayOnly;
+ ValueBinding vb = getValueBinding("displayOnly");
+ return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * set the field to display only
+ */
+ public void setDisplayOnly(Boolean displayOnly)
+ {
+ this.displayOnly = displayOnly;
+ }
+
+ /**
+ * @see #setReadOnly(Boolean)
+ */
+ public Boolean getReadOnly()
+ {
+ if (readOnly != null)
+ return readOnly;
+ ValueBinding vb = getValueBinding("readOnly");
+ return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * configure this field as readOnly - noneditable input field
+ */
+ public void setReadOnly(Boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ /**
+ * @see #setDisabled(Boolean)
+ */
+ public Boolean getDisabled()
+ {
+ if (disabled != null)
+ return disabled;
+ ValueBinding vb = getValueBinding("disabled");
+ return vb != null ? (Boolean) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * configure this field as disabled - like readOnly but grayed too
+ */
+ public void setDisabled(Boolean disabled)
+ {
+ this.disabled = disabled;
+ }
+
+ /**
+ * @see #setFor(String)
+ */
+ public String getFor()
+ {
+ if (forProperty != null)
+ return forProperty;
+ ValueBinding vb = getValueBinding("for");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * the name of the property this configuration is for
+ */
+ public void setFor(String forProperty)
+ {
+ this.forProperty = forProperty;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object stateArray)
+ {
+ Object[] states = (Object[]) stateArray;
+ super.restoreState(context, states[0]);
+ displaySize = (Integer) states[1];
+ forProperty = (String) states[2];
+ displayOnly = (Boolean) states[3];
+ readOnly = (Boolean) states[4];
+ disabled = (Boolean) states[5];
+ }
+
+ @Override
+ public Object saveState(FacesContext context)
+ {
+ return new Object[]
+ {
+ super.saveState(context),
+ displaySize,
+ forProperty,
+ displayOnly,
+ readOnly,
+ disabled
+ };
+ }
+
+ public void configureMetaData(FieldImpl field)
+ {
+ if (getDisplaySize() != null)
+ {
+ field.setDisplaySize(getDisplaySize().intValue());
+ }
+ if (getDisplayOnly() != null)
+ {
+ field.setDisplayOnly(getDisplayOnly());
+ }
+ if (getReadOnly() != null)
+ {
+ field.setCanWrite(getReadOnly().booleanValue());
+ }
+ if (getDisabled() != null)
+ {
+ field.setDisabled(getDisabled().booleanValue());
+ }
+
+ if (getChildCount() > 0)
+ {
+ field.setWantedComponent((UIComponent) getChildren().get(0));
+ }
+ }
+}
\ No newline at end of file
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfig.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,137 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.component.dynaForm;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.shared_tomahawk.taglib.UIComponentBodyTagBase;
+
+public class DynaConfigTag extends UIComponentBodyTagBase
+{
+ private String displaySize;
+ private String forProperty;
+ private String displayOnly;
+ private String readOnly;
+ private String disabled;
+
+ public void release()
+ {
+ super.release();
+
+ displaySize = null;
+ forProperty = null;
+ }
+
+ protected void setProperties(UIComponent component)
+ {
+ super.setProperties(component);
+ setIntegerProperty(component, "displaySize", displaySize);
+ setStringProperty(component, "for", forProperty);
+ setBooleanProperty(component, "displayOnly", displayOnly);
+ setBooleanProperty(component, "readOnly", readOnly);
+ setBooleanProperty(component, "disabled", disabled);
+ }
+
+ /**
+ * @see DynaConfig#setDisplaySize(Integer)
+ */
+ public String getDisplaySize()
+ {
+ return displaySize;
+ }
+
+ /**
+ * @see DynaConfig#setDisplaySize(Integer)
+ */
+ public void setDisplaySize(String size)
+ {
+ this.displaySize = size;
+ }
+
+ /**
+ * @see DynaConfig#setFor(String)
+ */
+ public String getFor()
+ {
+ return forProperty;
+ }
+
+ /**
+ * @see DynaConfig#setFor(String)
+ */
+ public void setFor(String forProperty)
+ {
+ this.forProperty = forProperty;
+ }
+
+ /**
+ * @see DynaConfig#setDisplayOnly(Boolean)
+ */
+ public String getDisplayOnly()
+ {
+ return displayOnly;
+ }
+
+ /**
+ * @see DynaConfig#setDisplayOnly(Boolean)
+ */
+ public void setDisplayOnly(String displayOnly)
+ {
+ this.displayOnly = displayOnly;
+ }
+
+ /**
+ * @see DynaConfig#setDisabled(Boolean)
+ */
+ public String getDisabled()
+ {
+ return disabled;
+ }
+
+ /**
+ * @see DynaConfig#setDisabled(Boolean)
+ */
+ public void setDisabled(String disabled)
+ {
+ this.disabled = disabled;
+ }
+
+ /**
+ * @see DynaConfig#setReadOnly(Boolean)
+ */
+ public String getReadOnly()
+ {
+ return readOnly;
+ }
+
+ /**
+ * @see DynaConfig#setReadOnly(Boolean)
+ */
+ public void setReadOnly(String readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ public String getComponentType()
+ {
+ return DynaConfig.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return null;
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigTag.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.component.dynaForm;
+
+import javax.faces.component.UIComponentBase;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * the dynaForm configuration component<br />
+ * handles overruled field setup
+ */
+public class DynaConfigs extends UIComponentBase
+{
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.dynaForm.DynaConfigs";
+ public static final String COMPONENT_FAMILY = "org.apache.myfaces.dynaForm.DynaConfigs";
+
+ private transient Map<String, DynaConfig> configMap = null;
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ public DynaConfig getConfig(String name)
+ {
+ Map<String, DynaConfig> configMap = getConfigMap();
+ return configMap.get(name);
+ }
+
+ protected Map<String, DynaConfig> getConfigMap()
+ {
+ if (configMap != null)
+ {
+ return configMap;
+ }
+ configMap = new LinkedHashMap<String, DynaConfig>();
+
+ for (Object child : getChildren())
+ {
+ if (child instanceof DynaConfig)
+ {
+ DynaConfig dynaConfig = (DynaConfig) child;
+ if (configMap.containsKey(dynaConfig.getFor()))
+ {
+ throw new IllegalStateException("duplicate config for property '" + dynaConfig.getFor() + "'");
+ }
+ configMap.put(dynaConfig.getFor(), dynaConfig);
+ }
+ }
+
+ return configMap;
+ }
+
+ public Iterator<DynaConfig> iterator()
+ {
+ return getConfigMap().values().iterator();
+ }
+}
\ No newline at end of file
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigs.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.component.dynaForm;
+
+import org.apache.myfaces.shared_tomahawk.taglib.UIComponentBodyTagBase;
+
+public class DynaConfigsTag extends UIComponentBodyTagBase
+{
+ public void release()
+ {
+ super.release();
+ }
+
+ public String getComponentType()
+ {
+ return DynaConfigs.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return null;
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaConfigsTag.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,324 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.component.dynaForm;
+
+import org.apache.myfaces.custom.dynaForm.metadata.Extractor;
+import org.apache.myfaces.custom.dynaForm.uri.FacesUriResolver;
+import org.apache.myfaces.custom.dynaForm.uri.UriResolver.Configuration;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+import javax.persistence.Transient;
+
+/**
+ * the dynaForm component<br />
+ * handles whats needed to dynamically create JSF component trees
+ */
+public class DynaForm extends UIComponentBase
+{
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.dynaForm.DynaForm";
+ public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.dynaForm.DynaForm";
+ public static final String COMPONENT_FAMILY = "org.apache.myfaces.dynaForm.DynaForm";
+
+ public static final String DYNA_FORM_CREATED = "org.apache.myfaces.dynaForm.CREATED";
+
+ private String uri;
+ private String bundle;
+ private String var;
+ private String valueBindingPrefix;
+ private Boolean displayOnly;
+ private Boolean exclusiveFields;
+
+ @Transient
+ private transient Configuration configuration = null;
+ private transient DynaConfigs formConfigs = null;
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ /**
+ * @see #setUri
+ */
+ public String getUri()
+ {
+ if (uri != null)
+ {
+ return uri;
+ }
+ ValueBinding vb = getValueBinding("uri");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * how to reach the model<br />
+ * e.g. ejb:fqn.to.model.Entity means use EJB3 to work with the given entity<br />
+ * beside the model itself the uri scheme also configures what to do with this entity
+ *
+ * @see org.apache.myfaces.custom.dynaForm.uri.UriResolver
+ */
+ public void setUri(String uri)
+ {
+ this.uri = uri;
+ }
+
+ /**
+ * @see #setValueBindingPrefix
+ */
+ public String getValueBindingPrefix()
+ {
+ if (valueBindingPrefix != null)
+ {
+ return valueBindingPrefix;
+ }
+ ValueBinding vb = getValueBinding("valueBindingPrefix");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * The value binding prefix which will be used to create the real value binding.
+ * If this is missing and the layout component has a "var" attribute its
+ * value will be used.
+ */
+ public void setValueBindingPrefix(String valueBindingPrefix)
+ {
+ this.valueBindingPrefix = valueBindingPrefix;
+ }
+
+ /**
+ * @see #setBundle
+ */
+ public String getBundle()
+ {
+ if (bundle != null)
+ {
+ return bundle;
+ }
+ ValueBinding vb = getValueBinding("bundle");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * The bundle to use to convert the labels to readable strings
+ */
+ public void setBundle(String bundle)
+ {
+ this.bundle = bundle;
+ }
+
+ /**
+ * @see #setVar
+ */
+ public String getVar()
+ {
+ if (var != null)
+ {
+ return var;
+ }
+ ValueBinding vb = getValueBinding("var");
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+ }
+
+ /**
+ * Display the whole form in read only mode
+ */
+ public void setDisplayOnly(boolean displayOnly)
+ {
+ this.displayOnly = displayOnly;
+ }
+
+ /**
+ * @see #setVar
+ */
+ public boolean isDisplayOnly()
+ {
+ if (displayOnly != null)
+ {
+ return displayOnly.booleanValue();
+ }
+ ValueBinding vb = getValueBinding("displayOnly");
+ if (vb != null)
+ {
+ Boolean ret = (Boolean) vb.getValue(getFacesContext());
+ if (ret != null)
+ {
+ return ret.booleanValue();
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Process only fields listed by their facets
+ */
+ public void setExclusiveFields(boolean exclusiveFields)
+ {
+ this.exclusiveFields = exclusiveFields;
+ }
+
+ /**
+ * @see #setExclusiveFields(boolean)
+ */
+ public boolean isExclusiveFields()
+ {
+ if (exclusiveFields != null)
+ {
+ return exclusiveFields.booleanValue();
+ }
+ ValueBinding vb = getValueBinding("exclusiveFields");
+ if (vb != null)
+ {
+ Boolean ret = (Boolean) vb.getValue(getFacesContext());
+ if (ret != null)
+ {
+ return ret.booleanValue();
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * the var name used to allow access to the form controller
+ */
+ public void setVar(String var)
+ {
+ this.var = var;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object stateArray)
+ {
+ Object[] states = (Object[]) stateArray;
+ super.restoreState(context, states[0]);
+ uri = (String) states[1];
+ var = (String) states[2];
+ displayOnly = (Boolean) states[3];
+ bundle = (String) states[4];
+ valueBindingPrefix = (String) states[5];
+ }
+
+ @Override
+ public Object saveState(FacesContext context)
+ {
+ return new Object[]
+ {
+ super.saveState(context),
+ uri,
+ var,
+ displayOnly,
+ bundle,
+ valueBindingPrefix
+ };
+ }
+
+ /**
+ * get the overall configuration based on the given uri
+ *
+ * @see org.apache.myfaces.custom.dynaForm.uri.UriResolver
+ */
+ protected Configuration getConfiguration()
+ {
+ if (configuration == null)
+ {
+ configuration = new FacesUriResolver().resolveUri(getUri());
+ }
+ return configuration;
+ }
+
+ public Extractor getExtractor()
+ {
+ return getConfiguration().getExtractor();
+ }
+
+ /**
+ * try to find a parent dyna form+
+ */
+ protected DynaForm findParentDynaForm(DynaForm start)
+ {
+ UIComponent component = start.getParent();
+ while (component != null)
+ {
+ if (component instanceof DynaForm)
+ {
+ return (DynaForm) component;
+ }
+ component = component.getParent();
+ }
+
+ return null;
+ }
+
+ /**
+ * we need to inject our "var" early in decoding phase
+ */
+ public void processDecodes(FacesContext context)
+ {
+ ((DynaFormRenderer) getRenderer(context)).processDecodes(context, this);
+
+ super.processDecodes(context);
+ }
+
+ /**
+ * Find the dynaForm component
+ */
+ public static DynaForm getDynaForm(UIComponent component)
+ {
+ if (component == null)
+ {
+ throw new IllegalArgumentException("component==null not allowed");
+ }
+
+ UIComponent dynaFormComponent = component;
+ while (dynaFormComponent != null && (!(dynaFormComponent instanceof DynaForm)))
+ {
+ dynaFormComponent = dynaFormComponent.getParent();
+ }
+ if (dynaFormComponent == null)
+ {
+ throw new IllegalArgumentException("component with id '" + component.getId() + "' not contained in an dynaForm");
+ }
+
+ return (DynaForm) dynaFormComponent;
+ }
+
+ /**
+ * get access to the special form configurations
+ */
+ public DynaConfigs getFormConfigs()
+ {
+ if (formConfigs != null)
+ {
+ return formConfigs;
+ }
+
+ for (Object obj : getChildren())
+ {
+ if (obj instanceof DynaConfigs)
+ {
+ formConfigs = (DynaConfigs) obj;
+ return formConfigs;
+ }
+ }
+
+ return null;
+ }
+}
\ No newline at end of file
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaForm.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,421 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.component.dynaForm;
+
+import org.apache.myfaces.custom.dynaForm.guiBuilder.Slipstream;
+import org.apache.myfaces.custom.dynaForm.guiBuilder.impl.jsf.JsfGuiBuilder;
+import org.apache.myfaces.custom.dynaForm.guiBuilder.impl.jsf.JsfGuiBuilderFactory;
+import org.apache.myfaces.custom.dynaForm.guiBuilder.impl.jsf.NewComponentListener;
+import org.apache.myfaces.custom.dynaForm.jsfext.ComponentUtils;
+import org.apache.myfaces.custom.dynaForm.lib.ViewType;
+import org.apache.myfaces.custom.dynaForm.metadata.FieldInterface;
+import org.apache.myfaces.custom.dynaForm.metadata.MetaData;
+import org.apache.myfaces.custom.dynaForm.metadata.impl.jsf.JsfExclusiveExtractor;
+import org.apache.myfaces.custom.dynaForm.metadata.impl.jsf.JsfExtractor;
+import org.apache.myfaces.custom.dynaForm.metadata.impl.jsf.JsfRequestFieldExtractor;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+import javax.faces.render.Renderer;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * the dynaForm renderer<br />
+ * regardles what the component told you, this is where the work happens ;-)
+ */
+public class DynaFormRenderer extends Renderer
+{
+ public final static String CONTEXT_GUI_BUILDER = "org.apache.myfaces.custom.dynaForm.GUI_BUILDER";
+
+ private final class AddComponentToTable implements NewComponentListener
+ {
+ private final UIComponent destCmp;
+
+ private AddComponentToTable(UIComponent component)
+ {
+ super();
+ this.destCmp = component;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void newComponent(String fieldName, UIComponent label, UIComponent component)
+ {
+ component.getAttributes().put(
+ DynaForm.DYNA_FORM_CREATED, Boolean.TRUE);
+
+ UIColumn column = new UIColumn();
+ column.getChildren().add(component);
+ column.setHeader(label);
+
+ int addPos = -1;
+ UIComponent dataIndicator = this.destCmp.findComponent("data");
+ if (dataIndicator != null)
+ {
+ addPos = this.destCmp.getChildren().indexOf(dataIndicator);
+ }
+
+ if (addPos > -1)
+ {
+ this.destCmp.getChildren().add(addPos, column);
+ }
+ else
+ {
+ this.destCmp.getChildren().add(column);
+ }
+ }
+ }
+
+ protected static class AddComponentSimple implements NewComponentListener
+ {
+ private final UIComponent destCmp;
+
+ protected AddComponentSimple(UIComponent component)
+ {
+ super();
+ this.destCmp = component;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void newComponent(String fieldName, UIComponent label, UIComponent component)
+ {
+ component.getAttributes().put(
+ DynaForm.DYNA_FORM_CREATED, Boolean.TRUE);
+
+ this.destCmp.getChildren().add(label);
+ this.destCmp.getChildren().add(component);
+ }
+ }
+
+ @Override
+ public boolean getRendersChildren()
+ {
+ return true;
+ }
+
+ /**
+ * pre decode - early inject var to make children happy
+ */
+ public void processDecodes(FacesContext context, DynaForm dynaForm)
+ {
+ UIComponent layoutComponent = findLayoutComponent(dynaForm);
+ ViewType viewType = getViewType(layoutComponent);
+
+ injectVar(context, dynaForm, layoutComponent, viewType);
+ }
+
+ /**
+ * on create view or in development mode this will build the component tree
+ */
+ @Override
+ public void encodeBegin(FacesContext context, UIComponent component)
+ throws IOException
+ {
+ super.encodeBegin(context, component);
+
+ DynaForm dynaForm = (DynaForm) component;
+
+ UIComponent layoutComponent = findLayoutComponent(dynaForm);
+ ViewType viewType = getViewType(layoutComponent);
+
+ // create & add components
+ boolean needAdd = processPreviouslyAdded(context, layoutComponent);
+ if (needAdd)
+ {
+ addComponents(context, dynaForm, layoutComponent, viewType);
+ }
+
+ injectVar(context, dynaForm, layoutComponent, viewType);
+ }
+
+ protected FieldInterface getFieldMetaData(final DynaForm dynaForm, String propertyName)
+ {
+ MetaData metaData = new MetaData();
+
+ // we are only interested in the property we are configured for
+ metaData.requestField(propertyName);
+ MetaData.FieldImpl field = metaData.getOrCreateField(propertyName);
+ metaData.setLockFields(true);
+
+ // use the users extractor
+ dynaForm.getExtractor().getMetaData(metaData, dynaForm.getConfiguration().getEntity());
+
+ return field;
+ }
+
+ /**
+ * determine the current view type
+ * <ul>
+ * <li>"list" means: the layout component "is a" or "is embedded in an" list component (UIData)</li>
+ * <li>"form" means: anything else</li>
+ * </ul>
+ */
+ protected ViewType getViewType(UIComponent startComponent)
+ {
+ UIComponent component = startComponent;
+ while (component != null && !(component instanceof DynaForm))
+ {
+ if (isTable(component))
+ {
+ return ViewType.LIST;
+ }
+
+ component = component.getParent();
+ }
+
+ return ViewType.FORM;
+ }
+
+ protected UIComponent findLayoutComponent(DynaForm dynaForm)
+ {
+ UIComponent layoutComponent = findComponentEx(dynaForm, dynaForm.getVar() + "-layout");
+ if (layoutComponent == null)
+ {
+ throw new IllegalStateException("DynaForm '" + dynaForm.getId()
+ + "' has no layout component (id=\"layout\")");
+ }
+ return layoutComponent;
+ }
+
+ /**
+ * find a component "by id" by simply traversing the tree
+ */
+ protected UIComponent findComponentEx(UIComponent base, String id)
+ {
+ if (id.equals(base.getId()))
+ {
+ return base;
+ }
+
+ Iterator iterChildren = base.getFacetsAndChildren();
+ while (iterChildren.hasNext())
+ {
+ UIComponent child = (UIComponent) iterChildren.next();
+ UIComponent found = findComponentEx(child, id);
+ if (found != null)
+ {
+ return found;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * provide access to the form controller
+ */
+ @SuppressWarnings("unchecked")
+ protected void injectVar(FacesContext context, DynaForm dynaForm,
+ UIComponent layoutComponent, ViewType viewType)
+ {
+ // todo: what todo?
+ }
+
+ /**
+ * get rid of var again
+ */
+ protected void removeVar(FacesContext context, DynaForm dynaForm)
+ {
+ context.getExternalContext().getRequestMap().remove(
+ dynaForm.getVar());
+ }
+
+ /**
+ * collect all input components within our layout component
+ */
+ protected List<UIInput> getInputComponents(UIComponent layoutComponent)
+ {
+ List<UIInput> ret = new ArrayList<UIInput>(30);
+
+ collectInputComponents(ret, layoutComponent);
+
+ return Collections.unmodifiableList(ret);
+ }
+
+ /**
+ * collect all input components recursiv starting with <code>component</code>
+ */
+ protected void collectInputComponents(List<UIInput> components, UIComponent baseComponent)
+ {
+ if (baseComponent instanceof UIInput)
+ {
+ components.add((UIInput) baseComponent);
+ }
+
+ if (baseComponent.getChildren() == null)
+ {
+ return;
+ }
+
+ for (Object component : baseComponent.getChildren())
+ {
+ UIComponent componentChild = (UIComponent) component;
+ collectInputComponents(components, componentChild);
+ }
+ }
+
+ /**
+ * create and add the components to the layout component
+ */
+ protected void addComponents(final FacesContext context,
+ final DynaForm dynaForm, final UIComponent layoutComponent,
+ final ViewType viewType)
+ {
+ MetaData metaData = extractMetaData(dynaForm);
+
+ Slipstream slipstream = new Slipstream();
+ slipstream.setModelMetaData(metaData);
+ slipstream.setDisplayOnly(dynaForm.isDisplayOnly());
+
+ if (dynaForm.getBundle() != null)
+ {
+ // get the bundle and attach it
+ Map bundleMap = (Map) context.getApplication().createValueBinding("#{" + dynaForm.getBundle() + "}").getValue(context);
+ slipstream.setLabelBundle(bundleMap);
+ }
+
+ JsfGuiBuilder guiBuilder = createGuiBuilder(context);
+
+ guiBuilder.setContext(context);
+ guiBuilder.setBackingBeanPrefix(dynaForm.getVar());
+
+ if (isTable(layoutComponent))
+ {
+ guiBuilder.setNewComponentListener(new AddComponentToTable(layoutComponent));
+ }
+ else
+ {
+ guiBuilder.setNewComponentListener(new AddComponentSimple(layoutComponent));
+ }
+
+ String valueBindingPrefix = getValueBindingPrefix(dynaForm, layoutComponent);
+ if (valueBindingPrefix == null)
+ {
+ throw new UnsupportedOperationException("can't determine the value binding prefix");
+ }
+ guiBuilder.setBackingEntityPrefix(valueBindingPrefix);
+
+ slipstream.setGuiBuilder(guiBuilder);
+ slipstream.process();
+ }
+
+ private boolean isTable(UIComponent layoutComponent)
+ {
+ return layoutComponent instanceof UIData || UIData.COMPONENT_FAMILY.equals(layoutComponent.getFamily());
+ }
+
+ protected String getValueBindingPrefix(DynaForm dynaForm, UIComponent layoutComponent)
+ {
+ String valueBindingPrefix = dynaForm.getValueBindingPrefix();
+ if (valueBindingPrefix == null)
+ {
+ valueBindingPrefix = (String) layoutComponent.getAttributes().get("var");
+ }
+
+ return valueBindingPrefix;
+ }
+
+ private MetaData extractMetaData(final DynaForm dynaForm)
+ {
+ MetaData metaData = new MetaData();
+
+ try
+ {
+ // lookup which fields to process
+ new JsfRequestFieldExtractor().getMetaData(metaData, dynaForm);
+
+ if (dynaForm.isExclusiveFields())
+ {
+ // the same as above, but keep their ordering and some additional metadata
+ new JsfExclusiveExtractor().getMetaData(metaData, dynaForm);
+ metaData.setLockFields(true);
+ }
+
+ // use the users extractor
+ dynaForm.getExtractor().getMetaData(metaData, dynaForm.getConfiguration().getEntity());
+
+ // processs the jsf stuff
+ new JsfExtractor().getMetaData(metaData, dynaForm);
+
+ }
+ finally
+ {
+ metaData.setLockFields(false);
+ }
+
+ return metaData;
+ }
+
+ protected JsfGuiBuilder createGuiBuilder(final FacesContext facesContext)
+ {
+ return JsfGuiBuilderFactory.create(facesContext);
+ }
+
+ /**
+ * check if we already added components to the layout component.<br />
+ *
+ * if this is the case then:
+ * <ul>
+ * <li>keep them cached and avoid readd</li>
+ * <li><strike>in development mode: remove the components</strike></li>
+ * <li><strike>in production mode: keep them cached</strike></li>
+ * </ul>
+ *
+ * TODO: need to figure out whats the best way to recreate the components
+ * @return true if we have to add our components again
+ */
+ protected boolean processPreviouslyAdded(FacesContext context,
+ UIComponent root)
+ {
+ List rootComponentChildren = root.getChildren();
+ if (rootComponentChildren != null)
+ {
+ for (Object component : rootComponentChildren)
+ {
+ UIComponent child = (UIComponent) component;
+ if (Boolean.TRUE.equals(child.getAttributes().get(
+ DynaForm.DYNA_FORM_CREATED)))
+ {
+ return false;
+ }
+
+ if (!processPreviouslyAdded(context, child))
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public void encodeChildren(FacesContext context, UIComponent component)
+ throws IOException
+ {
+ // TODO: remove this (and maybe the method at all) afer myfaces > 1.1.1
+ // is out ==>
+ ComponentUtils.renderChildren(context, component);
+ // TODO: remove this afer myfaces > 1.1.1 is out <==
+ }
+}
\ No newline at end of file
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormRenderer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.component.dynaForm;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.shared_tomahawk.taglib.UIComponentBodyTagBase;
+
+public class DynaFormTag extends UIComponentBodyTagBase
+{
+ private String uri;
+ private String var;
+ private String valueBindingPrefix;
+ private String displayOnly;
+ private String bundle;
+ private String exclusiveFields;
+
+ public void release()
+ {
+ super.release();
+
+ uri = null;
+ var = null;
+ displayOnly = null;
+ bundle = null;
+ exclusiveFields = null;
+ valueBindingPrefix = null;
+ }
+
+ protected void setProperties(UIComponent component)
+ {
+ super.setProperties(component);
+ setStringProperty(component, "uri", uri);
+ setStringProperty(component, "var", var);
+ setStringProperty(component, "valueBindingPrefix", valueBindingPrefix);
+ setBooleanProperty(component, "displayOnly", displayOnly);
+ setStringProperty(component, "bundle", bundle);
+ setBooleanProperty(component, "exclusiveFields", exclusiveFields);
+ }
+
+ /**
+ * @see DynaForm#setUri(String)
+ */
+ public String getUri()
+ {
+ return uri;
+ }
+
+ /**
+ * @see DynaForm#setUri(String)
+ */
+ public void setUri(String uri)
+ {
+ this.uri = uri;
+ }
+
+ /**
+ * @see DynaForm#setVar(String)
+ */
+ public String getVar()
+ {
+ return var;
+ }
+
+ /**
+ * @see DynaForm#setVar(String)
+ */
+ public void setVar(String var)
+ {
+ this.var = var;
+ }
+
+ /**
+ * @see DynaForm#setDisplayOnly(boolean)
+ */
+ public String getDisplayOnly()
+ {
+ return displayOnly;
+ }
+
+ /**
+ * @see DynaForm#setDisplayOnly(boolean)
+ */
+ public void setDisplayOnly(String displayOnly)
+ {
+ this.displayOnly = displayOnly;
+ }
+
+ /**
+ * @see DynaForm#setBundle(String)
+ */
+ public String getBundle()
+ {
+ return bundle;
+ }
+
+ /**
+ * @see DynaForm#setBundle(String)
+ */
+ public void setBundle(String bundle)
+ {
+ this.bundle = bundle;
+ }
+
+ /**
+ * @see DynaForm#setExclusiveFields(boolean)
+ */
+ public String getExclusiveFields()
+ {
+ return exclusiveFields;
+ }
+
+ /**
+ * @see DynaForm#setExclusiveFields(boolean)
+ */
+ public void setExclusiveFields(String exclusiveFields)
+ {
+ this.exclusiveFields = exclusiveFields;
+ }
+
+ /**
+ * @see DynaForm#setValueBindingPrefix(String)
+ */
+ public String getValueBindingPrefix()
+ {
+ return valueBindingPrefix;
+ }
+
+ /**
+ * @see DynaForm#setValueBindingPrefix(String)
+ */
+ public void setValueBindingPrefix(String valueBindingPrefix)
+ {
+ this.valueBindingPrefix = valueBindingPrefix;
+ }
+
+ public String getComponentType()
+ {
+ return DynaForm.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return DynaForm.DEFAULT_RENDERER_TYPE;
+ }
+}
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/component/dynaForm/DynaFormTag.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java?view=auto&rev=464192
==============================================================================
--- myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java (added)
+++ myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java Sun Oct 15 06:33:49 2006
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.dynaForm.guiBuilder;
+
+public enum ComponentEnum
+{
+ Automatic,
+ OutputText,
+ InputText,
+ InputDate,
+ SelectOneMenu,
+ SelectSearchMenu,
+ InputNumber,
+ InputBoolean
+}
\ No newline at end of file
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: myfaces/tomahawk/trunk/sandbox15/core/src/main/java/org/apache/myfaces/custom/dynaForm/guiBuilder/ComponentEnum.java
------------------------------------------------------------------------------
svn:mime-type = text/plain