esql taglib and autocommit = false

2002-07-22 Thread Christoph . Oberle

Hi,

we are using the esql taglib. There we realized some strange behavior concerning
autocommit.

Conclusion:
 If you want to set autocommit to false, you have to state
  esql:autocommitfalse/esql:autocommit
 in every esql:connection you use!

 Not stating esql:autocommitfalse/esql:autocommit in a esql:connection
resets autocommit to true!


Explanation:
 We are using the jdbc/auto-commit element in cocoon.xconf to state wether we
need autocommit or not.
 In the esql-queries we do not use the esql:autocommit element at all.

 Now it seems that autocommit is only deactivated if the esql:autocommit
element is present and does contain false.
 In every other case, autocommit is set to true (even if the jdbc connection
says auto-commitfalse/auto-commit).

 In the xsl-code of the esql-taglib (the source is from cocoon 2.0.2) I found
the following:

 xsl:template match=esql:connection

  ...
  xsl:variable name=autocommitxsl:call-template
name=get-nested-stringxsl:with-param name=content
select=esql:autocommit//xsl:call-template/xsl:variable
  ...

  try {
if (false.equals(String.valueOf(xsl:copy-of select=$autocommit/)))
 {
  if (_esql_connection.getAutoCommit()) {
_esql_connection.setAutoCommit(false);
  }
} else {
  if (!_esql_connection.getAutoCommit()) {
_esql_connection.setAutoCommit(true);
  }
}
   ...

 /xsl:template

 I think, the else-clause is the problem:

  If esql:autocommit is not false, then autocommit will be set to true!

 So this means, even when the jdbc connection states
auto-commitfalse/auto-commit it will be set to true,
 if no element esql:autocommitfalse/esql:autocommit is present.

With best wishes and hopefully no more unwanted commits
Christoph Oberle



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

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




Antwort: Problem with special german characters and LDAP-Transformer

2002-04-23 Thread Christoph . Oberle

Hi,

 I use the LDAP-Transformer. It's works fine. But I have a Problem with
 special german characters. I must use the character set ISO-8859-1.
 The Problem occurs only on LDAP-Transformer-Datas. On the normal conversion
 from xml to html using xslt occurs no Problems with special german
 characters.
 What can I do?

We had a similar problem with our Oracle database when we used html forms.
Everything worked fine, when we typed data in the form and sent it to the xsp
page for processing.
But when we read data from the database and used it to initialize the form data,
it got encrypted.
Our solution - which, in my opinion, is not really good - is to tell the html
serializer to generate output in the ISO-8859-1 character set instead of the
normal UTF-8 character set. Then all the data, which is serialized to html
stays in the ISO-8859-1 character set, which has been read from the database.

You can achieve this by including the following definition for the html
serializer in the map:serializers section of your sitemap:

   map:serializer name=html mime-type=text/html
src=org.apache.cocoon.serialization.HTMLSerializer
doctype-public-//W3C//DTD HTML 4.01 Transitional//EN/doctype-public
encodingISO-8859-1/encoding
omit-xml-declarationyes/omit-xml-declaration
   /map:serializer

We did not put this into the main sitemap. We use it only in some sub-sitemaps,
where we need it.

Greetings | Viele Grüße
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: esql insert statement

2001-12-11 Thread Christoph . Oberle

Hi Reto,

your xsp:page element is missing the namespace declaration for esql.

Just add the following attributes
 xmlns:esql=http://apache.org/cocoon/SQL/v2;
 xmlns:log=http://apache.org/xsp/log/2.0;
to your xsp:page element.

I dont know whether xmlns:log is really needed.

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




Calling C2 from command line: problem with Oracle driver

2001-12-04 Thread Christoph . Oberle

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]




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]