You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by di...@apache.org on 2001/05/31 15:05:39 UTC
cvs commit: xml-cocoon2/src/org/apache/cocoon/transformation I18nTransformer.java I18nTransformer2.java TraxTransformer.java XTTransformer.java
dims 01/05/31 06:05:38
Modified: src/org/apache/cocoon/components/language/generator
ProgramGeneratorImpl.java
src/org/apache/cocoon/environment Source.java
src/org/apache/cocoon/generation FileGenerator.java
src/org/apache/cocoon/transformation I18nTransformer.java
I18nTransformer2.java TraxTransformer.java
XTTransformer.java
Log:
- Added method getInputSource to Source.java
- Updated rest of the files where we wrap a Source into InputSource.
Revision Changes Path
1.4 +2 -2 xml-cocoon2/src/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java
Index: ProgramGeneratorImpl.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ProgramGeneratorImpl.java 2001/05/25 14:25:58 1.3
+++ ProgramGeneratorImpl.java 2001/05/31 13:05:17 1.4
@@ -48,7 +48,7 @@
/**
* The default implementation of <code>ProgramGenerator</code>
* @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
- * @version CVS $Revision: 1.3 $ $Date: 2001/05/25 14:25:58 $
+ * @version CVS $Revision: 1.4 $ $Date: 2001/05/31 13:05:17 $
*/
public class ProgramGeneratorImpl extends AbstractLoggable
implements ProgramGenerator, Contextualizable, Composable, Configurable, ThreadSafe, Disposable {
@@ -227,7 +227,7 @@
throws Exception {
// Input Source
- InputSource is = new InputSource(resolver.resolve(fileName).getInputStream());
+ InputSource is = resolver.resolve(fileName).getInputSource();
// Generate code
String code = markupLanguage.generateCode(is, normalizedName, programmingLanguage, resolver);
String encoding = markupLanguage.getEncoding();
1.5 +11 -1 xml-cocoon2/src/org/apache/cocoon/environment/Source.java
Index: Source.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/environment/Source.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Source.java 2001/05/30 15:31:06 1.4
+++ Source.java 2001/05/31 13:05:23 1.5
@@ -24,7 +24,7 @@
* for accessing any resource (URL, local file etc).
*
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.4 $ $Date: 2001/05/30 15:31:06 $
+ * @version CVS $Revision: 1.5 $ $Date: 2001/05/31 13:05:23 $
*/
public final class Source {
@@ -119,6 +119,16 @@
this.connection = this.url.openConnection();
return this.connection.getInputStream();
}
+ }
+
+ /**
+ * Return an <code>InputSource</code> object to read from the source.
+ */
+ public InputSource getInputSource()
+ throws IOException {
+ InputSource source = new InputSource(getInputStream());
+ source.setSystemId(getSystemId());
+ return source;
}
/**
1.7 +2 -4 xml-cocoon2/src/org/apache/cocoon/generation/FileGenerator.java
Index: FileGenerator.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/generation/FileGenerator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- FileGenerator.java 2001/05/31 12:31:03 1.6
+++ FileGenerator.java 2001/05/31 13:05:27 1.7
@@ -39,7 +39,7 @@
* @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.6 $ $Date: 2001/05/31 12:31:03 $
+ * @version CVS $Revision: 1.7 $ $Date: 2001/05/31 13:05:27 $
*/
public class FileGenerator extends ComposerGenerator
implements Cacheable, Recyclable {
@@ -113,9 +113,7 @@
parser = (Parser)this.manager.lookup(Roles.PARSER);
parser.setConsumer(super.xmlConsumer);
- InputSource is = new InputSource(inputSource.getInputStream());
- is.setSystemId(inputSource.getSystemId());
- parser.parse(is);
+ parser.parse(inputSource.getInputSource());
} catch (IOException e) {
getLogger().error("FileGenerator.generate()", e);
throw new ResourceNotFoundException("FileGenerator could not find resource", e);
1.7 +1 -1 xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer.java
Index: I18nTransformer.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- I18nTransformer.java 2001/05/28 10:03:48 1.6
+++ I18nTransformer.java 2001/05/31 13:05:31 1.7
@@ -332,7 +332,7 @@
try
{
parser = (Parser)(manager.lookup(Roles.PARSER));
- InputSource input = new InputSource(this.inputSource.getInputStream());
+ InputSource input = this.inputSource.getInputSource();
// How this could be cached?
dictionary = new Hashtable();
1.7 +1 -1 xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer2.java
Index: I18nTransformer2.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/I18nTransformer2.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- I18nTransformer2.java 2001/05/28 10:03:49 1.6
+++ I18nTransformer2.java 2001/05/31 13:05:32 1.7
@@ -516,7 +516,7 @@
try
{
parser = (Parser)(manager.lookup(Roles.PARSER));
- InputSource input = new InputSource(inputSource.getInputStream());
+ InputSource input = inputSource.getInputSource();
// How this could be cached?
this.dictionary = new HashMap();
1.13 +3 -5 xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java
Index: TraxTransformer.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/TraxTransformer.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TraxTransformer.java 2001/05/31 08:21:49 1.12
+++ TraxTransformer.java 2001/05/31 13:05:32 1.13
@@ -100,7 +100,7 @@
* @author <a href="mailto:dims@yahoo.com">Davanum Srinivas</a>
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
* @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
- * @version CVS $Id: TraxTransformer.java,v 1.12 2001/05/31 08:21:49 cziegeler Exp $
+ * @version CVS $Id: TraxTransformer.java,v 1.13 2001/05/31 13:05:32 dims Exp $
*/
public class TraxTransformer extends ContentHandlerWrapper
implements Transformer, Composable, Recyclable, Configurable, Cacheable, Disposable, URIResolver {
@@ -146,8 +146,7 @@
Templates templates = getTemplates();
if(templates == null) {
getLogger().debug("Creating new Templates in " + this + " for " + this.inputSource.getSystemId());
- InputSource is = new InputSource(this.inputSource.getInputStream());
- is.setSystemId(this.inputSource.getSystemId());
+ InputSource is = this.inputSource.getInputSource();
//templates = getTransformerFactory().newTemplates(new SAXSource(is));
// Create a Templates ContentHandler to handle parsing of the
@@ -178,8 +177,7 @@
if(handler == null) {
/* If there is a problem in getting the handler, try using a brand new Templates object */
getLogger().debug("Re-creating new Templates in " + this + " for" + this.inputSource.getSystemId());
- InputSource is = new InputSource(this.inputSource.getInputStream());
- is.setSystemId(this.inputSource.getSystemId());
+ InputSource is = this.inputSource.getInputSource();
templates = getTransformerFactory().newTemplates(new SAXSource(is));
putTemplates (templates);
handler = getTransformerFactory().newTransformerHandler(templates);
1.4 +2 -2 xml-cocoon2/src/org/apache/cocoon/transformation/XTTransformer.java
Index: XTTransformer.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/transformation/XTTransformer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XTTransformer.java 2001/05/22 14:47:56 1.3
+++ XTTransformer.java 2001/05/31 13:05:34 1.4
@@ -65,7 +65,7 @@
* This Transformer use the XT processor.
*
* @author <a href="mailto:ssahuc@imediation.com">Sahuc Sebastien</a>
- * @version CVS $Revision: 1.3 $ $Date: 2001/05/22 14:47:56 $
+ * @version CVS $Revision: 1.4 $ $Date: 2001/05/31 13:05:34 $
*/
public class XTTransformer extends DocumentHandlerWrapper
implements Transformer, Composable, Loggable, Recyclable, Disposable {
@@ -139,7 +139,7 @@
new ProcessingException(e.getMessage(),e);
}
loaderprocessor.setParser(saxParser.getParser());
- InputSource xslsrc = new InputSource(resolver.resolve(xsluri).getInputStream());;
+ InputSource xslsrc = resolver.resolve(xsluri).getInputSource();
loaderprocessor.loadStylesheet(xslsrc);
if (store != null) store.store(xsluri, loaderprocessor);
}
----------------------------------------------------------------------
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
AW: cvs commit: xml-cocoon2/src/org/apache/cocoon/transformation I18nTransformer.java I18nTransformer2.java TraxTransformer.java XTTransformer.java
Posted by Matthew Langham <ml...@sundn.de>.
>>
great Dims: two developers - same idea..
<<
There is an English (British?) saying that goes:
Great minds think alike - and fools seldom differ :-).
Didn't The Police sing about Synchronicity?
Matthew
--
Open Source Group sunShine - Lighting up e:Business
=================================================================
Matthew Langham, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
Tel: +49-5251-1581-30 [mlangham@sundn.de - http://www.sundn.de]
=================================================================
-----Ursprüngliche Nachricht-----
Von: Carsten Ziegeler [mailto:cziegeler@sundn.de]
Gesendet: Donnerstag, 31. Mai 2001 15:26
An: cocoon-dev@xml.apache.org
Betreff: AW: cvs commit:
xml-cocoon2/src/org/apache/cocoon/transformation I18nTransformer.java
I18nTransformer2.java TraxTransformer.java XTTransformer.java
Hey,
great Dims: two developers - same idea..
I just checked in the same patch for the Source and the FileGenerator object
and did name the method exactly as you did: getInputSource().
Hmm, twilight zone?!?
I don't know why my cvs didn't tell me about your check-in but I think
my check in didn't break your code.
Carsten
Open Source Group sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de mailto: cziegeler@sundn.de
================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: AW: cvs commit: xml-cocoon2/src/org/apache/cocoon/transformation I18nTransformer.java I18nTransformer2.java TraxTransformer.java XTTransformer.java
Posted by Davanum Srinivas <di...@yahoo.com>.
It's eerie...More material for X-Files :)
Your method name is exactly the same as mine. So anticipate no problems...Am doing a full get
anyway.
Thanks,
dims
--- Carsten Ziegeler <cz...@sundn.de> wrote:
> Hey,
>
> great Dims: two developers - same idea..
>
> I just checked in the same patch for the Source and the FileGenerator object
> and did name the method exactly as you did: getInputSource().
> Hmm, twilight zone?!?
>
> I don't know why my cvs didn't tell me about your check-in but I think
> my check in didn't break your code.
>
>
> Carsten
>
> Open Source Group sunShine - b:Integrated
> ================================================================
> Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
> www.sundn.de mailto: cziegeler@sundn.de
> ================================================================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
AW: cvs commit: xml-cocoon2/src/org/apache/cocoon/transformation I18nTransformer.java I18nTransformer2.java TraxTransformer.java XTTransformer.java
Posted by Carsten Ziegeler <cz...@sundn.de>.
Hey,
great Dims: two developers - same idea..
I just checked in the same patch for the Source and the FileGenerator object
and did name the method exactly as you did: getInputSource().
Hmm, twilight zone?!?
I don't know why my cvs didn't tell me about your check-in but I think
my check in didn't break your code.
Carsten
Open Source Group sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de mailto: cziegeler@sundn.de
================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org