cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject Re: Nesting/Aggregating generator...
Date Tue, 24 Aug 2004 23:28:21 GMT
On 24 Aug 2004, at 22:28, Pier Fumagalli wrote:
> On 24 Aug 2004, at 21:48, Pier Fumagalli wrote:
>> On 24 Aug 2004, at 19:07, Vadim Gritsenko wrote:
>>>
>>> How it will differ from [1]? IncludeTransformer was added recently  
>>> exactly to address this problem with CIncludeTransformer. See also  
>>> bug #30356.
>>>
>>> Vadim
>>>
>>> [1]  
>>> http://svn.apache.org/repos/asf/cocoon/trunk/src/blocks/scratchpad/ 
>>> java/org/apache/cocoon/transformation/IncludeTransformer.java
>>
>> Well, at a first glance, I'd say that the IncludeTransformer is  
>> breaking up quite a lot of rules regarding caching...
>
> Disregard entirely... I'm f**king stupid... See the  
> "URLEncodingTransformer" which is by all means cachable.
>
> Nope, then... The union of FileGenerator + IncludeTransformer or  
> PiersIncludeGenerator don't have anything different, apart from a  
> little subtlety regarding the recursive-inclusion behavior (if one of  
> the included sources contains the inclusion element, it'll be  
> processed recursively).

Ahhh.... FOR CRYING OUT LOUD! :-( I don't have access to Subversion :-(

svn: Commit failed (details follow):
svn: MKACTIVITY of  
/repos/asf/!svn/act/ed3896a8-6ee2-0310-b4ce-bc301ee366a2: 403 Forbidden  
(http://svn.apache.org)

Can someone post this? If the validity is not "closed", it will always  
say it's invalid no matter what, and therefore the caching won't  
work...

Also, anyone against me patching this one to allow the recursive  
behavior (upon configuration, obviously) of includes within includes?

	Pier

PS. How do I get access to SVN?

PPS. Da patch below!

Index: IncludeTransformer.java
===================================================================
--- IncludeTransformer.java     (revision 36825)
+++ IncludeTransformer.java     (working copy)
@@ -81,6 +81,20 @@
          m_validity = null;
      }

+    public void startDocument()
+    throws SAXException {
+        // Make sure that we have a validity while processing
+        this.getValidity();
+        super.startDocument();
+    }
+
+    public void endDocument()
+    throws SAXException {
+        // Make sure that the validity is "closed" at the end
+        this.m_validity.close();
+        super.endDocument();
+    }
+
      public void startElement(String uri, String localName, String  
qName, Attributes atts)
      throws SAXException {
          if (NS_URI.equals(uri)) {
@@ -89,9 +103,7 @@
                  Source source = null;
                  try {
                      source = m_resolver.resolveURI(src);
-                    if (m_validity != null) {
-                        m_validity.addSource(source);
-                    }
+                    m_validity.addSource(source);
                      SourceUtil.toSAX(m_manager, source, "text/xml",
                              new  
IncludeXMLConsumer(super.contentHandler));
                  }

Mime
View raw message