Re: MySQL "Year" vs CForms "Date"

2008-02-14 Thread Derek Hohls
Tobia
 
In terms of code - assuming I have a MySQL "Year-type" column;

Case 1:

  Year
  
 

Cocoon will not accept a form entry with just a "year" value (e.g. 2007)
and flags the entry field for the user to reenter the number.

Case 2:

  Year
  
 

Cocoon  will not accept this as a valid forms definition, when trying
to access the form via the browser.

As an interim solution I have used MySQL integer column, with 4 digits
and set a min/max range to the cocoon form widget.

>>> On 2008/02/14 at 04:32, in message <[EMAIL PROTECTED]>, Tobia Conforto 
>>> <[EMAIL PROTECTED]> wrote:
Derek Hohls wrote:
> if I use MySQL "Year" column and Cocoon Forms "integer" type  
> together, then the forms validator complains that the widget is not  
> a date type.

This part I don't understand.  Are you trying to apply some sort of  
date widget or date formatting or date validation to the integer  
field?  (You shouldn't.)  What component "complains that the widget is  
not a date type"?  Does a simple integer text field work?


Tobia

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



-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.


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



Re: Authentication in xsl:fo in Cocoon

2008-02-14 Thread Joerg Heinicke
If I understand it correctly you have two independent web applications 
in the same Tomcat instance. Couldn't you stay "inside" the secure area 
so that you don't need to authenticate from Cocoon when accessing the 
WMS server? I think you can check if the accessed URL was localhost or 
127.0.0.1.


Joerg

On 14.02.2008 12:44, Lehtonen, Mika wrote:


I did a quick and dirty solution: I add 
src="http://user:[EMAIL PROTECTED]" to my fo:external-graphics 
tag. Just for the testing.


Any better ideas?

Are there any way to build something to sitemap, which would do the 
trick? The user has just logged into the GeoServer so there must be some 
way to forward authentication info into cocoon and pass it back to 
Geoserver. Sounds stupid. Am I doing this too complicated?


reg. mika


Lehtonen, Mika kirjoitti:

Hi,

Cocoon 2.1.11 / TomCat 6.0.14

Cocoon is running in "main" host and wms-server (GeoServer) in another 
virtual host. Cocoon gets rasterdata from wms and renders it into pdf. 
So there is fo:external-graphics tag in the xsl, which has a 
wms-request as a src attribute.


Everything works fine until I add authentication (openLDAP + JNDI) 
into wms-server. Cocoon can't get the data anymore, because it can't 
authenticate itself.


Have anybody any idea how to solve this? It might be as much a TomCat 
issue, but I believe there are lots of TomCat experts round here too. 
I tried SingleSignOn valve in Tomcat but I guess it works only among 
the applications under same virtual host.


- mika -


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



Re: [2.1.11] Selectors in map:transform

2008-02-14 Thread Joerg Heinicke

On 14.02.2008 11:02, [EMAIL PROTECTED] wrote:


Cocoon-2.1.11
Selector is ignored inside a transform -- test2 is the empty string.
Is this by design or a bug?
Or did I miss something?


This just does not work. Selector has to be outside of transform.

Joerg

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



Re: Authentication in xsl:fo in Cocoon

2008-02-14 Thread Lehtonen, Mika


I did a quick and dirty solution: I add 
src="http://user:[EMAIL PROTECTED]" to my fo:external-graphics 
tag. Just for the testing.


Any better ideas?

Are there any way to build something to sitemap, which would do the 
trick? The user has just logged into the GeoServer so there must be some 
way to forward authentication info into cocoon and pass it back to 
Geoserver. Sounds stupid. Am I doing this too complicated?


reg. mika


Lehtonen, Mika kirjoitti:

Hi,

Cocoon 2.1.11 / TomCat 6.0.14

Cocoon is running in "main" host and wms-server (GeoServer) in another 
virtual host. Cocoon gets rasterdata from wms and renders it into pdf. 
So there is fo:external-graphics tag in the xsl, which has a 
wms-request as a src attribute.


Everything works fine until I add authentication (openLDAP + JNDI) 
into wms-server. Cocoon can't get the data anymore, because it can't 
authenticate itself.


Have anybody any idea how to solve this? It might be as much a TomCat 
issue, but I believe there are lots of TomCat experts round here too. 
I tried SingleSignOn valve in Tomcat but I guess it works only among 
the applications under same virtual host.


- mika -

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



How to log/trace functional information ??

2008-02-14 Thread Sébastien Geindre

hi all,

I'd like to make functional log.

I explain.
A client send xml data.
I need to put it in kind of database.
This is ok.

But i would like to write in a file (for example) that client A send 
this datas, this day,...

All information i need to trace are in  the xml data sent.

A kind of monitoring, or functional trace.

How can i do that with C2.2 ?


Thanks for your advices.

Sébastien.


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



[2.1.11] Selectors in map:transform

2008-02-14 Thread solprovider
Cocoon-2.1.11
Selector is ignored inside a transform -- test2 is the empty string.
Is this by design or a bug?
Or did I miss something?

solprovider

XMAP Excerpt


  
  

  


  

  



XSL Excerpt







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



Re: MySQL "Year" vs CForms "Date"

2008-02-14 Thread Tobia Conforto

Derek Hohls wrote:
if I use MySQL "Year" column and Cocoon Forms "integer" type  
together, then the forms validator complains that the widget is not  
a date type.


This part I don't understand.  Are you trying to apply some sort of  
date widget or date formatting or date validation to the integer  
field?  (You shouldn't.)  What component "complains that the widget is  
not a date type"?  Does a simple integer text field work?



Tobia

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



Re: REPOST: Losing request parameters during form error

2008-02-14 Thread Tobia Conforto

Derek Hohls wrote:
upgrading on the servers is, unfortunately, a much longer and time- 
consuming process.  I guess I was hoping it was not a bug.


Maybe it's not.  Can you post a minimal example (simple form with  
maybe 1 widget) and minimal sitemap that exhibits the problem?



Tobia

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



Re: REPOST: Losing request parameters during form error

2008-02-14 Thread Derek Hohls
Florian

Thanks for the suggestion.  I could try out a version locally,
but upgrading on the servers is, unfortunately, a much longer
and time-consuming process.  I guess I was hoping it was not a bug.

>>> On 2008/02/14 at 02:39, in message <[EMAIL PROTECTED]>, Dev at weitling 
>>> <[EMAIL PROTECTED]> wrote:
Hi Derek,

do you have the opportunity to try it with a more recent version of Cocoon?
If you initialize a widget with a given parameter this sounds like a bug 
probably corrected in the meantime.

Bye,
Florian

Derek Hohls wrote:
> Anyone able to help with this?
>
> Thanks!
>
>   
 On 2008/01/08 at 03:53, in message <[EMAIL PROTECTED]>, "Derek Hohls" 
 <[EMAIL PROTECTED]> wrote:
 
> Using Cocoon 2.1.8.
>
> I am creating a new form and passing some default values 
> to it using request parameters:
>
> eg. http://localhost:/mydb/newPerson.do?i=piet&r=16&c=5 
>
> The form displays normally and the user can add data -> submission 
> of a correct form also works. However, when encountering an 
> error on first submission e.g. a key field value is missing, then 
> when the form is redisplayed, the values obtained from parameters
> passed in the first time are no longer displayed.  How do I ensure 
> that these parameters are used for each submission?
>
> Thanks
> Derek
>
>
>   

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



-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their 
support.


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



Re: Doing string operations over sitemap values

2008-02-14 Thread Tobia Conforto

Joerg Heinicke wrote:

Nacho (Derecho.com) wrote:

"{request:translate('{1}','-','')}"


the user might go to: http://localhost:8080/b/hello',nasty.java.call(),'world


It's JXPath, not JXTemplate. Does it evaluate Java calls at all?
If your example really works, http://localhost:8080/b/nasty.java.call() 
 will as well.


To be honest I don't know what JXPath can and cannot evaluate
(Java calls? any extensions to XPath? Java objects? request and  
session objects?)


I just saw some bad/unusual quotation  
{request:translate('{1}','-','')} and I thought I'd alert against  
possible problems. But maybe I'm wrong.



Tobia

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



Authentication in xsl:fo in Cocoon

2008-02-14 Thread Lehtonen, Mika

Hi,

Cocoon 2.1.11 / TomCat 6.0.14

Cocoon is running in "main" host and wms-server (GeoServer) in another 
virtual host. Cocoon gets rasterdata from wms and renders it into pdf. 
So there is fo:external-graphics tag in the xsl, which has a wms-request 
as a src attribute.


Everything works fine until I add authentication (openLDAP + JNDI) into 
wms-server. Cocoon can't get the data anymore, because it can't 
authenticate itself.


Have anybody any idea how to solve this? It might be as much a TomCat 
issue, but I believe there are lots of TomCat experts round here too. I 
tried SingleSignOn valve in Tomcat but I guess it works only among the 
applications under same virtual host.


- mika -

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



Re: response xml from Document

2008-02-14 Thread Joerg Heinicke

On 13.02.2008 05:56, nanomonk wrote:


so, I have an xml generated by java(in Document now)...
I need to do response this xml to client...
pls tell me a true-way how to do that with cocoon 2.2?


I guess you are talking about a DOM Document (org.w3c.dom.Document)? 
Then you can use the org.apache.cocoon.xml.dom.DOMStreamer and its 
stream method. But it very much depends on how you plug your Java code 
into Cocoon since you need access to a SAX ContentHandler.


Joerg

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



Re: Doing string operations over sitemap values

2008-02-14 Thread Joerg Heinicke

On 14.02.2008 07:42, Tobia Conforto wrote:


Nacho (Derecho.com) wrote:

* I have this URL "http://localhost:8080/b/menores-de-edad";
* In sitemap i have a match like "b/**"
* I need to do replace "-" in {1} to spaces
* I do this using an input module inheriting from 
AbstractJXPathModule, and using a xpath like expression, 
"{request:translate('{1}','-','')}"


I would write a custom input module that can be called safely like this:
"{translate:-: :{1}}"
It can be implemented using basic java.lang.String methods.

I think your solution doesn't quote the argument correctly and is 
susceptible to "JX code injection" or other problems.
For example the user might go to: 
http://localhost:8080/b/hello',nasty.java.call(),'world
If I'm not mistaken, the ' after hello would close the Jx string and 
damage would ensue.


It's JXPath, not JXTemplate. Does it evaluate Java calls at all?

If your example really works, http://localhost:8080/b/nasty.java.call() 
will as well.


Joerg

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



Re: Doing string operations over sitemap values

2008-02-14 Thread Tobia Conforto

Nacho (Derecho.com) wrote:

* I have this URL "http://localhost:8080/b/menores-de-edad";
* In sitemap i have a match like "b/**"
* I need to do replace "-" in {1} to spaces
* I do this using an input module inheriting from  
AbstractJXPathModule, and using a xpath like expression,  
"{request:translate('{1}','-','')}"


I would write a custom input module that can be called safely like this:
"{translate:-: :{1}}"
It can be implemented using basic java.lang.String methods.

I think your solution doesn't quote the argument correctly and is  
susceptible to "JX code injection" or other problems.

For example the user might go to: 
http://localhost:8080/b/hello',nasty.java.call(),'world
If I'm not mistaken, the ' after hello would close the Jx string and  
damage would ensue.



Tobia

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



Re: REPOST: Losing request parameters during form error

2008-02-14 Thread Dev at weitling

Hi Derek,

do you have the opportunity to try it with a more recent version of Cocoon?
If you initialize a widget with a given parameter this sounds like a bug 
probably corrected in the meantime.


Bye,
Florian

Derek Hohls wrote:

Anyone able to help with this?

Thanks!

  

On 2008/01/08 at 03:53, in message <[EMAIL PROTECTED]>, "Derek Hohls" <[EMAIL 
PROTECTED]> wrote:


Using Cocoon 2.1.8.

I am creating a new form and passing some default values 
to it using request parameters:


eg. http://localhost:/mydb/newPerson.do?i=piet&r=16&c=5 

The form displays normally and the user can add data -> submission 
of a correct form also works. However, when encountering an 
error on first submission e.g. a key field value is missing, then 
when the form is redisplayed, the values obtained from parameters
passed in the first time are no longer displayed.  How do I ensure 
that these parameters are used for each submission?


Thanks
Derek


  


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



Doing string operations over sitemap values

2008-02-14 Thread Nacho (Derecho.com)
Hola a todos:

I've needed to do some of string transformations over sitemap parameters
obtained from parts of a url, and i'm lookng for the smart way to it,
rigth now i have done it using the method described below:

* I have this URL "http://localhost:8080/b/menores-de-edad";
* In sitemap i have a match like "b/**"  
* I need to do replace "-" in {1} to spaces
* I dothis using any input module inheriting from AbstractJXPathModule,
and using a xpath like expression, "{request:translate('{1}','-','')}"

Is there any othe way ( a more smart or polite one :) to do this? 

TIA


Ignacio J. Ortega
Dpto. soporte y desarrollo
http://www.derecho.com
http://www.elabogado.com

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



Re: Newer FOP to Cocoon 2.1.11

2008-02-14 Thread Lehtonen, Mika




Holy smoke!

It works like a train toalet!

Funny how the old xsl-fo templates don't much work anymore. And that is
mainly because they are not created by the standard but so that they
worked with fop-0.20.5.

Million times thank you! You really saved my day and helped me with
this Cocoon project. I am working on a map plotter application and I
must say that trying to get raster maps into template in right scale,
in right direction whether user choose landscape or portrait plot, was
a pain in an ass with former FOP. I hope this new one will solve my
problems.

Thanks again!
Have a nice day!

Cheers
mika

Kai Mütz kirjoitti:

  Lehtonen, Mika <> wrote:
  
  
Superb!

..but still too complicated for me, I'm afraid.

Could you be more specific on compling part? I tried to compile that
code with javac (1.6.0_04) and got 73 errors. Then I "stole" the

  
  
You have to compile it with the cocoon 2.1.11 libs in classpath. This should
work. I haven't tried it with java 1.6.

You need at least the following libs in classpath:
fop.jar;
cocoon-2.1.11.jar;
avalon-framework-api-4.3.jar;
avalon-framework-impl-4.3.jar;
avalon-logkit-2.1.jar;
excalibur-sourceresolve-2.1.jar;
excalibur-xmlutil-2.1.jar;
excalibur-pool-api-2.1.jar;
commons-lang-2.3.jar

Regards, Kai


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


-- 
Sähköpostiosoitteeni on vaihtunut. Uusi osoite on [EMAIL PROTECTED].
Vanhaan osoitteeseen tulevat postit kääntyvät uuteen 25.4. asti.

My e-mail address has been changed. New address is [EMAIL PROTECTED].
Mails arriving in the old address will be forwarded to the new one till 25th April.

Mika Lehtonen
XML-Scanning Littoinen Ky
Lankakatu 2 E 13, 20660 Littoinen
[EMAIL PROTECTED]
mbl +358 (0)44 2908259 



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



Re: Using xsl variables in javascript

2008-02-14 Thread Tobia Conforto

Lincoln Mitchell wrote:

I simple need to convert this inline javascript:


  function myFunction(){
  

  alert('x')

  
  }


…to an external javascript file like:

function myFunction(){
  if ($myParam='x'){
alert('x')
  }
}


I don't think you have execution times very clear.  XSLT code runs on  
your server at pipeline execution time, before or during page  
generation.  Client javascript code runs in the client browser at page  
rendering time, after page generation and transmission.  This means  
that whatever comes out of your pipeline must be well-formed HTML and/ 
or Javascript that will run on the browser, without access to any XSLT  
or Cocoon variables.  In fact, by the time the generated HTML reaches  
the browser, the variables used in your XSLT won't exist anymore.


Nevertheless, it might be that what you're after is simply this:


  var myParam = "";


Notice the extra quotation marks around the value-of: this XSLT code  
is generating a HTML script tag containing Javascript code that, when  
run by the browser, will declare a global string variable called  
myParam.  From that moment on, every piece of Javascript code run on  
the browser will have access to that global variable.


Also, this is generic web programming matter, not exactly related to  
Cocoon.



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