RE: problem creating a new transformer

2003-08-14 Thread Bruno Dumon
On Wed, 2003-08-06 at 16:36, Miguel Carvalho wrote:
 Hi again, after i have upgraded to 2.0.4 and corrected some problems in the
 transformer i ended up getting this:
 
 the first part of the result (marked) bellow is ok, and i am applying this
 to the html serializer, and this is the result
 
 !--This is ok--
snip/

 java.lang.ArrayIndexOutOfBoundsException: -1/pre/ppbrequest-uri/b
 pre/dae/daestart/pre/ppboriginal exception/bpreOriginal
 exception : java.lang.ArrayIndexOutOfBoundsException: -1
   at org.apache.xml.utils.BoolStack.pop(BoolStack.java:134)
   at
 org.apache.xalan.serialize.SerializerToHTML.endElement(SerializerToHTML.java
 :706)
   at

This is likely because your startElement and endElement calls do not
line up. Double check the source of your transformer that for every call
to startElement, you also do a call to endElement.

For debugging purposes, you may want to put a LogTransformer after your
transformer, which will log all SAX-events to a given logfile.

snip/
   at
 org.apache.cocoon.www.sitemap_xmap.wildcardMatchN400194(sitemap_xmap.java:16
 53)

I see you're still using the compiled sitemap engine (which is indeed
the default in 2.0.4). Do yourself a favor and change it to the
interpreted engine, Cocoon's startup time will then be much faster (this
can be changed in the cocoon.xconf file).

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem creating a new transformer

2003-08-14 Thread Bruno Dumon
On Wed, 2003-08-06 at 19:11, Miguel Carvalho wrote:
 I see you're still using the compiled sitemap engine (which is indeed
 the default in 2.0.4). Do yourself a favor and change it to the
 interpreted engine, Cocoon's startup time will then be much faster (this
 can be changed in the cocoon.xconf file).
 
 ok, and can you give me a hand in doing this!! :( I tried to copy the
 sitemap.xmap, cocoon.xconf and web.xml from the cocoon 2.0.4 to my project
 and it didn't worked. I also copied all the libs plus the cocoon-scratchpad
 and added it to my classpath and still no good... :( but there are backups
 :)
 
 Could you tell me the steps that i have to go, so i can pass to the
 iterpreted engine?

it's only a change to the cocoon.xconf: comment out the following lines:

  sitemap class=org.apache.cocoon.sitemap.SitemapManager
   file=sitemap.xmap reload-method=synchron
check-reload=yes logger=sitemap/

and enable the following line:
!-- sitemap logger=sitemap/ --
thus change it to:
sitemap logger=sitemap/



However, this will not help you with your transformer problem.

I've had a quick look at the code you sent earlier, and the problem
might be with your endElement calls, currently they are like:

super.endElement(NAMESPACE, ARTICLE_ELEMENT, );

but you should provide a value for the qName, and your code would be
easier to read if you just pass on the values you get as arguments:

super.endElement(namespaceURI, localName, qName);

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem creating a new transformer

2003-08-14 Thread Bruno Dumon
On Thu, 2003-08-07 at 13:07, Miguel Carvalho wrote:
 Hi, i am now trying to upgrade to 2.1rc1, but i am wondering ... what
 precautions do i need to clean up cooon a little. I just need a cocoon
 project that allows me to create a generator, and a transformer in xsp and
 java respectively. What are your sugestions? 

 do i start with the webapp
 directory /cocoon2.1rc1/src/webapp directory and start from there, do i
 build cocoon and get the jar and libs and start a new project (but here i
 will have another problem that is to achieve the right configuration to the
 sitemap and xconf) or are there any more options that i am not seing???
 
 oh and by the way... the compile time of cocoon in my computer was 14
 minutes, how can i tell it not to build the javadoc and maybe the samples, i
 dont know if it is possible but i would like to try and reduce a bit the
 compile time.. :)


* read the file INSTALL.TXT
* look at the files block.properties and build.properties

you can easily disable all optional cocoon functionality, and disable
building of javadocs and other stuff to optimize the build time.

For an easy setup to get continuous integration of your project with
newer Cocoon releases, see the following page on the wiki:
http://wiki.cocoondev.org/Wiki.jsp?page=YourCocoonBasedProject

But for starters, if you keep all your stuff in your own subdirectory
with a subsitemap, and simply add one jar with your own classes to the
WEB-INF/lib dir, things should be easy enough I guess? (maybe you don't
know about subsitemaps etc. yet, in that case I recommend to investigate
the default Cocoon webapp and to browse around in the documentation and
on the wiki).

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem creating a new transformer

2003-08-09 Thread Bruno Dumon
On Wed, 2003-08-06 at 14:11, Miguel Carvalho wrote:
 hmmm...
 
 i've started this project begining with an example chello, but i also
 downloaded and tried the cocoon version 2.0.4, perhaps that is why i
 confused it.
 
 In the libs directory of the project there is a jar cocoo-2.0rc2.jar, maybe
 this is the version.

Wow, that version is so old that I won't even bother to look further. I
recommend that your upgrade to Cocoon 2.0.4.

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem creating a new transformer

2003-08-08 Thread Bruno Dumon
On Thu, 2003-08-07 at 16:07, Miguel Carvalho wrote:
 I also tried to create a naked version of cocoon but with no success. I
 created the local.blocks.properties and the local.build.properties, made a
 build clean and then made a new build and it still builded all the blocks
 that i sought i had removed, bellow i will put boht the files
 

your local.blocks.properties file looks ok. You're sure you put it in
the right location (the cocoon distribution root directory, thus the
same directory containing the build script and the build.properties
file)? And how do you know they're still being build?

BTW: if have new questions unrelated to your previous questions, it is
better to start new threads (i.e. send a new message, with a new
subject).

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem creating a new transformer

2003-08-08 Thread Miguel Carvalho
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:646)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:644)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:376)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:518)
at java.lang.Thread.run(Thread.java:536)
/pre/pHR size=1 noshade/body/html

Does anyone know what is going wrong here? becaus i don't have a clue :(


Thanks in advance for your time :)
Miguel Carvalho

-Original Message-
From: Bruno Dumon [mailto:[EMAIL PROTECTED]
Sent: quarta-feira, 6 de Agosto de 2003 13:21
To: [EMAIL PROTECTED]
Subject: RE: problem creating a new transformer


On Wed, 2003-08-06 at 14:11, Miguel Carvalho wrote:
 hmmm...

 i've started this project begining with an example chello, but i also
 downloaded and tried the cocoon version 2.0.4, perhaps that is why i
 confused it.

 In the libs directory of the project there is a jar cocoo-2.0rc2.jar,
maybe
 this is the version.

Wow, that version is so old that I won't even bother to look further. I
recommend that your upgrade to Cocoon 2.0.4.

--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem creating a new transformer

2003-08-08 Thread Olivier Billard
Hi Miguel,

It seems that you are doing something with a null variable at line 116 of your 
Transformer... Do you already have checked this ? (see further)

Miguel Carvalho wrote:
Hi, i want to create a new transformer that gets sax events from a XSP
Generator created by me.
i'm using cocoon 2.0.4 under a XP with java version 1.4.1_03.

bellow i will post the XSP code of the generator
snip/

type internal-server-error

message Exception in ServerPagesGenerator.generate()

description org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate(): java.lang.NullPointerException
sender org.apache.cocoon.servlet.CocoonServlet

source Cocoon servlet

exception

org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate(): java.lang.NullPointerException
request-uri

/dae/daestart

original exception

Original exception : java.lang.NullPointerException
at
org.apache.cocoon.serialization.AbstractTextSerializer.startElement(Abstract
TextSerializer.java:271)
at
org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:87)
HERE

at
pt.laseeb.dae.transformer.daeTransformer.startElement(daeTransformer.java:11
6)
--
Olivier
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: problem creating a new transformer

2003-08-07 Thread Bruno Dumon
On Wed, 2003-08-06 at 21:18, Miguel Carvalho wrote:
 i tried to do that but it didn't worked that well, the thing is, like you
 have probably noticed i'm kind of newbie in cocoon, so i started this
 project from a sample chello that used cocoon 2.0rc2.
 Now, trying to upgrade to 2.0.4 i kind of messed up things a little :P

This chello thing, is that something you got recently? If so, could
you tell me where it's from? It might confuse other potential users as
well...

 
 I thought that it would be ehough to copy the cocoon.jar that is generated
 from the build dir of the src of cocon2.0.4 but it seems (my recente
 experience - today :) ) that this isn't that linear..

You'll need to copy over all the jars from WEB-INF/lib.

But I think it will be more manageable if you work the other way around:
copy your things to a new Cocoon webapp.

Since you're doing this work now, you might as well upgrade immediately
to the cocoon 2.1 Release Candidate.

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem creating a new transformer

2003-08-07 Thread Miguel Carvalho
Hi, i am now trying to upgrade to 2.1rc1, but i am wondering ... what
precautions do i need to clean up cooon a little. I just need a cocoon
project that allows me to create a generator, and a transformer in xsp and
java respectively. What are your sugestions? do i start with the webapp
directory /cocoon2.1rc1/src/webapp directory and start from there, do i
build cocoon and get the jar and libs and start a new project (but here i
will have another problem that is to achieve the right configuration to the
sitemap and xconf) or are there any more options that i am not seing???

oh and by the way... the compile time of cocoon in my computer was 14
minutes, how can i tell it not to build the javadoc and maybe the samples, i
dont know if it is possible but i would like to try and reduce a bit the
compile time.. :)

Thanks in advance
Miguel Carvalho

-Original Message-
From: Bruno Dumon [mailto:[EMAIL PROTECTED]
Sent: quinta-feira, 7 de Agosto de 2003 8:44
To: [EMAIL PROTECTED]
Subject: RE: problem creating a new transformer


On Wed, 2003-08-06 at 21:18, Miguel Carvalho wrote:
 i tried to do that but it didn't worked that well, the thing is, like you
 have probably noticed i'm kind of newbie in cocoon, so i started this
 project from a sample chello that used cocoon 2.0rc2.
 Now, trying to upgrade to 2.0.4 i kind of messed up things a little :P

This chello thing, is that something you got recently? If so, could
you tell me where it's from? It might confuse other potential users as
well...


 I thought that it would be ehough to copy the cocoon.jar that is generated
 from the build dir of the src of cocon2.0.4 but it seems (my recente
 experience - today :) ) that this isn't that linear..

You'll need to copy over all the jars from WEB-INF/lib.

But I think it will be more manageable if you work the other way around:
copy your things to a new Cocoon webapp.

Since you're doing this work now, you might as well upgrade immediately
to the cocoon 2.1 Release Candidate.

--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: problem creating a new transformer

2003-08-07 Thread Bruno Dumon
On Thu, 2003-08-07 at 15:27, Miguel Carvalho wrote:
 Hi, thanks for the previous tips.. ;)
 
 Now i'm having an existencial doubt... :)
 
 I've created a transformer in java but it was made when i was still using
 the chello project...
 
 Because i am trying to follow the instructions on the wiki,

I would suggest first trying to get your project working on Cocoon 2.1,
and only after that try to automate things using the wiki-description.

  i will try to
 create my project outside the cocoon folder and change the
 $cocoon-root/sitemap.xmap so i create a mount point to my directory.

It would be better if you let your build script copy your directory to
the cocoon webapp. The root sitemap contains an automount mount
statement that will automatically mount any subdirectories.

 
 and now my doubt ...
 
 the transformer mentioned above imported org.apache.cocoon.*, do i have to
 copy the cocoon.jar and all the other libs needed by cocoon to my project
 libs directory?? or is there another way?

Instead of copying them, let your build script directly point to the
WEB-INF/lib directory of the webapp.

Don't expect me to hold your hand during all this however.

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: problem creating a new transformer

2003-08-06 Thread Bruno Dumon
On Wed, 2003-08-06 at 13:56, Miguel Carvalho wrote:
 Hi, i want to create a new transformer that gets sax events from a XSP
 Generator created by me.
 
 i'm using cocoon 2.0.4 under a XP with java version 1.4.1_03.
 

snip/

 
 org.apache.cocoon.ProcessingException: Exception in
 ServerPagesGenerator.generate(): java.lang.NullPointerException
 
 request-uri
 
 /dae/daestart
 
 original exception
 
 Original exception : java.lang.NullPointerException
   at
 org.apache.cocoon.serialization.AbstractTextSerializer.startElement(Abstract
 TextSerializer.java:271)
   at
 org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:87)
   at
 pt.laseeb.dae.transformer.daeTransformer.startElement(daeTransformer.java:11
 6)
 .
 and it goes on... :(

I have just checked the source of cocoon 2.0.4 and the line 271 of the
AbstractTextSerializer is outside of the startElement method, which
conflicts with what your stacktrace is showing. Are you sure you are
using version 2.0.4, or have you maybe made changes to those sources?

-- 
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java  XML Competence Support Center
[EMAIL PROTECTED]  [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



problem creating a new transformer

2003-08-06 Thread Miguel Carvalho

Hi, i want to create a new transformer that gets sax events from a XSP
Generator created by me.

i'm using cocoon 2.0.4 under a XP with java version 1.4.1_03.


bellow i will post the XSP code of the generator

!--Begin of
start.xsp

xsp:page language=java xmlns:xsp=http://apache.org/xsp;
  xmlns:util=http://apache.org/xsp/util/2.0;

xsp:structure
xsp:includept.laseeb.dae.xmlDbApi.daeXmlDbApi/xsp:include
xsp:includeorg.xmldb.api.base.ResourceIterator/xsp:include
xsp:includeorg.xmldb.api.base.Resource/xsp:include
xsp:includeorg.xmldb.api.base.XMLDBException/xsp:include

xsp:includeorg.apache.cocoon.components.language.markup.xsp.XSPUtil.*/xsp
:include
/xsp:structure

document xmlns:dae=http://laseeb/dae/sgDae;
xsp:logic
try
{
Resource res = null;
String resStr = null;
daeXmlDbApi daeApi = new daeXmlDbApi();
ResourceIterator results;
results = daeApi.getArticleSection(1).getIterator();

while (results.hasMoreResources())
{
res = results.nextResource();
resStr = (String) res.getContent();
util:include-exprutil:exprxsp:exprresStr/xsp:expr/util:expr/util:
include-expr
}
}
catch(Exception e)
{
}
/xsp:logic

/document
/xsp:page

!--End of
start.xsp

when i create a pipeline with only this genrator and a html serializer like,

map:pipeline
map:match pattern=daestart
map:generate type=serverpages src=daexsps/start.xsp/
map:serialize type=html/
 /map:match
  /map:pipeline

i get the following result,

!--


document xmlns:xml=http://www.w3.org/XML/1998/namespace;
xmlns:util=http://apache.org/xsp/util/2.0;
xmlns:xsp=http://apache.org/xsp; xmlns:dae=http://laseeb/dae/sgDae;
dae:article id=1 rating=2 sectionid=1
xmlns:dae=http://laseeb/dae/sgDae;
xmlns:src=http://xml.apache.org/xindice/Query; src:col=/db/daeDocuments
src:key=1
dae:titleTitulo com rating 2/dae:title
dae:textTexto/dae:text
/dae:article
dae:article id=2 rating=1 sectionid=1
xmlns:dae=http://laseeb/dae/sgDae;
xmlns:src=http://xml.apache.org/xindice/Query; src:col=/db/daeDocuments
src:key=2
dae:titleTitulo do artigo com rating igual a 1/dae:title
dae:texttexto do artigo com rating igual a 1/dae:text
dae:imageimg1.jpg/dae:image
/dae:article
dae:article id=3 rating=2 sectionid=1
xmlns:dae=http://laseeb/dae/sgDae;
xmlns:src=http://xml.apache.org/xindice/Query; src:col=/db/daeDocuments
src:key=3
dae:titleTitulo do artigo com rating igual a 2/dae:title
dae:texttexto do artigo com rating igual a 2/dae:text
dae:imageimg1.jpg/dae:image
/dae:article
dae:article id=4 rating=2 sectionid=1
xmlns:dae=http://laseeb/dae/sgDae;
xmlns:src=http://xml.apache.org/xindice/Query; src:col=/db/daeDocuments
src:key=4
dae:titleTitulo do artigo com rating igual a 2/dae:title
dae:texttexto do artigo com rating igual a 2/dae:text
dae:imageimg1.jpg/dae:image
/dae:article


/document

!--


wich is the right one. But when i try to apply one transformer created by
me, deaTransformer.java (bellow are the methods setup, startElement and
endElement that i had to implement,


!--Begin of
daeTransformer.java-
---

 public void setup(SourceResolver resolver, Map objectModel, String src,
Parameters par)
throws ProcessingException, SAXException, IOException
{
 this.mode = MODE_NONE;
}

public void startElement(String namespaceURI, String localName, String
qName,
Attributes attributes) throws SAXException
{
if (namespaceURI != null  namespaceURI.equals(NAMESPACE) )
{
AttributesImpl newAttr = new AttributesImpl();
if (localName.equals(ARTICLE_ELEMENT) == true)
{
newAttr.addAttribute(namespaceURI, ARTICLE_ELEMENT, qName,
color, red);
super.startElement(namespaceURI, ARTICLE_ELEMENT, qName,
newAttr);
}
else if (localName.equals(ARTICLE_TITLE_ELEMENT) == true)
{
this.mode = MODE_TITLE;
super.startElement(namespaceURI, localName, qName,
attributes);
}
else if (localName.equals(ARTICLE_TEXT_ELEMENT) == true)
{
this.mode = MODE_TEXT;
super.startElement(namespaceURI, localName, qName,
attributes);
}
else if (localName.equals(ARTICLE_IMAGE_ELEMENT) == true)
{
this.mode = MODE_IMAGE;
super.startElement(namespaceURI,