You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2004/09/17 16:36:30 UTC
svn commit: rev 46253 - in cocoon/branches/BRANCH_2_1_X: . legal lib src/blocks/faces src/blocks/faces/WEB-INF src/blocks/faces/conf src/blocks/faces/java src/blocks/faces/java/META-INF src/blocks/faces/java/org src/blocks/faces/java/org/apache src/blocks/faces/java/org/apache/cocoon src/blocks/faces/java/org/apache/cocoon/faces src/blocks/faces/java/org/apache/cocoon/faces/context src/blocks/faces/java/org/apache/cocoon/faces/renderkit src/blocks/faces/java/org/apache/cocoon/faces/samples src/blocks/faces/java/org/apache/cocoon/faces/taglib src/blocks/faces/java/org/apache/cocoon/faces/taglib/html src/blocks/faces/lib src/blocks/faces/samples src/blocks/scratchpad/lib src/webapp/WEB-INF
Author: vgritsenko
Date: Fri Sep 17 07:36:29 2004
New Revision: 46253
Added:
cocoon/branches/BRANCH_2_1_X/legal/commons-el-1.0.jar.license.txt (contents, props changed)
cocoon/branches/BRANCH_2_1_X/legal/jsp-api-2.0.jar.license.txt (contents, props changed)
cocoon/branches/BRANCH_2_1_X/legal/myfaces-20040916m.jar.license.txt (contents, props changed)
cocoon/branches/BRANCH_2_1_X/legal/myfaces-jsf-api-20040916.jar.license.txt (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/WEB-INF/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/WEB-INF/faces-config.xml (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces-listener.xweb (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces-taglib.xconf (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces.xsamples
- copied, changed from rev 46209, cocoon/branches/BRANCH_2_1_X/src/blocks/apples/conf/apples.xsamples
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/META-INF/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/META-INF/faces-config.xml (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesAction.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesRedirector.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesUtils.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/ApplicationMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/BaseMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/ExternalContextImpl.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/FacesContextFactoryImpl.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/FacesContextImpl.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/InitParameterMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestHeaderMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestHeaderValuesMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestParameterMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestParameterValuesMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/SessionMap.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/renderkit/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/renderkit/XMLResponseWriter.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/Hello.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ActionListenerTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/AttributeTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConvertDateTimeTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConvertNumberTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConverterTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/FacetTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/LoadBundleTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ParameterTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SelectItemTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SelectItemsTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SubviewTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/UIComponentBodyTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/UIComponentTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateDoubleRangeTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateLengthTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateLongRangeTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateRequiredTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidatorTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValueChangeListenerTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/VerbatimTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ViewTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/ColumnTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/CommandButtonTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/CommandLinkTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/ConstantMethodBinding.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/DataTableTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/FormTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/GraphicImageTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputHiddenTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputSecretTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputTextTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputTextareaTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/MessageTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/MessagesTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputFormatTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputLabelTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputLinkTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputTextTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/PanelGridTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/PanelGroupTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectBooleanCheckboxTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyCheckboxTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyListboxTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyMenuTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneListboxTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneMenuTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneRadioTag.java (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/commons-beanutils-core-1.7.jar
- copied unchanged from rev 46173, cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/lib/commons-beanutils-core-1.7.jar
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/commons-digester-1.5.jar
- copied unchanged from rev 46173, cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/lib/commons-digester-1.5.jar
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/commons-el-1.0.jar (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/jsp-api-2.0.jar (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/myfaces-20040916m.jar (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/myfaces-jsf-api-20040916.jar (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/goodbye.xml
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/hello.xml
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/myfaces-patch.diff (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/samples.xml (contents, props changed)
cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/sitemap.xmap (contents, props changed)
Removed:
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/lib/commons-beanutils-core-1.7.jar
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/lib/commons-digester-1.5.jar
Modified:
cocoon/branches/BRANCH_2_1_X/blocks.properties
cocoon/branches/BRANCH_2_1_X/gump.xml
cocoon/branches/BRANCH_2_1_X/lib/jars.xml
cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/web.xml
cocoon/branches/BRANCH_2_1_X/status.xml
Log:
Initial implementation of Faces block.
Moved beanutils and digester from scratchpad to faces.
Regenerated blocks.properties.
Updated web.xml descriptor to version 2.3 (need to register listener).
Modified: cocoon/branches/BRANCH_2_1_X/blocks.properties
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/blocks.properties (original)
+++ cocoon/branches/BRANCH_2_1_X/blocks.properties Fri Sep 17 07:36:29 2004
@@ -74,8 +74,9 @@
#include.block.paranoid=false
#include.block.php=false
#include.block.poi=false
-#-----[dependency]: "portal-fw" depends on "authentication-fw", "session-fw".
-#include.block.portal-fw=false
+#-----[dependency]: "portal" depends on "authentication-fw", "html", "session-fw".
+#-----[dependency]: "portal" is needed by "faces".
+#include.block.portal=false
#include.block.profiler=false
#-----[dependency]: "python" depends on "xsp".
#include.block.python=false
@@ -111,6 +112,9 @@
#-----[dependency]: "eventcache" depends on "jms", "xsp" (for samples).
#-----[dependency]: "eventcache" is needed by "repository".
#include.block.eventcache=false
+#-----[dependency]: "faces" depends on "portal", "taglib".
+#-----[dependency]: "faces" is needed by "scratchpad".
+#include.block.faces=false
#-----[dependency]: "forms" depends on "xsp" (for samples).
#-----[dependency]: "forms" is needed by "apples", "javaflow", "lucene", "ojb", "petstore", "tour".
#include.block.forms=false
@@ -128,14 +132,12 @@
#include.block.ojb=false
#-----[dependency]: "petstore" depends on "databases", "forms", "hsqldb", "velocity".
#include.block.petstore=false
-#-----[dependency]: "portal" depends on "authentication-fw", "html", "session-fw".
-#include.block.portal=false
#include.block.proxy=false
#include.block.qdox=false
#-----[dependency]: "repository" depends on "databases", "eventcache".
#-----[dependency]: "repository" is needed by "slide", "webdav".
#include.block.repository=false
-#-----[dependency]: "scratchpad" depends on "batik" (for samples), "cron", "velocity", "xsp".
+#-----[dependency]: "scratchpad" depends on "batik" (for samples), "cron", "faces", "velocity", "xsp".
#-----[dependency]: "scratchpad" is needed by "mail".
#include.block.scratchpad=false
#include.block.serializers=false
@@ -143,6 +145,7 @@
#include.block.slide=false
#include.block.slop=false
#include.block.stx=false
+#-----[dependency]: "taglib" is needed by "faces".
#include.block.taglib=false
#-----[dependency]: "tour" depends on "batik", "fop", "forms".
#include.block.tour=false
@@ -156,6 +159,8 @@
# For including one of them you have to set the exclude property into comment in
# blocks.properties.
+#-----[dependency]: "portal-fw" depends on "authentication-fw", "session-fw".
+include.block.portal-fw=false
include.block.swf=false
#-----[dependency]: "woody" depends on "xsp" (for samples).
include.block.woody=false
Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/gump.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml Fri Sep 17 07:36:29 2004
@@ -148,14 +148,13 @@
<depend project="castor"/>
<depend project="commons-jexl" inherit="all"/>
<depend project="commons-betwixt" inherit="all"/>
- <depend project="commons-beanutils-core" inherit="all"/>
- <depend project="commons-digester" inherit="all"/>
<depend project="jakarta-velocity" inherit="all"/>
<depend project="jakarta-servletapi-4"/>
<depend project="cocoon-block-velocity"/>
<depend project="cocoon-block-cron"/>
<depend project="cocoon-block-batik" type="samples"/>
<depend project="cocoon-block-xsp"/>
+ <depend project="cocoon-block-faces"/>
<work nested="tools/anttasks"/>
<home nested="build/cocoon-@@DATE@@"/>
@@ -1178,6 +1177,31 @@
<home nested="build/cocoon-@@DATE@@"/>
<jar name="blocks/tour-block.jar"/>
+
+ <nag from="Gump" to="dev@cocoon.apache.org"/>
+ </project>
+
+ <project name="cocoon-block-faces" status="unstable">
+ <package>org.apache.cocoon</package>
+
+ <ant target="faces-block">
+ <property name="block-name" value="faces"/>
+ <property name="version" value="@@DATE@@"/>
+ </ant>
+
+ <depend project="cocoon" inherit="all"/>
+ <depend project="cocoon-block-taglib"/>
+ <depend project="cocoon-block-portal"/>
+ <depend project="commons-beanutils-core" inherit="all"/>
+ <depend project="commons-digester" inherit="all"/>
+ <!-- FIXME Add commons-el dependency -->
+ <depend project="jakarta-servletapi-5" inherit="all"/>
+ <!-- FIXME Add myfaces dependency -->
+
+ <work nested="tools/anttasks"/>
+ <home nested="build/cocoon-@@DATE@@"/>
+
+ <jar name="blocks/faces-block.jar"/>
<nag from="Gump" to="dev@cocoon.apache.org"/>
</project>
Added: cocoon/branches/BRANCH_2_1_X/legal/commons-el-1.0.jar.license.txt
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/legal/commons-el-1.0.jar.license.txt Fri Sep 17 07:36:29 2004
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
Added: cocoon/branches/BRANCH_2_1_X/legal/jsp-api-2.0.jar.license.txt
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/legal/jsp-api-2.0.jar.license.txt Fri Sep 17 07:36:29 2004
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
Added: cocoon/branches/BRANCH_2_1_X/legal/myfaces-20040916m.jar.license.txt
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/legal/myfaces-20040916m.jar.license.txt Fri Sep 17 07:36:29 2004
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
Added: cocoon/branches/BRANCH_2_1_X/legal/myfaces-jsf-api-20040916.jar.license.txt
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/legal/myfaces-jsf-api-20040916.jar.license.txt Fri Sep 17 07:36:29 2004
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml Fri Sep 17 07:36:29 2004
@@ -977,8 +977,8 @@
However, these APIs can be quite complex to understand and utilize.
The BeanUtils component provides easy-to-use wrappers around these capabilities.
</description>
- <used-by>BetwixtTransformer</used-by>
- <lib>scratchpad/lib/commons-beanutils-core-1.7.jar</lib>
+ <used-by>Faces block, BetwixtTransformer</used-by>
+ <lib>faces/lib/commons-beanutils-core-1.7.jar</lib>
<homepage>http://jakarta.apache.org/commons/beanutils/</homepage>
</file>
@@ -990,8 +990,8 @@
XML elements is recognized. A rich set of predefined rules is
available for your use, or you can also create your own.
</description>
- <used-by>BetwixtTransformer</used-by>
- <lib>scratchpad/lib/commons-digester-1.5.jar</lib>
+ <used-by>Faces block, BetwixtTransformer</used-by>
+ <lib>faces/lib/commons-digester-1.5.jar</lib>
<homepage>http://jakarta.apache.org/commons/digester/</homepage>
</file>
@@ -1131,5 +1131,47 @@
<used-by>XSLTC, javaflow</used-by>
<lib>endorsed/jakarta-bcel-20040329.jar</lib>
<homepage>http://jakarta.apache.org/bcel/</homepage>
+ </file>
+
+ <file>
+ <title>MyFaces</title>
+ <description>
+ MyFaces is an open source implementation of the JSR-127 JavaServer Faces
+ specification.
+ </description>
+ <used-by>Faces block</used-by>
+ <lib>faces/lib/myfaces-20040916m.jar</lib>
+ <homepage>http://www.myfaces.org/</homepage>
+ </file>
+
+ <file>
+ <title>MyFaces</title>
+ <description>
+ MyFaces is an open source implementation of the JSR-127 JavaServer Faces
+ specification.
+ </description>
+ <used-by>Faces block</used-by>
+ <lib>faces/lib/myfaces-jsf-api-20040916.jar</lib>
+ <homepage>http://www.myfaces.org/</homepage>
+ </file>
+
+ <file>
+ <title>Jakarta Commons EL</title>
+ <description>
+ EL is the JSP 2.0 Expression Language Interpreter from Apache.
+ </description>
+ <used-by>Faces block</used-by>
+ <lib>faces/lib/commons-el-1.0.jar</lib>
+ <homepage>http://jakarta.apache.org/commons/el/</homepage>
+ </file>
+
+ <file>
+ <title>Apache Tomcat JSP API</title>
+ <description>
+ JSP API classes from Apache Tomcat
+ </description>
+ <used-by>Faces block</used-by>
+ <lib>faces/lib/jsp-api-2.0.jar</lib>
+ <homepage>http://jakarta.apache.org/tomcat/</homepage>
</file>
</jars>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/WEB-INF/faces-config.xml
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/WEB-INF/faces-config.xml Fri Sep 17 07:36:29 2004
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>hello</managed-bean-name>
+ <managed-bean-class>org.apache.cocoon.faces.samples.Hello</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <navigation-rule>
+ <from-view-id>/samples/blocks/faces/hello</from-view-id>
+ <navigation-case>
+ <from-outcome>flip</from-outcome>
+ <to-view-id>/samples/blocks/faces/goodbye</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/samples/blocks/faces/goodbye</from-view-id>
+ <navigation-case>
+ <from-outcome>flip</from-outcome>
+ <to-view-id>/samples/blocks/faces/hello</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces-listener.xweb
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces-listener.xweb Fri Sep 17 07:36:29 2004
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<xweb xpath="/web-app" unless="listener" insert-before="node()[1]">
+
+ <listener>
+ <listener-class>net.sourceforge.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+</xweb>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces-taglib.xconf
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces-taglib.xconf Fri Sep 17 07:36:29 2004
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<xconf xpath="/cocoon/component[@role='org.apache.cocoon.taglib.TagSelector']"
+ unless="taglib[@name='http://java.sun.com/jsf/core']">
+
+ <taglib name="http://java.sun.com/jsf/core" logger="sitemap.taglib.jsf" class="org.apache.cocoon.components.ExtendedComponentSelector">
+ <tag name="actionListener" class="org.apache.cocoon.faces.taglib.ActionListenerTag" logger="sitemap.taglib.jsf"/>
+ <tag name="attribute" class="org.apache.cocoon.faces.taglib.AttributeTag" logger="sitemap.taglib.jsf"/>
+ <tag name="convertDateTime" class="org.apache.cocoon.faces.taglib.ConvertDateTimeTag" logger="sitemap.taglib.jsf"/>
+ <tag name="converter" class="org.apache.cocoon.faces.taglib.ConverterTag" logger="sitemap.taglib.jsf"/>
+ <tag name="convertNumber" class="org.apache.cocoon.faces.taglib.ConvertNumberTag" logger="sitemap.taglib.jsf"/>
+ <tag name="facet" class="org.apache.cocoon.faces.taglib.FacetTag" logger="sitemap.taglib.jsf"/>
+ <tag name="loadBundle" class="org.apache.cocoon.faces.taglib.LoadBundleTag" logger="sitemap.taglib.jsf"/>
+ <tag name="param" class="org.apache.cocoon.faces.taglib.ParameterTag" logger="sitemap.taglib.jsf"/>
+ <tag name="selectItem" class="org.apache.cocoon.faces.taglib.SelectItemTag" logger="sitemap.taglib.jsf"/>
+ <tag name="selectItems" class="org.apache.cocoon.faces.taglib.SelectItemsTag" logger="sitemap.taglib.jsf"/>
+ <tag name="subview" class="org.apache.cocoon.faces.taglib.SubviewTag" logger="sitemap.taglib.jsf"/>
+ <tag name="validateDoubleRange" class="org.apache.cocoon.faces.taglib.ValidateDoubleRangeTag" logger="sitemap.taglib.jsf"/>
+ <tag name="validateLength" class="org.apache.cocoon.faces.taglib.ValidateLengthTag" logger="sitemap.taglib.jsf"/>
+ <tag name="validateLongRange" class="org.apache.cocoon.faces.taglib.ValidateLongRangeTag" logger="sitemap.taglib.jsf"/>
+ <tag name="validator" class="org.apache.cocoon.faces.taglib.ValidatorTag" logger="sitemap.taglib.jsf"/>
+ <tag name="valueChangeListener" class="org.apache.cocoon.faces.taglib.ValueChangeListenerTag" logger="sitemap.taglib.jsf"/>
+ <tag name="verbatim" class="org.apache.cocoon.faces.taglib.VerbatimTag" logger="sitemap.taglib.jsf"/>
+ <tag name="view" class="org.apache.cocoon.faces.taglib.ViewTag" logger="sitemap.taglib.jsf"/>
+ </taglib>
+ <taglib name="http://java.sun.com/jsf/html" logger="sitemap.taglib.jsf.html" class="org.apache.cocoon.components.ExtendedComponentSelector">
+ <tag name="column" class="org.apache.cocoon.faces.taglib.html.ColumnTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="commandButton" class="org.apache.cocoon.faces.taglib.html.CommandButtonTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="commandLink" class="org.apache.cocoon.faces.taglib.html.CommandLinkTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="dataTable" class="org.apache.cocoon.faces.taglib.html.DataTableTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="form" class="org.apache.cocoon.faces.taglib.html.FormTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="graphicImage" class="org.apache.cocoon.faces.taglib.html.GraphicImageTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="inputHidden" class="org.apache.cocoon.faces.taglib.html.InputHiddenTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="inputSecret" class="org.apache.cocoon.faces.taglib.html.InputSecretTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="inputText" class="org.apache.cocoon.faces.taglib.html.InputTextTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="inputTextarea" class="org.apache.cocoon.faces.taglib.html.InputTextareaTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="message" class="org.apache.cocoon.faces.taglib.html.MessageTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="messages" class="org.apache.cocoon.faces.taglib.html.MessagesTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="outputFormat" class="org.apache.cocoon.faces.taglib.html.OutputFormatTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="outputLabel" class="org.apache.cocoon.faces.taglib.html.OutputLabelTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="outputLink" class="org.apache.cocoon.faces.taglib.html.OutputLinkTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="outputText" class="org.apache.cocoon.faces.taglib.html.OutputTextTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="panelGrid" class="org.apache.cocoon.faces.taglib.html.PanelGridTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="panelGroup" class="org.apache.cocoon.faces.taglib.html.PanelGroupTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="selectBooleanCheckbox" class="org.apache.cocoon.faces.taglib.html.SelectBooleanCheckboxTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="selectManyCheckbox" class="org.apache.cocoon.faces.taglib.html.SelectManyCheckboxTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="selectManyListbox" class="org.apache.cocoon.faces.taglib.html.SelectManyListboxTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="selectManyMenu" class="org.apache.cocoon.faces.taglib.html.SelectManyMenuTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="selectOneListbox" class="org.apache.cocoon.faces.taglib.html.SelectOneListboxTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="selectOneMenu" class="org.apache.cocoon.faces.taglib.html.SelectOneMenuTag" logger="sitemap.taglib.jsf.html"/>
+ <tag name="selectOneRadio" class="org.apache.cocoon.faces.taglib.html.SelectOneRadioTag" logger="sitemap.taglib.jsf.html"/>
+ </taglib>
+
+</xconf>
Copied: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces.xsamples (from rev 46209, cocoon/branches/BRANCH_2_1_X/src/blocks/apples/conf/apples.xsamples)
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/apples/conf/apples.xsamples (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/conf/faces.xsamples Fri Sep 17 07:36:29 2004
@@ -15,11 +15,11 @@
limitations under the License.
-->
-<xsamples xpath="/samples" unless="group[@name='Apples']">
+<xsamples xpath="/samples" unless="group[@name='Faces']">
- <group name="Apples">
- <sample name="Apples Block" href="apples/">
- Apples (an alternative flow implementation) examples.
+ <group name="Faces">
+ <sample name="Faces Block" href="faces/welcome">
+ JavaServer Faces integration into Cocoon
</sample>
</group>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/META-INF/faces-config.xml
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/META-INF/faces-config.xml Fri Sep 17 07:36:29 2004
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+ <factory>
+ <faces-context-factory>org.apache.cocoon.faces.context.FacesContextFactoryImpl</faces-context-factory>
+ </factory>
+</faces-config>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesAction.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesAction.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,226 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces;
+
+import org.apache.avalon.framework.activity.Initializable;
+import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.thread.ThreadSafe;
+
+import org.apache.cocoon.CascadingIOException;
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.acting.Action;
+import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Redirector;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.Response;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.environment.portlet.ActionResponse;
+import org.apache.cocoon.environment.portlet.PortletResponse;
+
+import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.webapp.FacesServlet;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public class FacesAction extends AbstractLogEnabled
+ implements Action, ThreadSafe, Contextualizable,
+ Configurable, Initializable {
+
+ public static final String REQUEST_REDIRECTOR_ATTRIBUTE = "org.apache.cocoon.faces.REDIRECTOR";
+
+ private Context context;
+
+ private String cutPrefix;
+ private String cutSuffix;
+ private String addPrefix;
+ private String addSuffix;
+
+ private FacesContextFactory facesContextFactory;
+ private Application application;
+ private Lifecycle lifecycle;
+
+
+ /**
+ *
+ */
+ class RedirectorImpl implements FacesRedirector {
+ private Redirector redirector;
+ private Request request;
+ private Response response;
+
+ RedirectorImpl (Redirector redirector, Request request, Response response) {
+ this.redirector = redirector;
+ this.request = request;
+ this.response = response;
+ }
+
+ public void dispatch(String url) throws IOException {
+ // System.err.println("INFO: Dispatching to " + url);
+ try {
+ // TODO: HACK: Dependency on ActionResponse
+ if (response instanceof ActionResponse) {
+ // Can't render response. Redirect to another face.
+ redirector.redirect(true, url);
+ } else {
+ // Need to render face. Convert face URL to view URL.
+ int begin = 0;
+ int end = url.length();
+
+ if (cutPrefix != null && url.startsWith(cutPrefix)) {
+ begin = cutPrefix.length();
+ }
+ if (cutSuffix != null && url.endsWith(cutSuffix)) {
+ end = end - cutSuffix.length();
+ }
+
+ StringBuffer buffer = new StringBuffer();
+ if (addPrefix != null) {
+ buffer.append(addPrefix);
+ }
+ if (begin < end) {
+ buffer.append(url.substring(begin, end));
+ }
+ if (addSuffix != null) {
+ buffer.append(addSuffix);
+ }
+ url = buffer.toString();
+
+ // System.err.println("INFO: Dispatching to view " + url);
+ redirector.redirect(true, "cocoon:/" + url);
+ }
+ } catch (Exception e) {
+ throw new CascadingIOException(e);
+ }
+ }
+
+ public void redirect(String url) throws IOException {
+ // System.err.println("redirect: " + url);
+ try {
+ redirector.redirect(true, url);
+ } catch (Exception e) {
+ throw new CascadingIOException(e);
+ }
+ }
+
+ public String encodeActionURL(String url) {
+ // System.err.println("encodeActionURL: " + url);
+ // TODO: HACK: Dependency on PortletResponse
+ if (response instanceof PortletResponse) {
+ final String context = request.getContextPath();
+
+ if (url.startsWith(context)) {
+ url = url.substring(context.length());
+ // System.err.println("encodeActionURL: cut: " + url);
+ }
+
+ return "portlet:action:" + response.encodeURL(url);
+ } else {
+ return response.encodeURL(url);
+ }
+ }
+
+ public String encodeResourceURL(String url) {
+ // System.err.println("encodeResourceURL: " + url);
+ return response.encodeURL(url);
+ }
+ }
+
+
+ public void contextualize(org.apache.avalon.framework.context.Context avalonContext) throws ContextException {
+ context = (Context) avalonContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
+ }
+
+ public void configure(Configuration configuration) throws ConfigurationException {
+ this.cutPrefix = configuration.getChild("cut-prefix").getValue(null);
+ this.cutSuffix = configuration.getChild("cut-suffix").getValue(".faces");
+ this.addPrefix = configuration.getChild("add-prefix").getValue(null);
+ this.addSuffix = configuration.getChild("add-suffix").getValue(".view");
+ }
+
+ public void initialize() throws Exception {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Initializing FacesAction");
+ }
+
+ facesContextFactory = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
+ // facesContextFactory = new FacesContextFactoryImpl();
+
+ ApplicationFactory applicationFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ application = applicationFactory.getApplication();
+ // application.setDefaultRenderKitId("COCOON_BASIC_XHTML");
+
+ LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ String lifecycleID = context.getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR);
+ if (lifecycleID == null) {
+ lifecycleID = "DEFAULT";
+ }
+ lifecycle = lifecycleFactory.getLifecycle(lifecycleID);
+
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Faces context factory is " + facesContextFactory.getClass().getName());
+ getLogger().debug("Faces application factory is " + applicationFactory.getClass().getName());
+ getLogger().debug("Faces lifecycle factory is " + lifecycleFactory.getClass().getName());
+ }
+ }
+
+ public Map act(Redirector redirector,
+ SourceResolver resolver,
+ Map objectModel,
+ String source,
+ Parameters parameters)
+ throws Exception {
+ Request request = ObjectModelHelper.getRequest(objectModel);
+ Response response = ObjectModelHelper.getResponse(objectModel);
+
+ // Pass FacesRedirector to the FacesContext implementation.
+ request.setAttribute(REQUEST_REDIRECTOR_ATTRIBUTE, new RedirectorImpl(redirector, request, response));
+
+ FacesContext context = facesContextFactory.getFacesContext(this.context, request, response, lifecycle);
+ try {
+ lifecycle.execute(context);
+ lifecycle.render(context);
+
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Request processed; View root ID: " + context.getViewRoot().getId());
+ }
+ } catch (FacesException e) {
+ throw new ProcessingException("Failed to process faces request", e);
+ } finally {
+ context.release();
+ }
+
+ return null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesRedirector.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesRedirector.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,33 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public interface FacesRedirector {
+
+ void dispatch(String url) throws IOException;
+
+ void redirect(String url) throws IOException;
+
+ String encodeActionURL(String url);
+
+ String encodeResourceURL(String url);
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesUtils.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/FacesUtils.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,115 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces;
+
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.cocoon.taglib.Tag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public class FacesUtils {
+
+ /**
+ * Key of the {@link FacesContext} in the object model.
+ */
+ private static final String FACES_CONTEXT_OBJECT = "javax.faces.webapp.FACES_CONTEXT";
+
+ /**
+ * Find current FacesContext, and store it in the objectModel
+ */
+ public static FacesContext getFacesContext(Tag tag, Map objectModel) {
+ FacesContext context = (FacesContext) objectModel.get(FACES_CONTEXT_OBJECT);
+ if (context == null) {
+ context = FacesContext.getCurrentInstance();
+ if (context == null) {
+ throw new FacesException("Tag <" + tag.getClass().getName() + "> " +
+ "could not find current FacesContext");
+ }
+ objectModel.put(FACES_CONTEXT_OBJECT, context);
+ }
+
+ return context;
+ }
+
+ /**
+ * Find child component by ID
+ */
+ public static UIComponent getChild(UIComponent component, String id) {
+ for (Iterator kids = component.getChildren().iterator(); kids.hasNext();) {
+ UIComponent kid = (UIComponent) kids.next();
+ if (id.equals(kid.getId())) {
+ return kid;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Remove child component by ID
+ */
+ public static UIComponent removeChild(UIComponent component, String id) {
+ UIComponent kid = getChild(component, id);
+ if (kid != null) {
+ component.getChildren().remove(kid);
+ }
+
+ return kid;
+ }
+
+ /**
+ * Is this an expression?
+ */
+ public static boolean isExpression(String value) {
+ if (value == null) {
+ return false;
+ }
+
+ int i = value.indexOf("#{");
+ return i != -1 && i < value.indexOf('}');
+ }
+
+ /**
+ * Evaluate expression
+ */
+ public static Object evaluate(FacesContext context, String value) {
+ if (isExpression(value)) {
+ return context.getApplication().createValueBinding(value).getValue(context);
+ }
+
+ return value;
+ }
+
+ /**
+ *
+ */
+ public static UIComponentTag findParentUIComponentTag(Tag tag) {
+ Tag parent = tag;
+ do {
+ parent = parent.getParent();
+ } while (parent != null && !(parent instanceof UIComponentTag));
+
+ return (UIComponentTag) parent;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/ApplicationMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/ApplicationMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,74 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Context;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Application context attributes map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class ApplicationMap extends BaseMap {
+
+ private Context context;
+
+
+ ApplicationMap(Context context) {
+ this.context = context;
+ }
+
+ public Object get(Object key) {
+ return context.getAttribute(key.toString());
+ }
+
+ public Object put(Object key, Object value) {
+ String sKey = key.toString();
+ Object old = context.getAttribute(sKey);
+ context.setAttribute(sKey, value);
+ return old;
+ }
+
+ public Object remove(Object key) {
+ String sKey = key.toString();
+ Object old = context.getAttribute(sKey);
+ context.removeAttribute(sKey);
+ return old;
+ }
+
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = context.getAttributeNames(); e.hasMoreElements();) {
+ String name = (String) e.nextElement();
+ entries.add(new BaseMap.Entry(name, context.getAttribute(name)));
+ }
+
+ return entries;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof ApplicationMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/BaseMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/BaseMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,88 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Base class for JSF context maps
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+abstract class BaseMap extends java.util.AbstractMap {
+
+ static class Entry implements Map.Entry {
+ private final Object key;
+ private final Object value;
+
+ Entry(Object key, Object value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public Object getKey() {
+ return key;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public Object setValue(Object value) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int hashCode() {
+ return (key != null ? key.hashCode() : 0) ^ (value != null ? value.hashCode() : 0);
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof Map.Entry)) {
+ return false;
+ }
+
+ Map.Entry other = (Map.Entry) obj;
+ Object key = other.getKey();
+ if (key == this.key || key != null && key.equals(this.key)) {
+ Object value = other.getValue();
+ return value == this.value || value != null && value.equals(this.value);
+ }
+ return false;
+ }
+ }
+
+
+ BaseMap() {
+ }
+
+ public void clear() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void putAll(Map t) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object remove(Object key) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set entrySet() {
+ throw new UnsupportedOperationException();
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/ExternalContextImpl.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/ExternalContextImpl.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,218 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.Response;
+import org.apache.cocoon.faces.FacesAction;
+import org.apache.cocoon.faces.FacesRedirector;
+
+import org.apache.commons.collections.iterators.EnumerationIterator;
+
+import javax.faces.context.ExternalContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.Principal;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Implementation of the Java Server Faces ExternalContext
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public class ExternalContextImpl extends ExternalContext {
+
+ private Context context;
+ private Request request;
+ private Response response;
+
+
+ public ExternalContextImpl(Context context, Request request, Response response) {
+ this.context = context;
+ this.request = request;
+ this.response = response;
+ }
+
+ public void dispatch(String url) throws IOException {
+ FacesRedirector redirector = (FacesRedirector)request.getAttribute(FacesAction.REQUEST_REDIRECTOR_ATTRIBUTE);
+ if (redirector == null) {
+ throw new IOException("Can not dispatch to <" + url + ">: Redirector missing.");
+ }
+
+ redirector.dispatch(url);
+ }
+
+ public String encodeActionURL(String url) {
+ FacesRedirector redirector = (FacesRedirector)request.getAttribute(FacesAction.REQUEST_REDIRECTOR_ATTRIBUTE);
+ if (redirector == null) {
+ throw new RuntimeException("Can not dispatch to <" + url + ">: Redirector missing.");
+ }
+
+ return redirector.encodeActionURL(url);
+ }
+
+ public String encodeNamespace(String ns) {
+ return ns;
+ }
+
+ public String encodeResourceURL(String url) {
+ FacesRedirector redirector = (FacesRedirector)request.getAttribute(FacesAction.REQUEST_REDIRECTOR_ATTRIBUTE);
+ if (redirector == null) {
+ throw new RuntimeException("Can not dispatch to <" + url + ">: Redirector missing.");
+ }
+
+ return redirector.encodeResourceURL(url);
+ }
+
+ public Map getApplicationMap() {
+ return new ApplicationMap(this.context);
+ }
+
+ public String getAuthType() {
+ return this.request.getAuthType();
+ }
+
+ public Object getContext() {
+ return this.context;
+ }
+
+ public String getInitParameter(String parameter) {
+ return this.context.getInitParameter(parameter);
+ }
+
+ public Map getInitParameterMap() {
+ return new InitParameterMap(this.context);
+ }
+
+ public String getRemoteUser() {
+ return this.request.getRemoteUser();
+ }
+
+ public Object getRequest() {
+ return this.request;
+ }
+
+ public String getRequestContextPath() {
+ return this.request.getContextPath();
+ }
+
+ public Map getRequestCookieMap() {
+ // TODO: Implement getRequestCookieMap
+ System.err.println("WARNING: getRequestCookieMap called.");
+ return Collections.EMPTY_MAP;
+ }
+
+ public Map getRequestHeaderMap() {
+ return new RequestHeaderMap(this.request);
+ }
+
+ public Map getRequestHeaderValuesMap() {
+ return new RequestHeaderValuesMap(this.request);
+ }
+
+ public Locale getRequestLocale() {
+ return this.request.getLocale();
+ }
+
+ public Iterator getRequestLocales() {
+ return new EnumerationIterator(this.request.getLocales());
+ }
+
+ public Map getRequestMap() {
+ return new RequestMap(this.request);
+ }
+
+ public Map getRequestParameterMap() {
+ return new RequestParameterMap(this.request);
+ }
+
+ public Iterator getRequestParameterNames() {
+ return new EnumerationIterator(this.request.getParameterNames());
+ }
+
+ public Map getRequestParameterValuesMap() {
+ return new RequestParameterValuesMap(this.request);
+ }
+
+ public String getRequestPathInfo() {
+ return this.request.getPathInfo();
+ }
+
+ public String getRequestServletPath() {
+ return this.request.getServletPath();
+ }
+
+ public URL getResource(String resource) throws MalformedURLException {
+ return this.context.getResource(resource);
+ }
+
+ public InputStream getResourceAsStream(String resource) {
+ return this.context.getResourceAsStream(resource);
+ }
+
+ public Set getResourcePaths(String path) {
+ // TODO: Implement getResourcePaths
+ System.err.println("WARNING: getResourcePaths(" + path + ") called.");
+ throw new UnsupportedOperationException();
+ }
+
+ public Object getResponse() {
+ return this.response;
+ }
+
+ public Object getSession(boolean create) {
+ return this.request.getSession(create);
+ }
+
+ public Map getSessionMap() {
+ return new SessionMap(request.getSession());
+ }
+
+ public Principal getUserPrincipal() {
+ return this.request.getUserPrincipal();
+ }
+
+ public boolean isUserInRole(String role) {
+ return this.request.isUserInRole(role);
+ }
+
+ public void log(String message) {
+ // TODO: Implement
+ System.err.println("WARNING: log(" + message + ") called.");
+ }
+
+ public void log(String message, Throwable e) {
+ // TODO: Implement
+ System.err.println("WARNING: log(" + message + ", " + e + ") called.");
+ }
+
+ public void redirect(String url) throws IOException {
+ FacesRedirector redirector = (FacesRedirector)request.getAttribute(FacesAction.REQUEST_REDIRECTOR_ATTRIBUTE);
+ if (redirector == null) {
+ throw new IOException("Can not dispatch to " + url + ": Redirector missing.");
+ }
+
+ redirector.redirect(url);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/FacesContextFactoryImpl.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/FacesContextFactoryImpl.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,77 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.Response;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.Lifecycle;
+
+/**
+ * JSF Context Factory Implementation
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public class FacesContextFactoryImpl extends FacesContextFactory {
+ // private static final String FALLBACK_FACTORY = "com.sun.faces.context.FacesContextFactoryImpl";
+ private static final String FALLBACK_FACTORY = "net.sourceforge.myfaces.context.FacesContextFactoryImpl";
+
+ private FacesContextFactory fallback;
+
+
+ public FacesContextFactoryImpl() {
+ try {
+ this.fallback =
+ (FacesContextFactory) Class.forName(FALLBACK_FACTORY).newInstance();
+ } catch (Exception ignored) {
+ }
+ }
+
+ public FacesContext getFacesContext(Object context,
+ Object request,
+ Object response,
+ Lifecycle lifecycle)
+ throws FacesException {
+ try {
+ if (!(context instanceof Context)) {
+ throw new FacesException("Context must be instance of " + Context.class.getName());
+ }
+
+ if (!(request instanceof Request)) {
+ throw new FacesException("Request must be instance of " + Request.class.getName());
+ }
+
+ if (!(response instanceof Response)) {
+ throw new FacesException("Response must be instance of " + Response.class.getName());
+ }
+
+ return new FacesContextImpl(new ExternalContextImpl((Context) context,
+ (Request) request,
+ (Response) response));
+ } catch (FacesException e) {
+ try {
+ return this.fallback.getFacesContext(context, request, response, lifecycle);
+ } catch (Exception ignored) {
+ throw e;
+ }
+ }
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/FacesContextImpl.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/FacesContextImpl.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,237 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseStream;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Implementation of the Java Server Faces Context
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public class FacesContextImpl extends FacesContext {
+ private ExternalContextImpl extContext;
+
+ private boolean released;
+ private boolean renderResponse;
+ private boolean responseComplete;
+
+ private Application application;
+ private UIViewRoot viewRoot;
+ private Map messages;
+
+ private ResponseStream responseStream;
+ private ResponseWriter responseWriter;
+
+
+ FacesContextImpl(ExternalContextImpl extContext) {
+ this.extContext = extContext;
+ FacesContext.setCurrentInstance(this);
+ }
+
+ private void checkReleased() {
+ if (released) {
+ throw new IllegalStateException("Context is released.");
+ }
+ }
+
+ public Application getApplication() {
+ checkReleased();
+
+ if (application == null) {
+ ApplicationFactory aFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ this.application = aFactory.getApplication();
+ }
+
+ return this.application;
+ }
+
+ public Iterator getClientIdsWithMessages() {
+ checkReleased();
+
+ if (this.messages == null) {
+ return Collections.EMPTY_LIST.iterator();
+ } else {
+ return this.messages.keySet().iterator();
+ }
+ }
+
+ public ExternalContext getExternalContext() {
+ checkReleased();
+ return this.extContext;
+ }
+
+ public Severity getMaximumSeverity() {
+ throw new UnsupportedOperationException();
+ }
+
+ public Iterator getMessages() {
+ checkReleased();
+ if (this.messages == null) {
+ return Collections.EMPTY_LIST.iterator();
+ }
+
+ List messages = new ArrayList();
+ for (Iterator i = this.messages.values().iterator(); i.hasNext();) {
+ final List list = (List) i.next();
+ messages.addAll(list);
+ }
+
+ if (messages.size() > 0) {
+ return messages.iterator();
+ }
+
+ return Collections.EMPTY_LIST.iterator();
+ }
+
+ public Iterator getMessages(String clientID) {
+ checkReleased();
+ if (this.messages != null) {
+ final List list = (List) this.messages.get(clientID);
+ if (list != null) {
+ return list.iterator();
+ }
+ }
+
+ return Collections.EMPTY_LIST.iterator();
+ }
+
+ public RenderKit getRenderKit() {
+ checkReleased();
+
+ UIViewRoot viewRoot = getViewRoot();
+ if (viewRoot == null) {
+ return null;
+ }
+
+ String renderKitId = viewRoot.getRenderKitId();
+ if (renderKitId == null) {
+ return null;
+ } else {
+ RenderKitFactory rkFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ return rkFactory.getRenderKit(this, renderKitId);
+ }
+ }
+
+ public boolean getRenderResponse() {
+ checkReleased();
+ return this.renderResponse;
+ }
+
+ public boolean getResponseComplete() {
+ checkReleased();
+ return this.responseComplete;
+ }
+
+ public ResponseStream getResponseStream() {
+ checkReleased();
+ return this.responseStream;
+ }
+
+ public void setResponseStream(ResponseStream responseStream) {
+ checkReleased();
+ if (responseStream == null) {
+ throw new NullPointerException("ResponseStream can't be null.");
+ }
+
+ this.responseStream = responseStream;
+ }
+
+ public ResponseWriter getResponseWriter() {
+ checkReleased();
+ return this.responseWriter;
+ }
+
+ public void setResponseWriter(ResponseWriter responseWriter) {
+ checkReleased();
+ if (responseWriter == null) {
+ throw new NullPointerException("ResponseWriter can't be null.");
+ }
+
+ this.responseWriter = responseWriter;
+ }
+
+ public UIViewRoot getViewRoot() {
+ checkReleased();
+ return this.viewRoot;
+ }
+
+ public void setViewRoot(UIViewRoot viewRoot) {
+ checkReleased();
+ this.viewRoot = viewRoot;
+ }
+
+ public void addMessage(String clientID, FacesMessage message) {
+ checkReleased();
+ if (message == null) {
+ throw new NullPointerException("Message can't be null");
+ }
+
+ if (messages == null) {
+ messages = new HashMap();
+ }
+
+ List list = (List) messages.get(clientID);
+ if (list == null) {
+ list = new ArrayList();
+ messages.put(clientID, list);
+ }
+
+ list.add(message);
+ }
+
+ public void release() {
+ this.released = true;
+ this.extContext = null;
+
+ FacesContext.setCurrentInstance(null);
+
+ this.application = null;
+ this.viewRoot = null;
+ this.messages = null;
+
+ this.responseStream = null;
+ this.responseWriter = null;
+ }
+
+ public void renderResponse() {
+ checkReleased();
+ this.renderResponse = true;
+ }
+
+ public void responseComplete() {
+ checkReleased();
+ this.responseComplete = true;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/InitParameterMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/InitParameterMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,51 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.Request;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Init parameters map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class InitParameterMap extends BaseMap {
+
+ private Context context;
+
+
+ InitParameterMap(Context context) {
+ this.context = context;
+ }
+
+ public Object get(Object key) {
+ return context.getInitParameter(key.toString());
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof InitParameterMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestHeaderMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestHeaderMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,60 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Request;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Request headers map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class RequestHeaderMap extends BaseMap {
+
+ private Request request;
+
+
+ RequestHeaderMap(Request request) {
+ this.request = request;
+ }
+
+ public Object get(Object key) {
+ return request.getHeader(key.toString());
+ }
+
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = request.getHeaderNames(); e.hasMoreElements();) {
+ String name = (String) e.nextElement();
+ entries.add(new BaseMap.Entry(name, request.getHeader(name)));
+ }
+
+ return entries;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof RequestHeaderMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestHeaderValuesMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestHeaderValuesMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,60 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Request;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Request header values map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class RequestHeaderValuesMap extends BaseMap {
+
+ private Request request;
+
+
+ RequestHeaderValuesMap(Request request) {
+ this.request = request;
+ }
+
+ public Object get(Object key) {
+ return request.getHeaders(key.toString());
+ }
+
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = request.getHeaderNames(); e.hasMoreElements();) {
+ String name = (String) e.nextElement();
+ entries.add(new BaseMap.Entry(name, request.getHeaders(name)));
+ }
+
+ return entries;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof RequestHeaderValuesMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,74 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Request;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Request attributes map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class RequestMap extends BaseMap {
+
+ private Request request;
+
+
+ RequestMap(Request request) {
+ this.request = request;
+ }
+
+ public Object get(Object key) {
+ return request.getAttribute(key.toString());
+ }
+
+ public Object put(Object key, Object value) {
+ String sKey = key.toString();
+ Object old = request.getAttribute(sKey);
+ request.setAttribute(sKey, value);
+ return old;
+ }
+
+ public Object remove(Object key) {
+ String sKey = key.toString();
+ Object old = request.getAttribute(sKey);
+ request.removeAttribute(sKey);
+ return old;
+ }
+
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = request.getAttributeNames(); e.hasMoreElements();) {
+ String name = (String) e.nextElement();
+ entries.add(new BaseMap.Entry(name, request.getAttribute(name)));
+ }
+
+ return entries;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof RequestMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestParameterMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestParameterMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,60 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Request;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Request parameters map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class RequestParameterMap extends BaseMap {
+
+ private Request request;
+
+
+ RequestParameterMap(Request request) {
+ this.request = request;
+ }
+
+ public Object get(Object key) {
+ return request.getParameter(key.toString());
+ }
+
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) {
+ String name = (String) e.nextElement();
+ entries.add(new BaseMap.Entry(name, request.getParameter(name)));
+ }
+
+ return entries;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof RequestParameterMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestParameterValuesMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/RequestParameterValuesMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,60 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Request;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Request parameter values map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class RequestParameterValuesMap extends BaseMap {
+
+ private Request request;
+
+
+ RequestParameterValuesMap(Request request) {
+ this.request = request;
+ }
+
+ public Object get(Object key) {
+ return request.getParameterValues(key.toString());
+ }
+
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) {
+ String name = (String) e.nextElement();
+ entries.add(new BaseMap.Entry(name, request.getParameterValues(name)));
+ }
+
+ return entries;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof RequestParameterValuesMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/SessionMap.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/context/SessionMap.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,74 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.context;
+
+import org.apache.cocoon.environment.Session;
+
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Session attributes map
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+class SessionMap extends BaseMap {
+
+ private Session session;
+
+
+ SessionMap(Session session) {
+ this.session = session;
+ }
+
+ public Object get(Object key) {
+ return session.getAttribute(key.toString());
+ }
+
+ public Object put(Object key, Object value) {
+ String sKey = key.toString();
+ Object old = session.getAttribute(sKey);
+ session.setAttribute(sKey, value);
+ return old;
+ }
+
+ public Object remove(Object key) {
+ String sKey = key.toString();
+ Object old = session.getAttribute(sKey);
+ session.removeAttribute(sKey);
+ return old;
+ }
+
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = session.getAttributeNames(); e.hasMoreElements();) {
+ String name = (String) e.nextElement();
+ entries.add(new BaseMap.Entry(name, session.getAttribute(name)));
+ }
+
+ return entries;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof SessionMap)) {
+ return false;
+ }
+
+ return super.equals(obj);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/renderkit/XMLResponseWriter.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/renderkit/XMLResponseWriter.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,202 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.renderkit;
+
+import org.apache.cocoon.CascadingIOException;
+import org.apache.cocoon.xml.XMLConsumer;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.ResponseWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * JSF Response Writer writing SAX events into the XMLConsumer
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public class XMLResponseWriter extends ResponseWriter {
+ private String contentType;
+ private String encoding;
+ private XMLConsumer xmlConsumer;
+
+ private boolean closeStart;
+ private String name;
+ private AttributesImpl attrs;
+
+ private char charHolder[];
+
+
+ public XMLResponseWriter(XMLConsumer xmlConsumer, String contentType, String encoding) throws FacesException {
+ this.contentType = contentType != null ? contentType : "application/xml";
+ this.encoding = encoding;
+ this.xmlConsumer = xmlConsumer;
+
+ this.attrs = new AttributesImpl();
+ this.charHolder = new char[1];
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public String getCharacterEncoding() {
+ return encoding;
+ }
+
+ public void startDocument() throws IOException {
+ }
+
+ public void endDocument() throws IOException {
+ closeStartIfNecessary();
+ }
+
+ public void flush() throws IOException {
+ closeStartIfNecessary();
+ }
+
+ public void startElement(String name, UIComponent component) throws IOException {
+ closeStartIfNecessary();
+ this.name = name;
+ this.closeStart = true;
+ }
+
+ public void endElement(String name) throws IOException {
+ closeStartIfNecessary();
+ try {
+ this.xmlConsumer.endElement("", name, name);
+ } catch (SAXException e) {
+ throw new CascadingIOException("SAXException", e);
+ }
+ }
+
+ public void writeAttribute(String name, Object value, String componentPropertyName) throws IOException {
+ if (value == null) {
+ this.attrs.addAttribute("", name, name, "CDATA", "");
+ } else if (Boolean.TRUE.equals(value)) {
+ this.attrs.addAttribute("", name, name, "CDATA", name);
+ } else {
+ this.attrs.addAttribute("", name, name, "CDATA", value.toString());
+ }
+ }
+
+ public void writeURIAttribute(String name, Object value, String componentPropertyName) throws IOException {
+ this.attrs.addAttribute("", name, name, "CDATA", value.toString());
+ }
+
+ public void writeComment(Object comment) throws IOException {
+ closeStartIfNecessary();
+ char[] ch = comment.toString().toCharArray();
+ try {
+ this.xmlConsumer.comment(ch, 0, ch.length);
+ } catch (SAXException e) {
+ throw new CascadingIOException("SAXException", e);
+ }
+ }
+
+ public void writeText(Object text, String componentPropertyName) throws IOException {
+ closeStartIfNecessary();
+ char[] ch = text.toString().toCharArray();
+ try {
+ this.xmlConsumer.characters(ch, 0, ch.length);
+ } catch (SAXException e) {
+ throw new CascadingIOException("SAXException", e);
+ }
+ }
+
+ public void writeText(char text) throws IOException {
+ closeStartIfNecessary();
+ charHolder[0] = text;
+ try {
+ this.xmlConsumer.characters(charHolder, 0, 1);
+ } catch (SAXException e) {
+ throw new CascadingIOException("SAXException", e);
+ }
+ }
+
+ public void writeText(char text[]) throws IOException {
+ closeStartIfNecessary();
+ try {
+ this.xmlConsumer.characters(text, 0, text.length);
+ } catch (SAXException e) {
+ throw new CascadingIOException("SAXException", e);
+ }
+ }
+
+ public void writeText(char text[], int off, int len) throws IOException {
+ closeStartIfNecessary();
+ try {
+ this.xmlConsumer.characters(text, off, len);
+ } catch (SAXException e) {
+ throw new CascadingIOException("SAXException", e);
+ }
+ }
+
+ public ResponseWriter cloneWithWriter(Writer writer) {
+ if (!(writer instanceof XMLResponseWriter)) {
+ throw new IllegalArgumentException("Expected XMLResponseWriter got " + writer);
+ }
+ return new XMLResponseWriter(((XMLResponseWriter) writer).xmlConsumer,
+ getContentType(),
+ getCharacterEncoding());
+ }
+
+ private void closeStartIfNecessary() throws IOException {
+ if (closeStart) {
+ try {
+ this.xmlConsumer.startElement("", this.name, this.name, this.attrs);
+ } catch (SAXException e) {
+ throw new CascadingIOException("SAXException", e);
+ }
+ this.attrs.clear();
+ closeStart = false;
+ }
+ }
+
+ public void close() throws IOException {
+ closeStartIfNecessary();
+ }
+
+ public void write(char cbuf) throws IOException {
+ closeStartIfNecessary();
+ writeText(cbuf);
+ }
+
+ public void write(char cbuf[], int off, int len) throws IOException {
+ closeStartIfNecessary();
+ writeText(cbuf);
+ }
+
+ public void write(int c) throws IOException {
+ closeStartIfNecessary();
+ writeText((char) c);
+ }
+
+ public void write(String str) throws IOException {
+ closeStartIfNecessary();
+ writeText(str.toCharArray());
+ }
+
+ public void write(String str, int off, int len) throws IOException {
+ closeStartIfNecessary();
+ writeText(str.toCharArray(), off, len);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/Hello.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/samples/Hello.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,46 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.samples;
+
+/**
+ * Hello World sample
+ *
+ * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
+ * @version CVS $Id$
+ */
+public class Hello {
+ private String value;
+
+
+ public String getValue() {
+ return this.value;
+ }
+
+ public void setValue(String value) {
+ if ("".equals(value)) {
+ value = null;
+ }
+ this.value = value;
+ }
+
+ public String doButton1Action() {
+ return "done";
+ }
+
+ public String doButton2Action() {
+ return "flip";
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ActionListenerTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ActionListenerTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,77 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.ActionSource;
+import javax.faces.component.UIComponent;
+import javax.faces.event.ActionListener;
+
+/**
+ * @version CVS $Id$
+ */
+public class ActionListenerTag extends TagSupport {
+
+ private String type;
+
+ public String getType() {
+ return this.type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ if (tag == null) {
+ throw new SAXException("Tag <" + getClass().getName() + "> have to be nested within a UIComponentTag");
+ }
+
+ if (!tag.getCreated()) {
+ return 0;
+ }
+
+ UIComponent component = tag.getComponentInstance();
+ if (component == null) {
+ throw new SAXException("Parent tag <" + tag.getClass().getName() + "> has no component instance");
+ }
+
+ if (component instanceof ActionSource) {
+ String clazz = (String) tag.createValueBinding(this.type).getValue(tag.getFacesContext());
+ ActionListener handler = null;
+ try {
+ handler = (ActionListener) Class.forName(clazz).newInstance();
+ } catch (Exception e) {
+ throw new SAXException("Tag <" + tag.getClass().getName() + "> could not create action listener <" + clazz + ">", e);
+ }
+ ((ActionSource)component).addActionListener(handler);
+ }
+
+ return SKIP_BODY;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.type = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/AttributeTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/AttributeTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,68 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @version CVS $Id$
+ */
+public class AttributeTag extends TagSupport {
+
+ private String name;
+ private String value;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ if (tag == null) {
+ throw new SAXException("Tag <" + getClass().getName() + "> have to be nested within a UIComponentTag");
+ }
+
+ UIComponent component = tag.getComponentInstance();
+ if (component == null) {
+ throw new SAXException("Parent tag <" + tag.getClass(). getName() + "> has no component instance");
+ }
+
+ String nameVal = (String) tag.evaluate(name);
+ Object valueVal = tag.evaluate(value);
+ if (component.getAttributes().get(nameVal) == null) {
+ component.getAttributes().put(nameVal, valueVal);
+ }
+
+ return SKIP_BODY;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.name = null;
+ this.value = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConvertDateTimeTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConvertDateTimeTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,125 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+import org.apache.cocoon.i18n.I18nUtils;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.DateTimeConverter;
+import java.util.Locale;
+import java.util.TimeZone;
+
+/**
+ * @version CVS $Id$
+ */
+public class ConvertDateTimeTag extends ConverterTag {
+ private String dateStyle;
+ private String locale;
+ private String pattern;
+ private String timeStyle;
+ private String timeZone;
+ private String type;
+
+ public void setDateStyle(String dateStyle) {
+ this.dateStyle = dateStyle;
+ }
+
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+ public void setTimeStyle(String timeStyle) {
+ this.timeStyle = timeStyle;
+ }
+
+ public void setTimeZone(String timeZone) {
+ this.timeZone = timeZone;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ setConverterId("javax.faces.DateTime");
+ return super.doStartTag(namespaceURI, localName, qName, atts);
+ }
+
+ protected Converter getConverter() {
+ final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ DateTimeConverter converter = (DateTimeConverter) super.getConverter();
+
+ converter.setDateStyle((String) tag.evaluate(dateStyle));
+ converter.setPattern((String) tag.evaluate(pattern));
+ converter.setTimeStyle((String) tag.evaluate(timeStyle));
+
+ String t = null;
+ if (type != null) {
+ t = (String) tag.evaluate(type);
+ } else if (timeStyle != null) {
+ t = dateStyle != null? "both" : "time";
+ } else {
+ t = "date";
+ }
+ converter.setType(t);
+
+ Locale l = null;
+ if (locale != null) {
+ if (FacesUtils.isExpression(locale)) {
+ l = (Locale) tag.evaluate(locale);
+ } else {
+ l = I18nUtils.parseLocale(locale);
+ }
+ }
+ converter.setLocale(l);
+
+ TimeZone tz = null;
+ if (timeZone != null) {
+ if (FacesUtils.isExpression(timeZone)) {
+ tz = (TimeZone) tag.evaluate(timeZone);
+ } else {
+ tz = TimeZone.getTimeZone(timeZone);
+ }
+ }
+ converter.setTimeZone(tz);
+
+ return converter;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.dateStyle = null;
+ this.locale = null;
+ this.pattern = null;
+ this.timeStyle = null;
+ this.timeZone = null;
+ this.type = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConvertNumberTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConvertNumberTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,152 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.i18n.I18nUtils;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.NumberConverter;
+import java.util.Locale;
+
+/**
+ * @version CVS $Id$
+ */
+public class ConvertNumberTag extends ConverterTag {
+ private String currencyCode;
+ private String currencySymbol;
+ private String groupingUsed;
+ private String integerOnly;
+ private String maxFractionDigits;
+ private String maxIntegerDigits;
+ private String minFractionDigits;
+ private String minIntegerDigits;
+ private String locale;
+ private String pattern;
+ private String type;
+
+
+ public void setCurrencyCode(String currencyCode) {
+ this.currencyCode = currencyCode;
+ }
+
+ public void setCurrencySymbol(String currencySymbol) {
+ this.currencySymbol = currencySymbol;
+ }
+
+ public void setGroupingUsed(String groupingUsed) {
+ this.groupingUsed = groupingUsed;
+ }
+
+ public void setIntegerOnly(String integerOnly) {
+ this.integerOnly = integerOnly;
+ }
+
+ public void setMaxFractionDigits(String maxFractionDigits) {
+ this.maxFractionDigits = maxFractionDigits;
+ }
+
+ public void setMaxIntegerDigits(String maxIntegerDigits) {
+ this.maxIntegerDigits = maxIntegerDigits;
+ }
+
+ public void setMinFractionDigits(String minFractionDigits) {
+ this.minFractionDigits = minFractionDigits;
+ }
+
+ public void setMinIntegerDigits(String minIntegerDigits) {
+ this.minIntegerDigits = minIntegerDigits;
+ }
+
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ super.setConverterId("javax.faces.Number");
+ return super.doStartTag(namespaceURI, localName, qName, atts);
+ }
+
+ protected Converter getConverter() {
+ final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ NumberConverter converter = (NumberConverter) super.getConverter();
+
+ converter.setCurrencyCode((String) tag.evaluate(currencyCode));
+ converter.setCurrencySymbol((String) tag.evaluate(currencySymbol));
+ converter.setPattern((String) tag.evaluate(pattern));
+ converter.setType((String) tag.evaluate(type));
+
+ if (groupingUsed != null) {
+ converter.setGroupingUsed(tag.evaluateBoolean(groupingUsed));
+ }
+ if (integerOnly != null) {
+ converter.setIntegerOnly(tag.evaluateBoolean(integerOnly));
+ }
+
+ if (maxFractionDigits != null) {
+ converter.setMaxFractionDigits(tag.evaluateInteger(maxFractionDigits));
+ }
+ if (maxIntegerDigits != null) {
+ converter.setMaxIntegerDigits(tag.evaluateInteger(maxIntegerDigits));
+ }
+ if (minFractionDigits != null) {
+ converter.setMinFractionDigits(tag.evaluateInteger(minFractionDigits));
+ }
+ if (minIntegerDigits != null) {
+ converter.setMinIntegerDigits(tag.evaluateInteger(minIntegerDigits));
+ }
+
+ Locale l = null;
+ if (locale != null) {
+ if (FacesUtils.isExpression(locale)) {
+ l = (Locale) tag.evaluate(locale);
+ } else {
+ l = I18nUtils.parseLocale(locale);
+ }
+ }
+ converter.setLocale(l);
+
+ return converter;
+ }
+
+ public void recycle() {
+ super.recycle();
+ currencyCode = null;
+ currencySymbol = null;
+ groupingUsed = null;
+ integerOnly = null;
+ maxFractionDigits = null;
+ maxIntegerDigits = null;
+ minFractionDigits = null;
+ minIntegerDigits = null;
+ locale = null;
+ pattern = null;
+ type = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConverterTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ConverterTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,82 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+
+/**
+ * @version CVS $Id$
+ */
+public class ConverterTag extends TagSupport {
+
+ private String converterId;
+
+ public String getConverterId() {
+ return this.converterId;
+ }
+
+ public void setConverterId(String converterId) {
+ this.converterId = converterId;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+
+ UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ if (tag == null) {
+ throw new SAXException("Tag " + getClass().getName() + " have to be nested in a UIComponentTag");
+ }
+
+ if (!tag.getCreated()) {
+ return 0;
+ }
+
+ Converter converter = getConverter();
+
+ ValueHolder vh = (ValueHolder) tag.getComponentInstance();
+ vh.setConverter(converter);
+ Object localValue = vh.getLocalValue();
+ if (localValue instanceof String) {
+ try {
+ localValue = converter.getAsObject(tag.getFacesContext(), (UIComponent) vh, (String) localValue);
+ vh.setValue(localValue);
+ } catch (ConverterException ce) {
+ }
+ }
+
+ return SKIP_BODY;
+ }
+
+ protected Converter getConverter() {
+ final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ String converterIdVal = (String) tag.evaluate(converterId);
+ return tag.getApplication().createConverter(converterIdVal);
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.converterId = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/FacetTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/FacetTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,39 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+/**
+ * @version CVS $Id$
+ */
+public class FacetTag extends TagSupport {
+
+ private String name;
+
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.name = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/LoadBundleTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/LoadBundleTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,188 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+import org.apache.cocoon.util.ClassUtils;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+/**
+ * @version CVS $Id$
+ */
+public class LoadBundleTag extends TagSupport {
+
+ private String basename;
+ private String var;
+
+ public void setBasename(String basename) {
+ this.basename = basename;
+ }
+
+ public void setVar(String var) {
+ this.var = var;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+ final FacesContext context = FacesUtils.getFacesContext(this, objectModel);
+
+ final String basename = (String) FacesUtils.evaluate(context, this.basename);
+
+ final ResourceBundle bundle = ResourceBundle.getBundle(basename,
+ context.getViewRoot().getLocale(),
+ ClassUtils.getClassLoader());
+
+ if (bundle == null) {
+ throw new FacesException("Tag <" + getClass().getName() + "> " +
+ "could not find ResourceBundle for <" + basename + ">");
+ }
+
+ context.getExternalContext().getRequestMap().put(this.var, new BundleMap(bundle));
+
+ return SKIP_BODY;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.basename = null;
+ this.var = null;
+ }
+}
+
+class BundleMap implements Map {
+ private ResourceBundle bundle;
+
+ public BundleMap (ResourceBundle bundle) {
+ this.bundle = bundle;
+ }
+
+ public void clear() {
+ throw new UnsupportedOperationException("BundleMap does not support clear()");
+ }
+
+ public boolean containsKey(Object key) {
+ if (key == null) {
+ return false;
+ }
+
+ try {
+ this.bundle.getObject(key.toString());
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ public boolean containsValue(Object value) {
+ if (value == null) {
+ return false;
+ }
+
+ for (Enumeration i = this.bundle.getKeys(); i.hasMoreElements();) {
+ Object obj = bundle.getObject((String) i.nextElement());
+ if (value == obj || value.equals(obj)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public Set entrySet() {
+ final HashMap entries = new HashMap();
+ for (Enumeration i = this.bundle.getKeys(); i.hasMoreElements();) {
+ String key = (String) i.nextElement();
+ entries.put(key, this.bundle.getObject(key));
+ }
+
+ return entries.entrySet();
+ }
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof Map)) {
+ return false;
+ }
+
+ return entrySet().equals(((Map) obj).entrySet());
+ }
+
+ public Object get(Object key) {
+ if (key == null) {
+ return null;
+ }
+
+ return bundle.getObject(key.toString());
+ }
+
+ public int hashCode() {
+ return this.bundle.hashCode();
+ }
+
+ public boolean isEmpty() {
+ return !this.bundle.getKeys().hasMoreElements();
+ }
+
+ public Set keySet() {
+ final Set keys = new HashSet();
+ for (Enumeration i = this.bundle.getKeys(); i.hasMoreElements();) {
+ keys.add(i.nextElement());
+ }
+ return keys;
+ }
+
+ public Object put(Object k, Object v) {
+ throw new UnsupportedOperationException("BundleMap does not support put()");
+ }
+
+ public void putAll(Map t) {
+ throw new UnsupportedOperationException("BundleMap does not support putAll()");
+ }
+
+ public Object remove(Object k) {
+ throw new UnsupportedOperationException("BundleMap does not support remove()");
+ }
+
+ public int size() {
+ int result = 0;
+ for (Enumeration i = this.bundle.getKeys(); i.hasMoreElements();) {
+ i.nextElement();
+ result ++;
+ }
+
+ return result;
+ }
+
+ public Collection values() {
+ ArrayList values = new ArrayList();
+ for (Enumeration i = this.bundle.getKeys(); i.hasMoreElements();) {
+ values.add(this.bundle.getObject((String) i.nextElement()));
+ }
+ return values;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ParameterTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ParameterTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,85 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIParameter;
+import javax.faces.FacesException;
+
+/**
+ * @version CVS $Id$
+ */
+public class ParameterTag extends UIComponentTag {
+
+ private String name;
+ private String value;
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ protected String getComponentType() {
+ return "javax.faces.Parameter";
+ }
+
+ protected String getRendererType() {
+ return null;
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIParameter parameter;
+ try {
+ parameter = (UIParameter) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIParameter. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (name != null) {
+ if (FacesUtils.isExpression(name)) {
+ parameter.setValueBinding("name", createValueBinding(name));
+ } else {
+ parameter.setName(name);
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ parameter.setValueBinding("value", createValueBinding(value));
+ } else {
+ parameter.setValue(value);
+ }
+ }
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.name = null;
+ this.value = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SelectItemTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SelectItemTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,124 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItem;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectItemTag extends UIComponentTag {
+
+ protected String value;
+ protected String itemValue;
+ protected String itemLabel;
+ protected String itemDescription;
+ protected String itemDisabled;
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setItemValue(String itemValue) {
+ this.itemValue = itemValue;
+ }
+
+ public void setItemLabel(String itemLabel) {
+ this.itemLabel = itemLabel;
+ }
+
+ public void setItemDescription(String itemDescription) {
+ this.itemDescription = itemDescription;
+ }
+
+ public void setItemDisabled(String itemDisabled) {
+ this.itemDisabled = itemDisabled;
+ }
+
+ protected String getComponentType() {
+ return "javax.faces.SelectItem";
+ }
+
+ protected String getRendererType() {
+ return null;
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectItem selectItem;
+ try {
+ selectItem = (UISelectItem) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectItem. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ selectItem.setValueBinding("value", createValueBinding(value));
+ } else {
+ selectItem.setValue(value);
+ }
+ }
+
+ if (itemValue != null) {
+ if (FacesUtils.isExpression(itemValue)) {
+ selectItem.setValueBinding("itemValue", createValueBinding(itemValue));
+ } else {
+ selectItem.setItemValue(itemValue);
+ }
+ }
+
+ if (itemLabel != null) {
+ if (FacesUtils.isExpression(itemLabel)) {
+ selectItem.setValueBinding("itemLabel", createValueBinding(itemLabel));
+ } else {
+ selectItem.setItemLabel(itemLabel);
+ }
+ }
+
+ if (itemDescription != null) {
+ if (FacesUtils.isExpression(itemDescription)) {
+ selectItem.setValueBinding("itemDescription", createValueBinding(itemDescription));
+ } else {
+ selectItem.setItemDescription(itemDescription);
+ }
+ }
+
+ if (itemDisabled != null) {
+ if (FacesUtils.isExpression(itemDisabled)) {
+ selectItem.setValueBinding("itemDisabled", createValueBinding(itemDisabled));
+ } else {
+ selectItem.setItemDisabled(BooleanUtils.toBoolean(itemDisabled));
+ }
+ }
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.value = null;
+ this.itemValue = null;
+ this.itemLabel = null;
+ this.itemDescription = null;
+ this.itemDisabled = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SelectItemsTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SelectItemsTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,67 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.faces.FacesUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItems;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectItemsTag extends UIComponentTag {
+
+ protected String value;
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ protected String getComponentType() {
+ return "javax.faces.SelectItems";
+ }
+
+ protected String getRendererType() {
+ return null;
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectItems selectItems;
+ try {
+ selectItems = (UISelectItems) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectItems. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ selectItems.setValueBinding("value", createValueBinding(value));
+ } else {
+ selectItems.setValue(value);
+ }
+ }
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.value = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SubviewTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/SubviewTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,30 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+/**
+ * @version CVS $Id$
+ */
+public class SubviewTag extends UIComponentTag {
+
+ protected String getComponentType() {
+ return "javax.faces.NamingContainer";
+ }
+
+ protected String getRendererType() {
+ return null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/UIComponentBodyTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/UIComponentBodyTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,45 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.BodyContent;
+import org.apache.cocoon.taglib.BodyTag;
+import org.apache.cocoon.taglib.Tag;
+
+import org.xml.sax.SAXException;
+
+/**
+ * @version CVS $Id$
+ */
+public abstract class UIComponentBodyTag extends UIComponentTag implements BodyTag {
+
+ protected BodyContent content;
+
+ public int doAfterBody() throws SAXException {
+ return getDoAfterBody();
+ }
+
+ public int getDoAfterBody() {
+ return BodyTag.SKIP_BODY;
+ }
+
+ public void doInitBody() throws SAXException {
+ }
+
+ public void setBodyContent(BodyContent bodyContent) throws SAXException {
+ this.content = bodyContent;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/UIComponentTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/UIComponentTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,497 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.avalon.framework.parameters.Parameters;
+
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.taglib.Tag;
+import org.apache.cocoon.taglib.XMLProducerTagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.renderkit.XMLResponseWriter;
+import org.apache.commons.lang.BooleanUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.el.ValueBinding;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @version CVS $Id$
+ */
+public abstract class UIComponentTag extends XMLProducerTagSupport {
+
+ private static final String CREATED_COMPONENTS = "javax.faces.webapp.COMPONENT_IDS";
+ private static final String CREATED_FACETS = "javax.faces.webapp.FACET_NAMES";
+
+ //
+ // Attributes
+ //
+
+ private String id;
+ private String binding;
+ private String rendered;
+
+ //
+ // Internal state
+ //
+
+ private FacesContext context;
+ private UIComponent component;
+
+ private boolean created;
+ private List createdComponents;
+ private List createdFacets;
+
+ //
+ // Services for subclasses
+ //
+
+ protected final FacesContext getFacesContext() {
+ return this.context;
+ }
+
+ protected final Application getApplication() {
+ return getFacesContext().getApplication();
+ }
+
+ protected final UIComponent getComponentInstance() {
+ return this.component;
+ }
+
+ protected final boolean getCreated() {
+ return this.created;
+ }
+
+ protected final ValueBinding createValueBinding(String valueRef) {
+ return getApplication().createValueBinding(valueRef);
+ }
+
+ protected final Object evaluate(String value) {
+ if (FacesUtils.isExpression(value)) {
+ return createValueBinding(value).getValue(getFacesContext());
+ }
+
+ return value;
+ }
+
+ protected final boolean evaluateBoolean(String value) {
+ if (FacesUtils.isExpression(value)) {
+ Boolean obj = (Boolean) createValueBinding(value).getValue(getFacesContext());
+ return obj.booleanValue();
+ }
+
+ return BooleanUtils.toBoolean(value);
+ }
+
+ protected final int evaluateInteger(String value) {
+ if (FacesUtils.isExpression(value)) {
+ Integer obj = (Integer) createValueBinding(value).getValue(getFacesContext());
+ return obj.intValue();
+ }
+
+ return Integer.parseInt(value);
+ }
+
+ //
+ // Tag Interface
+ //
+
+ public void setup(SourceResolver resolver, Map objectModel, Parameters parameters)
+ throws SAXException, IOException {
+ super.setup(resolver, objectModel, parameters);
+
+ // Obtain Faces context
+ this.context = FacesUtils.getFacesContext(this, objectModel);
+
+ // Set up response writer
+ ResponseWriter writer = this.context.getResponseWriter();
+ if (writer == null) {
+ // Not calling RenderKit here.
+ Request request = ObjectModelHelper.getRequest(objectModel);
+ writer = new XMLResponseWriter(this.xmlConsumer, null, request.getCharacterEncoding());
+ this.context.setResponseWriter(writer);
+ }
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes attrs)
+ throws SAXException {
+ final UIComponentTag parentTag = findParent();
+
+ this.component = findComponent(parentTag);
+
+ try {
+ if (!isSuppressed()) {
+ if (!this.component.getRendersChildren()) {
+ encodeBegin();
+ getFacesContext().getResponseWriter().flush();
+ }
+ }
+ } catch (IOException e) {
+ throw new SAXException("Exception in doStartTag", e);
+ }
+
+ return getDoStartValue();
+ }
+
+ public int doEndTag(String namespaceURI, String localName, String qName)
+ throws SAXException {
+ removeOldChildren();
+ removeOldFacets();
+ try {
+ if (!isSuppressed()) {
+ if (this.component.getRendersChildren()) {
+ encodeBegin();
+ encodeChildren();
+ }
+ encodeEnd();
+ getFacesContext().getResponseWriter().flush();
+ }
+ } catch (IOException e) {
+ throw new SAXException("Exception in doEndTag", e);
+ }
+
+ return getDoEndValue();
+ }
+
+
+ //
+ // Lifecycle
+ //
+
+ public void recycle() {
+ super.recycle();
+
+ this.component = null;
+ this.context = null;
+
+ this.id = null;
+ this.binding = null;
+ this.created = false;
+ this.rendered = null;
+
+ this.createdComponents = null;
+ this.createdFacets = null;
+ }
+
+
+ //
+ // Methods to be implemented or overridden in subclasses
+ //
+
+ protected abstract String getComponentType();
+
+ protected abstract String getRendererType();
+
+ protected int getDoEndValue() {
+ return Tag.EVAL_PAGE;
+ }
+
+ protected int getDoStartValue() {
+ return Tag.EVAL_BODY;
+ }
+
+ protected void encodeBegin() throws IOException {
+ this.component.encodeBegin(this.context);
+ }
+
+ protected void encodeChildren() throws IOException {
+ this.component.encodeChildren(this.context);
+ }
+
+ protected void encodeEnd() throws IOException {
+ this.component.encodeEnd(this.context);
+ }
+
+ protected void setProperties(UIComponent component) {
+ if (this.rendered != null) {
+ if (FacesUtils.isExpression(this.rendered)) {
+ ValueBinding vb = createValueBinding(this.rendered);
+ component.setValueBinding("rendered", vb);
+ } else {
+ component.setRendered(BooleanUtils.toBoolean(this.rendered));
+ }
+ }
+
+ if (getRendererType() != null) {
+ component.setRendererType(getRendererType());
+ }
+ }
+
+ protected final void setProperty(UIComponent component, String name, String value) {
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ ValueBinding vb = createValueBinding(value);
+ component.setValueBinding(name, vb);
+ } else {
+ component.getAttributes().put(name, value);
+ }
+ }
+ }
+
+ protected final void setBooleanProperty(UIComponent component, String name, String value) {
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ ValueBinding vb = createValueBinding(value);
+ component.setValueBinding(name, vb);
+ } else {
+ component.getAttributes().put(name, BooleanUtils.toBooleanObject(value));
+ }
+ }
+ }
+
+ protected final void setIntegerProperty(UIComponent component, String name, String value) {
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ ValueBinding vb = createValueBinding(value);
+ component.setValueBinding(name, vb);
+ } else {
+ component.getAttributes().put(name, new Integer(value));
+ }
+ }
+ }
+
+
+ //
+ // Implementation methods
+ //
+
+ private UIComponentTag findParent() {
+ Tag parent = this;
+ do {
+ parent = parent.getParent();
+ } while (parent != null && !(parent instanceof UIComponentTag));
+
+ return (UIComponentTag) parent;
+ }
+
+ /**
+ * Creates or finds (if pre-created) UIComponent for this tag instance
+ */
+ private UIComponent findComponent(UIComponentTag parentTag) {
+ // Check if this is root
+ if (parentTag == null) {
+ UIComponent root = getFacesContext().getViewRoot();
+ setProperties(root);
+ if (this.id != null) {
+ root.setId(this.id);
+ }
+ return root;
+ }
+
+ String id = createId();
+
+ // Create facet
+ String facet = getFacetName();
+ if (facet != null) {
+ return createFacet(parentTag, facet, id);
+ }
+
+ // Create child
+ return createChild(parentTag, id);
+ }
+
+ /**
+ * Get name of the facet or null
+ */
+ private String getFacetName() {
+ final Tag parentTag = getParent();
+ if (parentTag instanceof FacetTag) {
+ return ((FacetTag) parentTag).getName();
+ }
+
+ return null;
+ }
+
+ private boolean isSuppressed() {
+ if (getFacetName() != null) {
+ return true;
+ }
+
+ if (!this.component.isRendered()) {
+ return true;
+ }
+
+ for (UIComponent component = this.component.getParent(); component != null; component = component.getParent()) {
+ if (!component.isRendered()) {
+ return true;
+ }
+
+ if (component.getRendersChildren()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private void addChild(UIComponent child) {
+ if (createdComponents == null) {
+ createdComponents = new ArrayList();
+ }
+ createdComponents.add(child.getId());
+ }
+
+ private void addFacet(String name) {
+ if (createdFacets == null) {
+ createdFacets = new ArrayList();
+ }
+ createdFacets.add(name);
+ }
+
+ private UIComponent createComponent(String id) {
+ UIComponent component;
+ Application application = context.getApplication();
+ if (this.binding != null) {
+ ValueBinding vb = application.createValueBinding(this.binding);
+ component = application.createComponent(vb, context, getComponentType());
+ component.setValueBinding("binding", vb);
+ } else {
+ component = application.createComponent(getComponentType());
+ }
+ component.setId(id);
+ this.created = true;
+
+ setProperties(component);
+ return component;
+ }
+
+ private UIComponent createChild(UIComponentTag parentTag, String id) {
+ final UIComponent parent = parentTag.getComponentInstance();
+ UIComponent component = FacesUtils.getChild(parent, id);
+ if (component == null) {
+ component = createComponent(id);
+ parent.getChildren().add(component);
+ }
+
+ parentTag.addChild(component);
+ return component;
+ }
+
+ private UIComponent createFacet(UIComponentTag parentTag, String name, String id) {
+ final UIComponent parent = parentTag.getComponentInstance();
+ UIComponent component = (UIComponent) parent.getFacets().get(name);
+ if (component == null) {
+ component = createComponent(id);
+ parent.getFacets().put(name, component);
+ }
+
+ parentTag.addFacet(name);
+ return component;
+ }
+
+ private String createId() {
+ if (this.id == null) {
+ return getFacesContext().getViewRoot().createUniqueId();
+ }
+
+ return this.id;
+ }
+
+ private void removeOldChildren() {
+ List oldList = (List) component.getAttributes().remove(CREATED_COMPONENTS);
+ if (oldList != null) {
+ if (createdComponents != null) {
+ for (Iterator olds = oldList.iterator(); olds.hasNext();) {
+ String old = (String) olds.next();
+ if (!createdComponents.contains(old)) {
+ FacesUtils.removeChild(component, old);
+ }
+ }
+ } else {
+ for (Iterator i = oldList.iterator(); i.hasNext();) {
+ FacesUtils.removeChild(component, (String) i.next());
+ }
+ }
+ }
+
+ if (createdComponents != null) {
+ component.getAttributes().put(CREATED_COMPONENTS, createdComponents);
+ createdComponents = null;
+ }
+ }
+
+ private void removeOldFacets() {
+ List oldList = (List) component.getAttributes().remove(CREATED_FACETS);
+ if (oldList != null) {
+ if (createdFacets != null) {
+ for (Iterator olds = oldList.iterator(); olds.hasNext();) {
+ String old = (String) olds.next();
+ if (!createdFacets.contains(old)) {
+ component.getFacets().remove(old);
+ }
+ }
+ } else {
+ for (Iterator olds = oldList.iterator(); olds.hasNext(); ) {
+ String old = (String) olds.next();
+ component.getFacets().remove(old);
+ }
+ }
+ }
+
+ if (createdFacets != null) {
+ component.getAttributes().put(CREATED_FACETS, createdFacets);
+ createdFacets = null;
+ }
+ }
+
+
+ //
+ // Setters / Getters
+ //
+
+ public String getId() {
+ return this.id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getBinding() {
+ return this.binding;
+ }
+
+ public void setBinding(String binding) {
+ if (!FacesUtils.isExpression(binding)) {
+ throw new IllegalArgumentException("Binding value must be an expression");
+ }
+
+ this.binding = binding;
+ }
+
+ public String getRendered() {
+ return this.rendered;
+ }
+
+ public void setRendered(String rendered) {
+ this.rendered = rendered;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateDoubleRangeTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateDoubleRangeTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,66 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.validator.DoubleRangeValidator;
+import javax.faces.validator.Validator;
+
+/**
+ * @version CVS $Id$
+ */
+public class ValidateDoubleRangeTag extends ValidatorTag {
+
+ private String minimum;
+ private String maximum;
+
+ public void setMaximum(String maximum) {
+ this.maximum = maximum;
+ }
+
+ public void setMinimum(String minimum) {
+ this.minimum = minimum;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ super.setValidatorId("javax.faces.DoubleRange");
+ return super.doStartTag(namespaceURI, localName, qName, atts);
+ }
+
+ protected Validator getValidator() {
+ final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ DoubleRangeValidator validator = (DoubleRangeValidator) super.getValidator();
+
+ if (maximum != null) {
+ validator.setMaximum(tag.evaluateInteger(maximum));
+ }
+ if (minimum != null) {
+ validator.setMinimum(tag.evaluateInteger(minimum));
+ }
+
+ return validator;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.minimum = null;
+ this.maximum = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateLengthTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateLengthTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,67 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.validator.Validator;
+import javax.faces.validator.LengthValidator;
+
+import org.apache.cocoon.faces.FacesUtils;
+
+/**
+ * @version CVS $Id$
+ */
+public class ValidateLengthTag extends ValidatorTag {
+
+ private String minimum;
+ private String maximum;
+
+ public void setMaximum(String maximum) {
+ this.maximum = maximum;
+ }
+
+ public void setMinimum(String minimum) {
+ this.minimum = minimum;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ super.setValidatorId("javax.faces.Length");
+ return super.doStartTag(namespaceURI, localName, qName, atts);
+ }
+
+ protected Validator getValidator() {
+ final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ LengthValidator validator = (LengthValidator) super.getValidator();
+
+ if (maximum != null) {
+ validator.setMaximum(tag.evaluateInteger(maximum));
+ }
+ if (minimum != null) {
+ validator.setMinimum(tag.evaluateInteger(minimum));
+ }
+
+ return validator;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.minimum = null;
+ this.maximum = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateLongRangeTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateLongRangeTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,66 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.validator.LongRangeValidator;
+import javax.faces.validator.Validator;
+
+/**
+ * @version CVS $Id$
+ */
+public class ValidateLongRangeTag extends ValidatorTag {
+
+ private String minimum;
+ private String maximum;
+
+ public void setMaximum(String maximum) {
+ this.maximum = maximum;
+ }
+
+ public void setMinimum(String minimum) {
+ this.minimum = minimum;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ super.setValidatorId("javax.faces.LongRange");
+ return super.doStartTag(namespaceURI, localName, qName, atts);
+ }
+
+ protected Validator getValidator() {
+ final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ LongRangeValidator validator = (LongRangeValidator) super.getValidator();
+
+ if (maximum != null) {
+ validator.setMaximum(tag.evaluateInteger(maximum));
+ }
+ if (minimum != null) {
+ validator.setMinimum(tag.evaluateInteger(minimum));
+ }
+
+ return validator;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.minimum = null;
+ this.maximum = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateRequiredTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidateRequiredTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,31 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * @version CVS $Id$
+ */
+public class ValidateRequiredTag extends ValidatorTag {
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ super.setValidatorId("javax.faces.Required");
+ return super.doStartTag(namespaceURI, localName, qName, atts);
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidatorTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValidatorTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,69 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.EditableValueHolder;
+import javax.faces.validator.Validator;
+
+/**
+ * @version CVS $Id$
+ */
+public class ValidatorTag extends TagSupport {
+
+ private String validatorId;
+
+ public String getValidatorId() {
+ return this.validatorId;
+ }
+
+ public void setValidatorId(String validatorId) {
+ this.validatorId = validatorId;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ if (tag == null) {
+ throw new SAXException("Tag <" + getClass().getName() + "> have to be nested within a UIComponentTag");
+ }
+
+ if (!tag.getCreated()) {
+ return 0;
+ }
+
+ Validator validator = getValidator();
+ ((EditableValueHolder)tag.getComponentInstance()).addValidator(validator);
+
+ return SKIP_BODY;
+ }
+
+ protected Validator getValidator() {
+ final UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ String validatorIdVal = (String) tag.evaluate(validatorId);
+ return tag.getApplication().createValidator(validatorIdVal);
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.validatorId = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValueChangeListenerTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ValueChangeListenerTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,78 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.event.ValueChangeListener;
+
+/**
+ * @version CVS $Id$
+ */
+public class ValueChangeListenerTag extends TagSupport {
+
+ private String type;
+
+ public String getType() {
+ return this.type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+
+ UIComponentTag tag = FacesUtils.findParentUIComponentTag(this);
+ if (tag == null) {
+ throw new SAXException("Tag <" + getClass().getName() + "> have to be nested within a UIComponentTag");
+ }
+
+ if (!tag.getCreated()) {
+ return 0;
+ }
+
+ UIComponent component = tag.getComponentInstance();
+ if (component == null) {
+ throw new SAXException("Parent tag <" + tag.getClass().getName() + "> has no component instance");
+ }
+
+ if (component instanceof EditableValueHolder) {
+ String clazz = (String) FacesUtils.evaluate(tag.getFacesContext(), this.type);
+ ValueChangeListener handler = null;
+ try {
+ handler = (ValueChangeListener) Class.forName(clazz).newInstance();
+ } catch (Exception e) {
+ throw new SAXException("Tag <" + tag.getClass().getName() + "> could not create action listener <" + clazz + ">", e);
+ }
+ ((EditableValueHolder)component).addValueChangeListener(handler);
+ }
+
+ return SKIP_BODY;
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.type = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/VerbatimTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/VerbatimTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,60 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.taglib.TagSupport;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIParameter;
+import javax.faces.FacesException;
+
+/**
+ * @version CVS $Id$
+ */
+public class VerbatimTag extends UIComponentBodyTag {
+
+ protected String getComponentType() {
+ return "javax.faces.Output";
+ }
+
+ protected String getRendererType() {
+ return "javax.faces.Text";
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+ // TODO: VerbatimTag: Implement escape attribute support
+ component.setTransient(true);
+ }
+
+ public void recycle() {
+ super.recycle();
+ }
+
+ public int doAfterBody() throws SAXException {
+ if (content != null) {
+ String value = content.getContent().toString();
+ ((UIOutput)getComponentInstance()).setValue(value);
+ }
+
+ return getDoAfterBody();
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ViewTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/ViewTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,128 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib;
+
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Response;
+import org.apache.cocoon.i18n.I18nUtils;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import javax.faces.application.StateManager;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ResponseWriter;
+import javax.faces.el.ValueBinding;
+import java.io.IOException;
+import java.util.Locale;
+
+/**
+ * @version CVS $Id$
+ */
+public class ViewTag extends UIComponentTag {
+
+ protected String locale;
+
+ public void setLocale(String locale) {
+ this.locale = locale;
+ }
+
+ public int doStartTag(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException {
+ int rc = super.doStartTag(namespaceURI, localName, qName, atts);
+
+ Response response = ObjectModelHelper.getResponse(objectModel);
+ response.setLocale(getFacesContext().getViewRoot().getLocale());
+
+ ResponseWriter writer = getFacesContext().getResponseWriter();
+ try {
+ writer.startDocument();
+ } catch (IOException e) {
+ throw new SAXException(e);
+ }
+
+ return rc;
+ }
+
+ public int doEndTag(String namespaceURI, String localName, String qName)
+ throws SAXException {
+ int rc = super.doEndTag(namespaceURI, localName, qName);
+
+ StateManager stateManager = getApplication().getStateManager();
+ StateManager.SerializedView view;
+ try {
+ view = stateManager.saveSerializedView(getFacesContext());
+ } catch (IllegalStateException e) {
+ throw new SAXException(e);
+ } catch (Exception e) {
+ throw new SAXException("Could not save faces view", e);
+ }
+
+ try {
+ // TODO: Saving state on the client not supported
+ if (view != null) {
+ stateManager.writeState(getFacesContext(), view);
+ }
+ } catch (IOException e) {
+ throw new SAXException("Could not save faces view", e);
+ }
+
+ ResponseWriter writer = getFacesContext().getResponseWriter();
+ try {
+ writer.endDocument();
+ } catch (IOException e) {
+ throw new SAXException("Exception in endDocument", e);
+ }
+
+ return rc;
+ }
+
+ public String getComponentType() {
+ throw new IllegalStateException();
+ }
+
+ public String getRendererType() {
+ return null;
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ if (this.locale != null) {
+ Object localeVal = this.locale;
+ if (FacesUtils.isExpression(this.locale)) {
+ ValueBinding vb = createValueBinding(this.locale);
+ component.setValueBinding("locale", vb);
+ localeVal = vb.getValue(getFacesContext());
+ }
+
+ Locale value = null;
+ if (localeVal instanceof Locale) {
+ value = (Locale) localeVal;
+ } else if (localeVal instanceof String) {
+ value = I18nUtils.parseLocale((String) localeVal);
+ }
+ ((UIViewRoot) component).setLocale(value);
+ }
+ }
+
+ public void recycle() {
+ super.recycle();
+ this.locale = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/ColumnTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/ColumnTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,45 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+
+/**
+ * @version CVS $Id$
+ */
+public class ColumnTag extends UIComponentTag {
+
+ public String getRendererType() {
+ return null;
+ }
+
+ public String getComponentType() {
+ return "javax.faces.Column";
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ if (!(component instanceof UIColumn)) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIColumn. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/CommandButtonTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/CommandButtonTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,307 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ActionEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class CommandButtonTag extends UIComponentTag {
+
+ private String action;
+ private String actionListener;
+ private String immediate;
+ private String value;
+ private String accesskey;
+ private String alt;
+ private String dir;
+ private String disabled;
+ private String image;
+ private String lang;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+ private String type;
+
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public void setActionListener(String actionListener) {
+ this.actionListener = actionListener;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setAlt(String alt) {
+ this.alt = alt;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getRendererType() {
+ return "javax.faces.Button";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlCommandButton";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UICommand command;
+ try {
+ command = (UICommand) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UICommand. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (action != null) {
+ MethodBinding vb;
+ if (FacesUtils.isExpression(action)) {
+ vb = getApplication().createMethodBinding(action, null);
+ } else {
+ vb = new ConstantMethodBinding(action);
+ }
+ command.setAction(vb);
+ }
+
+ if (actionListener != null) {
+ if (FacesUtils.isExpression(actionListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(actionListener,
+ new Class[]{ ActionEvent.class });
+ command.setActionListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> actionListener must be an expression. " +
+ "Got <" + actionListener + ">");
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ command.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ command.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ command.setValueBinding("value", createValueBinding(value));
+ } else {
+ command.setValue(value);
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+ setProperty(component, "alt", alt);
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "image", image);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ setProperty(component, "type", type);
+ }
+
+ public void recycle() {
+ super.recycle();
+ action = null;
+ actionListener = null;
+ immediate = null;
+ value = null;
+ accesskey = null;
+ alt = null;
+ dir = null;
+ disabled = null;
+ image = null;
+ lang = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ type = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/CommandLinkTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/CommandLinkTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,310 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ActionEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class CommandLinkTag extends UIComponentTag {
+
+ private String action;
+ private String actionListener;
+ private String immediate;
+ private String value;
+ private String accesskey;
+ private String charset;
+ private String coords;
+ private String dir;
+ private String hreflang;
+ private String lang;
+ private String onblur;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String rel;
+ private String rev;
+ private String shape;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String target;
+ private String title;
+ private String type;
+
+
+ public void setAction(String action) {
+ this.action = action;
+ }
+
+ public void setActionListener(String actionListener) {
+ this.actionListener = actionListener;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setCharset(String charset) {
+ this.charset = charset;
+ }
+
+ public void setCoords(String coords) {
+ this.coords = coords;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setHreflang(String hreflang) {
+ this.hreflang = hreflang;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setRel(String rel) {
+ this.rel = rel;
+ }
+
+ public void setRev(String rev) {
+ this.rev = rev;
+ }
+
+ public void setShape(String shape) {
+ this.shape = shape;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getRendererType() {
+ return "javax.faces.Link";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlCommandLink";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UICommand command;
+ try {
+ command = (UICommand) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UICommand. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (action != null) {
+ MethodBinding vb;
+ if (FacesUtils.isExpression(action)) {
+ vb = getApplication().createMethodBinding(action, null);
+ } else {
+ vb = new ConstantMethodBinding(action);
+ }
+ command.setAction(vb);
+ }
+
+ if (actionListener != null) {
+ if (FacesUtils.isExpression(actionListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(actionListener,
+ new Class[]{ ActionEvent.class });
+ command.setActionListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> actionListener must be an expression. " +
+ "Got <" + actionListener + ">");
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ command.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ command.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ command.setValueBinding("value", createValueBinding(value));
+ } else {
+ command.setValue(value);
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+ setProperty(component, "charset", charset);
+ setProperty(component, "coords", coords);
+ setProperty(component, "dir", dir);
+ setProperty(component, "hreflang", hreflang);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "rel", rel);
+ setProperty(component, "rev", rev);
+ setProperty(component, "shape", shape);
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "target", target);
+ setProperty(component, "title", title);
+ setProperty(component, "type", type);
+ }
+
+ public void recycle() {
+ super.recycle();
+ action = null;
+ actionListener = null;
+ immediate = null;
+ value = null;
+ accesskey = null;
+ charset = null;
+ coords = null;
+ dir = null;
+ hreflang = null;
+ lang = null;
+ onblur = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ rel = null;
+ rev = null;
+ shape = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ target = null;
+ title = null;
+ type = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/ConstantMethodBinding.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/ConstantMethodBinding.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,61 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+
+/**
+ * @version CVS $Id$
+ */
+public class ConstantMethodBinding extends MethodBinding
+ implements StateHolder {
+
+ private String outcome;
+ private boolean isTransient;
+
+ public ConstantMethodBinding() {
+ }
+
+ public ConstantMethodBinding(String outcome) {
+ this.outcome = outcome;
+ }
+
+ public Object invoke(FacesContext context, Object params[]) {
+ return this.outcome;
+ }
+
+ public Class getType(FacesContext context) {
+ return String.class;
+ }
+
+ public Object saveState(FacesContext context) {
+ return this.outcome;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ this.outcome = (String) state;
+ }
+
+ public boolean isTransient() {
+ return this.isTransient;
+ }
+
+ public void setTransient(boolean isTransient) {
+ this.isTransient = isTransient;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/DataTableTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/DataTableTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,301 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.cocoon.faces.FacesUtils;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
+import javax.faces.FacesException;
+
+/**
+ * @version CVS $Id$
+ */
+public class DataTableTag extends UIComponentTag {
+
+ private String first;
+ private String rows;
+ private String value;
+ private String var;
+ private String bgcolor;
+ private String border;
+ private String cellpadding;
+ private String cellspacing;
+ private String columnClasses;
+ private String dir;
+ private String footerClass;
+ private String frame;
+ private String headerClass;
+ private String lang;
+ private String onclick;
+ private String ondblclick;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String rowClasses;
+ private String rules;
+ private String style;
+ private String styleClass;
+ private String summary;
+ private String title;
+ private String width;
+
+
+ public void setFirst(String first) {
+ this.first = first;
+ }
+
+ public void setRows(String rows) {
+ this.rows = rows;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setVar(String var) {
+ this.var = var;
+ }
+
+ public void setBgcolor(String bgcolor) {
+ this.bgcolor = bgcolor;
+ }
+
+ public void setBorder(String border) {
+ this.border = border;
+ }
+
+ public void setCellpadding(String cellpadding) {
+ this.cellpadding = cellpadding;
+ }
+
+ public void setCellspacing(String cellspacing) {
+ this.cellspacing = cellspacing;
+ }
+
+ public void setColumnClasses(String columnClasses) {
+ this.columnClasses = columnClasses;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setFooterClass(String footerClass) {
+ this.footerClass = footerClass;
+ }
+
+ public void setFrame(String frame) {
+ this.frame = frame;
+ }
+
+ public void setHeaderClass(String headerClass) {
+ this.headerClass = headerClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setRowClasses(String rowClasses) {
+ this.rowClasses = rowClasses;
+ }
+
+ public void setRules(String rules) {
+ this.rules = rules;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Textarea";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlInputTextarea";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIData data;
+ try {
+ data = (UIData) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIData. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (first != null) {
+ if (FacesUtils.isExpression(first)) {
+ data.setValueBinding("first", createValueBinding(first));
+ } else {
+ data.setFirst(Integer.parseInt(first));
+ }
+ }
+
+ if (rows != null) {
+ if (FacesUtils.isExpression(rows)) {
+ data.setValueBinding("rows", createValueBinding(rows));
+ } else {
+ data.setRows(Integer.parseInt(rows));
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ data.setValueBinding("value", createValueBinding(value));
+ } else {
+ data.setValue(value);
+ }
+ }
+
+ data.setVar(var);
+
+ setProperty(component, "bgcolor", bgcolor);
+
+ setIntegerProperty(component, "border", border);
+
+ setProperty(component, "cellpadding", cellpadding);
+ setProperty(component, "cellspacing", cellspacing);
+ setProperty(component, "columnClasses", columnClasses);
+ setProperty(component, "dir", dir);
+ setProperty(component, "footerClass", footerClass);
+ setProperty(component, "frame", frame);
+ setProperty(component, "headerClass", headerClass);
+ setProperty(component, "lang", lang);
+
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+
+ setProperty(component, "rowClasses", rowClasses);
+ setProperty(component, "rules", rules);
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "summary", summary);
+ setProperty(component, "title", title);
+ setProperty(component, "width", width);
+ }
+
+ public void recycle() {
+ super.recycle();
+ first = null;
+ rows = null;
+ value = null;
+ var = null;
+ bgcolor = null;
+ border = null;
+ cellpadding = null;
+ cellspacing = null;
+ columnClasses = null;
+ dir = null;
+ footerClass = null;
+ frame = null;
+ headerClass = null;
+ lang = null;
+ onclick = null;
+ ondblclick = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ rowClasses = null;
+ rules = null;
+ style = null;
+ styleClass = null;
+ summary = null;
+ title = null;
+ width = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/FormTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/FormTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,199 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIForm;
+
+/**
+ * @version CVS $Id$
+ */
+public class FormTag extends UIComponentTag {
+
+ private String accept;
+ private String acceptcharset;
+ private String dir;
+ private String enctype;
+ private String lang;
+ private String onclick;
+ private String ondblclick;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onreset;
+ private String onsubmit;
+ private String style;
+ private String styleClass;
+ private String target;
+ private String title;
+
+
+ public void setAccept(String accept) {
+ this.accept = accept;
+ }
+
+ public void setAcceptcharset(String acceptcharset) {
+ this.acceptcharset = acceptcharset;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setEnctype(String enctype) {
+ this.enctype = enctype;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnreset(String onreset) {
+ this.onreset = onreset;
+ }
+
+ public void setOnsubmit(String onsubmit) {
+ this.onsubmit = onsubmit;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getRendererType() {
+ return "javax.faces.Form";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlForm";
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ if (!(component instanceof UIForm)) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIForm. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ setProperty(component, "accept", accept);
+ setProperty(component, "acceptcharset", acceptcharset);
+ setProperty(component, "dir", dir);
+ setProperty(component, "enctype", enctype);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onreset", onreset);
+ setProperty(component, "onsubmit", onsubmit);
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "target", target);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ accept = null;
+ acceptcharset = null;
+ dir = null;
+ enctype = null;
+ lang = null;
+ onclick = null;
+ ondblclick = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onreset = null;
+ onsubmit = null;
+ style = null;
+ styleClass = null;
+ target = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/GraphicImageTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/GraphicImageTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,236 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIGraphic;
+
+/**
+ * @version CVS $Id$
+ */
+public class GraphicImageTag extends UIComponentTag {
+
+ private String url;
+ private String value;
+ private String alt;
+ private String dir;
+ private String height;
+ private String ismap;
+ private String lang;
+ private String longdesc;
+ private String onclick;
+ private String ondblclick;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String style;
+ private String styleClass;
+ private String title;
+ private String usemap;
+ private String width;
+
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setAlt(String alt) {
+ this.alt = alt;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setHeight(String height) {
+ this.height = height;
+ }
+
+ public void setIsmap(String ismap) {
+ this.ismap = ismap;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setLongdesc(String longdesc) {
+ this.longdesc = longdesc;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setUsemap(String usemap) {
+ this.usemap = usemap;
+ }
+
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Image";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlGraphicImage";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIGraphic graphic = null;
+ try {
+ graphic = (UIGraphic) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIGraphic. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (url != null) {
+ if (FacesUtils.isExpression(url)) {
+ graphic.setValueBinding("url", createValueBinding(url));
+ } else {
+ graphic.setUrl(url);
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ graphic.setValueBinding("value", createValueBinding(value));
+ } else {
+ graphic.setValue(value);
+ }
+ }
+
+ setProperty(component, "alt", alt);
+ setProperty(component, "dir", dir);
+ setProperty(component, "height", height);
+
+ setBooleanProperty(component, "ismap", ismap);
+
+ setProperty(component, "lang", lang);
+ setProperty(component, "longdesc", longdesc);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "title", title);
+ setProperty(component, "usemap", usemap);
+ setProperty(component, "width", width);
+ }
+
+ public void recycle() {
+ super.recycle();
+ url = null;
+ value = null;
+ alt = null;
+ dir = null;
+ height = null;
+ ismap = null;
+ lang = null;
+ longdesc = null;
+ onclick = null;
+ ondblclick = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ style = null;
+ styleClass = null;
+ title = null;
+ usemap = null;
+ width = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputHiddenTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputHiddenTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,151 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class InputHiddenTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Hidden";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlInputHidden";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIInput input = null;
+ try {
+ input = (UIInput) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIInput. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ input.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ input.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ input.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ input.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ input.setValueBinding("required", createValueBinding(required));
+ } else {
+ input.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ input.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ input.setValueBinding("value", createValueBinding(value));
+ } else {
+ input.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ input.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputSecretTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputSecretTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,52 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @version CVS $Id$
+ */
+public class InputSecretTag extends InputTextTag {
+
+ private String redisplay;
+
+
+ public void setRedisplay(String redisplay) {
+ this.redisplay = redisplay;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Secret";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlInputSecret";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ setBooleanProperty(component, "redisplay", redisplay);
+ }
+
+ public void recycle() {
+ super.recycle();
+ redisplay = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputTextTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputTextTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,232 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @version CVS $Id$
+ */
+public class InputTextTag extends InputHiddenTag {
+
+ private String accesskey;
+ private String alt;
+ private String dir;
+ private String disabled;
+ private String lang;
+ private String maxlength;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String size;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setAlt(String alt) {
+ this.alt = alt;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setMaxlength(String maxlength) {
+ this.maxlength = maxlength;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setSize(String size) {
+ this.size = size;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getRendererType() {
+ return "javax.faces.Text";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlInputText";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ setProperty(component, "accesskey", accesskey);
+ setProperty(component, "alt", alt);
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "lang", lang);
+
+ setIntegerProperty(component, "maxlength", maxlength);
+
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+ setIntegerProperty(component, "size", size);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ accesskey = null;
+ alt = null;
+ dir = null;
+ disabled = null;
+ lang = null;
+ maxlength = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ size = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputTextareaTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/InputTextareaTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,226 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * @version CVS $Id$
+ */
+public class InputTextareaTag extends InputHiddenTag {
+
+ private String accesskey;
+ private String cols;
+ private String dir;
+ private String disabled;
+ private String lang;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String rows;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setCols(String cols) {
+ this.cols = cols;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setRows(String rows) {
+ this.rows = rows;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getRendererType() {
+ return "javax.faces.Textarea";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlInputTextarea";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ setProperty(component, "accesskey", accesskey);
+
+ setIntegerProperty(component, "cols", cols);
+
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "lang", lang);
+
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+ setIntegerProperty(component, "rows", rows);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ accesskey = null;
+ cols = null;
+ dir = null;
+ disabled = null;
+ lang = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ rows = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/MessageTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/MessageTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,195 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIMessage;
+
+/**
+ * @version CVS $Id$
+ */
+public class MessageTag extends UIComponentTag {
+
+ private String _for;
+ private String showDetail;
+ private String showSummary;
+ private String errorClass;
+ private String errorStyle;
+ private String fatalClass;
+ private String fatalStyle;
+ private String infoClass;
+ private String infoStyle;
+ private String layout;
+ private String style;
+ private String styleClass;
+ private String title;
+ private String tooltip;
+ private String warnClass;
+ private String warnStyle;
+
+
+ public void setFor(String _for) {
+ this._for = _for;
+ }
+
+ public void setShowDetail(String showDetail) {
+ this.showDetail = showDetail;
+ }
+
+ public void setShowSummary(String showSummary) {
+ this.showSummary = showSummary;
+ }
+
+ public void setErrorClass(String errorClass) {
+ this.errorClass = errorClass;
+ }
+
+ public void setErrorStyle(String errorStyle) {
+ this.errorStyle = errorStyle;
+ }
+
+ public void setFatalClass(String fatalClass) {
+ this.fatalClass = fatalClass;
+ }
+
+ public void setFatalStyle(String fatalStyle) {
+ this.fatalStyle = fatalStyle;
+ }
+
+ public void setInfoClass(String infoClass) {
+ this.infoClass = infoClass;
+ }
+
+ public void setInfoStyle(String infoStyle) {
+ this.infoStyle = infoStyle;
+ }
+
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setTooltip(String tooltip) {
+ this.tooltip = tooltip;
+ }
+
+ public void setWarnClass(String warnClass) {
+ this.warnClass = warnClass;
+ }
+
+ public void setWarnStyle(String warnStyle) {
+ this.warnStyle = warnStyle;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Message";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlMessage";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIMessage message = null;
+ try {
+ message = (UIMessage) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIMessage. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (_for != null) {
+ // FIXME Should it be "for"?
+ if (FacesUtils.isExpression(_for)) {
+ message.setValueBinding("_for", createValueBinding(_for));
+ } else {
+ message.setFor(_for);
+ }
+ }
+
+ if (showDetail != null) {
+ if (FacesUtils.isExpression(showDetail)) {
+ message.setValueBinding("showDetail", createValueBinding(showDetail));
+ } else {
+ message.setShowDetail(BooleanUtils.toBoolean(showDetail));
+ }
+ }
+
+ if (showSummary != null) {
+ if (FacesUtils.isExpression(showSummary)) {
+ message.setValueBinding("showSummary", createValueBinding(showSummary));
+ } else {
+ message.setShowSummary(BooleanUtils.toBoolean(showSummary));
+ }
+ }
+
+ setProperty(component, "errorClass", errorClass);
+ setProperty(component, "errorStyle", errorStyle);
+ setProperty(component, "fatalClass", fatalClass);
+ setProperty(component, "fatalStyle", fatalStyle);
+ setProperty(component, "infoClass", infoClass);
+ setProperty(component, "infoStyle", infoStyle);
+ setProperty(component, "layout", layout);
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "title", title);
+
+ setBooleanProperty(component, "tooltip", tooltip);
+
+ setProperty(component, "warnClass", warnClass);
+ setProperty(component, "warnStyle", warnStyle);
+ }
+
+ public void recycle() {
+ super.recycle();
+ _for = null;
+ showDetail = null;
+ showSummary = null;
+ errorClass = null;
+ errorStyle = null;
+ fatalClass = null;
+ fatalStyle = null;
+ infoClass = null;
+ infoStyle = null;
+ layout = null;
+ style = null;
+ styleClass = null;
+ title = null;
+ tooltip = null;
+ warnClass = null;
+ warnStyle = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/MessagesTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/MessagesTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,198 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIInput;
+import javax.faces.component.UIMessages;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class MessagesTag extends UIComponentTag {
+
+ private String globalOnly;
+ private String showDetail;
+ private String showSummary;
+ private String errorClass;
+ private String errorStyle;
+ private String fatalClass;
+ private String fatalStyle;
+ private String infoClass;
+ private String infoStyle;
+ private String layout;
+ private String style;
+ private String styleClass;
+ private String title;
+ private String tooltip;
+ private String warnClass;
+ private String warnStyle;
+
+
+ public void setGlobalOnly(String globalOnly) {
+ this.globalOnly = globalOnly;
+ }
+
+ public void setShowDetail(String showDetail) {
+ this.showDetail = showDetail;
+ }
+
+ public void setShowSummary(String showSummary) {
+ this.showSummary = showSummary;
+ }
+
+ public void setErrorClass(String errorClass) {
+ this.errorClass = errorClass;
+ }
+
+ public void setErrorStyle(String errorStyle) {
+ this.errorStyle = errorStyle;
+ }
+
+ public void setFatalClass(String fatalClass) {
+ this.fatalClass = fatalClass;
+ }
+
+ public void setFatalStyle(String fatalStyle) {
+ this.fatalStyle = fatalStyle;
+ }
+
+ public void setInfoClass(String infoClass) {
+ this.infoClass = infoClass;
+ }
+
+ public void setInfoStyle(String infoStyle) {
+ this.infoStyle = infoStyle;
+ }
+
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setTooltip(String tooltip) {
+ this.tooltip = tooltip;
+ }
+
+ public void setWarnClass(String warnClass) {
+ this.warnClass = warnClass;
+ }
+
+ public void setWarnStyle(String warnStyle) {
+ this.warnStyle = warnStyle;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Messages";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlMessages";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIMessages messages = null;
+ try {
+ messages = (UIMessages) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIMessages. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (globalOnly != null) {
+ if (FacesUtils.isExpression(globalOnly)) {
+ messages.setValueBinding("globalOnly", createValueBinding(globalOnly));
+ } else {
+ messages.setGlobalOnly(BooleanUtils.toBoolean(globalOnly));
+ }
+ }
+
+ if (showDetail != null) {
+ if (FacesUtils.isExpression(showDetail)) {
+ messages.setValueBinding("showDetail", createValueBinding(showDetail));
+ } else {
+ messages.setShowDetail(BooleanUtils.toBoolean(showDetail));
+ }
+ }
+
+ if (showSummary != null) {
+ if (FacesUtils.isExpression(showSummary)) {
+ messages.setValueBinding("showSummary", createValueBinding(showSummary));
+ } else {
+ messages.setShowSummary(BooleanUtils.toBoolean(showSummary));
+ }
+ }
+
+ setProperty(component, "errorClass", errorClass);
+ setProperty(component, "errorStyle", errorStyle);
+ setProperty(component, "fatalClass", fatalClass);
+ setProperty(component, "fatalStyle", fatalStyle);
+ setProperty(component, "infoClass", infoClass);
+ setProperty(component, "infoStyle", infoStyle);
+ setProperty(component, "layout", layout);
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "title", title);
+
+ setBooleanProperty(component, "tooltip", tooltip);
+
+ setProperty(component, "warnClass", warnClass);
+ setProperty(component, "warnStyle", warnStyle);
+ }
+
+ public void recycle() {
+ super.recycle();
+ globalOnly = null;
+ showDetail = null;
+ showSummary = null;
+ errorClass = null;
+ errorStyle = null;
+ fatalClass = null;
+ fatalStyle = null;
+ infoClass = null;
+ infoStyle = null;
+ layout = null;
+ style = null;
+ styleClass = null;
+ title = null;
+ tooltip = null;
+ warnClass = null;
+ warnStyle = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputFormatTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputFormatTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,30 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+/**
+ * @version CVS $Id$
+ */
+public class OutputFormatTag extends OutputTextTag {
+
+ public String getRendererType() {
+ return "javax.faces.Format";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlOutputFormat";
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputLabelTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputLabelTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,227 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+
+/**
+ * @version CVS $Id$
+ */
+public class OutputLabelTag extends UIComponentTag {
+
+ private String converter;
+ private String value;
+ private String accesskey;
+ private String dir;
+ private String _for;
+ private String lang;
+ private String onblur;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setFor(String _for) {
+ this._for = _for;
+ }
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Text";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlOutputText";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIOutput output;
+ try {
+ output = (UIOutput) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIOutput. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ output.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ output.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ output.setValueBinding("value", createValueBinding(value));
+ } else {
+ output.setValue(value);
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+ setProperty(component, "dir", dir);
+ // FIXME: Should it be __for?
+ setProperty(component, "for", _for);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ value = null;
+ accesskey = null;
+ dir = null;
+ _for = null;
+ lang = null;
+ onblur = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputLinkTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputLinkTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,274 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+
+/**
+ * @version CVS $Id$
+ */
+public class OutputLinkTag extends UIComponentTag {
+
+ private String converter;
+ private String value;
+ private String accesskey;
+ private String charset;
+ private String coords;
+ private String dir;
+ private String hreflang;
+ private String lang;
+ private String onblur;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String rel;
+ private String rev;
+ private String shape;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String target;
+ private String title;
+ private String type;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setCharset(String charset) {
+ this.charset = charset;
+ }
+
+ public void setCoords(String coords) {
+ this.coords = coords;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setHreflang(String hreflang) {
+ this.hreflang = hreflang;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setRel(String rel) {
+ this.rel = rel;
+ }
+
+ public void setRev(String rev) {
+ this.rev = rev;
+ }
+
+ public void setShape(String shape) {
+ this.shape = shape;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getRendererType() {
+ return "javax.faces.Link";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlOutputLink";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIOutput output;
+ try {
+ output = (UIOutput) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIOutput. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ output.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ output.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ output.setValueBinding("value", createValueBinding(value));
+ } else {
+ output.setValue(value);
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+ setProperty(component, "charset", charset);
+ setProperty(component, "coords", coords);
+ setProperty(component, "dir", dir);
+ setProperty(component, "hreflang", hreflang);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "rel", rel);
+ setProperty(component, "rev", rev);
+ setProperty(component, "shape", shape);
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "target", target);
+ setProperty(component, "title", title);
+ setProperty(component, "type", type);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ value = null;
+ accesskey = null;
+ charset = null;
+ coords = null;
+ dir = null;
+ hreflang = null;
+ lang = null;
+ onblur = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ rel = null;
+ rev = null;
+ shape = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ target = null;
+ title = null;
+ type = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputTextTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/OutputTextTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,113 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIOutput;
+
+/**
+ * @version CVS $Id$
+ */
+public class OutputTextTag extends UIComponentTag {
+
+ private String converter;
+ private String value;
+ private String escape;
+ private String style;
+ private String styleClass;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setEscape(String escape) {
+ this.escape = escape;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getRendererType() {
+ return "javax.faces.Text";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlOutputText";
+ }
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UIOutput output;
+ try {
+ output = (UIOutput) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIOutput. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ output.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ output.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ output.setValueBinding("value", createValueBinding(value));
+ } else {
+ output.setValue(value);
+ }
+ }
+
+ setBooleanProperty(component, "escape", escape);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ value = null;
+ escape = null;
+ style = null;
+ styleClass = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/PanelGridTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/PanelGridTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,256 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIPanel;
+
+/**
+ * @version CVS $Id$
+ */
+public class PanelGridTag extends UIComponentTag {
+
+ private String bgcolor;
+ private String border;
+ private String cellpadding;
+ private String cellspacing;
+ private String columnClasses;
+ private String columns;
+ private String dir;
+ private String footerClass;
+ private String frame;
+ private String headerClass;
+ private String lang;
+ private String onclick;
+ private String ondblclick;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String rowClasses;
+ private String rules;
+ private String style;
+ private String styleClass;
+ private String summary;
+ private String title;
+ private String width;
+
+
+ public void setBgcolor(String bgcolor) {
+ this.bgcolor = bgcolor;
+ }
+
+ public void setBorder(String border) {
+ this.border = border;
+ }
+
+ public void setCellpadding(String cellpadding) {
+ this.cellpadding = cellpadding;
+ }
+
+ public void setCellspacing(String cellspacing) {
+ this.cellspacing = cellspacing;
+ }
+
+ public void setColumnClasses(String columnClasses) {
+ this.columnClasses = columnClasses;
+ }
+
+ public void setColumns(String columns) {
+ this.columns = columns;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setFooterClass(String footerClass) {
+ this.footerClass = footerClass;
+ }
+
+ public void setFrame(String frame) {
+ this.frame = frame;
+ }
+
+ public void setHeaderClass(String headerClass) {
+ this.headerClass = headerClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setRowClasses(String rowClasses) {
+ this.rowClasses = rowClasses;
+ }
+
+ public void setRules(String rules) {
+ this.rules = rules;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Grid";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlPanelGrid";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ if (!(component instanceof UIPanel)) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIPanel. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ setProperty(component, "bgcolor", bgcolor);
+
+ setIntegerProperty(component, "border", border);
+
+ setProperty(component, "cellpadding", cellpadding);
+ setProperty(component, "cellspacing", cellspacing);
+ setProperty(component, "columnClasses", columnClasses);
+
+ setIntegerProperty(component, "columns", columns);
+
+ setProperty(component, "dir", dir);
+ setProperty(component, "footerClass", footerClass);
+ setProperty(component, "frame", frame);
+ setProperty(component, "headerClass", headerClass);
+ setProperty(component, "lang", lang);
+
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+
+ setProperty(component, "rowClasses", rowClasses);
+ setProperty(component, "rules", rules);
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "summary", summary);
+ setProperty(component, "title", title);
+ setProperty(component, "width", width);
+ }
+
+ public void recycle() {
+ super.recycle();
+ bgcolor = null;
+ border = null;
+ cellpadding = null;
+ cellspacing = null;
+ columnClasses = null;
+ columns = null;
+ dir = null;
+ footerClass = null;
+ frame = null;
+ headerClass = null;
+ lang = null;
+ onclick = null;
+ ondblclick = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ rowClasses = null;
+ rules = null;
+ style = null;
+ styleClass = null;
+ summary = null;
+ title = null;
+ width = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/PanelGroupTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/PanelGroupTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,68 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIPanel;
+
+/**
+ * @version CVS $Id$
+ */
+public class PanelGroupTag extends UIComponentTag {
+
+ private String style;
+ private String styleClass;
+
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Group";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlPanelGroup";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ if (!(component instanceof UIPanel)) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UIPanel. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ }
+
+ public void recycle() {
+ super.recycle();
+ style = null;
+ styleClass = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectBooleanCheckboxTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectBooleanCheckboxTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,317 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectBoolean;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectBooleanCheckboxTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+ private String accesskey;
+ private String dir;
+ private String disabled;
+ private String lang;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Checkbox";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlSelectBooleanCheckbox";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectBoolean select;
+ try {
+ select = (UISelectBoolean) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectBoolean. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ select.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ select.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ select.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ select.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ select.setValueBinding("required", createValueBinding(required));
+ } else {
+ select.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ select.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ select.setValueBinding("value", createValueBinding(value));
+ } else {
+ select.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ select.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ accesskey = null;
+ dir = null;
+ disabled = null;
+ lang = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyCheckboxTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyCheckboxTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,347 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectMany;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectManyCheckboxTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+ private String accesskey;
+ private String border;
+ private String dir;
+ private String disabled;
+ private String disabledClass;
+ private String enabledClass;
+ private String lang;
+ private String layout;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setBorder(String border) {
+ this.border = border;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ this.disabledClass = disabledClass;
+ }
+
+ public void setEnabledClass(String enabledClass) {
+ this.enabledClass = enabledClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Checkbox";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlSelectManyCheckbox";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectMany select;
+ try {
+ select = (UISelectMany) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectMany. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ select.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ select.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ select.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ select.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ select.setValueBinding("required", createValueBinding(required));
+ } else {
+ select.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ select.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ select.setValueBinding("value", createValueBinding(value));
+ } else {
+ select.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ select.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+
+ setIntegerProperty(component, "border", border);
+
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "disabledClass", disabledClass);
+ setProperty(component, "enabledClass", enabledClass);
+ setProperty(component, "lang", lang);
+ setProperty(component, "layout", layout);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ accesskey = null;
+ border = null;
+ dir = null;
+ disabled = null;
+ disabledClass = null;
+ enabledClass = null;
+ lang = null;
+ layout = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyListboxTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyListboxTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,339 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectMany;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectManyListboxTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+ private String accesskey;
+ private String dir;
+ private String disabled;
+ private String disabledClass;
+ private String enabledClass;
+ private String lang;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String size;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ this.disabledClass = disabledClass;
+ }
+
+ public void setEnabledClass(String enabledClass) {
+ this.enabledClass = enabledClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setSize(String size) {
+ this.size = size;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Listbox";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlSelectManyListbox";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectMany select;
+ try {
+ select = (UISelectMany) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectMany. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ select.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ select.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ select.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ select.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ select.setValueBinding("required", createValueBinding(required));
+ } else {
+ select.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ select.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ select.setValueBinding("value", createValueBinding(value));
+ } else {
+ select.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ select.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "disabledClass", disabledClass);
+ setProperty(component, "enabledClass", enabledClass);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+ setIntegerProperty(component, "size", size);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ accesskey = null;
+ dir = null;
+ disabled = null;
+ disabledClass = null;
+ enabledClass = null;
+ lang = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ size = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyMenuTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectManyMenuTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,332 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectMany;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectManyMenuTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+ private String accesskey;
+ private String dir;
+ private String disabled;
+ private String disabledClass;
+ private String enabledClass;
+ private String lang;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ this.disabledClass = disabledClass;
+ }
+
+ public void setEnabledClass(String enabledClass) {
+ this.enabledClass = enabledClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Menu";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlSelectManyMenu";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectMany select;
+ try {
+ select = (UISelectMany) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectMany. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ select.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ select.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ select.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ select.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ select.setValueBinding("required", createValueBinding(required));
+ } else {
+ select.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ select.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ select.setValueBinding("value", createValueBinding(value));
+ } else {
+ select.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ select.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "disabledClass", disabledClass);
+ setProperty(component, "enabledClass", enabledClass);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ accesskey = null;
+ dir = null;
+ disabled = null;
+ disabledClass = null;
+ enabledClass = null;
+ lang = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneListboxTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneListboxTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,339 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectOne;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectOneListboxTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+ private String accesskey;
+ private String dir;
+ private String disabled;
+ private String disabledClass;
+ private String enabledClass;
+ private String lang;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String size;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ this.disabledClass = disabledClass;
+ }
+
+ public void setEnabledClass(String enabledClass) {
+ this.enabledClass = enabledClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setSize(String size) {
+ this.size = size;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Listbox";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlSelectManyListbox";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectOne select;
+ try {
+ select = (UISelectOne) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectOne. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ select.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ select.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ select.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ select.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ select.setValueBinding("required", createValueBinding(required));
+ } else {
+ select.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ select.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ select.setValueBinding("value", createValueBinding(value));
+ } else {
+ select.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ select.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "disabledClass", disabledClass);
+ setProperty(component, "enabledClass", enabledClass);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+ setIntegerProperty(component, "size", size);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ accesskey = null;
+ dir = null;
+ disabled = null;
+ disabledClass = null;
+ enabledClass = null;
+ lang = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ size = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneMenuTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneMenuTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,332 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectOne;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectOneMenuTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+ private String accesskey;
+ private String dir;
+ private String disabled;
+ private String disabledClass;
+ private String enabledClass;
+ private String lang;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ this.disabledClass = disabledClass;
+ }
+
+ public void setEnabledClass(String enabledClass) {
+ this.enabledClass = enabledClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Menu";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlSelectOneMenu";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectOne select;
+ try {
+ select = (UISelectOne) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectOne. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ select.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ select.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ select.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ select.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ select.setValueBinding("required", createValueBinding(required));
+ } else {
+ select.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ select.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ select.setValueBinding("value", createValueBinding(value));
+ } else {
+ select.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ select.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "disabledClass", disabledClass);
+ setProperty(component, "enabledClass", enabledClass);
+ setProperty(component, "lang", lang);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ accesskey = null;
+ dir = null;
+ disabled = null;
+ disabledClass = null;
+ enabledClass = null;
+ lang = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneRadioTag.java
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/java/org/apache/cocoon/faces/taglib/html/SelectOneRadioTag.java Fri Sep 17 07:36:29 2004
@@ -0,0 +1,346 @@
+/*
+ * Copyright 1999-2004 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.cocoon.faces.taglib.html;
+
+import org.apache.cocoon.faces.FacesUtils;
+import org.apache.cocoon.faces.taglib.UIComponentTag;
+import org.apache.commons.lang.BooleanUtils;
+
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectOne;
+import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @version CVS $Id$
+ */
+public class SelectOneRadioTag extends UIComponentTag {
+
+ private String converter;
+ private String immediate;
+ private String required;
+ private String validator;
+ private String value;
+ private String valueChangeListener;
+ private String accesskey;
+ private String border;
+ private String dir;
+ private String disabled;
+ private String disabledClass;
+ private String enabledClass;
+ private String lang;
+ private String layout;
+ private String onblur;
+ private String onchange;
+ private String onclick;
+ private String ondblclick;
+ private String onfocus;
+ private String onkeydown;
+ private String onkeypress;
+ private String onkeyup;
+ private String onmousedown;
+ private String onmousemove;
+ private String onmouseout;
+ private String onmouseover;
+ private String onmouseup;
+ private String onselect;
+ private String readonly;
+ private String style;
+ private String styleClass;
+ private String tabindex;
+ private String title;
+
+
+ public void setConverter(String converter) {
+ this.converter = converter;
+ }
+
+ public void setImmediate(String immediate) {
+ this.immediate = immediate;
+ }
+
+ public void setRequired(String required) {
+ this.required = required;
+ }
+
+ public void setValidator(String validator) {
+ this.validator = validator;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setValueChangeListener(String valueChangeListener) {
+ this.valueChangeListener = valueChangeListener;
+ }
+
+ public void setAccesskey(String accesskey) {
+ this.accesskey = accesskey;
+ }
+
+ public void setBorder(String border) {
+ this.border = border;
+ }
+
+ public void setDir(String dir) {
+ this.dir = dir;
+ }
+
+ public void setDisabled(String disabled) {
+ this.disabled = disabled;
+ }
+
+ public void setDisabledClass(String disabledClass) {
+ this.disabledClass = disabledClass;
+ }
+
+ public void setEnabledClass(String enabledClass) {
+ this.enabledClass = enabledClass;
+ }
+
+ public void setLang(String lang) {
+ this.lang = lang;
+ }
+
+ public void setLayout(String layout) {
+ this.layout = layout;
+ }
+
+ public void setOnblur(String onblur) {
+ this.onblur = onblur;
+ }
+
+ public void setOnchange(String onchange) {
+ this.onchange = onchange;
+ }
+
+ public void setOnclick(String onclick) {
+ this.onclick = onclick;
+ }
+
+ public void setOndblclick(String ondblclick) {
+ this.ondblclick = ondblclick;
+ }
+
+ public void setOnfocus(String onfocus) {
+ this.onfocus = onfocus;
+ }
+
+ public void setOnkeydown(String onkeydown) {
+ this.onkeydown = onkeydown;
+ }
+
+ public void setOnkeypress(String onkeypress) {
+ this.onkeypress = onkeypress;
+ }
+
+ public void setOnkeyup(String onkeyup) {
+ this.onkeyup = onkeyup;
+ }
+
+ public void setOnmousedown(String onmousedown) {
+ this.onmousedown = onmousedown;
+ }
+
+ public void setOnmousemove(String onmousemove) {
+ this.onmousemove = onmousemove;
+ }
+
+ public void setOnmouseout(String onmouseout) {
+ this.onmouseout = onmouseout;
+ }
+
+ public void setOnmouseover(String onmouseover) {
+ this.onmouseover = onmouseover;
+ }
+
+ public void setOnmouseup(String onmouseup) {
+ this.onmouseup = onmouseup;
+ }
+
+ public void setOnselect(String onselect) {
+ this.onselect = onselect;
+ }
+
+ public void setReadonly(String readonly) {
+ this.readonly = readonly;
+ }
+
+ public void setStyle(String style) {
+ this.style = style;
+ }
+
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ public void setTabindex(String tabindex) {
+ this.tabindex = tabindex;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+
+ public String getRendererType() {
+ return "javax.faces.Radio";
+ }
+
+ public String getComponentType() {
+ return "javax.faces.HtmlSelectOneRadio";
+ }
+
+
+ protected void setProperties(UIComponent component) {
+ super.setProperties(component);
+
+ UISelectOne select;
+ try {
+ select = (UISelectOne) component;
+ } catch (ClassCastException cce) {
+ throw new FacesException("Tag <" + getClass().getName() + "> expected UISelectOne. " +
+ "Got <" + component.getClass().getName() + ">");
+ }
+
+ if (converter != null) {
+ if (FacesUtils.isExpression(converter)) {
+ select.setValueBinding("converter", createValueBinding(converter));
+ } else {
+ select.setConverter(getApplication().createConverter(converter));
+ }
+ }
+
+ if (immediate != null) {
+ if (FacesUtils.isExpression(immediate)) {
+ select.setValueBinding("immediate", createValueBinding(immediate));
+ } else {
+ select.setImmediate(BooleanUtils.toBoolean(immediate));
+ }
+ }
+
+ if (required != null) {
+ if (FacesUtils.isExpression(required)) {
+ select.setValueBinding("required", createValueBinding(required));
+ } else {
+ select.setRequired(BooleanUtils.toBoolean(required));
+ }
+ }
+
+ if (validator != null) {
+ if (FacesUtils.isExpression(validator)) {
+ MethodBinding vb = getApplication().createMethodBinding(validator,
+ new Class[]{ FacesContext.class, UIComponent.class, Object.class });
+ select.setValidator(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> validator must be an expression. " +
+ "Got <" + validator + ">");
+ }
+ }
+
+ if (value != null) {
+ if (FacesUtils.isExpression(value)) {
+ select.setValueBinding("value", createValueBinding(value));
+ } else {
+ select.setValue(value);
+ }
+ }
+
+ if (valueChangeListener != null) {
+ if (FacesUtils.isExpression(valueChangeListener)) {
+ MethodBinding vb = getApplication().createMethodBinding(valueChangeListener,
+ new Class[]{ ValueChangeEvent.class });
+ select.setValueChangeListener(vb);
+ } else {
+ throw new FacesException("Tag <" + getClass().getName() + "> valueChangeListener must be an expression. " +
+ "Got <" + valueChangeListener + ">");
+ }
+ }
+
+ setProperty(component, "accesskey", accesskey);
+
+ setIntegerProperty(component, "border", border);
+
+ setProperty(component, "dir", dir);
+
+ setBooleanProperty(component, "disabled", disabled);
+
+ setProperty(component, "disabledClass", disabledClass);
+ setProperty(component, "enabledClass", enabledClass);
+ setProperty(component, "lang", lang);
+ setProperty(component, "layout", layout);
+ setProperty(component, "onblur", onblur);
+ setProperty(component, "onchange", onchange);
+ setProperty(component, "onclick", onclick);
+ setProperty(component, "ondblclick", ondblclick);
+ setProperty(component, "onfocus", onfocus);
+ setProperty(component, "onkeydown", onkeydown);
+ setProperty(component, "onkeypress", onkeypress);
+ setProperty(component, "onkeyup", onkeyup);
+ setProperty(component, "onmousedown", onmousedown);
+ setProperty(component, "onmousemove", onmousemove);
+ setProperty(component, "onmouseout", onmouseout);
+ setProperty(component, "onmouseover", onmouseover);
+ setProperty(component, "onmouseup", onmouseup);
+ setProperty(component, "onselect", onselect);
+
+ setBooleanProperty(component, "readonly", readonly);
+
+ setProperty(component, "style", style);
+ setProperty(component, "styleClass", styleClass);
+ setProperty(component, "tabindex", tabindex);
+ setProperty(component, "title", title);
+ }
+
+ public void recycle() {
+ super.recycle();
+ converter = null;
+ immediate = null;
+ required = null;
+ validator = null;
+ value = null;
+ valueChangeListener = null;
+ accesskey = null;
+ dir = null;
+ disabled = null;
+ disabledClass = null;
+ enabledClass = null;
+ lang = null;
+ layout = null;
+ onblur = null;
+ onchange = null;
+ onclick = null;
+ ondblclick = null;
+ onfocus = null;
+ onkeydown = null;
+ onkeypress = null;
+ onkeyup = null;
+ onmousedown = null;
+ onmousemove = null;
+ onmouseout = null;
+ onmouseover = null;
+ onmouseup = null;
+ onselect = null;
+ readonly = null;
+ style = null;
+ styleClass = null;
+ tabindex = null;
+ title = null;
+ }
+}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/commons-el-1.0.jar
==============================================================================
Binary file. No diff available.
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/jsp-api-2.0.jar
==============================================================================
Binary file. No diff available.
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/myfaces-20040916m.jar
==============================================================================
Binary file. No diff available.
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/lib/myfaces-jsf-api-20040916.jar
==============================================================================
Binary file. No diff available.
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/goodbye.xml
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/goodbye.xml Fri Sep 17 07:36:29 2004
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<page xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+ <title>JavaServer Faces Test: Goodbye!</title>
+ <content>
+ <f:view>
+ <h:form styleClass="form" id="form1">
+ <table>
+ <tr>
+ <td>
+ Goodbye,
+ <h:outputText styleClass="outputText" value="#{hello.value != null ? hello.value : 'Anonymous'}" id="text2"/>!
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:inputText value="#{hello.value}" styleClass="inputText" id="text1"/>
+ <h:commandButton type="submit" value="Submit" id="button1" action="#{hello.doButton1Action}"/>
+ <h:commandButton type="submit" value="Flop" id="button2" action="#{hello.doButton2Action}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:message style="color: red; text-decoration: overline" for="text1"/>
+ </td>
+ </tr>
+ </table>
+ </h:form>
+ </f:view>
+ <p>
+ This page prompts for the name (NOT required, you can reset it), and has navigation to
+ the first page.
+ </p>
+ </content>
+</page>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/hello.xml
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/hello.xml Fri Sep 17 07:36:29 2004
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<page xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+ <title>JavaServer Faces Test: Hello!</title>
+ <content>
+ <f:view>
+ <h:form styleClass="form" id="form1">
+ <table>
+ <tr>
+ <td>
+ Hello,
+ <h:outputText value="#{hello.value != null ? hello.value : 'Anonymous'}" id="text2"/>!
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:inputText value="#{hello.value}" styleClass="inputText" id="text1" required="true">
+ <f:validateLength minimum="3"/>
+ </h:inputText>
+
+ <h:commandButton type="submit" value="Submit" id="button1" action="#{hello.doButton1Action}"/>
+ <h:commandButton type="submit" value="Flip" id="button2" action="#{hello.doButton2Action}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:message style="color: red; text-decoration: overline" for="text1"/>
+ </td>
+ </tr>
+ </table>
+ </h:form>
+ </f:view>
+ <p>
+ This page prompts for the name (required, minimum 3 characters length), and has navigation to
+ the second page.
+ </p>
+ </content>
+</page>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/myfaces-patch.diff
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/myfaces-patch.diff Fri Sep 17 07:36:29 2004
@@ -0,0 +1,98 @@
+Index: src/myfaces/net/sourceforge/myfaces/application/jsp/JspViewHandlerImpl.java
+===================================================================
+RCS file: /cvsroot/myfaces/myfaces/src/myfaces/net/sourceforge/myfaces/application/jsp/JspViewHandlerImpl.java,v
+retrieving revision 1.28
+diff -u -u -r1.28 JspViewHandlerImpl.java
+--- src/myfaces/net/sourceforge/myfaces/application/jsp/JspViewHandlerImpl.java 2 Sep 2004 09:04:14 -0000 1.28
++++ src/myfaces/net/sourceforge/myfaces/application/jsp/JspViewHandlerImpl.java 16 Sep 2004 18:57:15 -0000
+@@ -29,13 +29,11 @@
+ import javax.faces.context.ExternalContext;
+ import javax.faces.context.FacesContext;
+ import javax.faces.render.RenderKitFactory;
+-import javax.servlet.ServletRequest;
+ import javax.servlet.ServletResponse;
+ import javax.servlet.http.HttpServletRequest;
+ import javax.servlet.http.HttpServletResponse;
+ import javax.servlet.http.HttpSession;
+ import java.io.IOException;
+-import java.util.Enumeration;
+ import java.util.Iterator;
+ import java.util.List;
+ import java.util.Locale;
+@@ -95,10 +93,10 @@
+ {
+ //ExternalContext.getLocales() is missing. Next Spec will define it.
+ //But since we are in a JSP specific impl we can cast...
+- Enumeration locales = ((ServletRequest)facesContext.getExternalContext().getRequest()).getLocales();
+- while (locales.hasMoreElements())
++ Iterator locales = facesContext.getExternalContext().getRequestLocales();
++ while (locales.hasNext())
+ {
+- Locale locale = (Locale) locales.nextElement();
++ Locale locale = (Locale) locales.next();
+ for (Iterator it = facesContext.getApplication().getSupportedLocales(); it.hasNext();)
+ {
+ Locale supportLocale = (Locale)it.next();
+@@ -209,7 +207,7 @@
+
+ String viewId = facesContext.getViewRoot().getViewId();
+ ServletMapping servletMapping = getServletMapping(externalContext);
+- if (servletMapping.isExtensionMapping())
++ if (servletMapping != null && servletMapping.isExtensionMapping())
+ {
+ String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME);
+ String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX;
+@@ -297,7 +295,7 @@
+
+ ExternalContext externalContext = facescontext.getExternalContext();
+ ServletMapping servletMapping = getServletMapping(externalContext);
+-
++ if (servletMapping != null) {
+ if (servletMapping.isExtensionMapping())
+ {
+ // extension mapping
+@@ -334,6 +332,9 @@
+ }
+ return urlpattern + viewId;
+ }
++ }
++
++ return viewId;
+ }
+
+
+@@ -376,8 +377,9 @@
+ }
+ log.error("could not find pathMapping for servletPath = " + servletPath +
+ " requestPathInfo = " + requestPathInfo);
+- throw new IllegalArgumentException("could not find pathMapping for servletPath = " + servletPath +
+- " requestPathInfo = " + requestPathInfo);
++ return null;
++ //throw new IllegalArgumentException("could not find pathMapping for servletPath = " + servletPath +
++ // " requestPathInfo = " + requestPathInfo);
+ }
+
+ }
+Index: src/myfaces/net/sourceforge/myfaces/lifecycle/LifecycleImpl.java
+===================================================================
+RCS file: /cvsroot/myfaces/myfaces/src/myfaces/net/sourceforge/myfaces/lifecycle/LifecycleImpl.java,v
+retrieving revision 1.40
+diff -u -u -r1.40 LifecycleImpl.java
+--- src/myfaces/net/sourceforge/myfaces/lifecycle/LifecycleImpl.java 25 Aug 2004 13:54:02 -0000 1.40
++++ src/myfaces/net/sourceforge/myfaces/lifecycle/LifecycleImpl.java 16 Sep 2004 18:57:15 -0000
+@@ -316,6 +316,7 @@
+ log, "RequestServletPath is null, cannot determine viewId of current page.");
+
+ //TODO: JSF Spec 2.2.1 - what do they mean by "if the default ViewHandler implementation is used..." ?
++ /*
+ String defaultSuffix = externalContext.getInitParameter(ViewHandler.DEFAULT_SUFFIX_PARAM_NAME);
+ String suffix = defaultSuffix != null ? defaultSuffix : ViewHandler.DEFAULT_SUFFIX;
+ DebugUtils.assertError(suffix.charAt(0) == '.',
+@@ -330,6 +331,7 @@
+ {
+ viewId = viewId.substring(0, dot) + suffix;
+ }
++ */
+ }
+
+ return viewId;
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/samples.xml
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/samples.xml Fri Sep 17 07:36:29 2004
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<!-- CVS $Id: samples.xml 30938 2004-07-29 19:08:16Z vgritsenko $ -->
+
+<samples name="Faces Block Samples" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <group name="Back">
+ <sample name="Back" href="../..">to Cocoon Samples main page</sample>
+ <sample name="Back" href="..">to Cocoon Blocks Samples main page</sample>
+ </group>
+
+ <group name="About">
+ <note>
+ Faces block should be considered experimental. Please see Cocoon Forms
+ block for supported forms processing framework.
+ </note>
+ <note>
+ Faces block comes with MyFaces JSF implementation with this small patch
+ applied. Cocoon Faces block can also be run with Sun (JSF 1.1_01) and
+ IBM implementations (WSAD 5.1.2) if those implementations are patched
+ appropriately.
+ </note>
+ <sample name="Patch" href="myfaces-patch.diff">
+ Patch against MyFaces CVS repository as of 20040916.
+ </sample>
+ </group>
+
+ <group name="JavaServer Faces">
+ <sample name="Hello" href="hello">
+ Simple two-page JSF application
+ </sample>
+ </group>
+
+ <group name="Resources">
+ <sample name="JSF Documentation" href="http://java.sun.com/j2ee/javaserverfaces/reference/api/index.html">
+ JavaServer Faces (JSF) Documentation
+ </sample>
+ <sample name="JSR 127" href="http://www.jcp.org/en/jsr/detail?id=127">
+ JSR 127: JavaServer Faces
+ </sample>
+ </group>
+</samples>
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/sitemap.xmap
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/faces/samples/sitemap.xmap Fri Sep 17 07:36:29 2004
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 1999-2004 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.
+-->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+<!-- =========================== Components ================================ -->
+
+ <map:components>
+ <map:transformers default="xslt">
+ <map:transformer name="taglib"
+ logger="sitemap.transformer.taglib"
+ src="org.apache.cocoon.transformation.TagTransformer"/>
+ </map:transformers>
+
+ <map:actions>
+ <map:action name="faces"
+ logger="sitemap.action.faces"
+ src="org.apache.cocoon.faces.FacesAction">
+ <!--
+ - Specify how to transform view ID to sitemap URI (optional).
+ <cut-prefix>/samples/blocks/faces</cut-prefix>
+ <add-prefix>/path/to/view/pipeline</add-prefix>
+ <cut-suffix>.faces</cut-suffix>
+ -->
+ <add-suffix>.view</add-suffix>
+ </map:action>
+ </map:actions>
+ </map:components>
+
+<!-- =========================== Views =================================== -->
+
+ <map:views>
+ <map:view from-label="content" name="content">
+ <map:serialize type="xml"/>
+ </map:view>
+
+ <map:view from-label="content" name="pretty-content">
+ <map:transform src="context://stylesheets/system/xml2html.xslt"/>
+ <map:serialize type="html"/>
+ </map:view>
+
+ <map:view from-position="last" name="links">
+ <map:serialize type="links"/>
+ </map:view>
+ </map:views>
+
+<!-- =========================== Pipelines ================================= -->
+
+ <map:pipelines>
+ <map:pipeline>
+ <!--
+ - Welcome page
+ -->
+ <map:match pattern="welcome">
+ <map:generate src="samples.xml"/>
+ <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
+ <map:parameter name="contextPath" value="{request:contextPath}"/>
+ </map:transform>
+ <map:serialize/>
+ </map:match>
+
+ <!--
+ - Pipeline generating JavaServer Faces view.
+ - JSF 1.1 Specification 2.2.6 Render Response.
+ -->
+ <map:match pattern="*.view">
+ <map:generate src="{1}.xml"/>
+ <map:transform type="taglib"/>
+ <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl">
+ <map:parameter name="contextPath" value="{request:contextPath}"/>
+ </map:transform>
+ <map:serialize/>
+ </map:match>
+
+ <!--
+ - MyFaces Patch
+ -->
+ <map:match pattern="*.diff">
+ <map:read mime-type="text/plain" src="{1}.diff"/>
+ </map:match>
+
+ <!--
+ - Action invoking JavaServer Faces lifecycle.
+ - Render phase of the lifecycle dispatches view render request
+ - back to the sitemap.
+ -->
+ <map:match pattern="*">
+ <map:act type="faces"/>
+ </map:match>
+
+ </map:pipeline>
+ </map:pipelines>
+</map:sitemap>
Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/web.xml
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/web.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/web.xml Fri Sep 17 07:36:29 2004
@@ -19,9 +19,8 @@
| This is the Cocoon web-app configurations file
+-->
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
- "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
Modified: cocoon/branches/BRANCH_2_1_X/status.xml
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Fri Sep 17 07:36:29 2004
@@ -205,6 +205,9 @@
<changes>
<release version="@version@" date="@date@">
<action dev="VG" type="add">
+ Faces block: Initial implementation of JavaServer Faces for Cocoon.
+ </action>
+ <action dev="VG" type="add">
Taglib block: Initial implementation of BodyTag.
</action>
<action dev="VG" type="update">