Re: i18n and database -- solve

2007-01-15 Thread 許議中
Solve it!

just change it
i18n
to
cocoon:/i18n

許議中 提到:
> Hi!
> 
> I'm try to put the i18n xml file to DB.
> 
> Here is the i18n setting in sitemap.xmap
> 
>   
>   
> 
>   
>src="org.apache.cocoon.transformation.I18nTransformer">
>   
>name="messages">
>   i18n
>   
>  
>   no
>   
>   
>   
> 
>   
>type="serverpages"/>
>   
>   
>   
>   
>   
> 
> when I read the messages_ja.xml it's ok,
> 
> but when I use this to be the resource
> 
>   
>type="serverpages">
>   
>   
>   
>   
>
> 
>value="{request-param:l}"/>
>   
>   
> 
> 
> 
> 
>   
> 
> the system say i18n/messages_ja.xml not loaded: Source URI not found
> 
> Because I need to change the i18n frequently, How to use it.
> 
> Best Regards
> 
> johnson
> 
> -
> 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]



linking excalibur sources to request

2007-01-15 Thread Robert, Danny
A simplified version of the problem I'm working on:

I need to be able to associate all (Excalibur) Sources used during a
pipeline with the initial request.  That is:

1) Request comes in through the Servlet
2) The pipeline executes
3) The servlet, upon completion, can output the URI for each Source read
from during the pipeline.

I tried implementing this by making my SourceFactory Contextualizable,
but this didn't end up working in the end because concurrent requests
would come in and set a different context before processing had
completed on the prior request.

Is there a way to accomplish this?  It's actually very important I be
able to track each Source read throughout the pipeline.

Thanks a lot,
-Danny Robert
[EMAIL PROTECTED]

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



i18n and database

2007-01-15 Thread 許議中
Hi!

I'm try to put the i18n xml file to DB.

Here is the i18n setting in sitemap.xmap








i18n

   
no







  




when I read the messages_ja.xml it's ok,

but when I use this to be the resource

  

  
  


 








  

the system say i18n/messages_ja.xml not loaded: Source URI not found

Because I need to change the i18n frequently, How to use it.

Best Regards

johnson

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



Re: Formtdefinition and -template from a org.w3c.dom.Document stream

2007-01-15 Thread Jason Johnston

ZongoZongo wrote:

Creating the form works fine. But the pipeline makes some trouble with
parsing the template:
"org.xml.sax.SAXException: The object type: class java.lang.String could not
be serialized to XML:"

Do I have to consider anything special? My template is valid and works fine
if I use it conventionally  :-/


That's strange... are you sure your JX template source object is a DOM 
Document?  The error message suggests it's actually a String.


If it's a String then the module source should work rather than xmodule:






  http://apache.org/cocoon/templates/jx/1.0";
uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml" />
  http://apache.org/cocoon/forms/1.0#template";
method="POST" enctype="multipart/form-data"
action="#{$continuation/id}.continue">

  http://apache.org/cocoon/forms/1.0#instance";
list-type="checkbox" />



  http://apache.org/cocoon/forms/1.0#instance";
type="textarea" cols="20" rows="5" />



  


kind regards,

Niclas




Jason Johnston-3 wrote:

ZongoZongo wrote:

Hi

Inside the flow I get the formtemplate and the formdefinition from a
javamethod as an org.w3c.dom.Document stream. How can I use this streams
to:
-  generate the form

I believe you can pass a DOM element to the Form flowscript constructor:

var form = new Form(myFormDocument.getDocumentElement());


-  call the formtemplate
What you need here is a way to use the DOM Document as input to the JX 
generator.  The xmodule source allows you to stream a DOM from an input 
module, for instance using the flow-attribute module:


(flowscript:)
form.showForm("display-pipeline", {dom : myJXDocument});

(sitemap:)

   
   ...


Now, you should be aware that while this sort of setup is certainly 
possible, there will be a performance penalty.  First of all, using a 
DOM object to build the form definition prevents the caching of that 
definition that usually takes place.  Similarly, the JX template cannot 
be precompiled and cached so it has to recompile the template each time. 
  You'll have to determine if that performance penalty is worth it for 
your particular case.


Hope that helps
--Jason

-
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: java.lang.IllegalStateException: Pipeline has already been processed for this request

2007-01-15 Thread Steven D. Majewski


On Jan 15, 2007, at 6:46 PM, Joerg Heinicke wrote:


On 16.01.2007 00:27, Steven D. Majewski wrote:

   java.lang.IllegalStateException: Pipeline has already been  
processed for this request



Can someone explain what happened and what that message above means ?


The message itself means that you try to send a second response on  
one request. From your description I guess the sendPage() results  
in the first response. As the flow is not interrupted by a  
sendPageAnd*Wait*() it continues the processing and will probably  
come to a second sendPage() which again results in a response. This  
will then cause the above exception. It's only a guess, but sounds  
reasonable, doesn't it ;)


Jörg



Thanks. Yes, that makes perfect sense.
I've been using flowscript in a couple of pipelines,
but I'm just starting to try to use the 'flow' part.
For some strange reason, I wasn't thinking about the
possibility that the script would keep running after
the page was sent.

BTW: I think the original bug I was hitting was another
instance of Java strings vs. Javascript strings.
I'm guessing that parameters must be Java strings.


-- Steve Majewski - University of Virginia Alderman Library


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



Re: Cocoon Training

2007-01-15 Thread Joerg Heinicke

On 15.01.2007 15:17, Hipkiss JR (Mr) wrote:


However, we need to get a number of internal developers up to speed on
Cocoon and we will also need access to come contractors to aid us with
the particularly tricky bits.



Does anyone know of any good Cocoon training courses running preferably
in Europe but we're open to the US as well?

Lastly is there a known pool of good British developers we can tap
contract work?


Yes, there are a few Cocoon committers (and developers) from Great 
Britain. You might ask the question on the dev list as well as I don't 
know how many of them are reading the users list. You can also find a 
good overview of Cocoon-based companies at http://www.cocoongt.org/. 
There is the list of sponsors. Don't want to nail you down to one 
company, but Sourcesense (http://www.sourcesense.com/) might 
geographically be the most interesting one for you. (I'm not related to 
them and have never worked with them.)


Jörg

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



Re: java.lang.IllegalStateException: Pipeline has already been processed for this request

2007-01-15 Thread Joerg Heinicke

On 16.01.2007 00:27, Steven D. Majewski wrote:

   java.lang.IllegalStateException: Pipeline has already been processed 
for this request



Can someone explain what happened and what that message above means ?


The message itself means that you try to send a second response on one 
request. From your description I guess the sendPage() results in the 
first response. As the flow is not interrupted by a sendPageAnd*Wait*() 
it continues the processing and will probably come to a second 
sendPage() which again results in a response. This will then cause the 
above exception. It's only a guess, but sounds reasonable, doesn't it ;)


Jörg

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



java.lang.IllegalStateException: Pipeline has already been processed for this request

2007-01-15 Thread Steven D. Majewski


OK: I've managed to find (I think) what caused this error, but I'm  
hoping someone

can explain what exactly it means to me:


   java.lang.IllegalStateException: Pipeline has already been  
processed for this request



I was debugging some flowscript, and I stuck in a sendPageAndWait()  
call to a template
page to show me some intermediate values. When my values were not  
showing up, I changed
it to a sendPage(). [ I did this because when it wasn't working, I  
looked at another
place where I called the same pipeline and it worked, and there I was  
calling sendPage(),

so I changed it to follow more closely what I knew was working code. ]

I got the above error, I couldn't figure out what it meant.
I tried a number of things, including stoping and restarting tomcat 
+cocoon.
Eventually, I put back the sendPageAndWait() and it started working  
again.



Can someone explain what happened and what that message above means ?


-- Steve Majewski - University of Virginia Alderman Library


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



Cocoon Training

2007-01-15 Thread Hipkiss JR (Mr)
Hi,

I hope you can help us, here in the UK we're beginning to ramp up a
major project that we've decided will be using Cocoon for its XML ->
XHTML transformations.

However, we need to get a number of internal developers up to speed on
Cocoon and we will also need access to come contractors to aid us with
the particularly tricky bits.

I've looked at http://cocoon.apache.org/link/training.html but half the
links are broken and the rest appear to only offer training in English.

Does anyone know of any good Cocoon training courses running preferably
in Europe but we're open to the US as well?

Lastly is there a known pool of good British developers we can tap
contract work?

Thanks to anyone who can point us in the right direction.


Jonathan Hipkiss

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



Re: Access items from a selection list from within flowscript

2007-01-15 Thread Mark Lundquist


On Jan 15, 2007, at 10:29 AM, Ralph Rauscher wrote:


Now if I try the following code

   var selList = widget.getFieldDefinition().getSelectionList();
   var selListItems = selList.getItems()

selListItmems will be null. I've used the exact same code for another 
selection list - however that selection list was not fed from a cocoon 
pipeline but statically initialized in the model using fi:items. So I 
suspect this behaviour has to do with Type (or implementation) of that 
specific selection list.


Hmm... StaticSelectionList has a getItems() method, but 
DynamicSelectionList doesn't seem to have one.  So I'm not sure why you 
don't get an exception when you try to call it...?


Any developers care to comment?

—ml—


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



Re: Regular Expressions, flowscript and java.lang.Character

2007-01-15 Thread Jason Johnston
>> I'm new to flowscript work in Cocoon, but I've gotten to this point from
>> a number of variable manipulations which are just a whole lot easier
>> (theoretically) with regular expressions than in XSLT. The following is
>> a simple variation that illustrates the problem. There are 40 or so
>> other pieces to the whole puzzle.
>>
>> Some of you will be familiar with the error message:
>> org.mozilla.javascript.EvaluatorException: "file:/D:/Program
>> Files/Apache Software Foundation/Tomcat
>> 5.5/webapps/dist/ROOT/Test/flow/searchTest.js", line 10: Cannot convert
>> /\s*((\S+\s*)*)/ to java.lang.Character
>> It was discussed at length in May 2005, but I would appreciate a simple
>> statement of the conclusions.  I don't see anything like them in play in
>> the schema.js flowscript for the linotype block, which pattern is echoed
>> below.
>>
>> Clues?
>>
>> Walter
>>
>> === the ProcessParameters.js script 
>> function main() {
>> /* collect the possible parameters from the search screens*/
>> var q = cocoon.request.get("q");
>> /* trim extra spaces and break q into words */
>> LTrim(q);
>> }
>>
>> // Removes leading whitespaces
>> function LTrim( value ) {
>> value = value.replace(/\s*((\S+\s*)*)/, "$1");
>
> I believe the problem is this: cocoon.request.get("q") returns a
> java.lang.String, not a JavaScript String.  Then you try to call the
> 'replace' method on it; java.lang.String does have a 'replace' method, but
> it takes Java char primitives as its arguments.  Rhino tries to convert
> your RegExp into a char (or Character) to fit the method signature but
> cannot, hence the error message.
>
> What you need is to convert the java.lang.String into a JavaScript String
> before calling the replace method:
>
>value = String(value).replace(/\s*((\S+\s*)*)/, "$1");
>
> You might also be able to use the java.util.String 'replaceAll' method

Of course I meant java.*lang*.String here.

> which takes a regular expression as its first argument, but I don't recall
> off the top of my head if it supports $1 substitutions in the second
> argument.
>
>
>> return value;
>> }
>>
>> === extracts from the Sitemap =
>>
>>   
>> 
>> 
>>   
>> 
>>
>> 
>> 
>> 
>> 
>> 
>> 
>>
>>
>>
>> -
>> 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]
>
>



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



Re: Regular Expressions, flowscript and java.lang.Character

2007-01-15 Thread Jason Johnston
> I'm new to flowscript work in Cocoon, but I've gotten to this point from
> a number of variable manipulations which are just a whole lot easier
> (theoretically) with regular expressions than in XSLT. The following is
> a simple variation that illustrates the problem. There are 40 or so
> other pieces to the whole puzzle.
>
> Some of you will be familiar with the error message:
> org.mozilla.javascript.EvaluatorException: "file:/D:/Program
> Files/Apache Software Foundation/Tomcat
> 5.5/webapps/dist/ROOT/Test/flow/searchTest.js", line 10: Cannot convert
> /\s*((\S+\s*)*)/ to java.lang.Character
> It was discussed at length in May 2005, but I would appreciate a simple
> statement of the conclusions.  I don't see anything like them in play in
> the schema.js flowscript for the linotype block, which pattern is echoed
> below.
>
> Clues?
>
> Walter
>
> === the ProcessParameters.js script 
> function main() {
> /* collect the possible parameters from the search screens*/
> var q = cocoon.request.get("q");
> /* trim extra spaces and break q into words */
> LTrim(q);
> }
>
> // Removes leading whitespaces
> function LTrim( value ) {
> value = value.replace(/\s*((\S+\s*)*)/, "$1");

I believe the problem is this: cocoon.request.get("q") returns a
java.lang.String, not a JavaScript String.  Then you try to call the
'replace' method on it; java.lang.String does have a 'replace' method, but
it takes Java char primitives as its arguments.  Rhino tries to convert
your RegExp into a char (or Character) to fit the method signature but
cannot, hence the error message.

What you need is to convert the java.lang.String into a JavaScript String
before calling the replace method:

   value = String(value).replace(/\s*((\S+\s*)*)/, "$1");

You might also be able to use the java.util.String 'replaceAll' method
which takes a regular expression as its first argument, but I don't recall
off the top of my head if it supports $1 substitutions in the second
argument.


> return value;
> }
>
> === extracts from the Sitemap =
>
>   
> 
> 
>   
> 
>
> 
> 
> 
> 
> 
> 
>
>
>
> -
> 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]



Regular Expressions, flowscript and java.lang.Character

2007-01-15 Thread Walter Lewis
I'm new to flowscript work in Cocoon, but I've gotten to this point from 
a number of variable manipulations which are just a whole lot easier 
(theoretically) with regular expressions than in XSLT. The following is 
a simple variation that illustrates the problem. There are 40 or so 
other pieces to the whole puzzle.


Some of you will be familiar with the error message:
   org.mozilla.javascript.EvaluatorException: "file:/D:/Program 
Files/Apache Software Foundation/Tomcat 
5.5/webapps/dist/ROOT/Test/flow/searchTest.js", line 10: Cannot convert 
/\s*((\S+\s*)*)/ to java.lang.Character
It was discussed at length in May 2005, but I would appreciate a simple 
statement of the conclusions.  I don't see anything like them in play in 
the schema.js flowscript for the linotype block, which pattern is echoed 
below.


Clues?

Walter

=== the ProcessParameters.js script 
function main() {
   /* collect the possible parameters from the search screens*/
   var q = cocoon.request.get("q");
   /* trim extra spaces and break q into words */
   LTrim(q);
}

// Removes leading whitespaces
function LTrim( value ) {
   value = value.replace(/\s*((\S+\s*)*)/, "$1");
   return value;
}

=== extracts from the Sitemap =
  
 
   
   
 




   
   
   




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



Re: Problem with new JX Template Generator

2007-01-15 Thread Gabriel Gruber
I found out my weird error: It was a Jar-problem.  (welcome to JAR 
HELL...)

For some reason I had the alt-rmi jars inside my web-inf/lib-directory and 
that caused the problem. I do not have any reasonable explanation why that 
led to the described error. but after removing those jars from the project 
(which I did not need anyway) it worked fine.

greets from vienna

Gabriel


__
Mag. Gabriel Gruber
Senior Consultant
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Workflow EDV GmbH, Dannebergplatz 6/23, A-1030 Wien
http://www.workflow.at




Gabriel Gruber <[EMAIL PROTECTED]> 
12.01.2007 18:40
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Problem with new JX Template Generator







Hello Cocoon Folks! 

I just upgraded to 2.1.10 and I have a problem with the new JX Template 
generator! I compiled the block as usual with the build system and the 
jetty dist runs fine. But my app doesn't run when the corresponding 
cocoon.xconf settings from the jx template generator are present: 

   
   
 
 
 
 
   
   
 
 
   
 
 
 

I get an exception at startup, as the component for key '
org.apache.cocoon.template.expression.StringTemplateParserSelector' cannot 
be found. While I could not find a class with that name neither in the 
project nor in the internet, I found a file called expression.roles at 
org/apache/cocoon/template/expression which has an entry with that key and 
points to a default implemenation class at path '
org.apache.cocoon.core.container.DefaultServiceSelector'. 

But at that classpath not classfile can be found eitherI really 
wonder how the jetty distribution (normal build of cocoon) can run 
?? 

Any Ideas, thoughts, etc. ??? 
many thanx in advance 

here is the exception I get in my own application. 

Webdesk starting... 
Reloading from: jndi:/localhost/webdesk3_cocoon/WEB-INF/cocoon.xconf - 
2007-01-12 18:10:33,337 access 
Cannot find CatalogManager.properties 
ThreadPool named "default" created with maximum 
queue-size=2147483647,max-pool-size=5,min-pool-size=5,priority=5,isDaemon=false,keep-alive-time-ms=6,block-policy="ABORT",shutdown-wait-time-ms=-1
 
- 2007-01-12 18:10:42,947 core.runnable 
ThreadPool named "daemon" created with no 
queue,max-pool-size=2147483647,min-pool-size=1,priority=5,isDaemon=true,keep-alive-time-ms=6,block-policy=ABORT,shutdown-wait-time-ms=-1
 
- 2007-01-12 18:10:43,009 core.runnable 
The session-fw block is deprecated. Please use the provided alternatives 
instead. - 2007-01-12 18:10:44,197 deprecation 
EHCache cache "cocoon-ehcache-1" initialized - 2007-01-12 18:10:44,353 
core.store 
Caught an exception trying to initialize the component handler. - 
2007-01-12 18:10:45,337 core.manager 
org.apache.avalon.framework.service.ServiceException: Could not find 
component (key 
[org.apache.cocoon.template.expression.StringTemplateParserSelector]) 
(Key='org.apache.cocoon.template.expression.StringTemplateParserSelector') 

at 
org.apache.avalon.framework.service.WrapperServiceManager.lookup(
WrapperServiceManager.java:80) 
at org.apache.cocoon.template.script.DefaultScriptManager.service(
DefaultScriptManager.java:64) 
at org.apache.avalon.framework.container.ContainerUtil.service(
ContainerUtil.java:143) 
at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(
DefaultComponentFactory.java:271) 
at 
org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(
ThreadSafeComponentHandler.java:108) 
at 
org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(
ExcaliburComponentManager.java:524) 
at org.apache.cocoon.components.CocoonComponentManager.initialize(
CocoonComponentManager.java:583) 
at org.apache.avalon.framework.container.ContainerUtil.initialize(
ContainerUtil.java:244) 
at org.apache.cocoon.Cocoon.initialize(Cocoon.java:345) 
at org.apache.avalon.framework.container.ContainerUtil.initialize(
ContainerUtil.java:244) 
at org.apache.cocoon.servlet.CocoonServlet.createCocoon(
CocoonServlet.java:1429) 
at org.apache.cocoon.servlet.CocoonServlet.init(
CocoonServlet.java:499) 
at at.workflow.webdesk.Webdesk.init(Webdesk.java:79) 
at org.apache.catalina.core.StandardWrapper.loadServlet(
StandardWrapper.java:1029) 
at org.apache.catalina.core.StandardWrapper.load(
StandardWrapper.java:862) 
at org.apache.catalina.core.StandardContext.loadOnStartup(
StandardContext.java:4013) 
at org.apache.catalina.core.StandardContext.start(
StandardContext.java:4357) 
at org.apache.catalina.core.ContainerBase.addChildInternal(
ContainerBase.java:823) 
at org.apache.catalina.core.ContainerBase.addChild(
ContainerBase.java:807) 
at org.apache.catalina.core.StandardHost.addChild(
StandardHost.java:595) 
at org.apache.cat

cocoon 2.1.10 + bsf + rhino (javascript)

2007-01-15 Thread Steven D. Majewski


I noticed that cocoon 2.1.10 has an newer release of bsf (Bean
Scripting Framework) along with the new javascript.
Does anyone know if this fixes the broken javascript+bsf problem in  
2.1.9 ?



-- Steve Majewski - University of Virginia Alderman Library


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



Re: Access items from a selection list from within flowscript

2007-01-15 Thread Jeroen Reijn

Hi Ralph,

as far as I can see it should still be possible.
What version of Cocoon are you using?

Kind regards,

Jeroen Reijn

Ralph Rauscher wrote:

Hi,

I tried to access (read-only) items of a selection list within 
flowscript. This selection list is fed from a cocoon pipeline. In the 
cforms model, it is set up like this:


dynamic="true"/>


Now if I try the following code

   var selList = widget.getFieldDefinition().getSelectionList();
   var selListItems = selList.getItems()

selListItmems will be null. I've used the exact same code for another 
selection list - however that selection list was not fed from a cocoon 
pipeline but statically initialized in the model using fi:items. So I 
suspect this behaviour has to do with Type (or implementation) of that 
specific selection list.


Is there any way to access items from a dynamic selection list via 
flowscript?


Best regards
Ralph




-
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]



Access items from a selection list from within flowscript

2007-01-15 Thread Ralph Rauscher

Hi,

I tried to access (read-only) items of a selection list within 
flowscript. This selection list is fed from a cocoon pipeline. In the 
cforms model, it is set up like this:


dynamic="true"/>


Now if I try the following code

   var selList = widget.getFieldDefinition().getSelectionList();
   var selListItems = selList.getItems()

selListItmems will be null. I've used the exact same code for another 
selection list - however that selection list was not fed from a cocoon 
pipeline but statically initialized in the model using fi:items. So I 
suspect this behaviour has to do with Type (or implementation) of that 
specific selection list.


Is there any way to access items from a dynamic selection list via 
flowscript?


Best regards
Ralph




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



Re: problem with headers

2007-01-15 Thread Mark Lundquist


On Jan 15, 2007, at 4:39 AM, Joose Vettenranta wrote:


[...] So it might indicate problem with caching and mime-types.


hmmm

https://issues.apache.org/jira/browse/COCOON-1624

???
—ml—


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



Re: problem with headers

2007-01-15 Thread Joose Vettenranta

Mark Lundquist kirjoitti 13.1.2007 kello 23.31:

I have like this in sitemap:

  
   

 

It works for some but not for every file I have.

For the ones it does not work, result is like  this: http:// 
joose.iki.fi/error.jpeg


That's really weird.  Some thoughts:
1) You say you think it has to do with mime type.  Why?


Because matcher with static mime-type works ok, but when I change  
mime-type per request -> no luck.




2) There's nothing in ResourceReader.java that explains why you  
would get this bogus Content-Length header inserted into the  
payload of the HTTP response;


Well, I said this is odd =)

3) If this were broken, lots of people would have this problem,  
because ResourceReader is used all the time to serve plain old  
static content;


It works when I don't dynamicly change mime-type with every request.

5) You say your pipeline works "for some images and not for  
others" (or something along those lines).  I'll bet the same ones  
are always broken, right?


Yep

I'll bet you have some image files that are just crapped up from  
the start, I mean just the plain files right there on the disk!   
I'll bet they are corrupted, and the reader is working just fine.


Hmm.. Nope. I have for images like this on filesystem:

 = original image
.thumb = thumbnail
.biggerthumb = thumbnail
.info = information about image

for thumbnails I have static mime-type: image/jpeg - works ok

for original images I have dynamic mime-type..

thumbnails always works. Also original files are correct and not  
corrupted. I have also tried to copy thumbnail to original image ==  
no work. What makes me think it's about mime-types is that when  
Firefox tries to show image/something it always says image is type  
"image/jpeg".


I made now it so that it (matcher) is in noncaching pipeline and it  
seems to work when I set content-disposition header with action. So  
it might indicate problem with caching and mime-types.


- Joose







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



Re: Convert string from html to xhtml

2007-01-15 Thread Abbas Mousavi
I had this problem also , this change in 
org.apache.cocoon.transformation.HTMLTransformer

solved the problem, the change is near line 173 >>>   
 new ByteArrayInputStream(text.getBytes("UTF-8"));

---
   .cPA8 { color:#008000; } .c9Y6TC { color:#ff; } .c50I2O { 
color:#808080; } .c50HZ4 { color:#008080; } .c4ZSSG { color:#800080; }  /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You 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 java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 import java.util.StringTokenizer;
 
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.transformation.AbstractSAXTransformer;
 import org.apache.cocoon.xml.XMLUtils;
 import org.apache.cocoon.xml.IncludeXMLConsumer;
 import org.apache.excalibur.source.Source;
 import org.w3c.tidy.Tidy;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
 /**
  * Converts (escaped) HTML snippets into JTidied HTML.
  * This transformer expects a list of elements, passed as comma separated
  * values of the "tags" parameter. It records the text enclosed in such
  * elements and pass it thru JTidy to obtain valid XHTML.
  *
  * TODO: Add namespace support.
  * WARNING: This transformer should be considered unstable.
  *
  * @author mailto:[EMAIL PROTECTED]">Daniele Madama
  * @author mailto:[EMAIL PROTECTED]">Gianugo Rabellino
  *
  * @version CVS $Id: HTMLTransformer.java 433543 2006-08-22 06:22:54Z crossley 
$
  */
 public class HTMLTransformer
 extends AbstractSAXTransformer
 implements Configurable {
 
 /**
  * Properties for Tidy format
  */
 private Properties properties;
 
 /**
  * Tags that must be normalized
  */
 private Map tags;
 
 /**
  * React on endElement calls that contain a tag to be
  * tidied and run Jtidy on it, otherwise passthru.
  *
  * @see org.xml.sax.ContentHandler#endElement(java.lang.String, 
java.lang.String, java.lang.String)
  */
 public void endElement(String uri, String name, String raw)
 throws SAXException {
 if (this.tags.containsKey(name)) {
 String toBeNormalized = this.endTextRecording();
 try {
 this.normalize(toBeNormalized);
 } catch (ProcessingException e) {
 e.printStackTrace();
 }
 }
 super.endElement(uri, name, raw);
 }
 
 /**
  * Start buffering text if inside a tag to be normalized,
  * passthru otherwise.
  *
  * @see org.xml.sax.ContentHandler#startElement(java.lang.String, 
java.lang.String, java.lang.String, org.xml.sax.Attributes)
  */
 public void startElement(
 String uri,
 String name,
 String raw,
 Attributes attr)
 throws SAXException {
 super.startElement(uri, name, raw, attr);
 if (this.tags.containsKey(name)) {
 this.startTextRecording();
 }
 }
 
 /**
  * Configure this transformer, possibly passing to it
  * a jtidy configuration file location.
  */
 public void configure(Configuration config) throws ConfigurationException {
 super.configure(config);
 
 String configUrl = config.getChild("jtidy-config").getValue(null);
 if (configUrl != null) {
 org.apache.excalibur.source.SourceResolver resolver = null;
 Source configSource = null;
 try {
 resolver = (org.apache.excalibur.source.SourceResolver)

this.manager.lookup(org.apache.excalibur.source.SourceResolver.ROLE);
 configSource = res

Re: Convert string from html to xhtml

2007-01-15 Thread philguillard

I use (jtidy)HtmlTransformer.

I had XSP (XML file in utf-8, database tables and jdbc connection in 
utf-8) --> html or XML Serializer in UTF-8 this was ok,
and i get character encoding troubles in my language after inserting the 
HTMLTransformer, confusion between ISO-8859-1 and UTF-8 ?...


I guess it is not possible to configure that in the html transformer?

Phil

Torsten Curdt wrote:


On 15.01.2007, at 07:38, Bertrand Delacretaz wrote:


On 1/14/07, philguillard <[EMAIL PROTECTED]> wrote:


... Anybody any idea? Is there a way to call jtidy to convert a


string in java?...

You could also use the (Neko)HtmlTransformer, see the samples at
http://cocoon.zones.apache.org/demos/release/samples/blocks/html/ 
welcome.

This allows you to cleanup HTML code contained in XML elements.



If you are just after a library - I found tagsoup to do a very good job!

 http://mercury.ccil.org/~cowan/XML/tagsoup/

cheers
--
Torsten



-
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: Ajax - on Submit: "Requerst failed - status=500"

2007-01-15 Thread ZongoZongo

I found the problem, but dont know how to solve it. The problem is the
location of the ajax-logic inside the aggregator. If its located inside a
pipeline everything works fine. Sadly I have to put the formprocessing after
the aggregation, because the tabs inside the form need, the tag ,
that is created after the aggregation through finalize.xsl.

Maybe somebody has an idea for a workaround ;-)

kind regards,

Niclas


ZongoZongo wrote:
> 
> Hi
> 
> I updateted my form with ajax. Now Iam getting a server error like
> described in the title of this thread when I hit the submitbutton.
> 
> Javastack:
> java.lang.IllegalStateException: getWriter() has already been called for
> this response
>   
> org.apache.catalina.connector.Response.getOutputStream(Response.java:568)
> 
> org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseFacade.java:180)
> 
> org.apache.cocoon.servlet.CocoonServlet.manageException(CocoonServlet.java:1316)
>   org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1202)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
> Sitemap:
>
>   
>   
>src="cocoon:/navigation"
> strip-root="true"/>
>element="main"/>
>strip-root="true"/>
>   
>src="stylesheets/finalize.xsl"/>
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
> 
> template:
> 
> 
>   http://apache.org/cocoon/templates/jx/1.0";
> uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml" />
>   http://apache.org/cocoon/forms/1.0#template";
> method="POST" enctype="multipart/form-data"
> action="#{$continuation/id}.continue" ajax="true">
> http://apache.org/cocoon/forms/1.0#instance";>
>   
>   
> 
>   abstract
>   
> 
>   
> 
>   
> 
>   
>   
> 
>   
>   
> 
>   
> 
>   
> 
>   
>   
>   
>   
> 
> 
>   paper
>   
> 
>   
> 
>   
> 
>   
>   
> 
>   
>   
> 
>   
> 
>   
> 
>   
>   
>   
>   
> 
>   
> 
> 
>   
> 
> 
> Maybe somebody has an Idea how to solve this problem.
> 
> kind regards,
> 
> Niclas
> 

-- 
View this message in context: 
http://www.nabble.com/Ajax---on-Submit%3A-%22Requerst-failed---status%3D500%22-tf2966619.html#a8369380
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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



Re: Formtdefinition and -template from a org.w3c.dom.Document stream

2007-01-15 Thread ZongoZongo

Creating the form works fine. But the pipeline makes some trouble with
parsing the template:
"org.xml.sax.SAXException: The object type: class java.lang.String could not
be serialized to XML:"

Do I have to consider anything special? My template is valid and works fine
if I use it conventionally  :-/


  http://apache.org/cocoon/templates/jx/1.0";
uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml" />
  http://apache.org/cocoon/forms/1.0#template";
method="POST" enctype="multipart/form-data"
action="#{$continuation/id}.continue">

  http://apache.org/cocoon/forms/1.0#instance";
list-type="checkbox" />



  http://apache.org/cocoon/forms/1.0#instance";
type="textarea" cols="20" rows="5" />



  


kind regards,

Niclas




Jason Johnston-3 wrote:
> 
> ZongoZongo wrote:
>> Hi
>> 
>> Inside the flow I get the formtemplate and the formdefinition from a
>> javamethod as an org.w3c.dom.Document stream. How can I use this streams
>> to:
>> -  generate the form
> 
> I believe you can pass a DOM element to the Form flowscript constructor:
> 
> var form = new Form(myFormDocument.getDocumentElement());
> 
>> -  call the formtemplate
> 
> What you need here is a way to use the DOM Document as input to the JX 
> generator.  The xmodule source allows you to stream a DOM from an input 
> module, for instance using the flow-attribute module:
> 
> (flowscript:)
> form.showForm("display-pipeline", {dom : myJXDocument});
> 
> (sitemap:)
> 
>
>...
> 
> 
> Now, you should be aware that while this sort of setup is certainly 
> possible, there will be a performance penalty.  First of all, using a 
> DOM object to build the form definition prevents the caching of that 
> definition that usually takes place.  Similarly, the JX template cannot 
> be precompiled and cached so it has to recompile the template each time. 
>   You'll have to determine if that performance penalty is worth it for 
> your particular case.
> 
> Hope that helps
> --Jason
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Formdefinition-and--template-from-an-org.w3c.dom.Document-stream-tf2945399.html#a8369117
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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



Re: custom document generation

2007-01-15 Thread Daniel Süpke
Mark Lundquist schrieb:
> Hi Daniel,
> 
> On Jan 13, 2007, at 1:06 PM, Daniel Süpke wrote:
> 
>> I used to work with struts and have some problems now getting into
>> Cocoon. Could you please give me a hint if I'm on the right track?
> 
> Yes, you're on the right track :-).  What problems are you having?

Well, you know, reading documentation and actually coding stuff... ;)


>>
>> I have to create an application which creates a document from an xml
>> source with only the parts that the user selected. This includes a
>> couple of steps:
>>
>> 1. Choose a basic configuration (automatic selection of some parts of
>> the xml document to use). I thought of doing this by a CForm where the
>> chosen configuration is stored in the session.
>>
>> 2. Based on the configuration in the session the user may now select in
>> detail which parts of the xml document he wants to use. I also want to
>> store all selected parts in the session with identifiers that are used
>> as attributes in the source xml document to indicate which parts to
>> include.
> 
> That all sounds like a plan; the only part that sounds a little wonky is
> the "stored in the session" bit.  If it's a direct workflow of (1)
> select parts => (2) generate document, then you probably want to just
> store this information as local variables in the flowscript function
> implementing your workflow.  That's the easiest (most parsimonious in
> terms of code) way to implement it if you don't really need explicit
> session variables.
> 
> Let us know if we can help further...
> 
> cheers,
> —ml—

Thank you very much for your advice :) !

Greetings,
Daniel Süpke

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



Re: Convert string from html to xhtml

2007-01-15 Thread Torsten Curdt


On 15.01.2007, at 07:38, Bertrand Delacretaz wrote:


On 1/14/07, philguillard <[EMAIL PROTECTED]> wrote:


... Anybody any idea? Is there a way to call jtidy to convert a

string in java?...

You could also use the (Neko)HtmlTransformer, see the samples at
http://cocoon.zones.apache.org/demos/release/samples/blocks/html/ 
welcome.

This allows you to cleanup HTML code contained in XML elements.


If you are just after a library - I found tagsoup to do a very good job!

 http://mercury.ccil.org/~cowan/XML/tagsoup/

cheers
--
Torsten



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