myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r546407 - in /myfaces/orchestra/trunk: core/ core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/ core/src/main/resources/META-INF/ core/src/site/xdoc/ core15/ core15/src/main/java/org/apache/myfaces/orchestra/conversation/a...
Date Tue, 12 Jun 2007 07:45:20 GMT
Author: imario
Date: Tue Jun 12 00:45:15 2007
New Revision: 546407

URL: http://svn.apache.org/viewvc?view=rev&rev=546407
Log:
fixed component namespace problems between tomahawk sandbox and orchestras dynaForm.
added a custom namespace which allows you to configure the conversationName through the spring
bean definition.

Example:

<bean name="userInfo"
    class="my.app.pck.backings.UserInfo"
    scope="conversation"
    orchestra:conversationName="multibean">
</bean>

Added:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
  (with props)
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java
  (with props)
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
  (with props)
    myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd   (with props)
    myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.handlers
    myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.schemas
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/conversation/annotations/
    myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/
    myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java
  (with props)
    myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java
  (with props)
    myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/
    myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/index.jsp
      - copied unchanged from r542198, myfaces/orchestra/trunk/examples/src/main/webapp/dynaForm/index.jsp
    myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp
      - copied, changed from r542198, myfaces/orchestra/trunk/examples/src/main/webapp/dynaForm/start.jsp
Modified:
    myfaces/orchestra/trunk/core/pom.xml
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java
    myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml
    myfaces/orchestra/trunk/core15/pom.xml
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfig.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfigs.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaForm.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaFormRenderer.java
    myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
    myfaces/orchestra/trunk/core15/src/main/resources/META-INF/faces-config.xml
    myfaces/orchestra/trunk/examples/pom.xml
    myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml
    myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp

Modified: myfaces/orchestra/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/pom.xml?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core/pom.xml (original)
+++ myfaces/orchestra/trunk/core/pom.xml Tue Jun 12 00:45:15 2007
@@ -64,7 +64,7 @@
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring</artifactId>
-			<version>2.0.2</version>
+			<version>2.0.5</version>
 			<scope>compile</scope>
 		</dependency>
 
@@ -73,7 +73,7 @@
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-mock</artifactId>
-			<version>2.0.2</version>
+			<version>2.0.5</version>
 			<scope>test</scope>
 		</dependency>
 

Added: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
(added)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
Tue Jun 12 00:45:15 2007
@@ -0,0 +1,44 @@
+/*
+ * 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.conversation.spring;
+
+import org.springframework.beans.factory.xml.BeanDefinitionDecorator;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.w3c.dom.Node;
+
+public class BeanDefinitionConversationNameAttrDecorator implements BeanDefinitionDecorator
+{
+	public final static String XSD_CONVERSATION_NAME_ATTRIBUTE = "conversationName"; // NON-NLS
+	public final static String CONVERSATION_NAME_ATTRIBUTE = "org.apache.myfaces.orchestra.spring.conversationName";
// NON-NLS
+
+	public BeanDefinitionHolder decorate(
+		Node node,
+		BeanDefinitionHolder definition,
+		ParserContext parserContext)
+	{
+		String conversationName = node.getTextContent();
+		if (conversationName != null && conversationName.length() > 0)
+		{
+			definition.getBeanDefinition().setAttribute(CONVERSATION_NAME_ATTRIBUTE, conversationName);
+		}
+
+		return null;
+	}
+}

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/BeanDefinitionConversationNameAttrDecorator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java
(added)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java
Tue Jun 12 00:45:15 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.conversation.spring;
+
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.w3c.dom.Element;
+
+/**
+ * Parse the Orchestra specific configuration out of the spring config
+ */
+public class OrchestraBeanDefinitionParser implements BeanDefinitionParser
+{
+	public BeanDefinition parse(Element element, ParserContext parserContext)
+	{
+		return parserContext.getContainingBeanDefinition();
+	}
+}

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
(added)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
Tue Jun 12 00:45:15 2007
@@ -0,0 +1,34 @@
+/*
+ * 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.conversation.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+/**
+ * wire the custom namespace "orchestra" to its parser to allow to configure
+ * further Orchestra aspects.
+ */
+public class OrchestraNamespaceHandler extends NamespaceHandlerSupport
+{
+	public void init()
+	{
+		// registerBeanDefinitionParser("orchestra", new OrchestraBeanDefinitionParser()); // NON-NLS
+		registerBeanDefinitionDecoratorForAttribute(BeanDefinitionConversationNameAttrDecorator.XSD_CONVERSATION_NAME_ATTRIBUTE,
new BeanDefinitionConversationNameAttrDecorator());
+	}
+}

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/OrchestraNamespaceHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java
(original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/spring/SpringConversationScope.java
Tue Jun 12 00:45:15 2007
@@ -27,13 +27,18 @@
 import org.apache.myfaces.orchestra.conversation.ConversationManager;
 import org.apache.myfaces.orchestra.conversation.CurrentConversationAdvice;
 import org.springframework.aop.framework.ProxyFactory;
+import org.springframework.aop.scope.ScopedProxyFactoryBean;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanFactory;
 import org.springframework.beans.factory.BeanFactoryAware;
 import org.springframework.beans.factory.ObjectFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 import org.springframework.beans.factory.config.Scope;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ConfigurableApplicationContext;
 
 /**
  * <p>adapts the conversation scope to a new spring scope</p>
@@ -66,8 +71,9 @@
  * The beanName will also be the conversation name.
  * </p>
  */
-public class SpringConversationScope implements Scope, BeanFactoryAware
+public class SpringConversationScope implements Scope, BeanFactoryAware, ApplicationContextAware
 {
+	private ConfigurableApplicationContext applicationContext;
 	private Advice[] advices;
 
 	public SpringConversationScope()
@@ -108,25 +114,27 @@
 		return getBean(name, objectFactory);
 	}
 
-	protected Object getBean(String name, ObjectFactory objectFactory)
+	protected Object getBean(String beanName, ObjectFactory objectFactory)
 	{
+		String conversationName = getConversationNameForBean(beanName);
+
 		ConversationManager manager = ConversationManager.getInstance();
 
 		// check if we have a conversation
 		synchronized(manager)
 		{
-			if (!manager.hasConversation(name))
+			if (!manager.hasConversation(conversationName))
 			{
 				// start the conversation
-				manager.startConversation(name, getConversationPolicy());
+				manager.startConversation(conversationName, getConversationPolicy());
 			}
 		}
 
 		// get the conversation
-		Conversation conversation = getConversationForBean(name);
+		Conversation conversation = manager.getConversation(conversationName);
 		synchronized(conversation)
 		{
-			if (!conversation.hasAttribute(name))
+			if (!conversation.hasAttribute(beanName))
 			{
 				// create the bean (if not already done)
 				Object value = objectFactory.getObject();
@@ -145,12 +153,12 @@
 
 				value = factory.getProxy();
 
-				conversation.setAttribute(name, value);
+				conversation.setAttribute(beanName, value);
 			}
 		}
 
 		// get the bean
-		return conversation.getAttribute(name);
+		return conversation.getAttribute(beanName);
 	}
 
 	protected ConversationPolicy getConversationPolicy()
@@ -193,11 +201,34 @@
 	protected Conversation getConversationForBean(String beanName)
 	{
 		ConversationManager manager = ConversationManager.getInstance();
-		Conversation conversation = manager.getConversation(beanName);
+		Conversation conversation = manager.getConversation(getConversationNameForBean(beanName));
 		return conversation;
 	}
 
 	/**
+	 * get the conversation name associating to the beanName
+	 */
+	protected String getConversationNameForBean(String beanName)
+	{
+		if (applicationContext != null)
+		{
+			BeanDefinition beanDefinition = applicationContext.getBeanFactory().getBeanDefinition(beanName);
+			if (ScopedProxyFactoryBean.class.getName().equals(beanDefinition.getBeanClassName()))
+			{
+				// bad hack to get access to the real definition
+				// TODO: is there a better way to do this?
+				beanDefinition = applicationContext.getBeanFactory().getBeanDefinition("scopedTarget."
+ beanName); // NON-NLS
+			}
+			if (beanDefinition.hasAttribute(BeanDefinitionConversationNameAttrDecorator.CONVERSATION_NAME_ATTRIBUTE))
+			{
+				return (String) beanDefinition.getAttribute(BeanDefinitionConversationNameAttrDecorator.CONVERSATION_NAME_ATTRIBUTE);
+			}
+		}
+
+		return beanName;
+	}
+
+	/**
 	 * strip off any spring namespace. (e.g. scopedTarget.)
 	 * This method will simply strip off anything before the first
 	 * dot.
@@ -245,5 +276,16 @@
 				}
 			}
 		);
+	}
+
+	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
+	{
+		if (!(applicationContext instanceof ConfigurableApplicationContext))
+		{
+			// TODO: log info
+			return;
+		}
+
+		this.applicationContext = (ConfigurableApplicationContext) applicationContext;
 	}
 }

Added: myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd (added)
+++ myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd Tue Jun 12 00:45:15
2007
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+  -->
+<xsd:schema xmlns="http://myfaces.apache.org/orchestra"
+	targetNamespace="http://myfaces.apache.org/orchestra"
+	elementFormDefault="qualified" attributeFormDefault="unqualified"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+	<!-- todo: limit to bean element -->
+	<xsd:attribute
+			name="conversationName"
+			type="xsd:string" />
+
+</xsd:schema>

Propchange: myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/orchestra/trunk/core/src/main/resources/META-INF/orchestra.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.handlers?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.handlers (added)
+++ myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.handlers Tue Jun 12 00:45:15
2007
@@ -0,0 +1 @@
+http\://myfaces.apache.org/orchestra=org.apache.myfaces.orchestra.conversation.spring.OrchestraNamespaceHandler
\ No newline at end of file

Added: myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.schemas?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.schemas (added)
+++ myfaces/orchestra/trunk/core/src/main/resources/META-INF/spring.schemas Tue Jun 12 00:45:15
2007
@@ -0,0 +1 @@
+http\://myfaces.apache.org/orchestra=/META-INF/orchestra.xsd
\ No newline at end of file

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/usage.xml Tue Jun 12 00:45:15 2007
@@ -28,12 +28,14 @@
 			<subsection name="Starting a conversation">
 				In the beginning, we'll want to start a conversation. Doing that is a no-brainer in Orchestra
- if
 				you've declared the relevant managed beans as in the following example:
-				<code><pre>&lt;bean name="userInfo"
-					class="my.app.pck.backings.UserInfo"
-					scope="conversation"
-					autowire="byName"&gt;
-					&lt;aop:scoped-proxy /&gt;
-					&lt;/bean&gt;</pre></code>
+				<code><pre>
+&lt;bean name="userInfo"
+    class="my.app.pck.backings.UserInfo"
+    scope="conversation"
+    autowire="byName"&gt;
+    &lt;aop:scoped-proxy /&gt;
+&lt;/bean&gt;
+				</pre></code>
 				<p>
 					We've learned about this syntax in the small example in the introduction - a short repetition:
 					<br/>
@@ -65,6 +67,31 @@
 					and your bean has a
 					<code>setUserInfoDao()</code>
 					method Spring will inject an instance of this DAO into your bean.
+				</p>
+				<p>
+					Alternatively you could provide a custom conversation name:
+				</p>
+				<code><pre>
+&lt;bean name="bean1"
+    class="my.app.pck.backings.bean1"
+    scope="conversation"
+    orchestra:conversationName="multibean"
+	autowire="byName"&gt;
+    &lt;aop:scoped-proxy /&gt;
+&lt;/bean&gt;
+&lt;bean name="bean2"
+	class="my.app.pck.backings.bean2"
+	scope="conversation"
+	orchestra:conversationName="multibean"
+	autowire="byName"&gt;
+	&lt;aop:scoped-proxy /&gt;
+&lt;/bean&gt;
+				</pre></code>
+				<p>
+					As you can see in the above example we put two beans into the same conversation, which
+					means they share the same persistence context.<br />
+					This opens the possibility to keep the "one class per page" paradigm and still
+					allows you to pass entities between these two pages (e.g. Master/Detail scenarios).
 				</p>
 			</subsection>
 

Modified: myfaces/orchestra/trunk/core15/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/pom.xml?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core15/pom.xml (original)
+++ myfaces/orchestra/trunk/core15/pom.xml Tue Jun 12 00:45:15 2007
@@ -102,12 +102,18 @@
 			<scope>provided</scope>
 		</dependency>
 
+                <dependency>
+                        <groupId>org.springframework</groupId>
+                        <artifactId>spring</artifactId>
+                        <version>2.0.5</version>
+                        <scope>compile</scope>
+                </dependency>
 
                 <!-- test dependencies -->
                 <dependency>
                         <groupId>org.springframework</groupId>
                         <artifactId>spring-mock</artifactId>
-                        <version>2.0.2</version>
+                        <version>2.0.5</version>
                         <scope>test</scope>
                 </dependency>
 

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfig.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfig.java?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfig.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfig.java
Tue Jun 12 00:45:15 2007
@@ -31,8 +31,8 @@
  */
 public class DynaConfig extends UIComponentBase
 {
-	public static final String COMPONENT_TYPE = "org.apache.myfaces.dynaForm.DynaConfig";
-	public static final String COMPONENT_FAMILY = "org.apache.myfaces.dynaForm.DynaConfig";
+	public static final String COMPONENT_TYPE = "org.apache.myfaces.orchestra.dynaForm.DynaConfig";
+	public static final String COMPONENT_FAMILY = "org.apache.myfaces.orchestra.dynaForm.DynaForm";
 
 	private String forProperty;
 	private Integer displaySize;

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfigs.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfigs.java?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfigs.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaConfigs.java
Tue Jun 12 00:45:15 2007
@@ -29,8 +29,8 @@
  */
 public class DynaConfigs extends UIComponentBase
 {
-	public static final String COMPONENT_TYPE = "org.apache.myfaces.dynaForm.DynaConfigs";
-	public static final String COMPONENT_FAMILY = "org.apache.myfaces.dynaForm.DynaConfigs";
+	public static final String COMPONENT_TYPE = "org.apache.myfaces.orchestra.dynaForm.DynaConfigs";
+	public static final String COMPONENT_FAMILY = "org.apache.myfaces.orchestra.dynaForm.DynaForm";
 
 	private transient Map<String, DynaConfig> configMap = null;
 

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaForm.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaForm.java?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaForm.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaForm.java
Tue Jun 12 00:45:15 2007
@@ -34,9 +34,9 @@
  */
 public class DynaForm extends UIComponentBase
 {
-	public static final String COMPONENT_TYPE = "org.apache.myfaces.dynaForm.DynaForm";
-	public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.dynaForm.DynaForm";
-	public static final String COMPONENT_FAMILY = "org.apache.myfaces.dynaForm.DynaForm";
+	public static final String COMPONENT_TYPE = "org.apache.myfaces.orchestra.dynaForm.DynaForm";
+	public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.orchestra.dynaForm.DynaForm";
+	public static final String COMPONENT_FAMILY = "org.apache.myfaces.orchestra.dynaForm.DynaForm";
 
 	public static final String DYNA_FORM_CREATED = "org.apache.myfaces.dynaForm.CREATED";
 

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaFormRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaFormRenderer.java?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaFormRenderer.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/component/dynaForm/DynaFormRenderer.java
Tue Jun 12 00:45:15 2007
@@ -46,7 +46,7 @@
  */
 public class DynaFormRenderer extends Renderer
 {
-	public final static String CONTEXT_GUI_BUILDER = "org.apache.myfaces.custom.dynaForm.GUI_BUILDER";
+	public final static String CONTEXT_GUI_BUILDER = "org.apache.myfaces.orchestra.dynaForm.GUI_BUILDER";
 
 	private final class AddComponentToTable implements NewComponentListener
 	{

Modified: myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
(original)
+++ myfaces/orchestra/trunk/core15/src/main/java/org/apache/myfaces/orchestra/dynaForm/metadata/impl/ejb/EjbExtractor.java
Tue Jun 12 00:45:15 2007
@@ -497,9 +497,9 @@
 			mdField.setTemporalType(temporal.value());
 		}
 		// ... but override with our own Temporal if required
-		if (accessibleObject.isAnnotationPresent(Temporal.class))
+		if (accessibleObject.isAnnotationPresent(org.apache.myfaces.orchestra.dynaForm.annot.ui.Temporal.class))
 		{
-			Temporal temporal = accessibleObject.getAnnotation(Temporal.class);
+			org.apache.myfaces.orchestra.dynaForm.annot.ui.Temporal temporal = accessibleObject.getAnnotation(org.apache.myfaces.orchestra.dynaForm.annot.ui.Temporal.class);
 			mdField.setTemporalType(temporal.value());
 		}
 

Modified: myfaces/orchestra/trunk/core15/src/main/resources/META-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/src/main/resources/META-INF/faces-config.xml?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/core15/src/main/resources/META-INF/faces-config.xml (original)
+++ myfaces/orchestra/trunk/core15/src/main/resources/META-INF/faces-config.xml Tue Jun 12
00:45:15 2007
@@ -27,12 +27,12 @@
 
     <!-- components -->
     <component>
-        <component-type>org.apache.myfaces.dynaForm.DynaConfigs</component-type>
+        <component-type>org.apache.myfaces.orchestra.dynaForm.DynaConfigs</component-type>
         <component-class>org.apache.myfaces.orchestra.dynaForm.component.dynaForm.DynaConfigs</component-class>
     </component>
 
     <component>
-        <component-type>org.apache.myfaces.dynaForm.DynaConfig</component-type>
+        <component-type>org.apache.myfaces.orchestra.dynaForm.DynaConfig</component-type>
         <component-class>org.apache.myfaces.orchestra.dynaForm.component.dynaForm.DynaConfig</component-class>
         <property>
           <description>
@@ -72,7 +72,7 @@
     </component>
 
     <component>
-        <component-type>org.apache.myfaces.dynaForm.DynaForm</component-type>
+        <component-type>org.apache.myfaces.orchestra.dynaForm.DynaForm</component-type>
         <component-class>org.apache.myfaces.orchestra.dynaForm.component.dynaForm.DynaForm</component-class>
         <property>
           <description>
@@ -125,8 +125,8 @@
         <description>
           Render the dynaForm (in fact it renders nothing but creates the children for the
layout component)
         </description>
-        <component-family>org.apache.myfaces.dynaForm.DynaForm</component-family>
-        <renderer-type>org.apache.myfaces.dynaForm.DynaForm</renderer-type>
+        <component-family>org.apache.myfaces.orchestra.dynaForm.DynaForm</component-family>
+        <renderer-type>org.apache.myfaces.orchestra.dynaForm.DynaForm</renderer-type>
         <renderer-class>org.apache.myfaces.orchestra.dynaForm.component.dynaForm.DynaFormRenderer</renderer-class>
       </renderer>
     </render-kit>

Modified: myfaces/orchestra/trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/pom.xml?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/examples/pom.xml (original)
+++ myfaces/orchestra/trunk/examples/pom.xml Tue Jun 12 00:45:15 2007
@@ -74,7 +74,7 @@
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring</artifactId>
-			<version>2.0.2</version>
+			<version>2.0.5</version>
 		</dependency>
 		<dependency>
 			<groupId>javax.mail</groupId>

Added: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java
(added)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java
Tue Jun 12 00:45:15 2007
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.examples.multibean;
+
+import org.apache.myfaces.orchestra.conversation.Conversation;
+
+public class Bean1
+{
+	public String getConversationName()
+	{
+		return Conversation.getCurrentInstance().getName();
+	}
+}

Propchange: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean1.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java?view=auto&rev=546407
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java
(added)
+++ myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java
Tue Jun 12 00:45:15 2007
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.examples.multibean;
+
+import org.apache.myfaces.orchestra.conversation.Conversation;
+
+public class Bean2
+{
+	public String getConversationName()
+	{
+		return Conversation.getCurrentInstance().getName();
+	}
+}

Propchange: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/orchestra/trunk/examples/src/main/java/org/apache/myfaces/examples/multibean/Bean2.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/WEB-INF/applicationContext.xml Tue Jun
12 00:45:15 2007
@@ -22,10 +22,12 @@
 	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	   xmlns:tx="http://www.springframework.org/schema/tx"
 	   xmlns:aop="http://www.springframework.org/schema/aop"
+	   xmlns:orchestra="http://myfaces.apache.org/orchestra"
 	   xsi:schemaLocation="
 			http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
 			http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
-			http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
+			http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+			http://myfaces.apache.org/orchestra /META-INF/orchestra.xsd">
 
 	<!-- register our custom spring scope -->
 	<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
@@ -277,6 +279,26 @@
 		class="org.apache.myfaces.examples.ballot.backings.BallotVoter"
 		scope="conversation"
 		autowire="byName">
+
+		<aop:scoped-proxy/>
+
+	</bean>
+
+	<bean
+		name="bean1"
+		class="org.apache.myfaces.examples.multibean.Bean1"
+		scope="conversation"
+		orchestra:conversationName="multibean">
+
+		<aop:scoped-proxy/>
+
+	</bean>
+
+	<bean
+		name="bean2"
+		class="org.apache.myfaces.examples.multibean.Bean2"
+		scope="conversation"
+		orchestra:conversationName="multibean">
 
 		<aop:scoped-proxy/>
 

Copied: myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp (from r542198,
myfaces/orchestra/trunk/examples/src/main/webapp/dynaForm/start.jsp)
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp?view=diff&rev=546407&p1=myfaces/orchestra/trunk/examples/src/main/webapp/dynaForm/start.jsp&r1=542198&p2=myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/dynaForm/start.jsp (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/multiBean/start.jsp Tue Jun 12 00:45:15
2007
@@ -29,16 +29,16 @@
 <h:form>
 
 	<t:htmlTag value="h3">
-		<h:outputText value="DynaForm Examples" />
+		<h:outputText value="MultiBean Example" />
 	</t:htmlTag>
 
-	<t:htmlTag value="ul">
-		<t:htmlTag value="li">
-			<h:outputLink value="Form.faces" >
-				<h:outputText value="A simple input form" />
-			</h:outputLink>
-		</t:htmlTag>
-	</t:htmlTag>
+	<h:panelGrid columns="2">
+		<h:outputText value="conversation name of bean1:" />
+		<h:outputText value="#{bean1.conversationName}" />
+
+		<h:outputText value="conversation name of bean2:" />
+		<h:outputText value="#{bean2.conversationName}" />
+	</h:panelGrid>
 
 </h:form>
 

Modified: myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp?view=diff&rev=546407&r1=546406&r2=546407
==============================================================================
--- myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp (original)
+++ myfaces/orchestra/trunk/examples/src/main/webapp/start.jsp Tue Jun 12 00:45:15 2007
@@ -50,6 +50,14 @@
 		</t:htmlTag>
 	</t:htmlTag>
 
+	<t:htmlTag value="ul">
+		<t:htmlTag value="li">
+			<h:outputLink value="multiBean/start.faces" >
+				<h:outputText value="Multiple Beans within the same conversation through special 'orchestra'
configuration" />
+			</h:outputLink>
+		</t:htmlTag>
+	</t:htmlTag>
+
 </h:form>
 
 <%@include file="footer.jspf"%>



Mime
View raw message