cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/components/saxconnector NullSAXConnector.java SAXConnector.java XIncludeSAXConnector.java
Date Fri, 27 Apr 2001 15:14:45 GMT
bloritsch    01/04/27 08:14:44

  Modified:    src/org/apache/cocoon Tag: xml-cocoon2 Cocoon.java
                        Roles.java
               src/org/apache/cocoon/components/language/markup/sitemap/java
                        Tag: xml-cocoon2 sitemap.xsl
               src/org/apache/cocoon/components/pipeline Tag: xml-cocoon2
                        AbstractEventPipeline.java
                        CachingEventPipeline.java EventPipeline.java
               src/org/apache/cocoon/components/saxconnector Tag:
                        xml-cocoon2 NullSAXConnector.java SAXConnector.java
                        XIncludeSAXConnector.java
  Log:
  Revert to the setSitemap() hack.  At least we are using IOC... :)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.80  +1 -2      xml-cocoon/src/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.4.2.79
  retrieving revision 1.4.2.80
  diff -u -r1.4.2.79 -r1.4.2.80
  --- Cocoon.java	2001/04/26 21:12:02	1.4.2.79
  +++ Cocoon.java	2001/04/27 15:14:11	1.4.2.80
  @@ -52,7 +52,7 @@
    *
    * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
(Apache Software Foundation, Exoffice Technologies)
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.4.2.79 $ $Date: 2001/04/26 21:12:02 $
  + * @version CVS $Revision: 1.4.2.80 $ $Date: 2001/04/27 15:14:11 $
    */
   public class Cocoon extends AbstractLoggable implements ThreadSafe, Component, Initializable,
Disposable, Modifiable, Processor, Contextualizable {
       /** The application context */
  @@ -212,7 +212,6 @@
           getLogger().debug("Sitemap location = " + this.sitemapFileName);
           getLogger().debug("Checking sitemap reload = " + this.checkSitemapReload);
           getLogger().debug("Reloading sitemap asynchron = " + this.reloadSitemapAsynchron);
  -        this.componentManager.addComponentInstance(Roles.SITEMAP_MANAGER, this.sitemapManager);
       }
   
       /** Queries the class to estimate its ergodic period termination. */
  
  
  
  1.1.2.17  +1 -2      xml-cocoon/src/org/apache/cocoon/Attic/Roles.java
  
  Index: Roles.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Attic/Roles.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- Roles.java	2001/04/26 21:12:03	1.1.2.16
  +++ Roles.java	2001/04/27 15:14:14	1.1.2.17
  @@ -12,7 +12,7 @@
    * Created this interface to specify the Avalon role names.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.1.2.16 $ $Date: 2001/04/26 21:12:03 $
  + * @version CVS $Revision: 1.1.2.17 $ $Date: 2001/04/27 15:14:14 $
    */
   
   public interface Roles {
  @@ -49,6 +49,5 @@
       String XML_DESERIALIZER     = "org.apache.cocoon.components.sax.XMLDeserializer";
       String EVENT_CACHE          = "org.apache.cocoon.caching.EventCache";
       String STREAM_CACHE         = "org.apache.cocoon.caching.StreamCache";
  -    String SITEMAP_MANAGER      = "org.apache.cocoon.sitemap.Manager";
   
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.109 +6 -1      xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl
  
  Index: sitemap.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
  retrieving revision 1.1.2.108
  retrieving revision 1.1.2.109
  diff -u -r1.1.2.108 -r1.1.2.109
  --- sitemap.xsl	2001/04/25 07:55:46	1.1.2.108
  +++ sitemap.xsl	2001/04/27 15:14:20	1.1.2.109
  @@ -98,7 +98,7 @@
        *
        * @author &lt;a href="mailto:giacomo@apache.org"&gt;Giacomo Pati&lt;/a&gt;
        * @author &lt;a href="mailto:bloritsch@apache.org"&gt;Berin Loritsch&lt;/a&gt;
  -     * @version CVS $Id: sitemap.xsl,v 1.1.2.108 2001/04/25 07:55:46 giacomo Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.1.2.109 2001/04/27 15:14:20 bloritsch Exp $
        */
       public class <xsl:value-of select="@file-name"/> extends AbstractSitemap {
         static final String LOCATION = "<xsl:value-of select="translate(@file-path, '/',
'.')"/>.<xsl:value-of select="@file-name"/>";
  @@ -307,6 +307,7 @@
           private boolean resource_<xsl:value-of select="translate(@name, '- ', '__')"/>
(StreamPipeline pipeline,
               EventPipeline eventPipeline, List listOfMaps, Environment environment, String
cocoon_view, boolean internalRequest)
           throws Exception {
  +          eventPipeline.setSitemap(this);
             Map map = null;
             Parameters param = null;
             <xsl:apply-templates select="./*"/>
  @@ -327,6 +328,7 @@
           private boolean view_<xsl:value-of select="translate(@name, '- ', '__')"/>
(StreamPipeline pipeline,
               EventPipeline eventPipeline, List listOfMaps, Environment environment, boolean
internalRequest)
           throws Exception {
  +          eventPipeline.setSitemap(this);
             Map map = null;
             Parameters param = null;
             <xsl:apply-templates select="./*"/>
  @@ -377,6 +379,7 @@
              components and the &lt;code&gt;StreamPipeline&lt;/code&gt; to
produce the requested resource */
           EventPipeline eventPipeline = (EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
           StreamPipeline pipeline = (StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
  +        eventPipeline.setSitemap(this);
           pipeline.setEventPipeline(eventPipeline);
           boolean result = false;
           try {
  @@ -411,6 +414,7 @@
              XPath kind expressions in values of src attribute used with
              generate and transform elements */
           List listOfMaps = (List) new ArrayList();
  +        eventPipeline.setSitemap(this);
           Map map;
           Parameters param;
           Map objectModel = environment.getObjectModel();
  @@ -463,6 +467,7 @@
               try {
                 eventPipeline = (EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
                 pipeline = (StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
  +              eventPipeline.setSitemap(this);
                 pipeline.setEventPipeline(eventPipeline);
                 List listOfMaps = (List)(new ArrayList());
                 Map map;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.10  +10 -1     xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/AbstractEventPipeline.java
  
  Index: AbstractEventPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/AbstractEventPipeline.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- AbstractEventPipeline.java	2001/04/25 17:06:16	1.1.2.9
  +++ AbstractEventPipeline.java	2001/04/27 15:14:25	1.1.2.10
  @@ -35,7 +35,7 @@
   /**
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:cziegeler@Carsten Ziegeler">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/04/25 17:06:16 $
  + * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/04/27 15:14:25 $
    */
   public abstract class AbstractEventPipeline
   extends AbstractXMLProducer
  @@ -64,6 +64,10 @@
           transformerSelector = (ComponentSelector)this.manager.lookup(Roles.TRANSFORMERS);
       }
   
  +    public final void setSitemap(final Sitemap sitemap) {
  +        this.sitemap = sitemap;
  +    }
  +
       public void setGenerator (String role, String source, Parameters param, Exception e)
       throws Exception {
           this.setGenerator (role, source, param);
  @@ -192,6 +196,7 @@
                   // connect SAXConnector
                   SAXConnector connect = (SAXConnector) this.manager.lookup(Roles.SAX_CONNECTOR);
                   connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
  +                connect.setSitemap(this.sitemap);
                   this.connectors.add(connect);
                   next = (XMLConsumer) connect;
                   prev.setConsumer(next);
  @@ -207,6 +212,7 @@
               // insert SAXConnector
               SAXConnector connect = (SAXConnector) this.manager.lookup(Roles.SAX_CONNECTOR);
               connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
  +            connect.setSitemap(this.sitemap);
               this.connectors.add(connect);
               next = (XMLConsumer) connect;
               prev.setConsumer(next);
  @@ -242,6 +248,9 @@
   
       public void recycle() {
           super.recycle();
  +
  +        this.sitemap = null;
  +
           try {
               // Release generator.
               if ( this.generatorSelector != null ) {
  
  
  
  1.1.2.11  +3 -1      xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/CachingEventPipeline.java
  
  Index: CachingEventPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/CachingEventPipeline.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- CachingEventPipeline.java	2001/04/25 17:06:19	1.1.2.10
  +++ CachingEventPipeline.java	2001/04/27 15:14:26	1.1.2.11
  @@ -52,7 +52,7 @@
    * does not cache! (If it would cache, the response would be cached twice!)
    *
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/04/25 17:06:19 $
  + * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/04/27 15:14:26 $
    */
   public final class CachingEventPipeline
   extends AbstractEventPipeline
  @@ -311,6 +311,7 @@
                   // connect SAXConnector
                   SAXConnector connect = (SAXConnector) this.manager.lookup(Roles.SAX_CONNECTOR);
                   connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
  +                connect.setSitemap(this.sitemap);
                   this.connectors.add(connect);
                   next = (XMLConsumer) connect;
                   prev.setConsumer(next);
  @@ -331,6 +332,7 @@
               // insert SAXConnector
               SAXConnector connect = (SAXConnector) this.manager.lookup(Roles.SAX_CONNECTOR);
               connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
  +            connect.setSitemap(this.sitemap);
               this.connectors.add(connect);
               next = (XMLConsumer) connect;
               prev.setConsumer(next);
  
  
  
  1.1.2.7   +2 -1      xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/EventPipeline.java
  
  Index: EventPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/EventPipeline.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- EventPipeline.java	2001/04/25 17:06:20	1.1.2.6
  +++ EventPipeline.java	2001/04/27 15:14:28	1.1.2.7
  @@ -18,12 +18,13 @@
   
   /**
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/04/25 17:06:20 $
  + * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/04/27 15:14:28 $
    */
   public interface EventPipeline extends Component, Composable, Recyclable, Processor {
       public void setGenerator (String role, String source, Parameters param, Exception e)
throws Exception;
       public void setGenerator (String role, String source, Parameters param) throws Exception;
       public Generator getGenerator ();
       public void addTransformer (String role, String source, Parameters param) throws Exception;
  +    public void setSitemap(Sitemap sitemap);
       public boolean process(Environment environment) throws Exception;
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +6 -1      xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/NullSAXConnector.java
  
  Index: NullSAXConnector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/NullSAXConnector.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- NullSAXConnector.java	2001/04/25 18:20:37	1.1.2.7
  +++ NullSAXConnector.java	2001/04/27 15:14:34	1.1.2.8
  @@ -20,9 +20,14 @@
   /**
    * Null implementation of the SAXConnector. Simply sends events on to the next component
in the pipeline.
    * @author <a href="prussell@apache.org">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/04/25 18:20:37 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/04/27 15:14:34 $
    */
   public class NullSAXConnector extends AbstractXMLPipe implements Poolable, SAXConnector
{
  +    /** Set the sitemap
  +     */
  +    public final void setSitemap(Sitemap sitemap) {
  +        // do nothing.
  +    }
   
       /** Setup this SAXConnector.
        */
  
  
  
  1.1.2.8   +7 -1      xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/SAXConnector.java
  
  Index: SAXConnector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/SAXConnector.java,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- SAXConnector.java	2001/04/25 18:20:37	1.1.2.7
  +++ SAXConnector.java	2001/04/27 15:14:36	1.1.2.8
  @@ -16,7 +16,13 @@
   /**
    * Provides a connection between SAX components.
    * @author <a href="mailto:prussell@apache.org">Paul Russell</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/04/25 18:20:37 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/04/27 15:14:36 $
    */
   public interface SAXConnector extends XMLPipe, Component, SitemapModelComponent {
  +    /**
  +     * Pass reference to containing Sitemap.
  +     * This is a temporary hack until something better
  +     * comes along.
  +     */
  +    void setSitemap(Sitemap sitemap);
   }
  
  
  
  1.1.2.10  +13 -10    xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/XIncludeSAXConnector.java
  
  Index: XIncludeSAXConnector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/XIncludeSAXConnector.java,v
  retrieving revision 1.1.2.9
  retrieving revision 1.1.2.10
  diff -u -r1.1.2.9 -r1.1.2.10
  --- XIncludeSAXConnector.java	2001/04/26 21:12:07	1.1.2.9
  +++ XIncludeSAXConnector.java	2001/04/27 15:14:37	1.1.2.10
  @@ -25,7 +25,7 @@
   import org.apache.cocoon.components.pipeline.StreamPipeline;
   import org.apache.cocoon.components.url.URLFactory;
   import org.apache.cocoon.environment.Environment;
  -import org.apache.cocoon.sitemap.Manager;
  +import org.apache.cocoon.sitemap.Sitemap;
   import org.apache.cocoon.xml.AbstractXMLPipe;
   import org.apache.cocoon.xml.IncludeXMLConsumer;
   import org.apache.cocoon.xml.XMLProducer;
  @@ -40,13 +40,16 @@
   /**
    * Copy of code from XIncludeTransformer as a starting point for XIncludeSAXConnector.
    * @author <a href="dims@yahoo.com">Davanum Srinivas</a>
  - * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/04/26 21:12:07 $
  + * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/04/27 15:14:37 $
    */
   public class XIncludeSAXConnector extends AbstractXMLPipe implements Composable, Recyclable,
SAXConnector, Disposable {
   
       /** Stacks namespaces during processing */
       private ArrayList currentNS = new ArrayList();
   
  +    /** The sitemap we manipulate */
  +    private Sitemap sitemap;
  +
       /** The current <code>ComponentManager</code>. */
       protected ComponentManager manager = null;
   
  @@ -65,8 +68,12 @@
               throws ProcessingException, SAXException, IOException {
           environment = (Environment) resolver;
       }
  +
  +    public final void setSitemap(final Sitemap sitemap) {
  +        this.sitemap = sitemap;
  +    }
   
  -    public void compose(ComponentManager manager) {
  +    public final void compose(final ComponentManager manager) {
           this.manager = manager;
       }
   
  @@ -154,7 +161,6 @@
       protected void processXIncludeElement(String src, String element, String ns, String
prefix)
           throws SAXException,MalformedURLException,IOException {
   
  -        Manager sitemap = null;
           EventPipeline eventPipeline = null;
           StreamPipeline pipeline = null;
           if (element == null) element="";
  @@ -162,9 +168,8 @@
           if (prefix == null) prefix="";
   
           try {
  -            sitemap = (Manager) manager.lookup(Roles.SITEMAP_MANAGER);
               getLogger().debug("Processing XInclude element: src=" + src
  -                                + ", sitemap=" + sitemap
  +                                + ", sitemap=" + this.sitemap
                                   + ", element=" + element
                                   + ", ns=" + ns
                                   + ", prefix=" + prefix);
  @@ -181,8 +186,7 @@
               ((XMLProducer)eventPipeline).setConsumer(consumer);
   
               this.environment.pushURI(src);
  -            sitemap.invoke(this.environment, "", src, true, true, pipeline, eventPipeline);
  -            //sitemap.process(this.environment, pipeline, eventPipeline);
  +            this.sitemap.process(this.environment, pipeline, eventPipeline);
               eventPipeline.process(this.environment);
               this.environment.popURI();
   
  @@ -191,8 +195,6 @@
           } catch (Exception e) {
               getLogger().error("Error selecting sitemap",e);
           } finally {
  -            if (sitemap != null)
  -                this.manager.release((Component)sitemap);
               if(eventPipeline != null)
                   this.manager.release((Component)eventPipeline);
               if(pipeline != null)
  @@ -208,5 +210,6 @@
        */
       public void recycle () {
           this.currentNS.clear();
  +        this.sitemap = null;
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message