RE: multiple submit button on a form

2002-04-03 Thread Chris Newland

Hi Raul,

The HTML input type submit supports the name attribute so you can just
name your buttons differently:

input type=submit value=option1 name=one/
input type=submit value=option2 name=two/

The button that was pressed will have the button text as its value so you
can test in this way.

variable one will have value option1 if it was pressed
variable two will have value option2 if it was pressed

(Sorry not sure of the sitemap syntax for this)

Hope this helps,

Regards,

Chris


 -Original Message-
 From: Fiedler, Raul [mailto:[EMAIL PROTECTED]]
 Sent: 03 April 2002 13:44
 To: '[EMAIL PROTECTED]'
 Subject: multiple submit button on a form


 Hi

 I have a HTML form with fields. In order to process the fields in 2
 different ways I need 2 submit buttons.
 How can one assign different actions to the 2 buttons.

 Ultimately I want to have 2 pipelines.

 Can it be done with:
 HTML form
 input type=submit value=option1/
 input type=submit value=option2/


 sitemap
 map:select
 map:parameter name=parameter-selector-test value=value/
 map:when test=option1
   map:redirect-to uri=/cocoon/optioin1/
 /map:when
 map:otherwise
   map:redirect-to uri=/cocoon/optioin2/
 /map:otherwise
 /map:select

 thanks

  Raul Fiedler
  European Central Bank
  DG Information Systems - Business Development
  *   +49 (0) 69 1344 6870
  * [EMAIL PROTECTED]
 

 Any e-mail message from the European Central Bank (ECB) is sent
 in good faith but shall neither be binding nor construed as
 constituting a commitment by the ECB except where provided for in
 a written agreement.
 This e-mail is intended only for the use of the recipient(s)
 named above. Any unauthorised disclosure, use or dissemination,
 either in whole or in part, is prohibited.
 If you have received this e-mail in error, please notify the
 sender immediately via e-mail and delete this e-mail from your system.


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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





-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Update on my problem

2002-03-28 Thread Chris Newland

Hi,

In my root.log file I have

DEBUG   (2002-03-26) 15:17.37:230   [root] (Unknown-URI)
Unknown-thread/Coco
onServlet: Trying to load class: org.gjt.mm.mysql.Driver

Thats the only log file reference I get to my DB driver and I have no
problems with DB pooling.

I'm using Cocoon 2.0 final, Tomcat 4.0 final, JDK1.3.1_01 but it looks like
you're pushing the envelope when it comes to latest versions ;)

Have you had DB pooling working with earlier versions of Cocoon / Tomcat /
JDK?

Does your exception occur when Cocoon tries to start, or when the XSP page
is accessed?

Can you post a snippet of your XSP page?

Thanks,

Chris


 -Original Message-
 From: Jeremy Beeler [mailto:[EMAIL PROTECTED]]
 Sent: 28 March 2002 17:08
 To: [EMAIL PROTECTED]
 Subject: Re: Update on my problem


 yes and in my access log it says trying to load and the driver
 name. i don't
 know if this means it failed or it loaded ok. is there any way to
 tell if it
 is loaded ok? and if it is loaded ok does the pool know to use that driver
 by default?

 thanks for your help.

 Jeremy

 - Original Message -
 From: Chris Newland [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, March 28, 2002 11:28 AM
 Subject: RE: Update on my problem


  Hi Jeremy,
 
  Have you added your database driver info to your WEB-INF/web.xml file?
 
  -
  cocoon.xconf:
  -
 
  datasources
  jdbc name=tester
  pool-controller min=5 max=10/
  dburljdbc:mysql://localhost:3306/tester/dburl
  auto-committrue/auto-commit
  userlogin/user
  passwordpass/password
  /jdbc
  /datasources
 
  
  WEB-INF/web.xml:
  
 
  !--
This parameter is used to list classes that should be loaded
at initialization time of the servlet.
Usually this classes are JDBC Drivers used
  --
  init-param
param-nameload-class/param-name
param-value
  !-- For IBM WebSphere:
  com.ibm.servlet.classloader.Handler --
 
  !-- For Database Driver: --
  org.gjt.mm.mysql.Driver
/param-value
  /init-param
 
 
  Hope this helps,
 
  Regards,
 
  Chris
 
 
  -Original Message-
  From: Jeremy Beeler [mailto:[EMAIL PROTECTED]]
  Sent: 28 March 2002 16:14
  To: [EMAIL PROTECTED]
  Subject: Update on my problem
 
 
  I am using j2sdk1.4.0, tomcat 4.0.4b2LE, mm.mysql-2.0.11 or
 mm.mysql-2.0.7
  (tried both), and cocoon 2.0.3-dev.
 
  Update on my problem:
 
  I can query the database now by instantiating a connection in
 my xsp app.
  however, the app that i am writing needs to use the pooling capabilities
 to
  handle simultaneous access to the DB. does anyone know how to
 get this to
  work??? i tried creating the pool with a driver tag in my cocoon.xconf
 but
  that still generates the exception (NoValidConnectionException: No valid
  JdbcConnection class available)
 
  this is my code:
 
  datasources
  jdbc name=tester
  driverorg.gjt.mm.mysql.Driver/driver
  pool-controller min=5 max=10/
  dburljdbc:mysql://localhost:3306/tester/dburl
  auto-committrue/auto-commit
  userlogin/user
  passwordpass/password
  /jdbc
  /datasources
 
  does anyone know if there is a mechanism that allows you to specify the
  driver for a pool in the cocoon.xconf?
 
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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





-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Update on my problem

2002-03-28 Thread Chris Newland

Hi Jeremy,

Your XSP page looks fine to me and if it is working without pooling then I'm
starting to think that a bug may have been introduced into the latest
database code.

My best suggestion would be to download the latest release version of Cocoon
(2.0.2) and try your XSP page on that. Also, double check your cocoon.xconf
and web.xml for typos. Maybe check that MySQL is running and do
mysqladmin -version to get the query count to see if any queries are making
it to the DB.

Best Regards,

Chris



 -Original Message-
 From: Jeremy Beeler [mailto:[EMAIL PROTECTED]]
 Sent: 28 March 2002 18:12
 To: [EMAIL PROTECTED]
 Subject: Re: Update on my problem


 Chris,
 Thanks again for all the help.

 trust me, i'm not pushing the envelope by design, it's just these are the
 versions that i've gotten the farthest with in terms of getting things
 working.
 i've never had db pooling working, in fact this past week or so
 has been my
 first venture into cocoon for any other use than classroom theory.
 the exception is generated when i try to run my test.xsp. cocoon
 loads fine
 otherwise.

 here is my code from the test.xsp

 ?xml version=1.0 encoding=ISO-8859-1?
 xsp:page language=java xmlns:xsp=http://apache.org/xsp;
 xmlns:esql=http://apache.org/cocoon/SQL/v2;
 page
 titleA Database Driven XSP Page to Test/title
 content
 esql:connection
 !--if the pool is commented out and the non-pooled instantiation
 is used it
 works fine--
 esql:pooltester/esql:pool

 !--this is commented out. if left in and pool is commented out this works
 fine
 esql:driverorg.gjt.mm.mysql.Driver/esql:driver
 esql:dburljdbc:mysql://localhost:3306/tester/esql:dburl
 esql:usernamelogin/esql:username
 esql:passwordpass/esql:password
 --

 esql:execute-query
 esql:queryselect * from operator/esql:query
 esql:results
 esql:row-results
 para
 esql:get-string column=Name/
 /para
 esql:get-columns/
 /esql:row-results
/esql:results
 /esql:execute-query
 /esql:connection
 /content
 /page
 /xsp:page

 For some reason when using the pool it will throw that exception, but if i
 just instantiate a connection in the xsp if generates the desired output
 just fine. the only problem is, i really need to use pooling.

 thanks again.

 Jeremy

 - Original Message -
 From: Chris Newland [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, March 28, 2002 12:39 PM
 Subject: RE: Update on my problem


  Hi,
 
  In my root.log file I have
 
  DEBUG   (2002-03-26) 15:17.37:230   [root] (Unknown-URI)
  Unknown-thread/Coco
  onServlet: Trying to load class: org.gjt.mm.mysql.Driver
 
  Thats the only log file reference I get to my DB driver and I have no
  problems with DB pooling.
 
  I'm using Cocoon 2.0 final, Tomcat 4.0 final, JDK1.3.1_01 but it looks
 like
  you're pushing the envelope when it comes to latest versions ;)
 
  Have you had DB pooling working with earlier versions of Cocoon
 / Tomcat /
  JDK?
 
  Does your exception occur when Cocoon tries to start, or when
 the XSP page
  is accessed?
 
  Can you post a snippet of your XSP page?
 
  Thanks,
 
  Chris
 
 
   -Original Message-
   From: Jeremy Beeler [mailto:[EMAIL PROTECTED]]
   Sent: 28 March 2002 17:08
   To: [EMAIL PROTECTED]
   Subject: Re: Update on my problem
  
  
   yes and in my access log it says trying to load and the driver
   name. i don't
   know if this means it failed or it loaded ok. is there any way to
   tell if it
   is loaded ok? and if it is loaded ok does the pool know to use that
 driver
   by default?
  
   thanks for your help.
  
   Jeremy
  
   - Original Message -
   From: Chris Newland [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Thursday, March 28, 2002 11:28 AM
   Subject: RE: Update on my problem
  
  
Hi Jeremy,
   
Have you added your database driver info to your
 WEB-INF/web.xml file?
   
-
cocoon.xconf:
-
   
datasources
jdbc name=tester
pool-controller min=5 max=10/
dburljdbc:mysql://localhost:3306/tester/dburl
auto-committrue/auto-commit
userlogin/user
passwordpass/password
/jdbc
/datasources
   

WEB-INF/web.xml:

   
!--
  This parameter is used to list classes that should be loaded
  at initialization time of the servlet.
  Usually this classes are JDBC Drivers used
--
init-param
  param-nameload-class/param-name
  param-value
!-- For IBM WebSphere:
com.ibm.servlet.classloader.Handler --
   
!-- For Database Driver: --
org.gjt.mm.mysql.Driver
  /param-value
/init-param
   
   
Hope this helps,
   
Regards,
   
Chris
   
   
-Original Message-
From: Jeremy Beeler [mailto:[EMAIL PROTECTED]]
Sent: 28 March 2002 16:14

RE: Src vs bin download

2002-03-27 Thread Chris Newland

Hi Peter,

As far as I know, the .tar.gz and the .zip files have exactly the same
content. I always choose the .tar.gz and Cocoon works fine in Linux and
Windows.

The reason why the .tar.gz is smaller is that the files are tarred together
first to create one large file which is then gzipped. In the zip, each file
is zipped seperately and then stored in a single zip file.

The larger tar file has higher data entropy than the individual files in the
zip and so can be compressed to a greater degree.

If you are using Windows and you have a decompresser for gzipped tar files
(e.g. WinZip) then you'll save some download time by choosing the .tar.gz

Hope this helps,

Regards

Chris

 -Original Message-
 From: Peter Robins [mailto:[EMAIL PROTECTED]]
 Sent: 27 March 2002 10:22
 To: [EMAIL PROTECTED]
 Subject: Src vs bin download


 As I'm not really interested in the actual sources, I would
 normally download
 the bin file. However, is it still the case that if I want a cutdown core
 installation I'm better off getting the src and running the build
 routine?
 With the distribution file getting ever bigger, on my slow connection,
 downloading 17MB is a lengthy procedure and I prefer not to have to do it
 twice!

 Do the tar.gz and zip files have the same content? Seems strange
 that the zip
 file is so much larger.

 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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





-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: SVG Transparency

2002-03-18 Thread Chris Newland

http://www.w3.org/TR/SVG/masking.html

HTH,

Chris

 -Original Message-
 From: Michael Zehrer [mailto:[EMAIL PROTECTED]]
 Sent: 18 March 2002 15:24
 To: Cocoon-Users (E-Mail)
 Subject: SVG Transparency
 
 
 Hi list,
 
 maybe a little offtopic, but how can I have svg images with transparent
 background in Cocoon?
 
 Cheers, Michael
 
 
 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: File mode cause of sitemap not available problems?

2002-02-04 Thread Chris Newland

Hi Peter,

Are you using any of the Cocoon 2 functionality that requires an X server
(SVG for example)? If not then you can run Cocoon 2 without any X server
running (although you will need to comment out the SVG serializer from the
sitemap so that it does not get loaded).

If you do need an X server running, have you tried using a 3rd party X
server instead of the Operating System's X server (I use Xvfb running on a
restricted user account).

I've just seen your 2nd message and your configuration is the same as mine
so the above should work OK for you. If not, mail me and I can send you the
relevant parts of my config.

Hope this helps,

Regards,

Chris

-Original Message-
From: Baer Peter [mailto:[EMAIL PROTECTED]]
Sent: 04 February 2002 07:58
To: [EMAIL PROTECTED]
Subject: File mode cause of sitemap not available problems?


Hi there,

quite a few people on this list report a problem for which we found
a (insufficient, dangerous) workaround. Maybe it helps some of you, too.
Before you read on, please, note that this is *not* a good solution
*for production* systems.

 DANGEROUS
In our case, the solution was to start the X session as
superuser. Then we start Tomcat, and -- voila -- C2 works as
expected!
DANGEROUS

Of course, we tried all the things suggested on this list, first. But:
No, it wasn't sufficient to start the X session as a normal user, then
becoming root with su -. This doesn't work in our environment. And no,
xhost +localhost, xhost + and xhost +root didn't help, either. Nor does
it help when we start Tomcat as superuser from the Linux console. It
only works if we do it form an xterm window within an X11 session owned
by root. And when we started the X session as a normal user, the DISPLAY
variable was set to :0.0.

We don't understand this, and we feel that this has severe security
implications. Normally you would rather never start an X session
being root.

We sincerely hope that someone has a better solution, and if so,
we *plea*: Please, let the rest of us participate in your knowledge! ;-)

Maybe the problem is caused by the file modes put on Tomcat or Cocoon
files. However, this appears to have changed. With Cocoon 1.8.2 we
didn't have that sort of problem. Or maybe, we ran into a chain of
mis-interpretations, here. Please, let us know!

Best regards!
--
+---+-+
|mailto:[EMAIL PROTECTED]   |
+-+


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Cocoon2 Cookie Recipe?

2001-12-07 Thread Chris Newland

Hi Liam,

Yes you can write an action to set a cookie and have the sitemap determine
when to call the action.

I use an action that sets a cookie according to request parameters.

This code should do the trick, just fill in the blanks:

---
import java.util.Map;
import java.util.HashMap;
import java.util.Enumeration;

import org.apache.avalon.framework.component.Component;
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.Constants;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.SourceResolver;

import org.apache.cocoon.components.language.markup.xsp.XSPCookieHelper;

public class StoreCookieAction extends AbstractAction
{

public Map act(Redirector redirector, SourceResolver resolver, Map
objectModel, String src, Parameters par)
throws Exception
{

Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);

String remember_user = request.getParameter(remember);

if (remember_user != null  remember_user.equals(on))
{

String value = ;

String name = ;

String comment = ;

String domain = ;

int maxage = ;

String path = ;

String secure = ;

int version = ;

XSPCookieHelper.addCookie(objectModel, name, value, comment, 
domain,
maxage, path, secure, version);

}

return new HashMap();
}
}



Hope this helps,

Best Regards,

Chris

-Original Message-
From: Liam Morley [mailto:[EMAIL PROTECTED]]
Sent: 06 December 2001 23:45
To: [EMAIL PROTECTED]
Subject: RE: Cocoon2 Cookie Recipe?


And if you're not using XSP, what then? Is it possible to set cookies
within the sitemap/XSL, using a Java Cocoon action?

Liam Morley


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




Re: redirect

2001-09-27 Thread Chris Newland

Hi Luda,

You don't need to use redirects in Cocoon 2, you can do username and password 
authentication using actions.
This way you don't even need to write esql tags yourself.

The DatabaseAuthenticatorAction is the best one to use.

Make sure it is mapped in your sitemap's map:actions section:
map:actions
map:action name=authenticate 
src=org.apache.cocoon.acting.DatabaseAuthenticatorAction/
...
/map:actions

Then you can use a match section like:

!-- 
This matcher authenticates the user.
==--
map:match pattern=page_after_login !-- the form action is 'page_after_login' --

!-- use the authenticate action to validate user login --
map:act type=authenticate
!-- Name the descriptor file that describes the database columns to 
compare --
map:parameter name=descriptor value=context://auth.xml/

!-- if the authenticate action succeeds then this section is executed 
--
map:generate type=serverpages src=page_after_login.xsp/
map:transform src=page2html.xsl/
map:serialize/
/map:act

!-- if the authenticate action fails then this section is executed --
map:generate type=serverpages src=login_failure.xsp/
map:transform src=page2html.xsl/
map:serialize/

/map:match

The auth.xml file that describes the database columns to compare will look something 
like:

?xml version=1.0?

auth
  connectionmy_connection/connection
  table name=enduser
select dbcol=username request-param=username/
select dbcol=password request-param=password/
  /table
/auth

You'll need to adjust the paths in the above sitemap example to suit your webapp 
structure.

Hope this helps,

Best Regards,

Chris




On Wednesday 26 September 2001 19:19, Luda Balakireva wrote:
 I am rewriting web application from coldfusion  to cocoon 2 -XSP .
 I am trying to undestand how to control flow - redirects from sitemap.
 I have login form where user inputs username and password ,so I submit it
 to another page
 where I perform sql (via esql tags),depends on results of sql I want to
 redirect user to diferent pages.
 Since response object does not work,
 Could you give me example how to do it (what to put in XSP page and
 siteMap) , Thank you.


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




programatically examine columns in a row

2001-09-17 Thread Chris Newland

Hi All,

I'm looking for a generic way to examine the columns in a row retrieved using esql:

esql:results
xsp:logic
int cols = esql:get-column-count/;
String colname;
/xsp:logic

esql:row-results
xsp:logic
for (int i = 0; i lt; cols; i++)
{
colname = esql:get-column-namexsp:attribute 
name=columnxsp:expri/xsp:expr/xsp:attribute/esql:get-column-name;   
  
}
/xsp:logic
/esql:row-results
/esql:results

but this throws an exception: No method matching getColumnName() found in interface 
java.sql.ResultSetMetaData. (i.e. the column attribute is not being picked up)

Is it possible to add attributes to a logicsheet tag? I don't think it is but I can't 
think of another way of passing the parameter to the get-column-name tag.

Is this possible?

Thanks,

Best Regards,

Chris


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




Re: programatically examine columns in a row

2001-09-17 Thread Chris Newland

Hi Klaus,

Sorry, I should have explained it better. I want to examine the column values 
and only produce XML for column names that have a certain value.

Each row in my table has columns of type bool and I want to only display the 
names of columns where the value is 1 (true).

Do you know of a way to do this?

Thanks,

Chris

On Monday 17 September 2001 18:05, Klaus Bertram wrote:
 Hi Chris,

 try it with esql:get-columns/

 like these
 esql:row-results
   esql:get-columns/
 /esql:row-results

 the result in xsp is like these:

 colname1value/colname1colname2value/colname2...
 at your xsl you can separate it for colname and value

 Klaus

  -Original Message-
  From: Chris Newland [mailto:[EMAIL PROTECTED]]
  Sent: Monday, September 17, 2001 8:43 PM
  To: [EMAIL PROTECTED]
  Subject: programatically examine columns in a row
 
 
  Hi All,
 
  I'm looking for a generic way to examine the columns in a row
  retrieved using esql:
 
  esql:results
  xsp:logic
  int cols = esql:get-column-count/;
  String colname;
  /xsp:logic
 
  esql:row-results
  xsp:logic
  for (int i = 0; i lt; cols; i++)
  {
  colname =
  esql:get-column-namexsp:attribute
  name=columnxsp:expri/xsp:expr/xsp:attribute/esql:get-col
  umn-name;
 
  }
  /xsp:logic
  /esql:row-results
  /esql:results
 
  but this throws an exception: No method matching getColumnName()
  found in interface java.sql.ResultSetMetaData. (i.e. the column
  attribute is not being picked up)
 
  Is it possible to add attributes to a logicsheet tag? I don't
  think it is but I can't think of another way of passing the
  parameter to the get-column-name tag.
 
  Is this possible?
 
  Thanks,
 
  Best Regards,
 
  Chris
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




Re: programatically examine columns in a row

2001-09-17 Thread Chris Newland

Hi Klaus

Realised this is not sensible thing to do so I passed the whole result set to 
the stylesheet and used XSL to filter the output.

Thanks for the suggestion,

Chris


On Monday 17 September 2001 19:06, Chris Newland wrote:
 Hi Klaus,

 Sorry, I should have explained it better. I want to examine the column
 values and only produce XML for column names that have a certain value.

 Each row in my table has columns of type bool and I want to only display
 the names of columns where the value is 1 (true).

 Do you know of a way to do this?

 Thanks,

 Chris

 On Monday 17 September 2001 18:05, Klaus Bertram wrote:
  Hi Chris,
 
  try it with esql:get-columns/
 
  like these
  esql:row-results
  esql:get-columns/
  /esql:row-results
 
  the result in xsp is like these:
 
  colname1value/colname1colname2value/colname2...
  at your xsl you can separate it for colname and value
 
  Klaus
 
   -Original Message-
   From: Chris Newland [mailto:[EMAIL PROTECTED]]
   Sent: Monday, September 17, 2001 8:43 PM
   To: [EMAIL PROTECTED]
   Subject: programatically examine columns in a row
  
  
   Hi All,
  
   I'm looking for a generic way to examine the columns in a row
   retrieved using esql:
  
   esql:results
 xsp:logic
 int cols = esql:get-column-count/;
 String colname;
 /xsp:logic
  
 esql:row-results
 xsp:logic
 for (int i = 0; i lt; cols; i++)
 {
 colname =
   esql:get-column-namexsp:attribute
   name=columnxsp:expri/xsp:expr/xsp:attribute/esql:get-col
   umn-name;
  
 }
 /xsp:logic
 /esql:row-results
   /esql:results
  
   but this throws an exception: No method matching getColumnName()
   found in interface java.sql.ResultSetMetaData. (i.e. the column
   attribute is not being picked up)
  
   Is it possible to add attributes to a logicsheet tag? I don't
   think it is but I can't think of another way of passing the
   parameter to the get-column-name tag.
  
   Is this possible?
  
   Thanks,
  
   Best Regards,
  
   Chris
  
  
   -
   Please check that your question has not already been answered in the
   FAQ before posting. http://xml.apache.org/cocoon/faqs.html
  
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]

 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: xmlns:util

2001-09-06 Thread Chris Newland

Hi All,

The util logicsheet still doesn't work in Cocoon2b2 (from CVS). Is this
still a valid way to insert a String containing XML into the document as SAX
events? i.e. should I try and fix it or is there a better way to do this?

(I'm using namespace xmlns:util=http://apache.org/xsp/util/2.0;)

Thanks,

Chris

 -Original Message-
 From: franck delarue [mailto:[EMAIL PROTECTED]]
 Sent: 06 July 2001 10:34
 To: cocoon
 Subject: xmlns:util


 hi everyone,
 i'm using cocoon2 on linux and i'm trying to use the
 util:include-expr tag, but when I just declare the
 namespace :
 xmlns:util=http://www.apache.org/1999/XSP/Util;
 in my xsp page, which is very simple (the most).
 Cocoon2 throws me an error :

org.apache.cocoon.ProcessingException: Language

 Exception:org.apache.cocoon.components.language.Languag
eException: Error compiling service_xsp:
  Line 94, column 75: '}' expected.


 ? do i have the wrong adress of the namespace ? is it
 still possible to use the tags util with cocoon2 ?

 thanks in advance.


 =
 _____    \
  \  |\   /|   \
 F R A N C K D E L A R U E  \  \\_//
 /  + - + - + - + - + - + - +  /   \
 //_/ \   /
  \_/

 ___
 Do You Yahoo!? -- Pour faire vos courses sur le Net,
 Yahoo! Shopping : http://fr.shopping.yahoo.com

 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: DatabaseXActions

2001-09-06 Thread Chris Newland

Hi Mario,

You are completely right!

I'd forgotton that the form validation action could substitute default
values for missing form parameters. In that case there is no need to add
support for nullable and default descriptor attributes in
AbstractDatabaseAction.

I'll still submit a patch to AbstractDatabaseAction that allows request
attributes to override request parameters since this allows an intermediate
action to be placed between form-validation and database action that can
manipulate the form parameters and store the updated values in attributes.

Thanks for pointing this out,

Chris

 -Original Message-
 From: Mario Muja [mailto:[EMAIL PROTECTED]]
 Sent: 06 September 2001 15:24
 To: [EMAIL PROTECTED]
 Cc: Cocoon Dev
 Subject: Re: DatabaseXActions


 Hi Chris,
 when I have a form validation descriptor to validate parameters, which
 are later stored in database columns, then I do not like to put the same
 rules into the form validation descriptor and also in the database
 descriptor.

 I like to have all validation rules in one descriptor. I think, the
 right place for this is the form validation descriptor because then you
 can validate parameters, which are not stored in a database. It think,
 this is the reason, why no validation attributes like nullable and
 default have been included in the database descriptor file.

 So, why do you not simply use the form validation descriptor for the
 Nullable and Default validations? This is, what it has been created for,
 or not?

 Regards, Mario


 Chris Newland wrote:

 Hi Mario,
 
 I can't see how this conflicts. I would imagine that people
 would be using
 different descriptor files for form validation and database manipulation
 wouldn't they?
 
 A form validation descriptor is about parameter constraint
 validation, the
 database action descriptor is about manipulating database columns. These
 seem like separate concerns to me?
 
 imho: I would not expect a developer to use the same descriptor file for
 form validation actions and database actions in their sitemap.
 
 Perhaps I've made too big an assumption?
 
 I'm trying to add a little more power to the database action
 descriptor to
 support the notion of nullable columns and default values for missing
 parameters / attributes (e.g. The IE browser omits parameters
 for checkboxes
 that aren't ticked but I want an 'N' in my database)
 
 Could some other people comment on this issue so I can get an idea about
 whether my fixes are a good thing ?
 
 Best Regards,
 
 Chris
 
 ps. Sorry for the duplicate posts earlier, having a major ISP
 headache today
 :(
 
 -Original Message-
 From: Mario Muja [mailto:[EMAIL PROTECTED]]
 Sent: 06 September 2001 14:24
 To: [EMAIL PROTECTED]
 Cc: Cocoon Dev
 Subject: Re: DatabaseXActions
 
 
 Hi Chris,
 sorry for interrupting your discussion with Andrew. You wrote:
 
 nullable attribute in the AbstractDatabaseAction descriptor
 default attribute in the AbstractDatabaseAction descriptor
 Does this not conflict with the Form Validation descriptor, which also
 includes nullable and default attributes?
 
 Regards, Mario
 
 
 
 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: DatabaseXActions

2001-09-06 Thread Chris Newland

Hi Mario,

I am using 3 nested actions in my sitemap:

action1: form validation and substitution of default value for missing
non-nullable parameters

action2: request parameter manipulation (new values are saved into request
attributes since there is no setParameter() method on the Request object).
An example of this is a checkbox parameter with the value on could be
converted into 'Y' and stored in a 1 char DB column.

action3: DatabaseAddAction (I've modified the AbstractDatabaseAction to take
values from request attributes in preference to request parameters)

For any changes I make I use cvs diff -u to create a patch and then attach
it to an email to cocoon-dev. This seems to be the preferred submission
method. I'm not one of the core development team, I'm just trying to fix the
bits that I need to use.

Regards,

Chris

-Original Message-
From: Mario Muja [mailto:[EMAIL PROTECTED]]
Sent: 06 September 2001 16:12
To: [EMAIL PROTECTED]
Cc: Cocoon Dev
Subject: Re: DatabaseXActions


Hi Chris,
1. how does this intermediate request attribute over request param work in
practice? I mean, how does your code / sitemap look like, when you use this
feature?

2. To whom do you forward your patch for AbstractDatabaseAction? Or do you
have permissions to write to the CVS tree? I ask this to find out, to whom I
shall send my own improvements of the code or documentation.

Best Regards,
Mario




-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Re[2]: DatabaseXActions

2001-09-06 Thread Chris Newland

Hi Andrew,

I'm working with the latest Cocoon2b2 code from CVS.

I've added support in AbstractDatabaseAction for:

request attributes overriding request parameters
nullable attribute in the AbstractDatabaseAction descriptor
default attribute in the AbstractDatabaseAction descriptor

I'll be submitting diffs today (if I can, my ISP is bad today :( )

Having said that, these are only fixes. Christian Haul is working on a new
architecture for this problem so I'm not sure if my diffs will make it into
the codebase. If your not happy applying diffs I can send you the patched
classes.

Regards,

Chris

 -Original Message-
 From: Andrew Answer [mailto:[EMAIL PROTECTED]]
 Sent: 06 September 2001 11:43
 To: Chris Newland
 Subject: Re[2]: DatabaseXActions


 Hello Chris,

 if you can send me your sources/patches, i will be very happy.
 I'm not java-spec, while only try :)

 What version on C2 you change?

 I described on cocoon-dev mailing list and can send your sources to
 developers. Or if you subscribed too, you can do it.
 I think what this changes are very important.
 Date/time requests is common task for any sites and i wonder why this
 task can't decided earlier.

 Wednesday, September 05, 2001, 8:31:15 PM, you wrote:

  Hi Andrew,

  I'm currently modifying the DatabaseAdd|Delete|UpdateAction actions to
  allow request parameters to be overriden with request attributes.

  This will allow me to pass my form data through another action which
  manipulates the values and sets them in request attributes before the
  DatabaseAddAction adds them into the database.

  Regards,

  Chris

  -Original Message-
  From: Andrew Answer [mailto:[EMAIL PROTECTED]]
  Sent: 05 September 2001 14:20
  To: [EMAIL PROTECTED]
  Subject: DatabaseXActions
 
 
  Hello cocoon-users,
 
i read thread named Action to modify request parameters and want
to ask another questions.
 
 
1. I try to use DatabaseAddAction for getting form data. In
descriptor file i setup column type as timestamp
value param=datetime dbcol=fdatetime type=time-stamp/.
How to set request parameter on NOW + 1 hour (for example)?
I can get integer or string values from form through request
parameters, but can't get timestamp.
util:time format=.../ not work because of this is a string
instead of date.
xsp:logicrequest.setAttribute(date,new Date());/xsp:logic not
work because DatabaseAddAction read real parameters only, not
attributes (as i understand).
Now i use Hsqldb and not need to convert Java datatypes into
another. This actions work without converting types?
 
2. Anybody use DatabaseSelectAction? How it work? It present into my
version (xml-cocoon2_20010831101539.tar.gz) of C2. When i use other
database actions, i call cocoon-action through pressing button.
How to run DatabaseSelectAction automatically when i open page?
 
  --
  Best regards,
   Andrew  mailto:[EMAIL PROTECTED]
 
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 





 --
 Best regards,
  Andrewmailto:[EMAIL PROTECTED]



 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: DatabaseXActions

2001-09-06 Thread Chris Newland

Hi Mario,

I can't see how this conflicts. I would imagine that people would be using
different descriptor files for form validation and database manipulation
wouldn't they?

A form validation descriptor is about parameter constraint validation, the
database action descriptor is about manipulating database columns. These
seem like separate concerns to me?

imho: I would not expect a developer to use the same descriptor file for
form validation actions and database actions in their sitemap.

Perhaps I've made too big an assumption?

I'm trying to add a little more power to the database action descriptor to
support the notion of nullable columns and default values for missing
parameters / attributes (e.g. The IE browser omits parameters for checkboxes
that aren't ticked but I want an 'N' in my database)

Could some other people comment on this issue so I can get an idea about
whether my fixes are a good thing ?

Best Regards,

Chris

ps. Sorry for the duplicate posts earlier, having a major ISP headache today
:(

-Original Message-
From: Mario Muja [mailto:[EMAIL PROTECTED]]
Sent: 06 September 2001 14:24
To: [EMAIL PROTECTED]
Cc: Cocoon Dev
Subject: Re: DatabaseXActions


Hi Chris,
sorry for interrupting your discussion with Andrew. You wrote:

nullable attribute in the AbstractDatabaseAction descriptor
default attribute in the AbstractDatabaseAction descriptor
Does this not conflict with the Form Validation descriptor, which also
includes nullable and default attributes?

Regards, Mario



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: C2: Action to modify request parameters

2001-09-05 Thread Chris Newland

Does this mean that sitemap parameters override request parameters of the
same name?

Form:
Set request parameter

---

Filter action:
Get request parameter
Alter parameter
Save in sitemap parameter

---

DatabaseAddAction:
use sitemap parameter instead of request parameter with same name

Otherwise, I cannot chain these actions without altering the code in
DatabaseAddAction (which I am trying not to do)

Thanks,

Chris

 -Original Message-
 From: Jörn Heid [mailto:[EMAIL PROTECTED]]
 Sent: 04 September 2001 19:14
 To: [EMAIL PROTECTED]
 Subject: AW: C2: Action to modify request parameters


 I think not. But you can use sitemap params (that's the preferred way for
 actions). And this works with the sitemap, other actions, xslt...

 -Ursprngliche Nachricht-
 Von: Chris Newland [mailto:[EMAIL PROTECTED]]
 Gesendet: Dienstag, 4. September 2001 19:34
 An: Cocoon-Users
 Betreff: C2: Action to modify request parameters


 Hi All,

 I'm writing an action that is a pre-filter to DatabaseAddAction that
 modifies request parameters before they are sent to the database.

 In the map() method of my action I can get the parameters using:

 Request req = (Request)objectModel.get(Constants.REQUEST_OBJECT);
 String my_param = (String)request.getParameter(my_param);

 // process parameter here

 But there is no request.setParameter() to return the updated value to the
 request.

 Is this possible? (I hope so)

 Thanks,

 Chris

 --
 Chris Newland
 Software Research Engineer

 Emorphia Ltd
 Registered in England.  4133002
 Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

 Email: [EMAIL PROTECTED]
 Tel: +44 (0)1279 450100
 Fax: +44 (0)1279 450102

 Check out FIPA-OS at http://fipa-os.sourceforge.net/

 This message may contain information proprietary to Emorphia so any
 unauthorised disclosure, copying or distribution of its contents
 is strictly
 prohibited.



 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: C2: Action to modify request parameters

2001-09-05 Thread Chris Newland

This is what I thought :(

So it is not possible to use another action to modify the request parameters
that will be picked up by DatabaseAddAction since I would have to put the
updated values into the sitemap parameters and DatabaseAddAction only looks
in the request parameters?

Guess I'll have to subclass the DatabaseXAction classes in order to filter
the parameters.

Thanks,

Chris

 -Original Message-
 From: Jörn Heid [mailto:[EMAIL PROTECTED]]
 Sent: 05 September 2001 10:22
 To: [EMAIL PROTECTED]
 Subject: AW: C2: Action to modify request parameters


 No. There are two maps.

 -Ursprngliche Nachricht-
 Von: Chris Newland [mailto:[EMAIL PROTECTED]]
 Gesendet: Mittwoch, 5. September 2001 11:14
 An: [EMAIL PROTECTED]
 Betreff: RE: C2: Action to modify request parameters


 Does this mean that sitemap parameters override request parameters of the
 same name?

 Form:
 Set request parameter

 ---

 Filter action:
 Get request parameter
 Alter parameter
 Save in sitemap parameter

 ---

 DatabaseAddAction:
 use sitemap parameter instead of request parameter with same name

 Otherwise, I cannot chain these actions without altering the code in
 DatabaseAddAction (which I am trying not to do)

 Thanks,

 Chris

  -Original Message-
  From: Jrn Heid [mailto:[EMAIL PROTECTED]]
  Sent: 04 September 2001 19:14
  To: [EMAIL PROTECTED]
  Subject: AW: C2: Action to modify request parameters
 
 
  I think not. But you can use sitemap params (that's the
 preferred way for
  actions). And this works with the sitemap, other actions, xslt...
 
  -Ursprngliche Nachricht-
  Von: Chris Newland [mailto:[EMAIL PROTECTED]]
  Gesendet: Dienstag, 4. September 2001 19:34
  An: Cocoon-Users
  Betreff: C2: Action to modify request parameters
 
 
  Hi All,
 
  I'm writing an action that is a pre-filter to DatabaseAddAction that
  modifies request parameters before they are sent to the database.
 
  In the map() method of my action I can get the parameters using:
 
  Request req = (Request)objectModel.get(Constants.REQUEST_OBJECT);
  String my_param = (String)request.getParameter(my_param);
 
  // process parameter here
 
  But there is no request.setParameter() to return the updated
 value to the
  request.
 
  Is this possible? (I hope so)
 
  Thanks,
 
  Chris
 
  --
  Chris Newland
  Software Research Engineer
 
  Emorphia Ltd
  Registered in England.  4133002
  Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK
 
  Email: [EMAIL PROTECTED]
  Tel: +44 (0)1279 450100
  Fax: +44 (0)1279 450102
 
  Check out FIPA-OS at http://fipa-os.sourceforge.net/
 
  This message may contain information proprietary to Emorphia so any
  unauthorised disclosure, copying or distribution of its contents
  is strictly
  prohibited.
 
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 



 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: C2: Action to modify request parameters

2001-09-05 Thread Chris Newland

Hi Konstantin,

Sorry for appearing stupid but I still don't see how attributes can help me.

here is the original situation:

1) Form is submitted and form values are set into request *parameters*
2) DatabaseAddAction reads request *parameters* and puts them into database.

But I need to manipulate the parameters first so I thought I'd put an action
between the form and the DatabaseAddAction which alters the request
parameters:

1) Form values set into request *parameters*

2) My action reads values from request *parameters*

I cannot set new values back into request parameters

If I set the new values into request attributes then the DatabaseAddAction
ignores these and reads the original values from the request parameters.

If I set the new values into sitemap parameters then the DatabaseAddAction
ignores these and reads the original values from the request parameters.

3) DatabaseAddAction reads request *parameters*

Request attributes are different from request parameters aren't they?

Thanks for your patience,

Chris

 -Original Message-
 From: Piroumian, Konstantin [mailto:[EMAIL PROTECTED]]
 Sent: 05 September 2001 10:43
 To: [EMAIL PROTECTED]
 Subject: Re: C2: Action to modify request parameters


 Why you don't want to use request attributes? They are the right place of
 holding this kind of information and passing between different processing
 layers: actions, pages, etc.


 - Original Message -
 From: Chris Newland [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, September 05, 2001 1:30 PM
 Subject: RE: C2: Action to modify request parameters


 This is what I thought :(

 So it is not possible to use another action to modify the request
 parameters
 that will be picked up by DatabaseAddAction since I would have to put the
 updated values into the sitemap parameters and DatabaseAddAction
 only looks
 in the request parameters?

 Guess I'll have to subclass the DatabaseXAction classes in
 order to filter
 the parameters.

 Thanks,

 Chris

  -Original Message-
  From: Jrn Heid [mailto:[EMAIL PROTECTED]]
  Sent: 05 September 2001 10:22
  To: [EMAIL PROTECTED]
  Subject: AW: C2: Action to modify request parameters
 
 
  No. There are two maps.
 
  -Ursprngliche Nachricht-
  Von: Chris Newland [mailto:[EMAIL PROTECTED]]
  Gesendet: Mittwoch, 5. September 2001 11:14
  An: [EMAIL PROTECTED]
  Betreff: RE: C2: Action to modify request parameters
 
 
  Does this mean that sitemap parameters override request
 parameters of the
  same name?
 
  Form:
  Set request parameter
 
  ---
 
  Filter action:
  Get request parameter
  Alter parameter
  Save in sitemap parameter
 
  ---
 
  DatabaseAddAction:
  use sitemap parameter instead of request parameter with same name
 
  Otherwise, I cannot chain these actions without altering the code in
  DatabaseAddAction (which I am trying not to do)
 
  Thanks,
 
  Chris
 
   -Original Message-
   From: Jrn Heid [mailto:[EMAIL PROTECTED]]
   Sent: 04 September 2001 19:14
   To: [EMAIL PROTECTED]
   Subject: AW: C2: Action to modify request parameters
  
  
   I think not. But you can use sitemap params (that's the
  preferred way for
   actions). And this works with the sitemap, other actions, xslt...
  
   -Ursprngliche Nachricht-
   Von: Chris Newland [mailto:[EMAIL PROTECTED]]
   Gesendet: Dienstag, 4. September 2001 19:34
   An: Cocoon-Users
   Betreff: C2: Action to modify request parameters
  
  
   Hi All,
  
   I'm writing an action that is a pre-filter to DatabaseAddAction that
   modifies request parameters before they are sent to the database.
  
   In the map() method of my action I can get the parameters using:
  
   Request req = (Request)objectModel.get(Constants.REQUEST_OBJECT);
   String my_param = (String)request.getParameter(my_param);
  
   // process parameter here
  
   But there is no request.setParameter() to return the updated
  value to the
   request.
  
   Is this possible? (I hope so)
  
   Thanks,
  
   Chris
  
   --
   Chris Newland
   Software Research Engineer
  
   Emorphia Ltd
   Registered in England.  4133002
   Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK
  
   Email: [EMAIL PROTECTED]
   Tel: +44 (0)1279 450100
   Fax: +44 (0)1279 450102
  
   Check out FIPA-OS at http://fipa-os.sourceforge.net/
  
   This message may contain information proprietary to Emorphia so any
   unauthorised disclosure, copying or distribution of its contents
   is strictly
   prohibited.
  
  
  
   -
   Please check that your question has not already been answered in the
   FAQ before posting. http://xml.apache.org/cocoon/faqs.html
  
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
   -
   Please check that your question has not already been answered in the
   FAQ before

RE: DatabaseXActions

2001-09-05 Thread Chris Newland

Hi Andrew,

I'm currently modifying the DatabaseAdd|Delete|UpdateAction actions to
allow request parameters to be overriden with request attributes.

This will allow me to pass my form data through another action which
manipulates the values and sets them in request attributes before the
DatabaseAddAction adds them into the database.

Regards,

Chris

 -Original Message-
 From: Andrew Answer [mailto:[EMAIL PROTECTED]]
 Sent: 05 September 2001 14:20
 To: [EMAIL PROTECTED]
 Subject: DatabaseXActions


 Hello cocoon-users,

   i read thread named Action to modify request parameters and want
   to ask another questions.


   1. I try to use DatabaseAddAction for getting form data. In
   descriptor file i setup column type as timestamp
   value param=datetime dbcol=fdatetime type=time-stamp/.
   How to set request parameter on NOW + 1 hour (for example)?
   I can get integer or string values from form through request
   parameters, but can't get timestamp.
   util:time format=.../ not work because of this is a string
   instead of date.
   xsp:logicrequest.setAttribute(date,new Date());/xsp:logic not
   work because DatabaseAddAction read real parameters only, not
   attributes (as i understand).
   Now i use Hsqldb and not need to convert Java datatypes into
   another. This actions work without converting types?

   2. Anybody use DatabaseSelectAction? How it work? It present into my
   version (xml-cocoon2_20010831101539.tar.gz) of C2. When i use other
   database actions, i call cocoon-action through pressing button.
   How to run DatabaseSelectAction automatically when i open page?

 --
 Best regards,
  Andrew  mailto:[EMAIL PROTECTED]



 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




C2: Action to modify request parameters

2001-09-04 Thread Chris Newland

Hi All,

I'm writing an action that is a pre-filter to DatabaseAddAction that
modifies request parameters before they are sent to the database.

In the map() method of my action I can get the parameters using:

Request req = (Request)objectModel.get(Constants.REQUEST_OBJECT);
String my_param = (String)request.getParameter(my_param);

// process parameter here

But there is no request.setParameter() to return the updated value to the
request.

Is this possible? (I hope so)

Thanks,

Chris

--
Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Email: [EMAIL PROTECTED]
Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at http://fipa-os.sourceforge.net/

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly
prohibited.



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




C2: Adding XML in String into document

2001-09-03 Thread Chris Newland

Hi All,

I've written a method that fetches the possible values of an enum column in
a MySQL database and creates an XML string that represents a form's select
element complete with an option element for each enum value.

In Cocoon 1 I could have just appended this text as a node in the DOM tree
but now I'm using Cocoon 2 and can't work out how to get the XML from this
String into the output document:

xsp:logic

String select_node = MyUtil.getEnumSelectBlock(  );

form method=POST action=foo

!-- want select node to be inserted here --

input type=submit value=choose/

/form

/xsp:logic

Is this a sensible thing to try and do? (Sorry if this is a really obvious
one)

Thanks,

Chris

--
Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Email: [EMAIL PROTECTED]
Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at http://fipa-os.sourceforge.net/

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly
prohibited.



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Requesting multiple selection lists

2001-08-30 Thread Chris Newland

Hi Andrei,

Its hard to diagnose the problem without an example from your code :)

This works for me by selecting the values from 1 column in the table and
putting them into a combo box:

...
esql:execute-query

esql:query
!-- select a single column from the table --
/esql:query

esql:results
xsp:logic
form action=blah method=POST
select name=fruit
esql:row-results
optionesql:get-columns//option
/esql:row-results
/select

input type=submit value=Choose/

/form
/xsp:logic
/esql:results

/esql:execute-query
...

Hope this helps,

Best Regards,

Chris

 -Original Message-
 From: Andrei Bejenaru [mailto:[EMAIL PROTECTED]]
 Sent: 30 August 2001 10:35
 To: [EMAIL PROTECTED]
 Subject: Requesting multiple selection lists


 I got a form with 3 selection lists which are dynamicaclly filled from a
 bunch of selects and some other lists.
 On submit (method is POST) all other input elements are send correctly to
 the action xsp; my 3 lists don't appear
 between the request parameters in the log, nor I can apply a
 getParameter or
 getParameterValues method on them.

 Any ideeas ?


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




C2: ESQL how to encode NOW() function

2001-08-30 Thread Chris Newland

Hi All,

Can somebody tell me the correct way to encode the names of SQL functions in
queries?

I'm trying to set a DATETIME column to the current time by passing the
function NOW() but the value is always ends up set to null.

I've tried:

esql:parameterNOW()/esql:parameter
esql:parameterNOW()/esql:parameter
esql:parameterxsp:exprNOW()/xsp:expr/esql:parameter

The insert statement works fine when I use the MySQL client.

Any ideas?

--
Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Email: [EMAIL PROTECTED]
Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at http://fipa-os.sourceforge.net/

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly
prohibited.



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Out of memory with JDK

2001-08-28 Thread Chris Newland

Hi Stephan,

I'm using Tomcat 4.0-b6 as my servlet container so I set the CATALINA_OPTS
variable in the tomcat/bin/startup.sh script:

CATALINA_OPTS= -Xms128m -Xmx128m 

as this environment variable is used to set the VM parameters when tomcat
starts:

java $CATALINA_OPTS ...

If you are using a different servlet container you'll need to make sure that
the VM that contains the Cocoon servlet has these parameters set when it
starts.

Hope this helps,

Chris


 -Original Message-
 From: Stephan Kassanke [mailto:[EMAIL PROTECTED]]
 Sent: 27 August 2001 10:39
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: Out of memory with JDK


 Hi chris,

 thanks for your quick answer. Currently we are using JVM 1.1.8
 under Linux.
 The switches are the same you mentioned below. Is this set when I
 start the
 cocoon servlet?

 eg. java -Xms128m -Xmx128m some-cocoon-initialization-classes


 best regards,
 Stephan
 - Original Message -
 From: Chris Newland [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, August 24, 2001 5:41 PM
 Subject: RE: Out of memory with JDK


  Hi Stephan,
 
  java -Xms128m -Xmx128m classname
 
  Would set the starting and maximum heap to 128MB. Just change the values
 to
  suit your machine.
 
  Which JVM version are you using? Some of the earlier VMs used a
 different
  switch.
 
  Best Regards,
 
  Chris
 
   -Original Message-
   From: Stephan Kassanke [mailto:[EMAIL PROTECTED]]
   Sent: 24 August 2001 16:33
   To: [EMAIL PROTECTED]
   Subject: Out of memory with JDK
  
  
   Hi,
  
   we have a problem with the JVM which has obviously not enough
   memory to do a
   trasnformation to HTML or PDF.
  
   I keep getting the error
 Cocoon 1.8.2
  
  
  
  
 Error found handling the request.
   java.lang.Exception: FATAL ERROR: the JVM ran out of memory when
processing the request. The maximum amount of memory used by your VM
can be changed at the command line (consult your JDK documentation)
and may not be at all related to the amount of physical memory
in your machine!
   at org.apache.cocoon.Engine.handle(Engine.java:435)
   at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
   at
  
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
   at org.apache.tomcat.core.Handler.service(Handler.java:286)
   at
   org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
   at
   org.apache.tomcat.core.ContextManager.internalService(ContextManag
   er.java:79
   7)
   at
   org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
   at
   org.apache.tomcat.service.connector.Ajp12ConnectionHandler.process
   Connection
   (Ajp12ConnectionHandler.java:166)
   at
  
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
   at
  
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
   at java.lang.Thread.run(Thread.java)
  
  
 Warning: this page has been dynamically generated.
  
  
   The problem i have is most probably trivial for most of you. How
   do I change
   the amount of memory available for the JVM. I searched the
 newsgroup and
   archives with no success yet. can somebody point me to the right
 resource.
  
   Thanks,
   Stephan
  
   PS.: Isn't this a candidate for the FAQ?
  
  
   -
   Please check that your question has not already been answered in the
   FAQ before posting. http://xml.apache.org/cocoon/faqs.html
  
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Out of memory with JDK

2001-08-24 Thread Chris Newland

Hi Stephan,

java -Xms128m -Xmx128m classname

Would set the starting and maximum heap to 128MB. Just change the values to
suit your machine.

Which JVM version are you using? Some of the earlier VMs used a different
switch.

Best Regards,

Chris

 -Original Message-
 From: Stephan Kassanke [mailto:[EMAIL PROTECTED]]
 Sent: 24 August 2001 16:33
 To: [EMAIL PROTECTED]
 Subject: Out of memory with JDK


 Hi,

 we have a problem with the JVM which has obviously not enough
 memory to do a
 trasnformation to HTML or PDF.

 I keep getting the error
   Cocoon 1.8.2




   Error found handling the request.
 java.lang.Exception: FATAL ERROR: the JVM ran out of memory when
  processing the request. The maximum amount of memory used by your VM
  can be changed at the command line (consult your JDK documentation)
  and may not be at all related to the amount of physical memory
  in your machine!
   at org.apache.cocoon.Engine.handle(Engine.java:435)
   at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
   at
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
   at org.apache.tomcat.core.Handler.service(Handler.java:286)
   at
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
   at
 org.apache.tomcat.core.ContextManager.internalService(ContextManag
 er.java:79
 7)
   at
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
   at
 org.apache.tomcat.service.connector.Ajp12ConnectionHandler.process
 Connection
 (Ajp12ConnectionHandler.java:166)
   at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
   at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
   at java.lang.Thread.run(Thread.java)


   Warning: this page has been dynamically generated.


 The problem i have is most probably trivial for most of you. How
 do I change
 the amount of memory available for the JVM. I searched the newsgroup and
 archives with no success yet. can somebody point me to the right resource.

 Thanks,
 Stephan

 PS.: Isn't this a candidate for the FAQ?


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




C2: can't match images in sitemap

2001-08-22 Thread Chris Newland

Hi All,

I'm trying to add a map:match to my sitemap to fetch images but they are not
fetched (my fault, Cocoon2 is working great)

Location of my files:

tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
tomcat/webapps/cocoon/stylesheets/my_xsl.xsl

sitemap entries:

map:match pattern=pages/*
map:generate type=serverpages src=docs/samples/pages/{1}.xsp/
map:transform src=stylesheets/my_xsl/
/map:match

(loads + processes XSP page fine)

map:match pattern=images/**.jpg
map:read src=docs/samples/images/{1}.jpg mime-type=image/jpg/
/map:match

(does not return the image)

The returned HTML contains:

img src=images/my_image.jpg

As far as I can see, this is the same way that the cocoon.gif image is
fetched from samples.xml but I can't see what I'm doing wrong.

Any help would be appreciated.

Thanks,

Chris

--
Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Email: [EMAIL PROTECTED]
Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at http://fipa-os.sourceforge.net/

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly
prohibited.



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: can't match images in sitemap

2001-08-22 Thread Chris Newland

Thanks everyone,

Accessing the images directly works fine and so does prefixing the url with
../ (path back to webapp root) but my understanding was that the sitemap
provided a total abstraction between the url fetched by the browser
images/my_image.jpg and the actual file on disk.

Prefixing my URLs so that they are relative to the current page seems a
little hardcoded to me.

Isn't the request for the image processed by the sitemap?

Thanks,

Chris

 -Original Message-
 From: Tibi DONDERA [mailto:[EMAIL PROTECTED]]
 Sent: 22 August 2001 15:31
 To: [EMAIL PROTECTED]
 Subject: Re: can't match images in sitemap


 IMHO,

 Your configuration seems right. I bet that using

 cocoon address/images/my_image.jpg
 will give you the image.

 But the tag that is in your page should be img
 src=../images/my_image.jpg
 After all, the URL of the page is

 cocoon address/pages/my_page.html,

 right?

 Hope this helps.


 - Original Message -
 From: Chris Newland [EMAIL PROTECTED]
 To: Cocoon-Users [EMAIL PROTECTED]
 Sent: Wednesday, August 22, 2001 4:10 PM
 Subject: C2: can't match images in sitemap


  Hi All,
 
  I'm trying to add a map:match to my sitemap to fetch images but they are
 not
  fetched (my fault, Cocoon2 is working great)
 
  Location of my files:
 
  tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
  tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
  tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
 
  sitemap entries:
 
  map:match pattern=pages/*
  map:generate type=serverpages src=docs/samples/pages/{1}.xsp/
  map:transform src=stylesheets/my_xsl/
  /map:match
 
  (loads + processes XSP page fine)
 
  map:match pattern=images/**.jpg
  map:read src=docs/samples/images/{1}.jpg mime-type=image/jpg/
  /map:match
 
  (does not return the image)
 
  The returned HTML contains:
 
  img src=images/my_image.jpg
 
  As far as I can see, this is the same way that the cocoon.gif image is
  fetched from samples.xml but I can't see what I'm doing wrong.
 
  Any help would be appreciated.
 
  Thanks,
 
  Chris
 
  --
  Chris Newland
  Software Research Engineer
 
  Emorphia Ltd
  Registered in England.  4133002
  Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK
 
  Email: [EMAIL PROTECTED]
  Tel: +44 (0)1279 450100
  Fax: +44 (0)1279 450102
 
  Check out FIPA-OS at http://fipa-os.sourceforge.net/
 
  This message may contain information proprietary to Emorphia so any
  unauthorised disclosure, copying or distribution of its contents is
 strictly
  prohibited.
 
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: can't match images in sitemap

2001-08-22 Thread Chris Newland

Ok, thanks all, this is much clearer now.

btw, is there any way to remove cocoon from the URL, I guess this is a
tomcat configuration issue so I'll have a look in there first.

thanks,

Chris

 -Original Message-
 From: java guru [mailto:[EMAIL PROTECTED]]
 Sent: 22 August 2001 16:08
 To: [EMAIL PROTECTED]
 Subject: RE: can't match images in sitemap


 Yes.,
   there is abstraction between the url and actual
 location of the files on the disk...But from my
 understanding what the situation is..

 1. If you have sent over html to browser with image
 link as /images/image1.jpg and that html url is
 http://localhost:8080/cocoon/welcome;..

 2. When the browser sends request back to server, the
 request for image is formed like
 http://localhost:8080/images/image1.jpg..this is
 something browser did..

 3. When the request hits the server, thr url doesnt
 fall under category of url to be forwarded to
 cocoon..and hence the web server(tomcat) try to handle
 by itself(or root web application)..which would not
 find the file obviously..

 4. Now on the page of
 http://localhost:8080/cocoon/welcome/intro; if u have
 image with images/image1.gif the request from
 browser for image is formed like
 http://localhost:8080/cocoon/welcome/images/image1.jpg;..

 5. Now once this request hits the server, the request
 if forwarded to cocoon by the container, by this time
 the uri becomes welcom/images/image1.jpg as it
 entered to cocoon context..

 6. This resulted uri is passed thru the mathers and
 if u have match saying 
 pattern=images/*.jpg..obviously the requested uri
 doesnt match with the specified pattern..

 7. This has nothing to do with abstraction between uri
 and actual file..This has to do with the way url are
 handled by browser

  --- Chris Newland [EMAIL PROTECTED] wrote:
  Thanks everyone,
 
  Accessing the images directly works fine and so does
  prefixing the url with
  ../ (path back to webapp root) but my understanding
  was that the sitemap
  provided a total abstraction between the url fetched
  by the browser
  images/my_image.jpg and the actual file on disk.
 
  Prefixing my URLs so that they are relative to the
  current page seems a
  little hardcoded to me.
 
  Isn't the request for the image processed by the
  sitemap?
 
  Thanks,
 
  Chris
 
   -Original Message-
   From: Tibi DONDERA
  [mailto:[EMAIL PROTECTED]]
   Sent: 22 August 2001 15:31
   To: [EMAIL PROTECTED]
   Subject: Re: can't match images in sitemap
  
  
   IMHO,
  
   Your configuration seems right. I bet that using
  
   cocoon address/images/my_image.jpg
   will give you the image.
  
   But the tag that is in your page should be img
   src=../images/my_image.jpg
   After all, the URL of the page is
  
   cocoon address/pages/my_page.html,
  
   right?
  
   Hope this helps.
  
  
   - Original Message -
   From: Chris Newland [EMAIL PROTECTED]
   To: Cocoon-Users [EMAIL PROTECTED]
   Sent: Wednesday, August 22, 2001 4:10 PM
   Subject: C2: can't match images in sitemap
  
  
Hi All,
   
I'm trying to add a map:match to my sitemap to
  fetch images but they are
   not
fetched (my fault, Cocoon2 is working great)
   
Location of my files:
   
   
  tomcat/webapps/cocoon/docs/samples/pages/my_page.xsp
   
 
 tomcat/webapps/cocoon/docs/samples/images/my_image.jpg
tomcat/webapps/cocoon/stylesheets/my_xsl.xsl
   
sitemap entries:
   
map:match pattern=pages/*
map:generate type=serverpages
  src=docs/samples/pages/{1}.xsp/
map:transform src=stylesheets/my_xsl/
/map:match
   
(loads + processes XSP page fine)
   
map:match pattern=images/**.jpg
map:read src=docs/samples/images/{1}.jpg
  mime-type=image/jpg/
/map:match
   
(does not return the image)
   
The returned HTML contains:
   
img src=images/my_image.jpg
   
As far as I can see, this is the same way that
  the cocoon.gif image is
fetched from samples.xml but I can't see what
  I'm doing wrong.
   
Any help would be appreciated.
   
Thanks,
   
Chris
   
--
Chris Newland
Software Research Engineer
   
Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill,
  Harlow, Essex, CM20 2EL, UK
   
Email: [EMAIL PROTECTED]
Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102
   
Check out FIPA-OS at
  http://fipa-os.sourceforge.net/
   
This message may contain information proprietary
  to Emorphia so any
unauthorised disclosure, copying or distribution
  of its contents is
   strictly
prohibited.
   
   
   
   
 
 -
Please check that your question has not already
  been answered in the
FAQ before posting.
  http://xml.apache.org/cocoon/faqs.html
   
To unsubscribe, e-mail:
  [EMAIL PROTECTED]
For additional commands, e-mail:
  [EMAIL PROTECTED

Possible to assign SQL query result to XSP variable?

2001-08-20 Thread Chris Newland

Hi All,

I'm trying to test for the presence of a key in an SQL table by performing
an SQL query and having the result (or null) set in an XSP variable:

parachecking for username = xsp:exprusername/xsp:expr/para

String got_uname = dummy;

  esql:connection
esql:poolmy_jdbc/esql:pool
esql:execute-query
esql:query
  select id from enduser where enduser.id =
esql:parameterxsp:exprusername/xsp:expr/esql:parameter
/esql:query
esql:row-results
got_uname = esql:get-string column=id/;
/esql:row-results
/esql:execute-query
  /esql:connection

paragot value from db uname = xsp:exprgot_uname/xsp:expr/para

where 'id' is the primary key column in the enduser table.

Is this even a rational thing to try and do?

When the page executes, the value for got_uname is dummy and the Java code
created from the page does not attempt to assign the got_uname variable to
the SQL result.

Can somebody let me know if it is actually possible/reasonable to try and
assign XSP variables from SQL queries?

Thanks for your help,

Chris



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Possible to assign SQL query result to XSP variable?

2001-08-20 Thread Chris Newland

Thanks Max,

It was that and the fact that I'd forgotton the esql:results around the
esql:row-results.

This code works for retrieving a value or null if it does not exist in the
DB:

parachecking for username = xsp:exprusername/xsp:expr/para

String got_uname = dummy;

  esql:connection
esql:poollh_jdbc/esql:pool
esql:execute-query
esql:query
  select id from enduser where enduser.id =
esql:parameterxsp:exprusername/xsp:expr/esql:parameter
/esql:query
esql:results
esql:row-results
FOUND RESULTS
xsp:logic
got_uname = esql:get-string column=id/;
/xsp:logic
/esql:row-results
/esql:results
esql:no-results
NO RESULTS
xsp:logic
got_uname = null;
/xsp:logic
/esql:no-results
/esql:execute-query
  /esql:connection

paragot value from db uname = xsp:exprgot_uname/xsp:expr/para


Best Regards,

Chris

 -Original Message-
 From: Max Larsson [mailto:[EMAIL PROTECTED]]
 Sent: 20 August 2001 12:24
 To: [EMAIL PROTECTED]
 Subject: AW: Possible to assign SQL query result to XSP variable?


 Hi,

 try to wrap it in a xsp:logic block:

 ...
  esql:execute-query
   esql:row-results
   xsp:logic
   got_uname = esql:get-string column=id/;
   /xsp:logic
  /esql:row-results
  /esql:execute-query
 ...

 Max

  -Ursprngliche Nachricht-
  Von: Chris Newland [mailto:[EMAIL PROTECTED]]
  Gesendet: Montag, 20. August 2001 13:21
  An: Cocoon-Users
  Betreff: Possible to assign SQL query result to XSP variable?
 
 
  Hi All,
 
  I'm trying to test for the presence of a key in an SQL table
  by performing
  an SQL query and having the result (or null) set in an XSP variable:
 
  parachecking for username = xsp:exprusername/xsp:expr/para
 
  String got_uname = dummy;
 
esql:connection
  esql:poolmy_jdbc/esql:pool
  esql:execute-query
  esql:query
select id from enduser where enduser.id =
  esql:parameterxsp:exprusername/xsp:expr/esql:parameter
  /esql:query
  esql:row-results
  got_uname = esql:get-string column=id/;
  /esql:row-results
  /esql:execute-query
/esql:connection
 
  paragot value from db uname = xsp:exprgot_uname/xsp:expr/para
 
  where 'id' is the primary key column in the enduser table.
 
  Is this even a rational thing to try and do?
 
  When the page executes, the value for got_uname is dummy
  and the Java code
  created from the page does not attempt to assign the
  got_uname variable to
  the SQL result.
 
  Can somebody let me know if it is actually
  possible/reasonable to try and
  assign XSP variables from SQL queries?
 
  Thanks for your help,
 
  Chris
 
 
 
  -
  Please check that your question has not already been answered in the
  FAQ before posting. http://xml.apache.org/cocoon/faqs.html
 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




OT: ESQL, MySQL, and the GPL

2001-08-14 Thread Chris Newland

Hi All,

A quick question about licensing.

If I use the ESQL logicsheet (Apache license?) with the MM JDBC driver
(LGPL) to connect to a MySQL DB server (GPL), is my XSP code protected from
the GPL ?

Thanks, and sorry for the off-topic post.

-Chris

PS. If you don't already have this configuration listed:

Cocoon2b2 (distribution) working on Tomcat 4.0-b6 (distribution) on SuSE 7.2
with Sun JDK 1.3.1-b24 (using -classic workaround for the VM seg fault bug)

--
Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Email: [EMAIL PROTECTED]
Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at http://fipa-os.sourceforge.net/

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly
prohibited.



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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




RE: Cocoon2: ant problem

2001-08-14 Thread Chris Newland

Hi,

I had this problem too running the build script from the Cocoon2.0b2
distribution on SuSE 7.2, Sun JDK1.3.1

A solution that works for me is to edit the Cocoon/bin/ant script and
resave it and then it works fine.

#! /bin/sh
echo in ant script  --- Line that I added
if [ -f $HOME/.antrc ] ; then
  . $HOME/.antrc
fi
...


HTH,

Chris

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Andre
 Juffer
 Sent: 14 August 2001 13:22
 To: Cocoon users
 Subject: Cocoon2: ant problem


 Hi All,

 I experience a somewhat perculiar problem when I try to install cocoon2
 on a Redhat Linux box. If I run build.sh, I get the following


 Apache Cocoon 2 Build System
 
 ./build.sh: /usr/local/xml-cocoon2/bin/ant: No such file or directory

 But, the /usr/local/xml-cocoon2/bin/ant certainly exists and also has
 the right permissions:

 ls -l bin/ant gives:

 -rwxr--r--1 root sys  2936 Jul 23 12:25 bin/ant

 I remember that somebody else on this list had a similar problem, but I
 could not find that message in the archive. So, I hope that one of you
 can help me out.

 I have installed Cocoon2 earlier on Slackware with no problems at all,
 so the aforementioned problem may be a Redhat thing. Tomcat and Java run
 without any problem, Java is jdk1.3.1. Suspecting that it may be a bash
 problem, I have made a build script based upon tcsh, but the result is
 exactly the same.

 Thanks,

 --
 Andre H. Juffer  | Phone: +358-8-553 1683
 The Biocenter and| Fax: +358-8-553-1141
 the Dep. of Biochemistry | Email: [EMAIL PROTECTED]
 University of Oulu, Finland  | WWW:
 http://www.biochem.oulu.fi/research.html

 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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






-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

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