Re: German special character got lost during XSP processing

2003-12-15 Thread Joose Vettenranta
Hey,

I think I had similar problems with PostgreSQL. The problem might be 
that that esql charset's are different than those in SQL-database (like 
utf-8 - iso-8859-1). I made it so, that data in PostgreSQL is stored 
as unicode but that didn't solve that problem yet. Last thing I did to 
solve the problem was in cocoon.xconf:

  dburljdbc:postgresql://localhost/database?charSet=UTF-8/dburl

After that everything started to work ok.

- Joose

15.12.2003 kello 00:45, David Zellhoefer kirjoitti:

 Hej,
I have a problem with the encoding of special characters (my 
assumption) and their processing in Cocoon. You'll find my 
configuration below.

I have a database holding some strings with special German Umlaute 
such as ä, ö etc.
All characters are stored right, when I check them with the MySQL 
console or with PHPMyAdmin on the server.

If I run a query with ESQL and retrieve some strings from MySQL Cocoon 
produces a weird output like thisIsATest?, where the last character 
should be one of the Umlauts.
I programmed a work-around for DOS which only takes the string and 
replaces all characters with themselves (String.replaceAll()).
This approach doesn't work under Linux.
I have a pipeline finally ending in a HTML output, but the XML 
produced by the XSP has this problem as well.

Has anyone an idea how to encode the characters in a way that Cocoon 
is able to work with? Or do I have to change something else?

--
Always remember that you are unique, just like everyone else!
* http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 *
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: how to create XML DOM from SAX event

2003-12-15 Thread Lionel Crine
Because If I do not write it, I don't get the Document coming from the 
pipeline.



At 10:37 11/12/2003 +0100, you wrote:
Lionel Crine wrote:

/**
 * Get the DOM return it in the flow.
 */
protected Document transform(Document doc) {
doc = this.builder.getDocument(); //get the doc as DOM
doc = this.addDmidref(doc); //any method you want to use.
return doc;
}
In above code, why do you set doc to this.builder.getDocument()? I thought 
the document was already handed to you as DOM already so why not use the 
reference passed in the function?

Jorg

Lionel

At 13:44 03/12/2003 -0500, you wrote:

i have tried to extend the AbstractDOMTransformer class. and now i dont find
anyhelp for ,how to work with transform method? it takes Document argument
and returns the document.but which other methods do I need to implement. I m
new bie and have started writing transformer straight away so, please help
me.
here is my code.i want to now get the Document object of the sax event that
has come from generator into my transformer.where do I write my code ? do i
have toimplement startElement and endElement methods? or just carry on with
transformer method? and another question is,
what does this transformer passes to next componanat? SAX event or DOM ?

public class MyTransformer
extends AbstractDOMTransformer
implements Transformer, DOMBuilder.Listener, Composable, 
Disposable,
Recyclable {

public void setup(
SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
throws ProcessingException, SAXException, IOException {
}
public void parameterize(Parameters parameters) throws 
ParameterException {
}
protected Document transform(Document doc) {
doc = this.builder.getDocument();
return doc;
}
}

-Original Message-
From: Reuben Christie [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 11:58 AM
To: Cocoon Apache
Subject: how to create XML DOM from SAX event
Hi all, I m currently writing custom transformer  to connect to external
java program from cocoon. i m stuck here where i need to convert the sax
event into xml DOM object.
I use file generator to read from xml file and then pass it to the
transformer(my custome transformer) in pipeline in this transformer i want
to create the original xml file (anything, either string or DOM object). can
anybody help me out and throw me some ideas how to do that?
anyhelp will be grtly appriciated
thanks alot in advance
reuben
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
-
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]
Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Form validation problem

2003-12-15 Thread Christian Haul
Joe D. Williams wrote:
Working on the examples in Chapter 12 of Lajos and Jeremy's book, I cannot
get the new ticket form to return the results. It just keeps displaying the
blank form,
without updating the database.
I am running Cocoon 2.0.4 on Tomcat 4.1.27 standalone with J2SDK1.4.1 and
MySQL 4.0.16
The idea is to use the org.apache.cocoon.acting.DatabaseAddAction to put
the info from a set of forms into a db.
The info must first be validated using
org.apache.cocoon.acting.FormValidatorAction. Looking at the sitemap log
for the logger sitemap.action.validator I find a number of messages where
it is validating the info from the forms.
After this, there is a message: All form params validated. An error
occurred.
There will be a message in the sitemap.log indicating the validation 
error. In addition, the info is available as request attribute (so dump 
all request attributes on your page and you'll see).

Besides, you should consider to move to cocoon forms aka Woody or at 
least use the database actions from the modular package. Their interface
is a lot more consistent and have more docs.

	Chris.

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


Portal Engine Security

2003-12-15 Thread Stefan Eichenhofer

Hi, 

i'm trying to find my way around the
portal-engine. Looking at the example i was able to figure out how the
layout and skin of the portal works. 
What i couldn't find is where the allocation
useroles/user to portlet takes place. 
Is there something similar to the user/role/global
deltas that where used in the portal-framework ?

thnx for any help

Stefan 

btw. im somebody knows where to find
some documentation on the new portal-engine 




Problem using chaperon

2003-12-15 Thread David Hello
Hi,

I actually use chaperon with cocoon and it worked with 2.1.1 cocoon version.
I changed to 2.1.3 version and  i have some problem, with  gram.xlex 
file, during the transformation.
It seems the problem occurs on the chaperon sample too, with that version.
Does Someone know if the problem is fixed for next version, or have a 
solution?

Thanks a lot,
David
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


synchronised method in javascript for petstore flowscript sample

2003-12-15 Thread David Hello
Hi,

I've studied the Petstore flowscript sample in coocon 2.1.3.
While inserting new Element in Database whith javascript method, first 
we select the max of the id in the table, then we insert a new element 
with an id:
new_id=max(id) +1.
It seems a problem can occur because, the two requests are  not 
transactionnal, and someone can insert a new element between the
selection of the max(id), and the insertion, and the database will be 
corrupted(2 elements with same id).
I'd like to know if there a way to put the javascript method wich do the 
insertion synchronised, or another way to do several database requests 
in a single transaction.

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


profile information with cachingeventpipeline

2003-12-15 Thread Jorg Heymans
Hi,

Is it a feature that the profilingcachingeventpipeline does not record 
profiling information about cached items (2.0.4)? Is there a parameter 
to set maybe to enable this?

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


absolute path in map:mount doesn't work

2003-12-15 Thread Sonja Löhr
Hi, all!

I repost my mount-question:

I've just installed cocoon 2.1.3 on a debian linux system under tomcat
4.1.27. 

My own examples are under /var/www/cocoon/myexamples (the directory name
cocoon has nothing to do with Cocoon's installation directory!!),
whith its own sitemap.xmap.

With cocoon 2.0.4 I had the following mount expression in the root
sitemap: 


   map:pipeline
 map:match pattern=myexamples/**
   map:mount uri-prefix=myexamples/
src=file:///var/www/cocoon/myexamples/sitemap.xmap
check-reload=yes reload-method=synchron/
  /map:match
/map:pipeline


The only change I made to cocoon 2.1.3 after the build was that I added
this pipeline to the root sitemap, which worked fine under 2.0.4

But cocoon simply ignores the absolute file-protocol path and searches
the sitemap under its own webapp directory:
I get a ResourceNotFoundException -- FileNotFoundException saying that

file:/usr/java/jakarta-tomcat/webapps/cocoon/myexamples/sitemap.xmap
doesn't exist

Is it a bug? Have there been changes in the mount-syntax I overread?
Does anyone have the same problem?



Thanks in advance
Sonja


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



RE: Configuring Cocoon with Apache and TomCat

2003-12-15 Thread gounis








this is my pipeline in cocoon's main sitemap that handle all 
/cocoon/domain.gr


map:pipeline
map:match pattern=*.gr/**
map:mount check-reload=yes 
src=file://c:/Server/xwww/{1}.gr/conf/sitemap.xmap uri-prefix={1}.gr/
/map:match
map:match pattern=*.gr
map:redirect-to uri={1}.gr//
/map:match
/map:pipeline

so i can get any http://:8080/cocoon/{domain}.gr/

be carefull to put the last / (slash)


this snip of code is in my local develop machine  (winXP) in the same way 
is configured my production linux server


but first of all try to get diferent sites from your cocoon instalation
:8080/cocoon/{domain}/ 







if this works then go to setup apache virtual hosting


-- stavros
On Sun, 14 Dec 2003, Krishna wrote:

 Hi,
 
   Let me explain what I have,
   Tomcat is installed in /var/tomcat4/
   Cocoon is installed in /var/tomcat4/webapps/cocoon/
   and main cocoon sitemap is in /var/tomcat4/webapps/cocoon/sitemap.xmap
 
   I have now installed apache 2.0.48 and enabled all modules.
   It is in /usr/local/apache/
 
   DocumentRoot for my website is in /usr/local/apache/domain.net/htdocs/
 
   I can access tomcat by doing.
   http://203.xxx.xxx.yyy:8180
   and cocoon by doing
   http://203.xxx.xxx.yyy:8180/cocoon
   They are all working!
   But I can't access http://203.122.59.60:8180/cocoon/domain.net !!!
 
 How do I configure this??
 
 Sitemap.xmap in entry /var/tomcat4/webapps/cocoon/sitemap.xmap under
 pipelines for domain.net is
 
 map:match pattern=*.net/**
 map:mount uri-prefix={1}.net
 src=/usr/local/apache2/{1}.net/htdocs/sitemap.xmap check-reload=yes/
  /map:match
 
 This is my virtualhost configuration in apache.
 VirtualHost 203.xxx.xxx.yyy:80
 
 Directory /usr/local/apache2/domain.net/htdocs
 Options -Indexes
 order allow,deny
 allow from all
 /Directory
 
 ServerAdmin [EMAIL PROTECTED]
 DocumentRoot /usr/local/apache2/domain.net/htdocs
 ServerName www.domain.net
 ServerAlias domain.net www.domain.net
 ErrorLog /usr/local/apache2/logs/error_log
 CustomLog /usr/local/apache2/logs/access_log combined
 
 Location /WEB-INF
 Order deny,allow
 Deny from all
 /Location
 
 #static content is served from apache
 #ProxyPass /media/ !
 #ProxyPass /stats/ !
 #ProxyPass /images/ !
 #ProxyPass /themes/images/ !
 
 #all the rest are passed to cocoon
 ProxyPass / http://203.xxx.xxx.yyy:8180/cocoon/domain.net/
 ProxyPassReverse / http://203.xxx.xxx.yyy:8180/cocoon/domain.net/
 
 ProxyErrorOverride On
 
 /VirtualHost
 
 regards,
 Krishna
 
 Krishna Shekhar, RHCE
 Network/Systems Engineer
 spectranet
 http://www.spectranet.com
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Sunday, December 14, 2003 3:28 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: Configuring Cocoon with Apache and TomCat
 
 
 
 http://wiki.cocoondev.org/Wiki.jsp?page=VirtualHost
 
 this works for us
 
 check first if your webapp work asking content directly form tomcat
 
 http://..:8008/examples/test.xml (maybe)
 
 --stavros
 
 On Sat, 13 Dec 2003, Krishna wrote:
 
  Hi,
 
  I have installed Tomcat (tomcat4-4.0.1-1) , Cocoon-2.1 and
  Apache_1.3.23. The installation of these packages went fine.
  Tomcat configuration files are in /var/tomcat4, Cocoon in
  /var/tomcat4/webapps/cocoon/ and Apache in /usr/local/apache
 
  This is my VirtualHost directive
 VirtualHost 203.xxx.xxx.yyy
  ServerAdmin [EMAIL PROTECTED]
  DocumentRoot /usr/local/apache/htdocs
  ServerName www.domain.net
  WebAppConnection conn warp localhost:8008
  WebAppDeploy examples conn /examples/
 /VirtualHost
 
 so, If I access http://203.xxx.xxx.yyy/examples/ , I can see the files
  placed under /var/tomcat4/webapps/examples and the servlets are
 executing.
 However when I made a test xml page it does not execute?
 
 Any idea? how I should configure it so that everything works under the
  DocumentRoot /usr/local/apache/htdocs/ for both xml and jsp pages!
 
 
  regards,
  Krishna
 
  Krishna Shekhar, RHCE
  Network/Systems Engineer
  Spectranet
  http://www.spectranet.com
 
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/2003
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 ---
 Incoming mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/2003
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system 

Re: German special character got lost during XSP processing

2003-12-15 Thread Collin VanDyck
We had a similar problem... We ended up using UTF-8 for everything; it
manifests itself in a couple of places.  Here's what we did - your mileage
may vary:

1. In your web.xml for your webapp, you'll want to set these params:

init-param
param-namecontainer-encoding/param-name
param-valueISO-8859-1/param-value
/init-param
init-param
param-nameform-encoding/param-name
param-valueUTF-8/param-value
/init-param

You can find more information about that here:

http://wiki.cocoondev.org/Wiki.jsp?page=RequestParameterEncoding

Then, in the sitemap, define your serializer with a specific encoding
(UTF-8):

map:serializer name=html mime-type=text/html
src=org.apache.cocoon.serialization.HTMLSerializer
encodingUTF-8/encoding
/map:serializer

At that point, redeploy, and generate an XSP.  In your browser, look to see
what the character encoding is.  It should be UTF-8.  If it is not, and you
are still seeing the funny characters, change it to UTF-8 in your browser.
It should fix it.  At that point, you know that it is a problem configuring
your client browser.  There is more information at the link above on how to
force certain browsers to use your encoding using response headers.

If changing to UTF-8 manually does NOT help, then I'm not sure what the
problem is.

Hope that helps,
Collin


- Original Message - 
From: David Zellhoefer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, December 14, 2003 5:45 PM
Subject: German special character got lost during XSP processing


 Hej,

 I have a problem with the encoding of special characters (my assumption)
 and their processing in Cocoon. You'll find my configuration below.

 I have a database holding some strings with special German Umlaute
 such as ä, ö etc.
 All characters are stored right, when I check them with the MySQL
 console or with PHPMyAdmin on the server.

 If I run a query with ESQL and retrieve some strings from MySQL Cocoon
 produces a weird output like thisIsATest?, where the last character
 should be one of the Umlauts.
 I programmed a work-around for DOS which only takes the string and
 replaces all characters with themselves (String.replaceAll()).
 This approach doesn't work under Linux.
 I have a pipeline finally ending in a HTML output, but the XML produced
 by the XSP has this problem as well.

 Has anyone an idea how to encode the characters in a way that Cocoon is
 able to work with? Or do I have to change something else?

 Cheers,

 David

 
 System:

 RedHat 8.0
 Java 1.4.1
 Cocoon 2.0.4
 MySQL Ver 8.23 Distrib 3.23.52
 mysql-connector-java-2.0.14-bin.jar

 -- 
 David Zellhöfer
 Västanågatan 22.207

 582 35 Linköping
 Sverige

 phone: +46 (0)13 149 188
 mobile phone: +46 (0)70 856 93 46
 e-mail: [EMAIL PROTECTED]
 icq: 241095373


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



XML serializer; handling characters outside the encoding

2003-12-15 Thread Christopher Painter-Wakefield




I have a data consumer who is pulling XML from our Cocoon webapp.  They
couldn't handle UTF-8 on their end, so I gave them the option to pull data
in US-ASCII encoding.  However, when I did that, symbol characters such as
Greek and math symbols got sent over even though they aren't in the
encoding.  When I saved a result from our system and opened it with XML
Spy, it complained about these characters.  On my consumer's end, it makes
his software blow up.  I'm not sure exactly how these characters are output
(I don't have a good byte-level editor), but I assume it is doing some kind
of double-character thing that creates bytes outside the range of defined
characters for the encoding, or something similar.

My question is, what should the behavior be when coping with characters
outside the encoding, and where does the responsibility lie?  My assumption
would be that the XML serializer should take characters outside the
encoding and turn them into entity references (#916; for greek delta, for
instance).  I am on C2.0.3, so maybe that has been done in a later release,
but if not, should it?  I am going to explore a change to the serializer
for just that purpose, but if it has already been done, I'd like to grab
the code for it.  I'm assuming you can use character entities in any
encoding, regardless of whether the characters thus specified have a code
in that encoding.

Thanks,
Christopher


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



ESQL : creating dynamic elements ?

2003-12-15 Thread julien bloit
I'm building a database request using ESQL. Let's say I have a table with
two columns in the table i'm requesting. This is the xsp snippet I use to
get the results from the request :

esql:results
 esql:row-results
  first_table_col_1
esql:get-string column=1/
xsp:attribute name=first_table_col2
esql:get-string column=2/
/xsp:attribute
/first_table_col_1
/esql:row-results
/esql:results

This works, but as I want this code to be dynamic in order to be used with
other tables, I need my column element name (the currently static
first_table_col_1 element) to be created with the requested column name.
The same logic would apply for the 'name' attribute in the 'xsp:attribute'
element. I don't know if this is possible, using the esql logicsheet.

any ideas?

Thank you,
Julien


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



Standalone Pipelines

2003-12-15 Thread Jeffrey Winter

I have been wading through the Cocoon documentation but
have been unable to answer a question:

Can Cocoon (or modules of it) be easily used outside of a 
servlet container?   

I like the generator, transformer, serializer paradigm, but
from what I can tell, these pipelines are triggered via an
HTTP request.  

Is it possible to define pipelines that are callable as 
stand-alone components from one's own context/container, etc.?

If someone could reference and example or a pointer into
the documentation that discusses this I would greatly
appreciate it.

Thanks

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



Re: XML serializer; handling characters outside the encoding

2003-12-15 Thread Christopher Painter-Wakefield




Never mind.  I just looked at the output with a different editor; it looks
like the characters are getting put in as entity references.  Not sure now
what is going on, I'll have to investigate further.  Perhaps my end user
can't handle US-ASCII, either  :(




|-+
| |   Christopher  |
| |   Painter-Wakefield|
| |   [EMAIL PROTECTED]|
| |   .edu|
| ||
| |   12/15/2003 10:28 |
| |   AM   |
| |   Please respond to|
| |   users|
| ||
|-+
  
--|
  |
  |
  |   To:   [EMAIL PROTECTED]  
|
  |   cc:  
  |
  |   Subject:  XML serializer; handling characters outside the encoding   
  |
  
--|








I have a data consumer who is pulling XML from our Cocoon webapp.  They
couldn't handle UTF-8 on their end, so I gave them the option to pull data
in US-ASCII encoding.  However, when I did that, symbol characters such as
Greek and math symbols got sent over even though they aren't in the
encoding.  When I saved a result from our system and opened it with XML
Spy, it complained about these characters.  On my consumer's end, it makes
his software blow up.  I'm not sure exactly how these characters are output
(I don't have a good byte-level editor), but I assume it is doing some kind
of double-character thing that creates bytes outside the range of defined
characters for the encoding, or something similar.

My question is, what should the behavior be when coping with characters
outside the encoding, and where does the responsibility lie?  My assumption
would be that the XML serializer should take characters outside the
encoding and turn them into entity references (#916; for greek delta, for
instance).  I am on C2.0.3, so maybe that has been done in a later release,
but if not, should it?  I am going to explore a change to the serializer
for just that purpose, but if it has already been done, I'd like to grab
the code for it.  I'm assuming you can use character entities in any
encoding, regardless of whether the characters thus specified have a code
in that encoding.

Thanks,
Christopher


-
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: Standalone Pipelines

2003-12-15 Thread Reinhard Poetz

From: Jeffrey Winter [mailto:[EMAIL PROTECTED] 

 
 I have been wading through the Cocoon documentation but
 have been unable to answer a question:
 
 Can Cocoon (or modules of it) be easily used outside of a 
 servlet container?   
 
 I like the generator, transformer, serializer paradigm, but 
 from what I can tell, these pipelines are triggered via an 
 HTTP request.  
 
 Is it possible to define pipelines that are callable as 
 stand-alone components from one's own context/container, etc.?
 
 If someone could reference and example or a pointer into
 the documentation that discusses this I would greatly appreciate it.

You can access Cocoon using the CocoonBean. Cocoon also offers a
CommandLineInterface
(http://wiki.cocoondev.org/Wiki.jsp?page=CommandLine) which uses the
CocoonBean (AFAIK there is no documentation for the CocoonBean available
except the comments in the sources)

--
Reinhard


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



Re: ESQL : creating dynamic elements ?

2003-12-15 Thread Christopher Painter-Wakefield




try this:

  xsp:logic
String s1 = junk;
String s2 = stuff;
  /xsp:logic
  xsp:element
xsp:param name=namexsp:exprs1/xsp:expr/xsp:param
xsp:attribute
  xsp:param name=namexsp:exprs
2/xsp:expr/xsp:param
/xsp:attribute
  /xsp:element

-Christopher



|-+
| |   julien bloit   |
| |   [EMAIL PROTECTED]|
| |   am.fr   |
| ||
| |   12/15/2003 10:30 |
| |   AM   |
| |   Please respond to|
| |   users|
| ||
|-+
  
--|
  |
  |
  |   To:   [EMAIL PROTECTED]
|
  |   cc:  
  |
  |   Subject:  ESQL : creating dynamic elements ? 
  |
  
--|




I'm building a database request using ESQL. Let's say I have a table with
two columns in the table i'm requesting. This is the xsp snippet I use to
get the results from the request :

esql:results
 esql:row-results
  first_table_col_1
esql:get-string column=1/
xsp:attribute name=first_table_col2
esql:get-string column=2/
/xsp:attribute
/first_table_col_1
/esql:row-results
/esql:results

This works, but as I want this code to be dynamic in order to be used with
other tables, I need my column element name (the currently static
first_table_col_1 element) to be created with the requested column
name.
The same logic would apply for the 'name' attribute in the 'xsp:attribute'
element. I don't know if this is possible, using the esql logicsheet.

any ideas?

Thank you,
Julien


-
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: Standalone Pipelines

2003-12-15 Thread Upayavira
Reinhard Poetz wrote:

From: Jeffrey Winter [mailto:[EMAIL PROTECTED] 

 

I have been wading through the Cocoon documentation but
have been unable to answer a question:
Can Cocoon (or modules of it) be easily used outside of a 
servlet container?   

I like the generator, transformer, serializer paradigm, but 
from what I can tell, these pipelines are triggered via an 
HTTP request.  

Is it possible to define pipelines that are callable as 
stand-alone components from one's own context/container, etc.?

If someone could reference and example or a pointer into
the documentation that discusses this I would greatly appreciate it.
   

You can access Cocoon using the CocoonBean. Cocoon also offers a
CommandLineInterface
(http://wiki.cocoondev.org/Wiki.jsp?page=CommandLine) 

or: http://cocoon.apache.org/2.1/userdocs/offline/index.html

which uses the
CocoonBean (AFAIK there is no documentation for the CocoonBean available
except the comments in the sources)
 

There are as yet no docs on the CocoonBean. Best place to look is in the 
org.apache.cocoon.Main class (the actual CLI), which is nothing more 
than a wrapper around the CocoonBean.

Upayavira



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


Re: ESQL : creating dynamic elements ?

2003-12-15 Thread julien bloit
It works perfectly as I wanted.

Thanks a lot Christopher!
Julien

- Original Message - 
From: Christopher Painter-Wakefield [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 15, 2003 5:01 PM
Subject: Re: ESQL : creating dynamic elements ?






 try this:

   xsp:logic
 String s1 = junk;
 String s2 = stuff;
   /xsp:logic
   xsp:element
 xsp:param name=namexsp:exprs1/xsp:expr/xsp:param
 xsp:attribute
   xsp:param name=namexsp:exprs
 2/xsp:expr/xsp:param
 /xsp:attribute
   /xsp:element

 -Christopher



 |-+
 | |   julien bloit   |
 | |   [EMAIL PROTECTED]|
 | |   am.fr   |
 | ||
 | |   12/15/2003 10:30 |
 | |   AM   |
 | |   Please respond to|
 | |   users|
 | ||
 |-+

---
---|
   |
|
   |   To:   [EMAIL PROTECTED]
|
   |   cc:
|
   |   Subject:  ESQL : creating dynamic elements ?
|

---
---|




 I'm building a database request using ESQL. Let's say I have a table with
 two columns in the table i'm requesting. This is the xsp snippet I use to
 get the results from the request :

 esql:results
  esql:row-results
   first_table_col_1
 esql:get-string column=1/
 xsp:attribute name=first_table_col2
 esql:get-string column=2/
 /xsp:attribute
 /first_table_col_1
 /esql:row-results
 /esql:results

 This works, but as I want this code to be dynamic in order to be used with
 other tables, I need my column element name (the currently static
 first_table_col_1 element) to be created with the requested column
 name.
 The same logic would apply for the 'name' attribute in the 'xsp:attribute'
 element. I don't know if this is possible, using the esql logicsheet.

 any ideas?

 Thank you,
 Julien


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



cocoon and svg rasteriser

2003-12-15 Thread Tsui, Alban
Title: cocoon and svg rasteriser





Hi


I am using cocoon 2.0.3. I have a transform to a xml file which contains a xlink to an cocoon pipeline for static images but it does not get rendered into jpeg.

image
xsl:attribute namespace=http://www.w3.org/1999/xlink name=xlink:hrefcocoon:///svgdiagram/xsl:value-of select=/page/extra/svgbackgroundimage//xsl:attribute

/image


So I have a pipeline for serving /svgdiagram/something.jpg but the above doesn't work... am I using cocoon:// correctly here?

Thanks
AT


This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you.




gzip compression

2003-12-15 Thread Carmona Perez, David
Hi all,

Does someone how can I make some action that activates compressing output data using 
GZip?  Gzip compression is an HTTP 1.1 standard feature.

Ideally it would be great if it could be like an action, so that it's easy to activate 
it on or off.
I have tried this code:

import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.zip.GZIPOutputStream;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;

import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.environment.http.HttpEnvironment;
import org.apache.cocoon.environment.http.HttpResponse;

public class CompressAction extends AbstractAction {
class StreamGzip extends ServletOutputStream {
public StreamGzip(OutputStream out) throws IOException {
gzip = new GZIPOutputStream(out);
}
/** @see java.io.OutputStream#write(int) */
public void write(int b) throws IOException {
gzip.write(b);
}
/** @see java.io.OutputStream#close() */
public void close() throws IOException {
gzip.close();
}
/** @see java.io.OutputStream#flush() */
public void flush() throws IOException {
gzip.flush();
}
private GZIPOutputStream gzip;
}
class GzipResponse extends HttpResponse {
GzipResponse(HttpServletResponse resp) throws IOException {
super(resp);
os = new StreamGzip(resp.getOutputStream());
}
public ServletOutputStream getOutputStream() throws IOException {
return os;
}
StreamGzip os;
}
public Map act(Redirector redirector, SourceResolver resolver, Map 
objectModel, String source, Parameters parameters) throws Exception {
Request pet = ObjectModelHelper.getRequest(objectModel);
String accept = pet.getHeader(Accept-Encoding);
if (accept != null  accept.indexOf(gzip) = 0) {
GzipResponse resp = new 
GzipResponse((HttpServletResponse)objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT));
resp.setHeader(Content-Encoding, gzip);
objectModel.put(ObjectModelHelper.RESPONSE_OBJECT, resp);
return EMPTY_MAP;
}
return null;
}
}

But it doesn't work, because the HttpEnvironment holds also holds a reference to the 
outputstream.
Which is the cleanest way to perform this?
Any suggestion will be greatly appreciated.



David


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



Re: gzip compression

2003-12-15 Thread Upayavira
If you use Apache in front of your servlet container, you could use 
mod_deflate, I believe. Really, HTTP compression of pages is not a job 
for Cocoon as such, but for the servlet container or front end server.

Upayavira

Carmona Perez, David wrote:

Hi all,

Does someone how can I make some action that activates compressing output data using GZip?  Gzip compression is an HTTP 1.1 standard feature.

Ideally it would be great if it could be like an action, so that it's easy to activate 
it on or off.
I have tried this code:
import java.io.IOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.zip.GZIPOutputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.environment.http.HttpEnvironment;
import org.apache.cocoon.environment.http.HttpResponse;
public class CompressAction extends AbstractAction {
class StreamGzip extends ServletOutputStream {
public StreamGzip(OutputStream out) throws IOException {
gzip = new GZIPOutputStream(out);
}
/** @see java.io.OutputStream#write(int) */
public void write(int b) throws IOException {
gzip.write(b);
}
/** @see java.io.OutputStream#close() */
public void close() throws IOException {
gzip.close();
}
/** @see java.io.OutputStream#flush() */
public void flush() throws IOException {
gzip.flush();
}
private GZIPOutputStream gzip;
}
class GzipResponse extends HttpResponse {
GzipResponse(HttpServletResponse resp) throws IOException {
super(resp);
os = new StreamGzip(resp.getOutputStream());
}
public ServletOutputStream getOutputStream() throws IOException {
return os;
}
StreamGzip os;
}
public Map act(Redirector redirector, SourceResolver resolver, Map 
objectModel, String source, Parameters parameters) throws Exception {
Request pet = ObjectModelHelper.getRequest(objectModel);
String accept = pet.getHeader(Accept-Encoding);
if (accept != null  accept.indexOf(gzip) = 0) {
GzipResponse resp = new 
GzipResponse((HttpServletResponse)objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT));
resp.setHeader(Content-Encoding, gzip);
objectModel.put(ObjectModelHelper.RESPONSE_OBJECT, resp);
return EMPTY_MAP;
}
return null;
}
}
But it doesn't work, because the HttpEnvironment holds also holds a reference to the 
outputstream.
Which is the cleanest way to perform this?
Any suggestion will be greatly appreciated.

David
-
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: gzip compression

2003-12-15 Thread Nicolas Toper
Apache could do that automatically...

Otherwise, I'd use Tomcat and a filter servlet to do it: you could find some
all ready to be used on the Web...
Le Lundi 15 Décembre 2003 18:46, Carmona Perez, David a écrit :
 Hi all,

 Does someone how can I make some action that activates compressing output
 data using GZip?  Gzip compression is an HTTP 1.1 standard feature.

 Ideally it would be great if it could be like an action, so that it's easy
 to activate it on or off. I have tried this code:

 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Map;
 import java.util.zip.GZIPOutputStream;

 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;

 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.acting.AbstractAction;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Redirector;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.environment.http.HttpEnvironment;
 import org.apache.cocoon.environment.http.HttpResponse;

 public class CompressAction extends AbstractAction {
   class StreamGzip extends ServletOutputStream {
   public StreamGzip(OutputStream out) throws IOException {
   gzip = new GZIPOutputStream(out);
   }
   /** @see java.io.OutputStream#write(int) */
   public void write(int b) throws IOException {
   gzip.write(b);
   }
   /** @see java.io.OutputStream#close() */
   public void close() throws IOException {
   gzip.close();
   }
   /** @see java.io.OutputStream#flush() */
   public void flush() throws IOException {
   gzip.flush();
   }
   private GZIPOutputStream gzip;
   }
   class GzipResponse extends HttpResponse {
   GzipResponse(HttpServletResponse resp) throws IOException {
   super(resp);
   os = new StreamGzip(resp.getOutputStream());
   }
   public ServletOutputStream getOutputStream() throws IOException {
   return os;
   }
   StreamGzip os;
   }
   public Map act(Redirector redirector, SourceResolver resolver, Map
 objectModel, String source, Parameters parameters) throws Exception {
 Request pet = ObjectModelHelper.getRequest(objectModel);
   String accept = pet.getHeader(Accept-Encoding);
   if (accept != null  accept.indexOf(gzip) = 0) {
   GzipResponse resp = new
 GzipResponse((HttpServletResponse)objectModel.get(HttpEnvironment.HTTP_RESP
ONSE_OBJECT)); resp.setHeader(Content-Encoding, gzip);
   objectModel.put(ObjectModelHelper.RESPONSE_OBJECT, resp);
   return EMPTY_MAP;
   }
   return null;
   }
 }

 But it doesn't work, because the HttpEnvironment holds also holds a
 reference to the outputstream. Which is the cleanest way to perform this?
 Any suggestion will be greatly appreciated.


 
 David


 -
 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: cocoon and svg rasteriser

2003-12-15 Thread Steve Schwarz
Hi,
Unless I'm missing something, it looks like you've got one too many / in 
your cocoon: statement. How's about:
cocoon://svgdiagram/

HTH,
Steve
I am using cocoon 2.0.3. I have a  transform to a xml file which contains a
xlink to an cocoon pipeline for static images but it does not get rendered
into jpeg.
image
xsl:attribute namespace=http://www.w3.org/1999/xlink;
name=xlink:hrefcocoon:///svgdiagram/xsl:value-of
select=/page/extra/svgbackgroundimage//xsl:attribute
/image
So I have a pipeline for serving /svgdiagram/something.jpg but the above
doesn't work... am I using cocoon:// correctly here?
_
Get holiday tips for festive fun. 
http://special.msn.com/network/happyholidays.armx

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


RE: cocoon and svg rasteriser

2003-12-15 Thread Tsui, Alban
Title: RE: cocoon and svg rasteriser





yeah I found that extra / but still it doesn't work, thanks.


I just wonder if I can resolve/expand this url:


 cocoon://svgdiagram/image.jpg


via java in my xsp to the full one...


 http://server:port/cocoon/svgdiagram/image.jpg


using come java call by passing in cocoon://svgdiagram/image.jpg as an argument?


Then I will have the full url in my xsl transform. It is because the rasteriser only works if that link is a full http url!

Cheers
AT



-Original Message-
From: Steve Schwarz [mailto:[EMAIL PROTECTED]]
Sent: 15 December 2003 18:11
To: [EMAIL PROTECTED]
Subject: RE: cocoon and svg rasteriser



Hi,
Unless I'm missing something, it looks like you've got one too many / in 
your cocoon: statement. How's about:
cocoon://svgdiagram/


HTH,
Steve



I am using cocoon 2.0.3. I have a transform to a xml file which contains a
xlink to an cocoon pipeline for static images but it does not get rendered
into jpeg.

image
xsl:attribute namespace=http://www.w3.org/1999/xlink
name=xlink:hrefcocoon:///svgdiagram/xsl:value-of
select=/page/extra/svgbackgroundimage//xsl:attribute
/image

So I have a pipeline for serving /svgdiagram/something.jpg but the above
doesn't work... am I using cocoon:// correctly here?


_
Get holiday tips for festive fun. 
http://special.msn.com/network/happyholidays.armx



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


This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you.




RE: cocoon and svg rasteriser

2003-12-15 Thread Steve Schwarz
Hi
Sorry I guess I did misunderstand your request.
A couple ideas:
- recently in the mail lists I seem to recall discussions about using source 
resolver to do this. But I'm not an XSP guy so I don't know how you go about 
accessing the source resolver w/in xsp...
- another post for this type of problem recommended putting your root dir in 
a config file and then using Xinclude to extract the root from the config 
file into the XSL.
- I have used a global site map variable named root and use the 
{global:root} to pass this into my XSLT.

HTH,
Steve
I just wonder if I can resolve/expand this url:

	cocoon://svgdiagram/image.jpg

via java in my xsp to the full one...

	http://server:port/cocoon/svgdiagram/image.jpg;

using come java call by passing in cocoon://svgdiagram/image.jpg as an
argument?
Then I will have the full url in my xsl transform. It is because the
rasteriser only works if that link is a full http url!
_
Cell phone ‘switch’ rules are taking effect — find out more here. 
http://special.msn.com/msnbc/consumeradvocate.armx

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


Re: How to obtain db connection from pool ?

2003-12-15 Thread Marcin Okraszewski
Hi,
And how about obtaining it outside a flow? How to get the instance of 
the component selector that I could run something similar to 
cocoon.getComponent() from the example below?

Regards,
Marcin Okraszewski
Suggested using flowscript, then try sth like this:

try {
var dbSelector = 
cocoon.getComponent(Packages.org.apache.avalon.excalibur.datasource.DataSourceComponent.ROLE 
+ Selector);
var dataSrc = dbSelector.select(your counnection);
conn = dataSrc.getConnection();

  // your stuff
}
catch (e) {
e.toString();
}
finally {
if (conn != null) {
conn.close();
conn = null;
}
if (dbSelector != null) {
cocoon.releaseComponent(dbSelector);
dbSelector = null;
}
}
But if you write Avalon Component, just look at database actions sources.

Regards

-
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: How to obtain db connection from pool ?

2003-12-15 Thread Mariusz Sieraczkiewicz
There are two possibities I know:
1) flowscript
2) Avalon Component.

Please give some context. I guess the flowscript is the easiest
solution, I've adopted it from the code of database action, and it
looks almost the same (but written in javascript instead of java).
Because Cocoon is Avalon based I dont think there's other (non-Avalon)
possibility to achieve what you asked. Flowscript gives you access to
some Cocoon Avalon Components, which you can make use of mixing with
your own java components (not necesserily Avalon Components). I did so
and it works.

Regards Mariusz Sieraczkiewicz.

BTW It's very funny to write in English to Polish folk ;-)

On Mon, 2003-12-15 at 23:24, Marcin Okraszewski wrote:
 Hi,
 And how about obtaining it outside a flow? How to get the instance of 
 the component selector that I could run something similar to 
 cocoon.getComponent() from the example below?
 
 Regards,
 Marcin Okraszewski
 
  Suggested using flowscript, then try sth like this:
  
  try {
  var dbSelector = 
  cocoon.getComponent(Packages.org.apache.avalon.excalibur.datasource.DataSourceComponent.ROLE
   
  + Selector);
  var dataSrc = dbSelector.select(your counnection);
  conn = dataSrc.getConnection();
  
// your stuff
  }
  catch (e) {
  e.toString();
  }
  finally {
  if (conn != null) {
  conn.close();
  conn = null;
  }
  
  if (dbSelector != null) {
  cocoon.releaseComponent(dbSelector);
  dbSelector = null;
  }
  }
  
  But if you write Avalon Component, just look at database actions sources.
  
  Regards
  
  -
  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: [Woody] Styling textarea

2003-12-15 Thread Antonio Gallardo
OK, the answer is yes. We can. :-D

Best Regards,

Antonio Gallardo

Antonio Gallardo dijo:
 Hi:

 Can we define more attributes for styling the widget in the sample?

 Sample:

 wt:widget id=pit_prinProd
   wi:styling type=textarea/
 /wt:widget

 We need to define the size of the textarea. Is posible?

 In HTML 4.01 the textareas, allow the use of rows and cols attributes
 to define the size of the textarea:

 http://www.w3.org/TR/html401/interact/forms.html#h-17.7

 Best Regards,

 Antonio Gallardo

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