You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by bs...@studserv.uni-leipzig.de on 2005/11/23 07:38:22 UTC
Lenya and DB-Query (on German)
Please apologize for posting my question in german, but my english isn't
very good....
Es geht um folgendes:
1. Ich habe neues Dokument erstellt, die Dokument-ID lautet showAll
2. Dann habe ich die Datenbankverbindung
(im $LENYA_HOME\build\lenya\webapp\WEB-INF\web.xml) definiert.
3. Die Treiberdatei wurde kopiert unter:
$LENYA_HOME\build\lenya\webapp\WEB-INF\lib
4. cocoon.xconf wurde entsprechend korrigiert (<dburl> geändert, user und pass
eingegeben)
5. Dann habe ich die Datei showAll.xsp erstellt
<?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">
<content>
<esql:connection>
<esql:pool>oracle_pool</esql:pool>
<esql:execute-query>
<esql:query>
select * from phpbb_ranks
</esql:query>
<esql:results>
<esql:row-results>
<RANK_TITLE><esql:get-string column="RANK_TITLE"/></RANK_TITLE>
<RANK_ID><esql:get-string column="RANK_ID"/></RANK_ID>
</esql:row-results>
</esql:results>
<esql:no-results>
Der Query gab eine leere Liste zurück!
</esql:no-results>
<esql:error-results>
Es ist ein Fehler bei der Anfrage aufgetreten!
</esql:error-results>
</esql:execute-query>
</esql:connection>
</content>
</xsp:page>
6. Und danach habe ich die showAll2html.xsl erstellt
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="content">
<html>
<body>
<table border="1">
<tr>
<td><xsl:apply-templates /></td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="rank_title">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="rank_id">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
7. Als letztes habe ich in der sitemap.xmap folgendes eingefügt
<map:match pattern="showAll.html">
<map:generate type="serverpages" src="xsp/showAll.xsp"/>
<map:transform src="xslt/showAll2html.xsl"/>
<map:serialize/>
</map:match>
Ich will also in dem Dokument showAll das Ergebnis von der Anfrage zu der
Datenbank sehen.
Wenn ich
<map:match pattern="**">
<map:mount uri-prefix="" src="publication-sitemap.xmap"/>
</map:match>
lösche, dann kommt die Fehlermeldung:
The requested document '/showAll.html' with document-id '/showAll'
Wenn ich
<map:match pattern="showAll.html">
mit
<map:match pattern="**">
ersetze und
<map:match pattern="**">
<map:mount uri-prefix="" src="publication-sitemap.xmap"/>
</map:match>
von der sitemap.xmap lösche, dann sehe ich das Ergebnis (die eine Zeile mit der
Info von der Datenbank). Also
die Verbindung wird hergestellt und die Anfrage
liefert Ergebnis. Ich muss also
<map:match pattern="showAll.html">
<map:generate type="serverpages" src="xsp/showAll.xsp"/>
<map:transform src="xslt/showAll2html.xsl"/>
<map:serialize/>
</map:match>
irgendwo anders einfügen. Ich weiß aber nicht, wo genau. Außerdem weiß ich
nicht, warum showAll.html nicht gefunden werden kann (wenn ich <map:match
pattern="showAll.html"> benutze).
Ich hoffe, jemand kann mir doch helfen.
CuPaKoB
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Lenya and DB-Query (on German)
Posted by Michael Wechner <mi...@wyona.com>.
Andreas Hartmann wrote:
> bss00ako@studserv.uni-leipzig.de wrote:
>
>> Please apologize for posting my question in german, but my english isn't
>> very good....
>
>
> There's a Cocoon-related German forum with a section on Cocoon
> applications,
> including Lenya:
>
> www.cocoonforum.de
>
> You could try to post your question there.
well, it seems to me that this is a Lenya specific question and people
at the cocoonforum might just send him back ... (whereas one never knows).
I think people should be able to post their questions in any language if
they are not familiar enough with english, because on the Lenya list are
a lot of people understanding german, spanish, etc and I think we should
encourage people to post their questions and help each other.
Michi
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://cocoon.apache.org/lenya/
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Lenya and DB-Query (on German)
Posted by Andreas Hartmann <an...@apache.org>.
bss00ako@studserv.uni-leipzig.de wrote:
> Please apologize for posting my question in german, but my english isn't
> very good....
There's a Cocoon-related German forum with a section on Cocoon applications,
including Lenya:
www.cocoonforum.de
You could try to post your question there.
-- Andreas
>
> Es geht um folgendes:
> 1. Ich habe neues Dokument erstellt, die Dokument-ID lautet „showAll“
> 2. Dann habe ich die Datenbankverbindung
> (im $LENYA_HOME\build\lenya\webapp\WEB-INF\web.xml) definiert.
> 3. Die Treiberdatei wurde kopiert unter:
> $LENYA_HOME\build\lenya\webapp\WEB-INF\lib
> 4. cocoon.xconf wurde entsprechend korrigiert (<dburl> geändert, user und pass
> eingegeben)
> 5. Dann habe ich die Datei showAll.xsp erstellt
>
> <?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">
> <content>
> <esql:connection>
> <esql:pool>oracle_pool</esql:pool>
> <esql:execute-query>
> <esql:query>
> select * from phpbb_ranks
> </esql:query>
> <esql:results>
> <esql:row-results>
> <RANK_TITLE><esql:get-string column="RANK_TITLE"/></RANK_TITLE>
> <RANK_ID><esql:get-string column="RANK_ID"/></RANK_ID>
> </esql:row-results>
> </esql:results>
> <esql:no-results>
> Der Query gab eine leere Liste zurück!
> </esql:no-results>
> <esql:error-results>
> Es ist ein Fehler bei der Anfrage aufgetreten!
> </esql:error-results>
> </esql:execute-query>
> </esql:connection>
> </content>
> </xsp:page>
>
> 6. Und danach habe ich die showAll2html.xsl erstellt
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="content">
> <html>
> <body>
> <table border="1">
> <tr>
> <td><xsl:apply-templates /></td>
> </tr>
> </table>
> </body>
> </html>
> </xsl:template>
> <xsl:template match="rank_title">
> <xsl:value-of select="."/>
> </xsl:template>
> <xsl:template match="rank_id">
> <xsl:value-of select="."/>
> </xsl:template>
> </xsl:stylesheet>
>
> 7. Als letztes habe ich in der sitemap.xmap folgendes eingefügt
>
> <map:match pattern="showAll.html">
> <map:generate type="serverpages" src="xsp/showAll.xsp"/>
> <map:transform src="xslt/showAll2html.xsl"/>
> <map:serialize/>
> </map:match>
>
> Ich will also in dem Dokument showAll das Ergebnis von der Anfrage zu der
> Datenbank sehen.
>
> Wenn ich
>
> <map:match pattern="**">
> <map:mount uri-prefix="" src="publication-sitemap.xmap"/>
> </map:match>
>
> lösche, dann kommt die Fehlermeldung:
>
> The requested document '/showAll.html' with document-id '/showAll'
>
> Wenn ich
> <map:match pattern="showAll.html">
>
> mit
>
> <map:match pattern="**">
>
> ersetze und
>
> <map:match pattern="**">
> <map:mount uri-prefix="" src="publication-sitemap.xmap"/>
> </map:match>
>
> von der sitemap.xmap lösche, dann sehe ich das Ergebnis (die eine Zeile mit der
> Info von der Datenbank). Also…die Verbindung wird hergestellt und die Anfrage
> liefert Ergebnis. Ich muss also
>
> <map:match pattern="showAll.html">
> <map:generate type="serverpages" src="xsp/showAll.xsp"/>
> <map:transform src="xslt/showAll2html.xsl"/>
> <map:serialize/>
> </map:match>
>
> irgendwo anders einfügen. Ich weiß aber nicht, wo genau. Außerdem weiß ich
> nicht, warum showAll.html nicht gefunden werden kann (wenn ich <map:match
> pattern="showAll.html"> benutze).
>
> Ich hoffe, jemand kann mir doch helfen.
>
> CuPaKoB
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Lenya and DB-Query (on German)
Posted by Michael Wechner <mi...@wyona.com>.
bss00ako@studserv.uni-leipzig.de wrote:
Ich muss also
>
> <map:match pattern="showAll.html">
> <map:generate type="serverpages" src="xsp/showAll.xsp"/>
> <map:transform src="xslt/showAll2html.xsl"/>
> <map:serialize/>
> </map:match>
>
> irgendwo anders einfügen.
I guess you are refering to the default publication, right? If so then I
think you need to modify resp. add your pipeline to
http://svn.apache.org/repos/asf/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/pubs/default/doctypes.xmap
Hope that helps
Michi
Ich weiß aber nicht, wo genau. Außerdem weiß ich
> nicht, warum showAll.html nicht gefunden werden kann (wenn ich <map:match
> pattern="showAll.html"> benutze).
>
> Ich hoffe, jemand kann mir doch helfen.
>
> CuPaKoB
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>
--
Michael Wechner
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://cocoon.apache.org/lenya/
michael.wechner@wyona.com michi@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org