Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 80467 invoked by uid 500); 14 Nov 2002 15:43:34 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 80434 invoked by uid 500); 14 Nov 2002 15:43:34 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 14 Nov 2002 15:43:32 -0000 Message-ID: <20021114154332.60304.qmail@icarus.apache.org> From: cziegeler@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon Cocoon.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N cziegeler 2002/11/14 07:43:32 Modified: src/java/org/apache/cocoon/components/source/impl SitemapSource.java src/java/org/apache/cocoon/components CocoonComponentManager.java src/blocks/databases/java/org/apache/cocoon/transformation SQLTransformer.java . changes.xml src/java/org/apache/cocoon Cocoon.java Log: Fixing namespace handling of SQLTransformer. Revision Changes Path 1.19 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java Index: SitemapSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- SitemapSource.java 14 Nov 2002 14:33:07 -0000 1.18 +++ SitemapSource.java 14 Nov 2002 15:43:17 -0000 1.19 @@ -303,7 +303,7 @@ reset(); try { - this.processKey = CocoonComponentManager.startProcessing(); + this.processKey = CocoonComponentManager.startProcessing(this.environment); this.environment.setURI(this.prefix, this.uri); this.processingPipeline = this.processor.processInternal(this.environment); this.pipelineProcessor = this.environment.changeToLastContext(); 1.29 +32 -4 xml-cocoon2/src/java/org/apache/cocoon/components/CocoonComponentManager.java Index: CocoonComponentManager.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/CocoonComponentManager.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- CocoonComponentManager.java 14 Nov 2002 14:33:07 -0000 1.28 +++ CocoonComponentManager.java 14 Nov 2002 15:43:20 -0000 1.29 @@ -89,6 +89,9 @@ /** The environment information */ private static InheritableThreadLocal environmentStack = new InheritableThreadLocal(); + /** The processing information */ + private static InheritableThreadLocal processList = new InheritableThreadLocal(); + /** The configured SourceResolver */ private SourceResolver sourceResolver; @@ -182,8 +185,16 @@ * cocoon protocol implementation. * @return A unique key within this thread. */ - public static Object startProcessing() { - return null; + public static Object startProcessing(Environment env) { + ArrayList processes = (ArrayList)processList.get(); + + if (processes == null) { + processes = new ArrayList(4); + processList.set(processes); + } + Map key = new HashMap(5); + processes.add(key); + return key; } /** @@ -191,9 +202,26 @@ * The hook is called by the Cocoon component and by the * cocoon protocol implementation. * @param key A unique key within this thread return by - * {@link startProcessing()}. + * {@link startProcessing(Environment)}. */ public static void endProcessing(Object key) { + ArrayList processes = (ArrayList)processList.get(); + if ( null != processes ) { + + // we do a direct object reference comparission + // here for improved performance + int i = 0; + int len = processes.size(); + + while (i < len) { + if (processes.get(i) == key) { + processes.remove(i); + i = len; + } else { + i++; + } + } + } } /** 1.3 +1 -31 xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/transformation/SQLTransformer.java Index: SQLTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/transformation/SQLTransformer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SQLTransformer.java 23 Oct 2002 04:31:04 -0000 1.2 +++ SQLTransformer.java 14 Nov 2002 15:43:23 -0000 1.3 @@ -173,9 +173,6 @@ /** Namespace uri to output */ protected String outUri; - /** The prefix of our namespace to listen to */ - protected String inPrefix; - /** The database selector */ protected ComponentSelector dbSelector; @@ -219,7 +216,6 @@ super.recycle(); this.queries.clear(); this.outUri = null; - this.inPrefix = null; this.outPrefix = null; this.manager.release(this.parser); this.parser = null; @@ -688,32 +684,6 @@ return name; } } - - /** - * ContentHandler method - */ - public void startPrefixMapping( String prefix, String uri ) - throws SAXException { - if ( uri.equals( NAMESPACE ) ) { - if (inPrefix != null) { - super.startPrefixMapping( inPrefix, NAMESPACE); - } - inPrefix = prefix; - } else { - super.startPrefixMapping( prefix, uri ); - } - } - - /** - * ContentHandler method - */ - public void endPrefixMapping( String prefix ) - throws SAXException { - if ( !prefix.equals( inPrefix ) ) { - super.endPrefixMapping( prefix ); - } - } - /** * ContentHandler method 1.282 +4 -1 xml-cocoon2/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/changes.xml,v retrieving revision 1.281 retrieving revision 1.282 diff -u -r1.281 -r1.282 --- changes.xml 13 Nov 2002 22:52:09 -0000 1.281 +++ changes.xml 14 Nov 2002 15:43:28 -0000 1.282 @@ -40,6 +40,9 @@ + + Fixing namespace handling of SQLTransformer. + Added SystemPropertyModule input module to enable environment variables in sitemap attributes. E.g.: 1.42 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java Index: Cocoon.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- Cocoon.java 14 Nov 2002 14:33:07 -0000 1.41 +++ Cocoon.java 14 Nov 2002 15:43:32 -0000 1.42 @@ -584,7 +584,7 @@ } environment.setComponents( this.sourceResolver, this.xmlizer ); - Object key = CocoonComponentManager.startProcessing(); + Object key = CocoonComponentManager.startProcessing(environment); try { boolean result; if (this.getLogger().isDebugEnabled()) { ---------------------------------------------------------------------- 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