portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r453503 - in /portals/jetspeed-2/trunk: components/portal/src/java/org/apache/jetspeed/layout/impl/MultipleAction.java src/webapp/WEB-INF/assembly/ajax-layout.xml
Date Fri, 06 Oct 2006 05:53:11 GMT
Author: taylor
Date: Thu Oct  5 22:53:10 2006
New Revision: 453503

URL: http://svn.apache.org/viewvc?view=rev&rev=453503
Log:
remove circular dependency in spring configuration
not too happy with this solution, thought i could get it around it with a full setter DI,
but no luck so instead Im 
making the DI during container factory set

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MultipleAction.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MultipleAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MultipleAction.java?view=diff&rev=453503&r1=453502&r2=453503
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MultipleAction.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/layout/impl/MultipleAction.java
Thu Oct  5 22:53:10 2006
@@ -36,6 +36,9 @@
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.context.Context;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
 
 /**
  * 
@@ -55,7 +58,7 @@
  * 
  */
 public class MultipleAction extends BasePortletAction implements AjaxAction,
-        AjaxBuilder
+        AjaxBuilder, BeanFactoryAware
 {
 
     protected static final String ALL_RESULTS = "results";
@@ -72,7 +75,7 @@
 
     protected static final String VALUE_TOKEN = ",";
 
-    protected Map m_sActionMap = null;
+    protected Map actionMap = null;
 
     protected VelocityEngine m_oVelocityEngine = null;
 
@@ -83,10 +86,17 @@
     {
         super(p_sTemplate, p_sErrorTemplate, p_oPageManager,
                 p_oSecurityBehavior);
-        m_sActionMap = requestService.getActionMap();
+        actionMap = requestService.getActionMap();
         m_oVelocityEngine = p_oVelocityEngine;
     }
 
+    public void setBeanFactory(BeanFactory beanFactory) throws BeansException
+    {
+        // get the proxied object for this, and put it in the map to avoid circular dep
+        Object proxy = beanFactory.getBean("AjaxMultipleAction");
+        actionMap.put("multiple", proxy);        
+    }
+    
     public boolean run(RequestContext p_oRequestContext, Map p_oResultMap)
             throws AJAXException
     {
@@ -136,7 +146,7 @@
             String a_sAction = a_oParamTok.nextToken();
 
             // Lookup the action from the action map
-            Object a_oActionObject = m_sActionMap.get(a_sAction);
+            Object a_oActionObject = actionMap.get(a_sAction);
             if (a_oActionObject == null
                     && !(a_oActionObject instanceof AjaxAction))
             {

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml?view=diff&rev=453503&r1=453502&r2=453503
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/ajax-layout.xml Thu Oct  5 22:53:10
2006
@@ -389,7 +389,7 @@
     </constructor-arg>    
 </bean>
         
-<bean id="AjaxRequestService" class="org.apache.jetspeed.ajax.AjaxRequestServiceImpl">
+<bean id="AjaxActionMap" class="java.util.HashMap">
     <constructor-arg index="0">
         <map>
             <entry key="move">
@@ -449,11 +449,14 @@
             <entry key="constraints">
                 <ref bean="AjaxSecurityConstraints"/>
             </entry>			                                    
-            <entry key="multiple">
-                <ref bean="AjaxMultipleAction"/>
-            </entry>
         </map>
-    </constructor-arg>
+    </constructor-arg>    
+</bean>    
+
+<bean id="AjaxRequestService" class="org.apache.jetspeed.ajax.AjaxRequestServiceImpl">
+    <constructor-arg index="0">
+        <ref bean="AjaxActionMap"/>
+    </constructor-arg>   
     <constructor-arg index="1">
         <ref bean="AjaxVelocityEngine"/>
     </constructor-arg>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message