myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r673662 - in /myfaces/orchestra/trunk/sandbox: ./ src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/ src/main/resources/META-INF/
Date Thu, 03 Jul 2008 12:08:26 GMT
Author: skitching
Date: Thu Jul  3 05:08:25 2008
New Revision: 673662

URL: http://svn.apache.org/viewvc?rev=673662&view=rev
Log:
Implement facelets support for the Dynaform component.

Added:
    myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/
    myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/DynaFormHandler.java
  (with props)
    myfaces/orchestra/trunk/sandbox/src/main/resources/META-INF/orchestra-dynaform.taglib.xml
  (with props)
Modified:
    myfaces/orchestra/trunk/sandbox/pom.xml

Modified: myfaces/orchestra/trunk/sandbox/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/pom.xml?rev=673662&r1=673661&r2=673662&view=diff
==============================================================================
--- myfaces/orchestra/trunk/sandbox/pom.xml (original)
+++ myfaces/orchestra/trunk/sandbox/pom.xml Thu Jul  3 05:08:25 2008
@@ -90,6 +90,14 @@
     </dependency>
 
     <dependency>
+      <groupId>com.sun.facelets</groupId>
+      <artifactId>jsf-facelets</artifactId>
+      <version>1.1.11</version>
+      <scope>provided</scope>
+      <optional>true</optional>
+    </dependency>
+
+    <dependency>
       <groupId>javax.persistence</groupId>
       <artifactId>persistence-api</artifactId>
       <version>1.0</version>

Added: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/DynaFormHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/DynaFormHandler.java?rev=673662&view=auto
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/DynaFormHandler.java
(added)
+++ myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/DynaFormHandler.java
Thu Jul  3 05:08:25 2008
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.orchestra.dynaForm.jsf.component.facelets;
+
+import com.sun.facelets.FaceletContext;
+import com.sun.facelets.tag.jsf.ComponentConfig;
+import com.sun.facelets.tag.jsf.ComponentHandler;
+import org.apache.myfaces.orchestra.dynaForm.jsf.component.DynaForm;
+
+import javax.faces.component.UIComponent;
+
+/**
+ * Facelets component-handler class for the DynaForm component. 
+ */
+public class DynaFormHandler extends ComponentHandler
+{
+	public DynaFormHandler(ComponentConfig tagConfig)
+	{
+		super(tagConfig);
+	}
+
+	@Override
+	protected void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent)
+	{
+		boolean resetParent = false;
+		DynaForm dynaForm = (DynaForm) c;
+		if (dynaForm.getParent() == null)
+		{
+			resetParent = true;
+			dynaForm.setParent(parent);
+		}
+		try
+		{
+			dynaForm.setELContext(ctx);
+			dynaForm.initView(ctx.getFacesContext());
+		}
+		finally
+		{
+			// ensure no one else will be able to use this ELContext afterwards
+			dynaForm.setELContext(null);
+			if (resetParent)
+			{
+				dynaForm.setParent(null);
+			}
+		}
+	}
+}
\ No newline at end of file

Propchange: myfaces/orchestra/trunk/sandbox/src/main/java/org/apache/myfaces/orchestra/dynaForm/jsf/component/facelets/DynaFormHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/orchestra/trunk/sandbox/src/main/resources/META-INF/orchestra-dynaform.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/sandbox/src/main/resources/META-INF/orchestra-dynaform.taglib.xml?rev=673662&view=auto
==============================================================================
--- myfaces/orchestra/trunk/sandbox/src/main/resources/META-INF/orchestra-dynaform.taglib.xml
(added)
+++ myfaces/orchestra/trunk/sandbox/src/main/resources/META-INF/orchestra-dynaform.taglib.xml
Thu Jul  3 05:08:25 2008
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+  "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
+
+<facelet-taglib>
+    <namespace>http://myfaces.apache.org/orchestra/dynaForm</namespace>
+
+  <tag>
+    <tag-name>dynaFormConfigs</tag-name>
+    <component>
+      <component-type>org.apache.myfaces.orchestra.dynaForm.DynaConfigs</component-type>
+    </component>
+  </tag>
+
+  <tag>
+    <tag-name>dynaFormConfig</tag-name>
+    <component>
+      <component-type>org.apache.myfaces.orchestra.dynaForm.DynaConfig</component-type>
+    </component>
+  </tag>
+
+  <tag>
+    <tag-name>dynaForm</tag-name>
+    <component>
+      <component-type>org.apache.myfaces.orchestra.dynaForm.DynaForm</component-type>
+      <renderer-type>org.apache.myfaces.orchestra.dynaForm.DynaForm</renderer-type>
+      <handler-class>org.apache.myfaces.orchestra.dynaForm.jsf.component.facelets.DynaFormHandler</handler-class>
+    </component>
+  </tag>
+</facelet-taglib>

Propchange: myfaces/orchestra/trunk/sandbox/src/main/resources/META-INF/orchestra-dynaform.taglib.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message