svn commit: r164795 - /cocoon/trunk/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java
Author: lgawron Date: Tue Apr 26 07:23:49 2005 New Revision: 164795 URL: http://svn.apache.org/viewcvs?rev=164795view=rev Log: queryString may be null Modified: cocoon/trunk/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java Modified: cocoon/trunk/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java?rev=164795r1=164794r2=164795view=diff == --- cocoon/trunk/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/util/log/CocoonLogFormatter.java Tue Apr 26 07:23:49 2005 @@ -230,9 +230,13 @@ final Object context = ctxMap.get(objectModel); if (context != null context instanceof Map) { // Get the request -final Request request = ObjectModelHelper.getRequest((Map) context); +final Request request = ObjectModelHelper +.getRequest((Map) context); if (request != null) { -return ? + request.getQueryString(); +String queryString = request.getQueryString(); +return (queryString != null) + ? (? + request.getQueryString()) + : ; } } }
svn commit: r164808 [3/3] - in /cocoon/branches/BRANCH_2_1_X/src: blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/ blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/generation/ blocks/chaperon/java/org/apache/cocoon/transformation/ blocks/forms/java/org/apache/cocoon/forms/datatype/ blocks/mail/java/org/apache/cocoon/generation/ blocks/mail/java/org/apache/cocoon/mail/ blocks/ojb/java/org/apache/cocoon/ojb/components/ blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/ blocks/portal/java/org/apache/cocoon/portal/tools/generation/ blocks/profiler/java/org/apache/cocoon/generation/ blocks/proxy/java/org/apache/cocoon/generation/ blocks/qdox/java/org/apache/cocoon/components/source/impl/ blocks/repository/java/org/apache/cocoon/components/source/helpers/ blocks/repository/java/org/apache/cocoon/generation/ blocks/slop/java/org/apache/cocoon/slop/parsing/ blocks/web3/java/org/apache/cocoon/components/web3/impl/ blocks/webdav/java/org/apache/cocoon/components/source/impl/ blocks/webdav/java/org/apache/cocoon/transformation/ blocks/woody/java/org/apache/cocoon/woody/ blocks/xsp/java/org/apache/cocoon/components/language/markup/ blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/ deprecated/java/org/apache/cocoon/transformation/ java/org/apache/cocoon/components/notification/ java/org/apache/cocoon/generation/ java/org/apache/cocoon/serialization/ java/org/apache/cocoon/sitemap/ java/org/apache/cocoon/transformation/ java/org/apache/cocoon/xml/dom/ samples/org/apache/cocoon/samples/errorhandling/ samples/org/apache/cocoon/samples/parentcm/
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java?rev=164808r1=164807r2=164808view=diff == --- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java Tue Apr 26 09:07:03 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,12 +33,12 @@ /** * @cocoon.sitemap.component.documentation - * Generates a document from a session attribute. - * + * Generates a document from a session attribute. + * * @cocoon.sitemap.component.name sessionattribute * @cocoon.sitemap.component.label content * @cocoon.sitemap.component.logger sitemap.generator.sessionattribute - * + * * Generates a document from a session attribute. The attribute may be a DOM * node, an codeXMLizable/code, or any other object, and is streamed using * the same rules as for lt;xsp:exprgt; in XSPs (see [EMAIL PROTECTED] @@ -73,7 +73,7 @@ * @see org.apache.cocoon.transformation.WriteDOMSessionTransformer * @author a href=mailto:[EMAIL PROTECTED]Ceacute;dric Damioli/a * @author a href=mailto:[EMAIL PROTECTED]Sylvain Wallez/a - * @version CVS $Id$ + * @version $Id$ */ public class SessionAttributeGenerator extends AbstractGenerator { @@ -91,12 +91,12 @@ */ public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { - + super.setup(resolver, objectModel, src, par); - + // Get the element name (can be null if the object is a DOM or an XMLizable) this.elementName = par.getParameter(ELEMENT_NAME, null); - + // Get the attribute name String attrName = par.getParameter(ATTR_NAME, src); if (attrName == null) { @@ -111,7 +111,7 @@ if (session != null) { this.attrObject = session.getAttribute(attrName); } - + // Controls if (this.attrObject == null) { if (this.elementName == null) { @@ -132,7 +132,7 @@ ! (this.attrObject instanceof XMLizable) ! (this.attrObject instanceof Node)) { -String msg = Session attribute ' + attrName + ' needs an enclosing element : class is + +String msg = Session attribute ' + attrName + ' needs an enclosing element : class is + this.attrObject.getClass().getName(); getLogger().warn(msg); @@ -144,17 +144,18 @@ /** * Generate XML data */ -public void generate() throws IOException, SAXException, ProcessingException { +public void generate() +throws IOException, SAXException, ProcessingException { xmlConsumer.startDocument(); if (this.elementName != null) { -xmlConsumer.startElement(, this.elementName, this.elementName, new AttributesImpl()); +xmlConsumer.startElement(, this.elementName, this.elementName, XMLUtils.EMPTY_ATTRIBUTES); XMLUtils.valueOf(new IncludeXMLConsumer(xmlConsumer), this.attrObject); xmlConsumer.endElement(, this.elementName, this.elementName); } else { XMLUtils.valueOf(new IncludeXMLConsumer(xmlConsumer), this.attrObject); } - + xmlConsumer.endDocument(); } } Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/StatusGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/StatusGenerator.java?rev=164808r1=164807r2=164808view=diff == --- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/StatusGenerator.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/StatusGenerator.java Tue Apr 26 09:07:03 2005 @@ -28,6 +28,8 @@ import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.cocoon.Constants; +import
svn commit: r164808 [2/3] - in /cocoon/branches/BRANCH_2_1_X/src: blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/ blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/generation/ blocks/chaperon/java/org/apache/cocoon/transformation/ blocks/forms/java/org/apache/cocoon/forms/datatype/ blocks/mail/java/org/apache/cocoon/generation/ blocks/mail/java/org/apache/cocoon/mail/ blocks/ojb/java/org/apache/cocoon/ojb/components/ blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/ blocks/portal/java/org/apache/cocoon/portal/tools/generation/ blocks/profiler/java/org/apache/cocoon/generation/ blocks/proxy/java/org/apache/cocoon/generation/ blocks/qdox/java/org/apache/cocoon/components/source/impl/ blocks/repository/java/org/apache/cocoon/components/source/helpers/ blocks/repository/java/org/apache/cocoon/generation/ blocks/slop/java/org/apache/cocoon/slop/parsing/ blocks/web3/java/org/apache/cocoon/components/web3/impl/ blocks/webdav/java/org/apache/cocoon/components/source/impl/ blocks/webdav/java/org/apache/cocoon/transformation/ blocks/woody/java/org/apache/cocoon/woody/ blocks/xsp/java/org/apache/cocoon/components/language/markup/ blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/ deprecated/java/org/apache/cocoon/transformation/ java/org/apache/cocoon/components/notification/ java/org/apache/cocoon/generation/ java/org/apache/cocoon/serialization/ java/org/apache/cocoon/sitemap/ java/org/apache/cocoon/transformation/ java/org/apache/cocoon/xml/dom/ samples/org/apache/cocoon/samples/errorhandling/ samples/org/apache/cocoon/samples/parentcm/
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/generation/HttpProxyGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/generation/HttpProxyGenerator.java?rev=164808r1=164807r2=164808view=diff == --- cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/generation/HttpProxyGenerator.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/generation/HttpProxyGenerator.java Tue Apr 26 09:07:03 2005 @@ -1,12 +1,12 @@ /* * Copyright 1999-2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -51,11 +51,11 @@ * The codeHttpProxyGenerator/code is a Cocoon generator using the * bJakarta Commons HTTPClient Library/b to access an XML stream * over HTTP. - * + * * @author a href=mailto:[EMAIL PROTECTED]Ivelin Ivanov/a, June 2002 * @author a href=mailto:[EMAIL PROTECTED]Tony Collen/a, December 2002 * @author a href=mailto:[EMAIL PROTECTED]Pier Fumagalli/a, February 2003 - * @version CVS $Id: HttpProxyGenerator.java,v 1.7 2004/03/05 13:02:20 bdelacretaz Exp $ + * @version CVS $Id$ */ public class HttpProxyGenerator extends ServiceableGenerator implements Configurable { @@ -293,19 +293,19 @@ if (this.method instanceof PostMethod) { String body = ((PostMethod) this.method).getRequestBodyAsString(); -attributes = new AttributesImpl(); +attributes.clear(); attributes.addAttribute(, name, name, CDATA, Content-Type); attributes.addAttribute(, value, value, CDATA, application/x-www-form-urlencoded); super.xmlConsumer.startElement(, header, header, attributes); super.xmlConsumer.endElement(, header, header); -attributes = new AttributesImpl(); +attributes.clear(); attributes.addAttribute(, name, name, CDATA, Content-Length); attributes.addAttribute(, value, value, CDATA, Integer.toString(body.length())); super.xmlConsumer.startElement(, header, header, attributes); super.xmlConsumer.endElement(, header, header); -attributes = new AttributesImpl(); +attributes.clear(); super.xmlConsumer.startElement(, body, body, attributes); super.xmlConsumer.characters(body.toCharArray(), 0, body.length()); super.xmlConsumer.endElement(, body, body); @@ -348,7 +348,7 @@ if (value != null) list.add(new NameValuePair(name, value)); } } - + return (list); } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java?rev=164808r1=164807r2=164808view=diff == --- cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java Tue Apr 26 09:07:03 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * + * Copyright 1999-2002,2004-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -42,6 +42,8 @@ import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.cocoon.serialization.XMLSerializer; +import org.apache.cocoon.xml.XMLUtils; + import org.apache.commons.lang.StringUtils; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceException; @@ -51,7 +53,6 @@ import org.apache.excalibur.xml.sax.XMLizable; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; -import org.xml.sax.Attributes;
svn commit: r164808 [1/3] - in /cocoon/branches/BRANCH_2_1_X/src: blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/ blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/generation/ blocks/chaperon/java/org/apache/cocoon/transformation/ blocks/forms/java/org/apache/cocoon/forms/datatype/ blocks/mail/java/org/apache/cocoon/generation/ blocks/mail/java/org/apache/cocoon/mail/ blocks/ojb/java/org/apache/cocoon/ojb/components/ blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/ blocks/portal/java/org/apache/cocoon/portal/tools/generation/ blocks/profiler/java/org/apache/cocoon/generation/ blocks/proxy/java/org/apache/cocoon/generation/ blocks/qdox/java/org/apache/cocoon/components/source/impl/ blocks/repository/java/org/apache/cocoon/components/source/helpers/ blocks/repository/java/org/apache/cocoon/generation/ blocks/slop/java/org/apache/cocoon/slop/parsing/ blocks/web3/java/org/apache/cocoon/components/web3/impl/ blocks/webdav/java/org/apache/cocoon/components/source/impl/ blocks/webdav/java/org/apache/cocoon/transformation/ blocks/woody/java/org/apache/cocoon/woody/ blocks/xsp/java/org/apache/cocoon/components/language/markup/ blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/ deprecated/java/org/apache/cocoon/transformation/ java/org/apache/cocoon/components/notification/ java/org/apache/cocoon/generation/ java/org/apache/cocoon/serialization/ java/org/apache/cocoon/sitemap/ java/org/apache/cocoon/transformation/ java/org/apache/cocoon/xml/dom/ samples/org/apache/cocoon/samples/errorhandling/ samples/org/apache/cocoon/samples/parentcm/
Author: vgritsenko Date: Tue Apr 26 09:07:03 2005 New Revision: 164808 URL: http://svn.apache.org/viewcvs?rev=164808view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/generation/ConfigurationGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/chaperon/java/org/apache/cocoon/transformation/PatternTransformer.java cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/generation/IMAPGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/mail/java/org/apache/cocoon/mail/MailContentHandlerDelegate.java cocoon/branches/BRANCH_2_1_X/src/blocks/ojb/java/org/apache/cocoon/ojb/components/LoggerImpl.java cocoon/branches/BRANCH_2_1_X/src/blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/PortalManagerImpl.java cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/generation/I18nCatalogueGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/profiler/java/org/apache/cocoon/generation/ProfilerGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/generation/GenericProxyGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/proxy/java/org/apache/cocoon/generation/HttpProxyGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/components/source/helpers/SourceProperty.java cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/generation/TraversableSourceDescriptionGenerator.java cocoon/branches/BRANCH_2_1_X/src/blocks/slop/java/org/apache/cocoon/slop/parsing/SimpleSlopParser.java cocoon/branches/BRANCH_2_1_X/src/blocks/web3/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java cocoon/branches/BRANCH_2_1_X/src/blocks/webdav/java/org/apache/cocoon/components/source/impl/WebDAVSource.java cocoon/branches/BRANCH_2_1_X/src/blocks/webdav/java/org/apache/cocoon/transformation/DASLTransformer.java cocoon/branches/BRANCH_2_1_X/src/blocks/woody/java/org/apache/cocoon/woody/Constants.java cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java cocoon/branches/BRANCH_2_1_X/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/XSPObjectHelper.java cocoon/branches/BRANCH_2_1_X/src/deprecated/java/org/apache/cocoon/transformation/CachingCIncludeTransformer.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/notification/Notifier.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/StatusGenerator.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/TextSerializer.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/sitemap/ContentAggregator.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/xml/dom/DOMUtil.java cocoon/branches/BRANCH_2_1_X/src/samples/org/apache/cocoon/samples/errorhandling/ExceptionGenerator.java cocoon/branches/BRANCH_2_1_X/src/samples/org/apache/cocoon/samples/parentcm/Generator.java Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java?rev=164808r1=164807r2=164808view=diff == --- cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java Tue Apr 26 09:07:03 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The
svn commit: r164812 - /cocoon/blocks/unsupported/ojb/trunk/java/org/apache/cocoon/ojb/components/LoggerImpl.java
Author: vgritsenko Date: Tue Apr 26 09:40:06 2005 New Revision: 164812 URL: http://svn.apache.org/viewcvs?rev=164812view=rev Log: add support for ojb 1.1 Modified: cocoon/blocks/unsupported/ojb/trunk/java/org/apache/cocoon/ojb/components/LoggerImpl.java Modified: cocoon/blocks/unsupported/ojb/trunk/java/org/apache/cocoon/ojb/components/LoggerImpl.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/ojb/trunk/java/org/apache/cocoon/ojb/components/LoggerImpl.java?rev=164812r1=164811r2=164812view=diff == --- cocoon/blocks/unsupported/ojb/trunk/java/org/apache/cocoon/ojb/components/LoggerImpl.java (original) +++ cocoon/blocks/unsupported/ojb/trunk/java/org/apache/cocoon/ojb/components/LoggerImpl.java Tue Apr 26 09:40:06 2005 @@ -23,6 +23,7 @@ import org.apache.ojb.broker.util.configuration.Configuration; import org.apache.ojb.broker.util.configuration.ConfigurationException; import org.apache.ojb.broker.util.logging.Logger; +import org.apache.ojb.broker.util.logging.LoggingConfiguration; /** * OJB logger implementation delegating to the Avalon logger @@ -51,10 +52,17 @@ } /** - * Constructor used by OJB to create a logger instance + * Constructor used by OJB 1.0 to create a logger instance */ public LoggerImpl(String name) { this.name = name.startsWith(org.apache.ojb.)? name.substring(15): name; +} + +/** + * Constructor used by OJB 1.1 to create a logger instance + */ +public LoggerImpl(String name, LoggingConfiguration config) { +this(name); } /**
svn commit: r164815 - in /cocoon/trunk/src: java/org/apache/cocoon/components/notification/ java/org/apache/cocoon/generation/ java/org/apache/cocoon/serialization/ java/org/apache/cocoon/sitemap/ java/org/apache/cocoon/transformation/ java/org/apache/cocoon/xml/dom/ samples/org/apache/cocoon/samples/errorhandling/ samples/org/apache/cocoon/samples/parentcm/
Author: vgritsenko Date: Tue Apr 26 09:43:13 2005 New Revision: 164815 URL: http://svn.apache.org/viewcvs?rev=164815view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/trunk/src/java/org/apache/cocoon/components/notification/Notifier.java cocoon/trunk/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java cocoon/trunk/src/java/org/apache/cocoon/generation/SessionAttributeGenerator.java cocoon/trunk/src/java/org/apache/cocoon/generation/StatusGenerator.java cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java cocoon/trunk/src/java/org/apache/cocoon/serialization/TextSerializer.java cocoon/trunk/src/java/org/apache/cocoon/sitemap/DefaultContentAggregator.java cocoon/trunk/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMUtil.java cocoon/trunk/src/samples/org/apache/cocoon/samples/errorhandling/ExceptionGenerator.java cocoon/trunk/src/samples/org/apache/cocoon/samples/parentcm/Generator.java Modified: cocoon/trunk/src/java/org/apache/cocoon/components/notification/Notifier.java URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/notification/Notifier.java?rev=164815r1=164814r2=164815view=diff == --- cocoon/trunk/src/java/org/apache/cocoon/components/notification/Notifier.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/components/notification/Notifier.java Tue Apr 26 09:43:13 2005 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ package org.apache.cocoon.components.notification; import org.apache.cocoon.Constants; +import org.apache.cocoon.xml.XMLUtils; import org.apache.commons.lang.StringEscapeUtils; import org.xml.sax.ContentHandler; @@ -32,7 +33,7 @@ * * @author a href=mailto:[EMAIL PROTECTED]Nicola Ken Barozzi/a * @author a href=mailto:[EMAIL PROTECTED]Stefano Mazzocchi/a - * @version CVS $Id$ + * @version $Id$ */ public class Notifier { @@ -134,16 +135,15 @@ } ch.endElement(URI, message, PREFIX + :message); -ch.startElement(URI, description, PREFIX + :description, -new AttributesImpl()); +ch.startElement(URI, description, PREFIX + :description, XMLUtils.EMPTY_ATTRIBUTES); ch.characters(n.getDescription().toCharArray(), 0, n.getDescription().length()); ch.endElement(URI, description, PREFIX + :description); Map extraDescriptions = n.getExtraDescriptions(); -Iterator keyIter = extraDescriptions.keySet().iterator(); -while (keyIter.hasNext()) { -String key = (String) keyIter.next(); -String value = String.valueOf(extraDescriptions.get(key)); +for (Iterator i = extraDescriptions.entrySet().iterator(); i.hasNext(); ) { +final Map.Entry me = (Map.Entry) i.next(); +String key = (String) me.getKey(); +String value = String.valueOf(me.getValue()); atts = new AttributesImpl(); atts.addAttribute(URI, description, PREFIX + :description, CDATA, key); Modified: cocoon/trunk/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java?rev=164815r1=164814r2=164815view=diff == --- cocoon/trunk/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/generation/LinkStatusGenerator.java Tue Apr 26 09:43:13 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -55,9 +55,11 @@ * @author Michael Homeijer * @author Nicola Ken Barozzi ([EMAIL PROTECTED]) * @author Bernhard Huber ([EMAIL PROTECTED]) - * @version CVS $Id: LinkStatusGenerator.java,v 1.10 2004/05/26 14:11:34 cziegeler Exp $ + * @version $Id$ */ -public class LinkStatusGenerator extends ServiceableGenerator implements Recyclable,
svn commit: r164816 - in /cocoon/blocks/supported/authentication-fw/trunk/java/org/apache/cocoon/webapps/authentication: context/AuthenticationContext.java generation/ConfigurationGenerator.java
Author: vgritsenko Date: Tue Apr 26 09:43:49 2005 New Revision: 164816 URL: http://svn.apache.org/viewcvs?rev=164816view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/supported/authentication-fw/trunk/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java cocoon/blocks/supported/authentication-fw/trunk/java/org/apache/cocoon/webapps/authentication/generation/ConfigurationGenerator.java Modified: cocoon/blocks/supported/authentication-fw/trunk/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/supported/authentication-fw/trunk/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java?rev=164816r1=164815r2=164816view=diff == --- cocoon/blocks/supported/authentication-fw/trunk/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java (original) +++ cocoon/blocks/supported/authentication-fw/trunk/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.java Tue Apr 26 09:43:49 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,16 +15,10 @@ */ package org.apache.cocoon.webapps.authentication.context; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - import org.apache.avalon.framework.CascadingRuntimeException; import org.apache.avalon.framework.context.Context; import org.apache.avalon.framework.parameters.Parameters; + import org.apache.cocoon.ProcessingException; import org.apache.cocoon.components.ContextHelper; import org.apache.cocoon.components.source.SourceUtil; @@ -36,7 +30,9 @@ import org.apache.cocoon.webapps.authentication.user.UserHandler; import org.apache.cocoon.webapps.session.context.SessionContext; import org.apache.cocoon.webapps.session.context.SimpleSessionContext; +import org.apache.cocoon.xml.XMLUtils; import org.apache.cocoon.xml.dom.DOMUtil; + import org.apache.excalibur.source.SourceParameters; import org.apache.excalibur.source.SourceResolver; import org.apache.excalibur.xml.xpath.XPathProcessor; @@ -47,16 +43,21 @@ import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.ext.LexicalHandler; -import org.xml.sax.helpers.AttributesImpl; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; /** * This is the implementation for the authentication context - * + * * @author a href=mailto:[EMAIL PROTECTED]Carsten Ziegeler/a - * @version CVS $Id$ + * @version $Id$ */ -public class AuthenticationContext -implements SessionContext { +public class AuthenticationContext implements SessionContext { protected String name; protected UserHandler handler; @@ -68,14 +69,14 @@ protected SourceResolver resolver; /** A list of roles the user is in */ protected Listroles; - + /** Constructor */ public AuthenticationContext(Context context, XPathProcessor processor, SourceResolver resolver) { this.context = context; this.xpathProcessor = processor; this.resolver = resolver; } - + /** * Initialize the context. This method has to be called right after * the constructor. @@ -91,25 +92,25 @@ throw new CascadingRuntimeException(Unable to create simple context., pe); } } - + /** * Return the current authentication state */ protected RequestState getState() { return DefaultAuthenticationManager.getRequestState( this.context ); } - + /** * Initialize this context */ -public void init(Document doc) +public void init(Document doc) throws ProcessingException { if ( initialized ) { throw new ProcessingException(The context can only be initialized once.); } this.authContext.setNode(/, doc.getFirstChild()); } - + /* (non-Javadoc) * @see org.apache.cocoon.webapps.session.context.SessionContext#setup(java.lang.String, java.lang.String, java.lang.String) */ @@ -135,7 +136,7 @@ if (!path.startsWith(/)) path = '/'
svn commit: r164817 - /cocoon/blocks/unsupported/chaperon/trunk/java/org/apache/cocoon/transformation/PatternTransformer.java
Author: vgritsenko Date: Tue Apr 26 09:44:01 2005 New Revision: 164817 URL: http://svn.apache.org/viewcvs?rev=164817view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/chaperon/trunk/java/org/apache/cocoon/transformation/PatternTransformer.java Modified: cocoon/blocks/unsupported/chaperon/trunk/java/org/apache/cocoon/transformation/PatternTransformer.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/chaperon/trunk/java/org/apache/cocoon/transformation/PatternTransformer.java?rev=164817r1=164816r2=164817view=diff == --- cocoon/blocks/unsupported/chaperon/trunk/java/org/apache/cocoon/transformation/PatternTransformer.java (original) +++ cocoon/blocks/unsupported/chaperon/trunk/java/org/apache/cocoon/transformation/PatternTransformer.java Tue Apr 26 09:44:01 2005 @@ -1,19 +1,18 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.cocoon.transformation; import net.sourceforge.chaperon.build.LexicalAutomatonBuilder; @@ -35,6 +34,7 @@ import org.apache.avalon.framework.service.Serviceable; import org.apache.cocoon.ProcessingException; +import org.apache.cocoon.xml.XMLUtils; import org.apache.cocoon.caching.CacheableProcessingComponent; import org.apache.cocoon.components.source.SourceUtil; import org.apache.cocoon.environment.SourceResolver; @@ -57,7 +57,7 @@ /** * This transfomer transforms text pattern of a XML file into lexemes by using a lexicon file. - * + * * p * Input: * /p @@ -66,7 +66,7 @@ * Text 123 bla * lt;/sectiongt; * /pre - * + * * p * can be transformed into the following output: * /p @@ -79,13 +79,12 @@ * /pre * * @author a href=mailto:[EMAIL PROTECTED]Stephan Michels/a - * @version CVS $Id: PatternTransformer.java,v 1.9 2004/03/05 13:01:48 bdelacretaz Exp $ + * @version $Id$ */ -public class PatternTransformer extends AbstractTransformer implements LogEnabled, Serviceable, - Recyclable, Disposable, - Parameterizable, - CacheableProcessingComponent -{ +public class PatternTransformer extends AbstractTransformer +implements LogEnabled, Serviceable, Recyclable, + Disposable, Parameterizable, CacheableProcessingComponent { + /** Namespace for the SAX events. */ public static final String NS = http://chaperon.sourceforge.net/schema/lexemes/2.0;; private String lexicon = null; @@ -425,15 +424,13 @@ atts.addAttribute(, text, text, CDATA, lexemetext); contentHandler.startElement(NS, lexeme, lexeme, atts); - if (this.groups) - { -for (int group = 0; groupgroups.length; group++) -{ - contentHandler.startElement(NS, group, group, new AttributesImpl()); - contentHandler.characters(groups[group].toCharArray(), 0, groups[group].length()); - contentHandler.endElement(NS, group, group); +if (this.groups) { +for (int group = 0; groupgroups.length; group++) { +contentHandler.startElement(NS, group, group, XMLUtils.EMPTY_ATTRIBUTES); +contentHandler.characters(groups[group].toCharArray(), 0, groups[group].length()); +contentHandler.endElement(NS, group, group); +} } - } contentHandler.endElement(NS, lexeme, lexeme); contentHandler.endPrefixMapping();
svn commit: r164818 - /cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
Author: vgritsenko Date: Tue Apr 26 09:44:18 2005 New Revision: 164818 URL: http://svn.apache.org/viewcvs?rev=164818view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java Modified: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java?rev=164818r1=164817r2=164818view=diff == --- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java (original) +++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java Tue Apr 26 09:44:18 2005 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import org.apache.cocoon.forms.datatype.convertor.ConversionResult; import org.apache.cocoon.xml.AttributesImpl; import org.apache.cocoon.xml.AbstractXMLPipe; +import org.apache.cocoon.xml.XMLUtils; import org.apache.cocoon.xml.dom.DOMBuilder; import org.w3c.dom.Element; @@ -189,7 +190,7 @@ if (localName.equals(item)) { if (!hasLabel) { // make the label now -super.startElement(Constants.INSTANCE_NS, LABEL_EL, Constants.INSTANCE_PREFIX_COLON + LABEL_EL, new AttributesImpl()); +super.startElement(Constants.INSTANCE_NS, LABEL_EL, Constants.INSTANCE_PREFIX_COLON + LABEL_EL, XMLUtils.EMPTY_ATTRIBUTES); super.characters(currentValueAsString.toCharArray(), 0, currentValueAsString.length()); super.endElement(Constants.INSTANCE_NS, LABEL_EL, Constants.INSTANCE_PREFIX_COLON + LABEL_EL); }
svn commit: r164819 - in /cocoon/blocks/unsupported/mail/trunk/java/org/apache/cocoon: generation/IMAPGenerator.java mail/MailContentHandlerDelegate.java
Author: vgritsenko Date: Tue Apr 26 09:44:29 2005 New Revision: 164819 URL: http://svn.apache.org/viewcvs?rev=164819view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/mail/trunk/java/org/apache/cocoon/generation/IMAPGenerator.java cocoon/blocks/unsupported/mail/trunk/java/org/apache/cocoon/mail/MailContentHandlerDelegate.java Modified: cocoon/blocks/unsupported/mail/trunk/java/org/apache/cocoon/generation/IMAPGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/mail/trunk/java/org/apache/cocoon/generation/IMAPGenerator.java?rev=164819r1=164818r2=164819view=diff == --- cocoon/blocks/unsupported/mail/trunk/java/org/apache/cocoon/generation/IMAPGenerator.java (original) +++ cocoon/blocks/unsupported/mail/trunk/java/org/apache/cocoon/generation/IMAPGenerator.java Tue Apr 26 09:44:29 2005 @@ -1,5 +1,5 @@ /* -* Copyright 1999-2004 The Apache Software Foundation +* Copyright 1999-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -15,21 +15,23 @@ */ package org.apache.cocoon.generation; -import java.io.IOException; -import java.util.Map; -import java.util.Properties; +import org.apache.avalon.framework.parameters.Parameters; + +import org.apache.cocoon.ProcessingException; +import org.apache.cocoon.environment.SourceResolver; +import org.apache.cocoon.xml.XMLUtils; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; import javax.mail.AuthenticationFailedException; import javax.mail.Folder; import javax.mail.Message; import javax.mail.Session; import javax.mail.Store; - -import org.apache.avalon.framework.parameters.Parameters; -import org.apache.cocoon.ProcessingException; -import org.apache.cocoon.environment.SourceResolver; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.AttributesImpl; +import java.io.IOException; +import java.util.Map; +import java.util.Properties; /** * Generates an XML listing of messages from an IMAP mail server. @@ -44,52 +46,50 @@ * and password parameters to the generator./p * * Instructions: get the JavaMail API jar from http://java.sun.com/products/javamail/, and - * the JAF activation.jar from http://java.sun.com/beans/glasgow/jaf.html. Put mail.jar + * the JAF activation.jar from http://java.sun.com/beans/glasgow/jaf.html. Put mail.jar * and activation.jar in xml-cocoon2/lib/local/, and recompile. These jars could actually be * moved to lib/optional and added to jars.xml in the future. * - * TODO Refactor all of this to use the MailCommandManager, etc... + * brTODO Refactor all of this to use the MailCommandManager, etc... * * @author a href=mailto:[EMAIL PROTECTED]Tony Collen/a - * @version CVS $Id: IMAPGenerator.java,v 1.6 2004/03/06 02:26:09 antonio Exp $ + * @version $Id$ */ public class IMAPGenerator extends AbstractGenerator { - + static final String URI = http://apache.org/cocoon/imap/1.0/;; static final String PREFIX = imap; private String host; private String user; private String pass; - + private Properties props = new Properties(); -private Message message[] = null; - +private Message message[]; + public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) -throws ProcessingException, SAXException, IOException { - +throws ProcessingException, SAXException, IOException { + // TODO: the default values should be something else... this.host = par.getParameter(host, none); this.user = par.getParameter(user, none); this.pass = par.getParameter(pass, none); -if (this.host.equals(none) || -this.user.equals(none) || +if (this.host.equals(none) || +this.user.equals(none) || this.pass.equals(none)) { throw new ProcessingException(You must configure this generator with host, user, and pass parameters.); } } - + public void generate() throws SAXException, ProcessingException { - + try { Session sess = Session.getDefaultInstance(this.props, null); Store st = sess.getStore(imap); -AttributesImpl attr = new AttributesImpl(); - log(Connecting to IMAP server @ + this.host); st.connect(this.host, this.user, this.pass); @@ -107,34 +107,32 @@ this.contentHandler.startDocument(); this.contentHandler.startPrefixMapping(PREFIX, URI); -start(imap, attr); - -start(messages, attr); +start(imap, XMLUtils.EMPTY_ATTRIBUTES); +start(messages, XMLUtils.EMPTY_ATTRIBUTES); for (i = 0; i this.message.length; i++) { +// Loop through the messages and output
svn commit: r164823 - in /cocoon/blocks/unsupported/proxy/trunk/java/org/apache/cocoon/generation: GenericProxyGenerator.java HttpProxyGenerator.java
Author: vgritsenko Date: Tue Apr 26 09:45:18 2005 New Revision: 164823 URL: http://svn.apache.org/viewcvs?rev=164823view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/proxy/trunk/java/org/apache/cocoon/generation/GenericProxyGenerator.java cocoon/blocks/unsupported/proxy/trunk/java/org/apache/cocoon/generation/HttpProxyGenerator.java Modified: cocoon/blocks/unsupported/proxy/trunk/java/org/apache/cocoon/generation/GenericProxyGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/proxy/trunk/java/org/apache/cocoon/generation/GenericProxyGenerator.java?rev=164823r1=164822r2=164823view=diff == --- cocoon/blocks/unsupported/proxy/trunk/java/org/apache/cocoon/generation/GenericProxyGenerator.java (original) +++ cocoon/blocks/unsupported/proxy/trunk/java/org/apache/cocoon/generation/GenericProxyGenerator.java Tue Apr 26 09:45:18 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -26,6 +26,7 @@ import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.cocoon.ProcessingException; +import org.apache.cocoon.xml.XMLUtils; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.http.HttpEnvironment; import org.apache.cocoon.util.RequestForwardingHttpMethod; @@ -40,18 +41,18 @@ import org.xml.sax.helpers.AttributesImpl; /** - * This is a generic HTTP proxy, designed to handle any possible HTTP method, + * This is a generic HTTP proxy, designed to handle any possible HTTP method, * but with a particular bias towards WebDAV. As of now it's pretty unstable, but * still it might be a good proof of concept towards a pure HTTP(++) proxy. - * - * TODO: doesn't handle authentication properly - * TODO: doesn't handle (and doubt it'll ever will) HTTP/1.1 keep-alive - * + * + * brTODO: doesn't handle authentication properly + * brTODO: doesn't handle (and doubt it'll ever will) HTTP/1.1 keep-alive + * * @author a href=mailto:[EMAIL PROTECTED]Gianugo Rabellino/a - * @version $Id: GenericProxyGenerator.java,v 1.5 2004/03/05 13:02:20 bdelacretaz Exp $ + * @version $Id$ */ public class GenericProxyGenerator extends ServiceableGenerator { - + /** The real URL to forward requests to */ HttpURL destination; /** The current request */ @@ -64,7 +65,7 @@ /** * Compose and get a SAX parser for further use. - * + * * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager) */ public void service(ServiceManager manager) throws ServiceException { @@ -82,14 +83,14 @@ } super.dispose(); } - + /** - * Setup this component by getting the (required) url parameter and the + * Setup this component by getting the (required) url parameter and the * (optional) path parameter. If path is not specified, the request URI will * be used and forwarded. - * + * * TODO: handle query string - * + * * @see org.apache.cocoon.sitemap.SitemapModelComponent#setup(org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters) */ public void setup( @@ -109,69 +110,68 @@ if (path == null) path = request.getRequestURI(); destination = new HttpURL(url); - + } - - + + /** * Get the request data, pass them on to the forwarder and return the result. - * + * * TODO: much better header handling - * TODO: handle non XML and bodyless responses (probably needs a smarter Serializer, + * TODO: handle non XML and bodyless responses (probably needs a smarter Serializer, *since some XML has to go through the pipeline anyway. - * + * * @see org.apache.cocoon.generation.Generator#generate() */ public void generate() throws IOException, SAXException, ProcessingException { -RequestForwardingHttpMethod method = +RequestForwardingHttpMethod method = new RequestForwardingHttpMethod(request, destination); - -// Build the forwarded connection -
svn commit: r164824 - /cocoon/blocks/unsupported/qdox/trunk/java/org/apache/cocoon/components/source/impl/QDoxSource.java
Author: vgritsenko Date: Tue Apr 26 09:45:27 2005 New Revision: 164824 URL: http://svn.apache.org/viewcvs?rev=164824view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/qdox/trunk/java/org/apache/cocoon/components/source/impl/QDoxSource.java Modified: cocoon/blocks/unsupported/qdox/trunk/java/org/apache/cocoon/components/source/impl/QDoxSource.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/qdox/trunk/java/org/apache/cocoon/components/source/impl/QDoxSource.java?rev=164824r1=164823r2=164824view=diff == --- cocoon/blocks/unsupported/qdox/trunk/java/org/apache/cocoon/components/source/impl/QDoxSource.java (original) +++ cocoon/blocks/unsupported/qdox/trunk/java/org/apache/cocoon/components/source/impl/QDoxSource.java Tue Apr 26 09:45:27 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * + * Copyright 1999-2002,2004-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -42,6 +42,8 @@ import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.cocoon.serialization.XMLSerializer; +import org.apache.cocoon.xml.XMLUtils; + import org.apache.commons.lang.StringUtils; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceException; @@ -51,7 +53,6 @@ import org.apache.excalibur.xml.sax.XMLizable; import org.apache.regexp.RE; import org.apache.regexp.RESyntaxException; -import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; @@ -60,11 +61,10 @@ * Source implementation for XML Javadoc. * * @author a href=mailto:[EMAIL PROTECTED]Bart Guijt/a - * @version CVS $Id: QDoxSource.java,v 1.11 2004/06/04 07:30:49 antonio Exp $ $Date: 2004/06/04 07:30:49 $ + * @version $Id$ $Date: 2004/04/30 22:50:39 $ */ -public final class QDoxSource -extends AbstractSource -implements XMLizable, Recyclable { +public final class QDoxSource extends AbstractSource + implements XMLizable, Recyclable { protected final static String ROOT_CLASSNAME = java.lang.Object; @@ -72,7 +72,6 @@ protected final static String NS_URI = http://apache.org/cocoon/javadoc/1.0;; protected final static String NS_PREFIX = jd; protected final static String ATTR_TYPE = NMTOKEN; -protected final static Attributes EMPTY_ATTRS = new AttributesImpl(); protected final static String CLASS_ELEMENT = class; protected final static String CLASSNAME_ATTRIBUTE = name; @@ -1168,7 +1167,7 @@ * @param localName */ private void saxStartElement(ContentHandler handler, String localName) throws SAXException { -handler.startElement(NS_URI, localName, NS_PREFIX + ':' + localName, EMPTY_ATTRS); +handler.startElement(NS_URI, localName, NS_PREFIX + ':' + localName, XMLUtils.EMPTY_ATTRIBUTES); } /**
svn commit: r164826 - in /cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon: components/source/helpers/SourceProperty.java generation/TraversableSourceDescriptionGenerator.java
Author: vgritsenko Date: Tue Apr 26 09:45:40 2005 New Revision: 164826 URL: http://svn.apache.org/viewcvs?rev=164826view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/components/source/helpers/SourceProperty.java cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/generation/TraversableSourceDescriptionGenerator.java Modified: cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/components/source/helpers/SourceProperty.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/components/source/helpers/SourceProperty.java?rev=164826r1=164825r2=164826view=diff == --- cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/components/source/helpers/SourceProperty.java (original) +++ cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/components/source/helpers/SourceProperty.java Tue Apr 26 09:45:40 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,8 +15,10 @@ */ package org.apache.cocoon.components.source.helpers; +import org.apache.cocoon.xml.XMLUtils; import org.apache.cocoon.xml.dom.DOMBuilder; import org.apache.cocoon.xml.dom.DOMStreamer; + import org.apache.excalibur.xml.sax.XMLizable; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -31,18 +33,18 @@ * * @author a href=mailto:[EMAIL PROTECTED]Stephan Michels/a * @author a href=mailto:[EMAIL PROTECTED]Martin Holz/a - * @version CVS $Id: SourceProperty.java,v 1.3 2004/03/27 21:49:09 unico Exp $ + * @version $Id$ */ public class SourceProperty implements XMLizable { private static final String URI = http://www.w3.org/2000/xmlns/;; private static final String NS_PREFIX = property; private static final String D_PREFIX = NS_PREFIX+:; - + private String namespace; private String name; private Element value; - + /** * Creates a new property for a source * @@ -166,9 +168,9 @@ StringBuffer buffer = new StringBuffer(); for (int i = 0; inodeslist.getLength(); i++) { if ((nodeslist.item(i).getNodeType()==Node.TEXT_NODE) || -(nodeslist.item(i).getNodeType()==Node.CDATA_SECTION_NODE)) +(nodeslist.item(i).getNodeType()==Node.CDATA_SECTION_NODE)) { - + buffer.append(nodeslist.item(i).getNodeValue()); } } @@ -185,7 +187,7 @@ try { DOMBuilder builder = new DOMBuilder(); builder.startDocument(); -builder.startElement(namespace, name, name, new AttributesImpl()); +builder.startElement(namespace, name, name, XMLUtils.EMPTY_ATTRIBUTES); DOMStreamer stream = new DOMStreamer(builder); for (int i = 0; ivalues.getLength(); i++) { stream.stream(values.item(i)); Modified: cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/generation/TraversableSourceDescriptionGenerator.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/generation/TraversableSourceDescriptionGenerator.java?rev=164826r1=164825r2=164826view=diff == --- cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/generation/TraversableSourceDescriptionGenerator.java (original) +++ cocoon/blocks/unsupported/repository/trunk/java/org/apache/cocoon/generation/TraversableSourceDescriptionGenerator.java Tue Apr 26 09:45:40 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,6 +20,7 @@ import org.apache.avalon.framework.parameters.Parameters; import
svn commit: r164827 - /cocoon/blocks/unsupported/slop/trunk/java/org/apache/cocoon/slop/parsing/SimpleSlopParser.java
Author: vgritsenko Date: Tue Apr 26 09:45:53 2005 New Revision: 164827 URL: http://svn.apache.org/viewcvs?rev=164827view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/slop/trunk/java/org/apache/cocoon/slop/parsing/SimpleSlopParser.java Modified: cocoon/blocks/unsupported/slop/trunk/java/org/apache/cocoon/slop/parsing/SimpleSlopParser.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/slop/trunk/java/org/apache/cocoon/slop/parsing/SimpleSlopParser.java?rev=164827r1=164826r2=164827view=diff == --- cocoon/blocks/unsupported/slop/trunk/java/org/apache/cocoon/slop/parsing/SimpleSlopParser.java (original) +++ cocoon/blocks/unsupported/slop/trunk/java/org/apache/cocoon/slop/parsing/SimpleSlopParser.java Tue Apr 26 09:45:53 2005 @@ -1,45 +1,46 @@ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * + * Copyright 1999-2002,2004-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.cocoon.slop.parsing; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; import org.apache.cocoon.ProcessingException; +import org.apache.cocoon.xml.XMLUtils; import org.apache.cocoon.slop.interfaces.SlopParser; import org.apache.cocoon.slop.interfaces.SlopConstants; -/** Simplistic SLOP parser, recognizes the following constructs: +/** + * Simplistic SLOP parser, recognizes the following constructs: * * Field: a line starting with letters and : is considered a field * * Empty lines are detected. * Other lines are output as line elements * - * This is sufficient for basic parsing of RFC 822 headers, - * but a configurable rfc822 mode would be good to differentiate - * between the header and body of the email message and parse them - * with different rules. + * This is sufficient for basic parsing of RFC 822 headers, + * but a configurable rfc822 mode would be good to differentiate + * between the header and body of the email message and parse them + * with different rules. * * @author a href=mailto:[EMAIL PROTECTED]Bertrand Delacretaz/a - * @version CVS $Id: SimpleSlopParser.java,v 1.3 2004/03/05 13:02:24 bdelacretaz Exp $ + * @version $Id$ */ - public class SimpleSlopParser implements SlopParser,SlopConstants { + private ContentHandler contentHandler; /** chars that can be part of a field name (other than letters) */ @@ -97,17 +98,16 @@ /** must be called before any call to processLine() */ public void startDocument(ContentHandler destination) -throws SAXException, ProcessingException { +throws SAXException, ProcessingException { contentHandler = destination; contentHandler.startDocument(); contentHandler.startPrefixMapping(, SLOP_NAMESPACE_URI); -final AttributesImpl atts = new AttributesImpl(); -contentHandler.startElement(SLOP_NAMESPACE_URI, SLOP_ROOT_ELEMENT, SLOP_ROOT_ELEMENT, atts); +contentHandler.startElement(SLOP_NAMESPACE_URI, SLOP_ROOT_ELEMENT, SLOP_ROOT_ELEMENT, XMLUtils.EMPTY_ATTRIBUTES); } /** must be called once all calls to processLine() are done */ public void endDocument() -throws SAXException, ProcessingException { +throws SAXException, ProcessingException { contentHandler.endElement(SLOP_NAMESPACE_URI, SLOP_ROOT_ELEMENT, SLOP_ROOT_ELEMENT); contentHandler.endPrefixMapping(); contentHandler.endDocument(); @@ -122,7 +122,7 @@ /** call this to process input lines, does the actual parsing */ public void processLine(String line) -throws SAXException, ProcessingException { +throws SAXException, ProcessingException { if(contentHandler == null) { throw new ProcessingException(SimpleSlopParser content handler is null (startDocument not called?)); }
svn commit: r164828 - /cocoon/blocks/unsupported/web3/trunk/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java
Author: vgritsenko Date: Tue Apr 26 09:46:03 2005 New Revision: 164828 URL: http://svn.apache.org/viewcvs?rev=164828view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/web3/trunk/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java Modified: cocoon/blocks/unsupported/web3/trunk/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/web3/trunk/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java?rev=164828r1=164827r2=164828view=diff == --- cocoon/blocks/unsupported/web3/trunk/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java (original) +++ cocoon/blocks/unsupported/web3/trunk/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java Tue Apr 26 09:46:03 2005 @@ -1,12 +1,12 @@ /* * Copyright 1999-2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -32,40 +32,40 @@ * * @author a href=mailto:[EMAIL PROTECTED]Michael Gerzabek/a * @since 2.1 - * @version CVS $Id: DefaultWeb3StreamerImpl.java,v 1.7 2004/03/05 13:02:25 bdelacretaz Exp $ + * @version CVS $Id$ */ public class DefaultWeb3StreamerImpl implements Web3Streamer, Poolable { -public void stream(JCO.Function function, -ContentHandler contentHandler) throws SAXException { +public void stream(JCO.Function function, + ContentHandler contentHandler) +throws SAXException { -AttributesImplattributes = new AttributesImpl(); -attributes.clear(); -attributes.addAttribute( Web3.URI, Web3.INCLUDE_NAME_ATTR, +AttributesImpl attributes = new AttributesImpl(); +attributes.addAttribute( Web3.URI, Web3.INCLUDE_NAME_ATTR, Web3.INCLUDE_NAME_ATTR, CDATA, function.getName().toUpperCase() ); -contentHandler.startElement( Web3.URI, Web3.INCLUDE_ELEM, +contentHandler.startElement( Web3.URI, Web3.INCLUDE_ELEM, Web3.INCLUDE_ELEM, attributes ); attributes.clear(); -contentHandler.startElement( Web3.URI, Web3.IMPORT_ELEM, +contentHandler.startElement( Web3.URI, Web3.IMPORT_ELEM, Web3.IMPORT_ELEM, attributes ); streamParameterList( function.getImportParameterList(), contentHandler ); contentHandler.endElement( Web3.URI, Web3.IMPORT_ELEM, Web3.IMPORT_ELEM ); attributes.clear(); -contentHandler.startElement( Web3.URI, Web3.EXPORT_ELEM, +contentHandler.startElement( Web3.URI, Web3.EXPORT_ELEM, Web3.EXPORT_ELEM, attributes ); streamParameterList( function.getExportParameterList(), contentHandler ); contentHandler.endElement( Web3.URI, Web3.EXPORT_ELEM, Web3.EXPORT_ELEM ); - + JCO.ParameterList tablesParameterList = function.getTableParameterList(); attributes.clear(); -contentHandler.startElement( Web3.URI, Web3.TABLES_ELEM, +contentHandler.startElement( Web3.URI, Web3.TABLES_ELEM, Web3.TABLES_ELEM, attributes ); if (null != tablesParameterList) { for (int i = 0; i tablesParameterList.getFieldCount(); i++) { attributes.clear(); -attributes.addAttribute( Web3.URI, Web3.TABLE_NAME_ATTR, -Web3.TABLE_NAME_ATTR, CDATA, +attributes.addAttribute( Web3.URI, Web3.TABLE_NAME_ATTR, +Web3.TABLE_NAME_ATTR, CDATA, tablesParameterList.getName(i).toUpperCase() ); contentHandler.startElement( Web3.URI, Web3.TABLE_ELEM, Web3.TABLE_ELEM, attributes ); @@ -74,87 +74,86 @@ for (int j = 0; j sapTable.getNumRows(); j++) { sapTable.setRow(j); attributes.clear(); -attributes.addAttribute(Web3.URI, Web3.ROW_ID_ATTR, +attributes.addAttribute(Web3.URI, Web3.ROW_ID_ATTR, Web3.ROW_ID_ATTR, CDATA, + (j + 1)); -contentHandler.startElement(Web3.URI, Web3.ROW_ELEM, +contentHandler.startElement(Web3.URI, Web3.ROW_ELEM, Web3.ROW_ELEM, attributes); for (int k = 0; k sapTable.getFieldCount(); k++) { attributes.clear(); -
svn commit: r164829 - in /cocoon/blocks/unsupported/webdav/trunk/java/org/apache/cocoon: components/source/impl/WebDAVSource.java transformation/DASLTransformer.java
Author: vgritsenko Date: Tue Apr 26 09:46:15 2005 New Revision: 164829 URL: http://svn.apache.org/viewcvs?rev=164829view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/webdav/trunk/java/org/apache/cocoon/components/source/impl/WebDAVSource.java cocoon/blocks/unsupported/webdav/trunk/java/org/apache/cocoon/transformation/DASLTransformer.java Modified: cocoon/blocks/unsupported/webdav/trunk/java/org/apache/cocoon/components/source/impl/WebDAVSource.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/webdav/trunk/java/org/apache/cocoon/components/source/impl/WebDAVSource.java?rev=164829r1=164828r2=164829view=diff == --- cocoon/blocks/unsupported/webdav/trunk/java/org/apache/cocoon/components/source/impl/WebDAVSource.java (original) +++ cocoon/blocks/unsupported/webdav/trunk/java/org/apache/cocoon/components/source/impl/WebDAVSource.java Tue Apr 26 09:46:15 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -69,7 +69,7 @@ /** * A source implementation to get access to WebDAV repositories. - * + * * h2Protocol syntax/h2 * pcodewebdav://[usr[:[EMAIL PROTECTED]:port][/path][?cocoon:webdav-depth][cocoon:webdav-action]/code/p * p @@ -84,31 +84,32 @@ * /li * /ul * p - * - * @version $Id: WebDAVSource.java,v 1.32 2004/07/02 12:32:36 unico Exp $ + * + * @version $Id$ */ -public class WebDAVSource extends AbstractLogEnabled -implements Source, TraversableSource, ModifiableSource, ModifiableTraversableSource, InspectableSource, MoveableSource { +public class WebDAVSource extends AbstractLogEnabled + implements Source, TraversableSource, ModifiableSource, + ModifiableTraversableSource, InspectableSource, MoveableSource { private static final String NAMESPACE = http://apache.org/cocoon/webdav/1.0;; private static final String PREFIX = webdav; private static final String RESOURCE_NAME = resource; private static final String COLLECTION_NAME = collection; - + // the http url private final HttpURL url; - + // the scheme name private final String protocol; - + // cached uri and secureUri values private String uri; private String secureUri; - + // the SWCL resource private WebdavResource resource = null; - + // current resource initialization values private int depth = -1; private int action = -1; @@ -119,15 +120,15 @@ private WebDAVSource(HttpURL url, String protocol) throws URIException { this.protocol = protocol; this.url = url; - + String qs = url.getQuery(); if (qs != null) { final SourceParameters sp = new SourceParameters(qs); - + // parse optional start depth and start action qs parameters this.depth = sp.getParameterAsInteger(cocoon:webdav-depth, DepthSupport.DEPTH_1); this.action = sp.getParameterAsInteger(cocoon:webdav-action, WebdavResource.NOACTION); - + // [UH] FIXME: Why this alternative way of passing in credentials? String principal = url.getUser(); String password = url.getPassword(); @@ -144,7 +145,7 @@ sp.removeParameter(cocoon:webdav-action); sp.removeParameter(cocoon:webdav-principal); sp.removeParameter(cocoon:webdav-password); - + // set the qs without WebdavSource specific parameters url.setQuery(sp.getQueryString()); } @@ -153,23 +154,23 @@ /** * Constructor used by getChildren() method. */ -private WebDAVSource (WebdavResource resource, HttpURL url, String protocol) +private WebDAVSource (WebdavResource resource, HttpURL url, String protocol) throws URIException { this(url, protocol); this.resource = resource; } - + /** * Initialize the SWCL WebdavResource. * p - * The action argument specifies a set of properties to load during initialization. + * The action argument specifies a set of properties to load during initialization. * Its value is one of WebdavResource.NOACTION, WebdavResource.NAME, * WebdavResource.BASIC, WebdavResource.DEFAULT, WebdavResource.ALL. - * Similarly the
svn commit: r164830 - in /cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup: CocoonMarkupLanguage.java xsp/XSPMarkupLanguage.java xsp/XSPObjectHelper.java
Author: vgritsenko Date: Tue Apr 26 09:46:29 2005 New Revision: 164830 URL: http://svn.apache.org/viewcvs?rev=164830view=rev Log: Use EMPTY_PROPERTIES Modified: cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/xsp/XSPObjectHelper.java Modified: cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java?rev=164830r1=164829r2=164830view=diff == --- cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java (original) +++ cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/CocoonMarkupLanguage.java Tue Apr 26 09:46:29 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,13 +19,14 @@ import org.apache.avalon.framework.logger.Logger; import org.apache.cocoon.ProcessingException; +import org.apache.cocoon.components.language.programming.ProgrammingLanguage; import org.apache.cocoon.xml.AbstractXMLPipe; import org.apache.cocoon.xml.XMLConsumer; -import org.apache.cocoon.components.language.programming.ProgrammingLanguage; +import org.apache.cocoon.xml.XMLUtils; import org.xml.sax.Attributes; -import org.xml.sax.SAXException; import org.xml.sax.ContentHandler; +import org.xml.sax.SAXException; import org.xml.sax.ext.LexicalHandler; import org.xml.sax.helpers.AttributesImpl; @@ -47,7 +48,7 @@ * @author a href=mailto:[EMAIL PROTECTED]Davanum Srinivas/a * @author a href=mailto:[EMAIL PROTECTED]Ovidiu Predescu/a * @author a href=mailto:[EMAIL PROTECTED]Vadim Gritsenko/a - * @version CVS $Id: CocoonMarkupLanguage.java,v 1.3 2004/05/01 00:05:44 joerg Exp $ + * @version CVS $Id$ */ public abstract class CocoonMarkupLanguage extends AbstractMarkupLanguage { @@ -432,7 +433,7 @@ Iterator iter = CocoonMarkupLanguage.this.dependencies.iterator(); while(iter.hasNext()) { super.startElement( -(String)rootElement[0], dependency, localPrefix + :dependency, new AttributesImpl() +(String) rootElement[0], dependency, localPrefix + :dependency, XMLUtils.EMPTY_ATTRIBUTES ); locationChars = ((String) iter.next()).toCharArray(); super.characters(locationChars, 0 , locationChars.length); Modified: cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java?rev=164830r1=164829r2=164830view=diff == --- cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java (original) +++ cocoon/blocks/unsupported/xsp/trunk/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java Tue Apr 26 09:46:29 2005 @@ -1,12 +1,12 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. - * + * Copyright 1999-2005 The Apache Software Foundation. + * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,10 +18,10 @@ import org.apache.cocoon.components.language.markup.CocoonMarkupLanguage; import org.apache.cocoon.components.language.programming.ProgrammingLanguage; import org.apache.cocoon.xml.AbstractXMLPipe; +import
svn commit: r164861 - /cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/CocoonApplicationContext.java
Author: roku Date: Tue Apr 26 12:08:14 2005 New Revision: 164861 URL: http://svn.apache.org/viewcvs?rev=164861view=rev Log: Added support for an empty application context if the default config locations do not exist. Modified: cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/CocoonApplicationContext.java Modified: cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/CocoonApplicationContext.java URL: http://svn.apache.org/viewcvs/cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/CocoonApplicationContext.java?rev=164861r1=164860r2=164861view=diff == --- cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/CocoonApplicationContext.java (original) +++ cocoon/blocks/spring-app/trunk/java/org/apache/cocoon/spring/CocoonApplicationContext.java Tue Apr 26 12:08:14 2005 @@ -15,12 +15,15 @@ */ package org.apache.cocoon.spring; +import java.io.IOException; import java.net.MalformedURLException; +import org.apache.avalon.framework.CascadingRuntimeException; import org.apache.cocoon.environment.internal.EnvironmentHelper; import org.apache.excalibur.source.SourceResolver; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; +import org.springframework.web.context.support.ServletContextResource; import org.springframework.web.context.support.XmlWebApplicationContext; /** @@ -73,9 +76,19 @@ /** * The default location for the context is conf/applicationContext.xml * which is searched relative to the current sitemap. + * @return The default config locations if they exist otherwise an empty array. */ protected String[] getDefaultConfigLocations() { -return new String[] {DEFAULT_SPRING_CONFIG}; +try { +if(resolver.resolveURI(DEFAULT_SPRING_CONFIG).exists()) { +return new String[] {DEFAULT_SPRING_CONFIG}; +} +} catch(MalformedURLException e) { +throw new CascadingRuntimeException(Malformed URL when resolving Spring default config location [ + DEFAULT_SPRING_CONFIG + ]. This is an unrecoverable programming error. Check the code where this exception was thrown., e); +} catch(IOException e) { +throw new CascadingRuntimeException(Cannot resolve default config location [+ DEFAULT_SPRING_CONFIG + ] due to an IOException. See cause for details., e); +} + +return new String[]{}; } - }
svn commit: r164876 - /cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMUtil.java
Author: vgritsenko Date: Tue Apr 26 13:49:28 2005 New Revision: 164876 URL: http://svn.apache.org/viewcvs?rev=164876view=rev Log: fix imports Modified: cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMUtil.java Modified: cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMUtil.java URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMUtil.java?rev=164876r1=164875r2=164876view=diff == --- cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMUtil.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/xml/dom/DOMUtil.java Tue Apr 26 13:49:28 2005 @@ -17,6 +17,7 @@ import org.apache.cocoon.ProcessingException; import org.apache.cocoon.xml.IncludeXMLConsumer; +import org.apache.cocoon.xml.XMLUtils; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; @@ -39,7 +40,6 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; import javax.xml.transform.TransformerException; import java.io.IOException; import java.io.Reader; @@ -49,7 +49,6 @@ import java.util.Collection; import java.util.Iterator; import java.util.Map; -import java.util.Properties; /** * This class is a utility class for miscellaneous DOM functions, like