Re: Re: Antwort: RE: Calling C2 from command line: problem with Oracle driver

2001-12-06 Thread Christoph . Oberle

Hello list,

  Why would you want to run Cocoon without Tomcat?  What can Cocoon do
 without a servlet engine?

 It is possible because Cocoon2 is made on an abstraction that can make it
 interface with different containers.
 Currently there are two abstactions (Environment) available: command line
 and servlet.
 So yes, it can function on itself, no, it can't respond to http requests by
 itself for now.
 Command line executes all the things in the sitemap and generates the
 resulting files on the filesystem.

Once again, to make it clear, what I want to achieve...

I have built a web application, which presents the informations concerning a
life insurance contract on our intranet.
The web page is called like
//http:server/cocoon/Contract.xsp?contract_id=1234567

For looking at single contracts everything is fine.

But now I want to generate all these info sheets for many hundreds of
contracts and send the results to an other department, which has no possibility
to access our intranet.

Therefor I want to call Cocoon with a todo list, which could look like this:
  Contract.xsp?contract_id=1112234
  Contract.xsp?contract_id=1112236
  Contract.xsp?contract_id=1112237
  Contract.xsp?contract_id=1112324
  Contract.xsp?contract_id=1123534
  Contract.xsp?contract_id=1467301
  Contract.xsp?contract_id=1668709
  ...

Now Cocoon has to generate the html files for each uri and save it somewhere.

My intermediate results are:
  1) Cocoon can be called from the command line by using the run.sh script in
the Cocoon root directory.

  2) It is possible to configure the Cocoon call with parameters. Execute sh
run.sh -h for a list of Parms and options.

  3) I have configured the run time environment in a way, that the command line
version takes the same sitemap files and web application files as the servlet
version called by tomcat.

And now there is only one question left:
  How can I tell the command line environment to load and initialize the classes
needed for the Oracle database access?
  In the servlet version this is done be specifying an init-param in the
web.xml
  file with the param-name load-class.

And here I'm stuck!

I think, the implementation of the class org.apache.cocoon.Main needs some
extension, to give a possibility to the user to achieve the same things, as
init-param in web.xml does in the servlet case.

Thanks
Christoph



-
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: Antwort: RE: Calling C2 from command line: problem with Oracle driver

2001-12-06 Thread Adrian Geissel

Hi,

Have you looked at the way that Cocoon generates it's own documentation from
a commandline invocation?

This may be what you are looking for in terms of generating off-line
content.

Hope this helps
Adrian

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 06, 2001 10:31 AM
Subject: Re: Re: Antwort: RE: Calling C2 from command line: problem with
Oracle driver


 Hello list,

   Why would you want to run Cocoon without Tomcat?  What can Cocoon do
  without a servlet engine?
 
  It is possible because Cocoon2 is made on an abstraction that can make
it
  interface with different containers.
  Currently there are two abstactions (Environment) available: command
line
  and servlet.
  So yes, it can function on itself, no, it can't respond to http requests
by
  itself for now.
  Command line executes all the things in the sitemap and generates the
  resulting files on the filesystem.

 Once again, to make it clear, what I want to achieve...

 I have built a web application, which presents the informations concerning
a
 life insurance contract on our intranet.
 The web page is called like
 file://http:server/cocoon/Contract.xsp?contract_id=1234567

 For looking at single contracts everything is fine.

 But now I want to generate all these info sheets for many hundreds of
 contracts and send the results to an other department, which has no
possibility
 to access our intranet.

 Therefor I want to call Cocoon with a todo list, which could look like
this:
   Contract.xsp?contract_id=1112234
   Contract.xsp?contract_id=1112236
   Contract.xsp?contract_id=1112237
   Contract.xsp?contract_id=1112324
   Contract.xsp?contract_id=1123534
   Contract.xsp?contract_id=1467301
   Contract.xsp?contract_id=1668709
   ...

 Now Cocoon has to generate the html files for each uri and save it
somewhere.

 My intermediate results are:
   1) Cocoon can be called from the command line by using the run.sh
script in
 the Cocoon root directory.

   2) It is possible to configure the Cocoon call with parameters. Execute
sh
 run.sh -h for a list of Parms and options.

   3) I have configured the run time environment in a way, that the command
line
 version takes the same sitemap files and web application files as the
servlet
 version called by tomcat.

 And now there is only one question left:
   How can I tell the command line environment to load and initialize the
classes
 needed for the Oracle database access?
   In the servlet version this is done be specifying an init-param in the
 web.xml
   file with the param-name load-class.

 And here I'm stuck!

 I think, the implementation of the class org.apache.cocoon.Main needs some
 extension, to give a possibility to the user to achieve the same things,
as
 init-param in web.xml does in the servlet case.

 Thanks
 Christoph



 -
 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: Calling C2 from command line: problem with Oracle driver

2001-12-04 Thread SANSONE, AARON M [Non-Pharmacia/1000]

Hi Christoph,

To get oracle working, you must first add a section to load the oracle
driver class in the web.xml file. Be certain that the Oracle driver Jar file
is in your servlet engine's classpath.

web-app
servlet
servlet-nameCocoon2/servlet-name
init-param
param-nameload-class/param-name
param-value
oracle.jdbc.driver.OracleDriver
/param-value
/init-param
...
/servlet
/web-app

Then in the cocoon.xconf configuration file you must specify a datasource
such as:

  datasources
jdbc name=mydata
  pool-controller min=5 max=10 oradb=true/
  dburljdbc:oracle:thin:@myserver.mydomain.com:1521:myInstance/dburl
  userscott/user
  passwordtiger/password
/jdbc
  /datasources


Finally, you can either use the connection in an XSP page or pass a Query in
XML to the SQL transformer as part of a pipeline in your sitemap:

map:transform type=sql
map:parameter name=use-connection value=fp/
map:parameter name=show-nr-of-rows
value=false/
/map:transform


HTH,
Aaron


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 6:14 AM
To: [EMAIL PROTECTED]
Subject: Calling C2 from command line: problem with Oracle driver


Hello,

I'm working with Cocoon2.0-rc1a and Tomcat 3.2.3 on a Linux-Server.
With Tomcat everything is fine, but yesterday I tried to call Cocoon from
the
command line.
I did not find any documentation on command line parameters and options,
only
the definition of
COCOON_LIB and COCOON_WORK environment variables in run.sh.
After some hours my Cocoon command line environment nearly works, but there
is a
problem left:

I can not get the Oracle JDBC (thin) driver to work. I think it has do do
with
the missing initialization of the JDBC driver class.

When Cocoon is called from Tomcat, there is a configuration file called
web.xml
in the WEB-INF directory, where the initial parameters - like load-class -
are
defined.

What is the right way to specify these settings for command line execution?

Many thanks in advance
Christoph

PS: How can I specify directories, like the application directory, which is
assumed to be ./webapp etc.



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




Antwort: RE: Calling C2 from command line: problem with Oracle driver

2001-12-04 Thread Christoph . Oberle

Hi all,

thank you Aaron, for the desription how to use Oracle from within Cocoon (and
Tomcat!).
This also works in my environment.

My question is:

I want to call Cocoon2 from then command line WITHOUT Tomcat.
There is a run.sh file in the Cocoon root directory, which starts Cocoon with a
stand alone java-cmd. No Tomcat!

In this case, Cocoon makes some assumptions, e.g. where the applications are
(./webapp), where the work-dir is, etc.

I wonder, where I can set these parameters. Also I wonder, where the settings
can be done, which are normally set in the web.xml file of Tomcat, like the
init-param named load-class (because there is no Tomcat in command line
operation).

 web-app
servlet
 servlet-nameCocoon2/servlet-name
 init-param
  param-nameload-class/param-name
  param-value
   oracle.jdbc.driver.OracleDriver
  /param-value
 /init-param
 ...
/servlet
 /web-app

So, in other words, my problem is: how can I set up an environment for starting
Cocoon stand alone which is compatable to my Tomcat environment.

Did anybody run Cocoon2 from the command line already

Any reports are appreciated!

The background for my request is the following:
I have written an application sampling together data concerning a life insurance
contract  from several SQL-databases with the esql-taglib in a xsp:page,
which is then transformed to html.
Now I want to run this application for many cases and send the final html-pages
to an other department.

Thank you
Christoph



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