cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r125078 - in cocoon/trunk/src/blocks/portal/java/org/apache/cocoon: components/modules/input components/variables portal/components/modules/input
Date Thu, 13 Jan 2005 14:41:17 GMT
Author: cziegeler
Date: Thu Jan 13 06:41:15 2005
New Revision: 125078

URL: http://svn.apache.org/viewcvs?view=rev&rev=125078
Log:
Code cleanup
Modified:
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/modules/input/PortletURLModule.java
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/DefaultVariableResolverFactory.java
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/NOPVariableResolver.java
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/PreparedVariableResolver.java
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/modules/input/PortletURLModule.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/modules/input/PortletURLModule.java?view=diff&rev=125078&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/modules/input/PortletURLModule.java&r1=125077&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/modules/input/PortletURLModule.java&r2=125078
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/modules/input/PortletURLModule.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/modules/input/PortletURLModule.java
Thu Jan 13 06:41:15 2005
@@ -49,7 +49,7 @@
  * <code>portlet:render:</code>, <code>portlet:resource:</code>)
are omitted.
  *
  * @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
- * @version CVS $Id: PortletURLModule.java,v 1.2 2004/03/05 13:02:07 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class PortletURLModule extends AbstractInputModule implements ThreadSafe {
 
@@ -124,16 +124,15 @@
             }
 
             return url.toString();
+        }
+        if (name.startsWith(PREFIX_RENDER)) {
+            return name.substring(PREFIX_RENDER.length());
+        } else if (name.startsWith(PREFIX_RESOURCE)) {
+            return name.substring(PREFIX_RESOURCE.length());
+        } else if (name.startsWith(PREFIX_ACTION)) {
+            return name.substring(PREFIX_ACTION.length());
         } else {
-            if (name.startsWith(PREFIX_RENDER)) {
-                return name.substring(PREFIX_RENDER.length());
-            } else if (name.startsWith(PREFIX_RESOURCE)) {
-                return name.substring(PREFIX_RESOURCE.length());
-            } else if (name.startsWith(PREFIX_ACTION)) {
-                return name.substring(PREFIX_ACTION.length());
-            } else {
-                throw new IllegalArgumentException("Invalid attribute name '" + name + "'
for '" + getClass().getName() + "'");
-            }
+            throw new IllegalArgumentException("Invalid attribute name '" + name + "' for
'" + getClass().getName() + "'");
         }
     }
 

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/DefaultVariableResolverFactory.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/DefaultVariableResolverFactory.java?view=diff&rev=125078&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/DefaultVariableResolverFactory.java&r1=125077&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/DefaultVariableResolverFactory.java&r2=125078
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/DefaultVariableResolverFactory.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/DefaultVariableResolverFactory.java
Thu Jan 13 06:41:15 2005
@@ -59,9 +59,8 @@
     throws PatternException {
         if ( this.needsResolve( expression ) ) {
             return new PreparedVariableResolver( expression, this.manager, this.context);
-        } else {
-            return new NOPVariableResolver( expression );
-        }
+        } 
+        return new NOPVariableResolver( expression );
     }
 
     public void release(VariableResolver resolver) {

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/NOPVariableResolver.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/NOPVariableResolver.java?view=diff&rev=125078&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/NOPVariableResolver.java&r1=125077&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/NOPVariableResolver.java&r2=125078
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/NOPVariableResolver.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/NOPVariableResolver.java
Thu Jan 13 06:41:15 2005
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.components.variables;
 
-import org.apache.avalon.framework.activity.Disposable;
 import org.apache.cocoon.sitemap.PatternException;
 
 /**
@@ -23,10 +22,10 @@
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  * 
- * @version CVS $Id: NOPVariableResolver.java,v 1.2 2004/03/05 13:02:07 bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class NOPVariableResolver 
-    implements VariableResolver, Disposable {
+    implements VariableResolver {
 
     protected String expression;
 
@@ -63,8 +62,5 @@
      */
     public String resolve() throws PatternException {
         return this.expression;
-    }
-
-    public void dispose() {
     }
 }

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/PreparedVariableResolver.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/PreparedVariableResolver.java?view=diff&rev=125078&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/PreparedVariableResolver.java&r1=125077&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/PreparedVariableResolver.java&r2=125078
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/PreparedVariableResolver.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/components/variables/PreparedVariableResolver.java
Thu Jan 13 06:41:15 2005
@@ -18,6 +18,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.service.ServiceException;
@@ -34,10 +35,11 @@
  * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  * @author <a href="mailto:tcurdt@apache.org">Torsten Curdt</a>
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Id: PreparedVariableResolver.java,v 1.4 2004/03/05 13:02:07 bdelacretaz
Exp $
+ * @version CVS $Id$
  */
 public class PreparedVariableResolver 
-    extends NOPVariableResolver {
+    extends NOPVariableResolver
+    implements Disposable {
     
     protected ServiceManager  manager;
     protected ServiceSelector selector;
@@ -56,7 +58,6 @@
     
     public PreparedVariableResolver(String expr, ServiceManager manager, Context context)

     throws PatternException {
-        
         super(null);
         this.expression = expr;
         this.manager = manager;
@@ -216,8 +217,10 @@
         
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.avalon.framework.activity.Disposable#dispose()
+     */
     public void dispose() {
-        super.dispose();
         if (this.selector != null) {
             for (int i = 0; i < this.items.size(); i++) {
                 int type = ((Integer) this.items.get(i)).intValue();

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java?view=diff&rev=125078&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java&r1=125077&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java&r2=125078
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
Thu Jan 13 06:41:15 2005
@@ -20,7 +20,6 @@
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.service.ServiceException;
-import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.commons.jxpath.JXPathContext;
 
@@ -45,9 +44,6 @@
 
             portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
 
-            // are we running inside a coplet?
-            final Map context = (Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
-            
             int pos = name.indexOf('/');
             String path;
             if ( pos == -1 ) {

Mime
View raw message