cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r315001 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon: components/variables/ portal/layout/renderer/aspect/impl/XSLTAspect.java portal/portal.roles
Date Wed, 12 Oct 2005 19:04:53 GMT
Author: cziegeler
Date: Wed Oct 12 12:04:42 2005
New Revision: 315001

URL: http://svn.apache.org/viewcvs?rev=315001&view=rev
Log:
Use variable resolver from tree processor

Removed:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/components/variables/
Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java?rev=315001&r1=315000&r2=315001&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
Wed Oct 12 12:04:42 2005
@@ -34,13 +34,16 @@
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.configuration.Configurable;
+import org.apache.avalon.framework.container.ContainerUtil;
+import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
+import org.apache.cocoon.components.treeprocessor.variables.VariableResolverFactory;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.apache.cocoon.sitemap.PatternException;
 import org.apache.cocoon.xml.IncludeXMLConsumer;
-import org.apache.cocoon.components.variables.VariableResolverFactory;
-import org.apache.cocoon.components.variables.VariableResolver;
+//import org.apache.cocoon.components.variables.VariableResolverFactory;
+//import org.apache.cocoon.components.variables.VariableResolver;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.xml.xslt.XSLTProcessor;
@@ -95,14 +98,14 @@
 
     protected Parameters parameters;
 
-    protected VariableResolverFactory variableFactory;
+//    protected VariableResolverFactory variableFactory;
 
     /**
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager manager) throws ServiceException {
         super.service(manager);
-        this.variableFactory = (VariableResolverFactory) this.manager.lookup(VariableResolverFactory.ROLE);
+//        this.variableFactory = (VariableResolverFactory) this.manager.lookup(VariableResolverFactory.ROLE);
     }
 
     /**
@@ -183,7 +186,7 @@
     throws SAXException {
         // FIXME Get the stylesheet either from a layout attribute or another aspect
         try {
-            String stylesheet = config.stylesheet.resolve();
+            String stylesheet = config.stylesheet.resolve(null);
             return stylesheet;
         } catch (PatternException pe) {
             throw new SAXException("Pattern exception during variable resolving.", pe); 
          
@@ -192,7 +195,7 @@
 
     protected String getParameterValue(Map.Entry entry) throws SAXException {
         try {
-            return ((VariableResolver)entry.getValue()).resolve();
+            return ((VariableResolver)entry.getValue()).resolve(null);
         } catch (PatternException pe) {
             throw new SAXException("Unable to get value for parameter " + entry.getKey(),
pe);
         }
@@ -219,7 +222,7 @@
         pc.xsltRole = configuration.getParameter("xslt-processor-role", XSLTProcessor.ROLE);
         String stylesheet = configuration.getParameter("style");
         try {
-            pc.stylesheet = this.variableFactory.lookup( stylesheet );
+            pc.stylesheet = VariableResolverFactory.getResolver(stylesheet, this.manager);
         } catch (PatternException pe) {
             throw new ParameterException("Unknown pattern for stylesheet " + stylesheet,
pe);
         }
@@ -229,7 +232,7 @@
             for (int i=0; i < name.length; ++i) {
                 try {
                     VariableResolver resolver =
-                        this.variableFactory.lookup(this.parameters.getParameter(name[i]));
+                        VariableResolverFactory.getResolver(this.parameters.getParameter(name[i]),
this.manager);
                     this.variables.add(resolver);
                     pc.parameters.put(name[i], resolver);
                 } catch (PatternException e) {
@@ -247,12 +250,12 @@
         if ( this.manager != null ) {
             Iterator vars = this.variables.iterator();
             while ( vars.hasNext() ) {
-                this.variableFactory.release( (VariableResolver) vars.next() );
+                ContainerUtil.dispose(vars.next());
             }
             this.variables.clear();
-            this.manager.release( this.variableFactory);
+            //this.manager.release( this.variableFactory);
             this.manager = null;
-            this.variableFactory = null;
+            //this.variableFactory = null;
         }
     }
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles?rev=315001&r1=315000&r2=315001&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles Wed Oct 12 12:04:42
2005
@@ -178,10 +178,6 @@
     <role name="org.apache.cocoon.portal.profile.ProfileLS"
           default-class="org.apache.cocoon.portal.profile.impl.MapProfileLS"/>
 
-    <role name="org.apache.cocoon.components.variables.VariableResolverFactory"
-          default-class="org.apache.cocoon.components.variables.DefaultVariableResolverFactory"/>
-
-
   <!--+
       | Coplet Adapters
       |



Mime
View raw message