You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by rachid harradi <ra...@gmx.net> on 2007/01/25 15:12:03 UTC
from flowscript to pipline
Dear All,
i need your help. so i have following flowscript.
function main()
{
try
{
var myXml = java.io.ByteArrayOutputStream();
var pipeutil = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
var dbmanger=cocoon.getComponent("dbmanager.DBManager");
var nodeDoc = dbmanger.runObjection_HTML();
var filename = nodeDoc.getFilename();
var pfad = new Packages.java.lang.String("E:/temp/"+filename);
var psID_Idea=nodeDoc.getDocument_id();
var psDocumentType= nodeDoc.getDocumenttype();
var psCreator =nodeDoc.getCreater();
var c_Persist_Ameli_IP=new Packages.wohland.de.ameli.Process.C_Persist_Ameli_IP();
var c_Error=c_Persist_Ameli_IP.add_StandardDocument(
psID_Idea,
psDocumentType,
psCreator
);
myXml= nodeDoc.serializeToOutputStream();
("Objection_HTML.js",{"path":pfad},myXml);
myXml.close();
cocoon.sendPage("success.txt", null);
/** cocoon.sendPage("ok", {"model": model});**/
} catch( ex ) {
cocoon.log.error(ex);
// Smth. went wrong. Sending a error.txt file to the browser
cocoon.sendPage("error.txt", null);
}
}
then i have this Sitemape:
<map:pipeline>
<map:match pattern="">
<map:call function="main"/>
</map:match>
<map:match pattern="Objection_HTML.js">
<map:generate src="module:flow-attr:myXml"/>
<map:transform type="xslt" src="objection04.xslt"/>
<map:transform src="saveFile.xsl">
<map:parameter name="serializer" value="html" />
<map:parameter name="filepath" value="{flow-attribute:path}" />
</map:transform>
<map:transform type ="savefiles"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="success.txt">
<map:generate type="jx" src="documents/templates/success.jxt"/>
<map:serialize type="html"/>
</map:match>
<map:match pattern="error.txt">
<map:generate type="jx" src="documents/templates/error.jxt"/>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
when i call flowscript. there is on problem with to call the pipline "Objection_HTML.js". so i get error.text
Rachid Harradi
--
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: from flowscript to pipline
Posted by Jason Johnston <co...@lojjic.net>.
> Dear All,
>
> i get a error like :
> org.apache.excalibur.source.SourceException: The attribute: myXml is empty
>
>
> any idea
>
>
> Rachid Harradi
> -------- Original-Nachricht --------
> Datum: Thu, 25 Jan 2007 15:12:03 +0100
> Von: "rachid harradi" <ra...@gmx.net>
> An: users@cocoon.apache.org
> Betreff: from flowscript to pipline
>
>> Dear All,
>>
>> i need your help. so i have following flowscript.
>>
>> function main()
>> {
>> try
>> {
>> var myXml = java.io.ByteArrayOutputStream();
>> var pipeutil =
>> cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
>> var dbmanger=cocoon.getComponent("dbmanager.DBManager");
>>
>> var nodeDoc = dbmanger.runObjection_HTML();
>> var filename = nodeDoc.getFilename();
>> var pfad = new Packages.java.lang.String("E:/temp/"+filename);
>>
>> var psID_Idea=nodeDoc.getDocument_id();
>> var psDocumentType= nodeDoc.getDocumenttype();
>> var psCreator =nodeDoc.getCreater();
>>
>> var c_Persist_Ameli_IP=new
>> Packages.wohland.de.ameli.Process.C_Persist_Ameli_IP();
>>
>> var c_Error=c_Persist_Ameli_IP.add_StandardDocument(
>> psID_Idea,
>> psDocumentType,
>> psCreator
>> );
>>
>> myXml= nodeDoc.serializeToOutputStream();
>>
>> ("Objection_HTML.js",{"path":pfad},myXml);
What is going on on this above line? I assume this is where you're
wanting to send the display, if so it should look something like:
cocoon.sendPage("Objection_HTML.js", {path:pfad, myXml:myXml});
Note the myXml has to be *inside* the viewData JS object definition, not
outside of it. That would explain why your JX template cannot find it.
>> myXml.close();
>> cocoon.sendPage("success.txt", null);
>> /** cocoon.sendPage("ok", {"model": model});**/
>>
>> } catch( ex ) {
>> cocoon.log.error(ex);
>> // Smth. went wrong. Sending a error.txt file to the browser
>> cocoon.sendPage("error.txt", null);
>> }
>> }
>>
>>
>>
>> then i have this Sitemape:
>>
>> <map:pipeline>
>>
>> <map:match pattern="">
>> <map:call function="main"/>
>> </map:match>
>>
>>
>> <map:match pattern="Objection_HTML.js">
>>
>> <map:generate src="module:flow-attr:myXml"/>
>>
>>
>> <map:transform type="xslt" src="objection04.xslt"/>
>>
>> <map:transform src="saveFile.xsl">
>> <map:parameter name="serializer" value="html" />
>> <map:parameter name="filepath" value="{flow-attribute:path}"
>> />
>> </map:transform>
>>
>> <map:transform type ="savefiles"/>
>> <map:serialize type="html"/>
>>
>> </map:match>
>>
>> <map:match pattern="success.txt">
>> <map:generate type="jx"
>> src="documents/templates/success.jxt"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> <map:match pattern="error.txt">
>> <map:generate type="jx" src="documents/templates/error.jxt"/>
>> <map:serialize type="html"/>
>> </map:match>
>>
>> </map:pipeline>
>>
>>
>> when i call flowscript. there is on problem with to call the pipline
>> "Objection_HTML.js". so i get error.text
>>
>>
>> Rachid Harradi
>> --
>> "Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
>> Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>
> --
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: from flowscript to pipline
Posted by rachid harradi <ra...@gmx.net>.
Dear All,
i get a error like :
org.apache.excalibur.source.SourceException: The attribute: myXml is empty
any idea
Rachid Harradi
-------- Original-Nachricht --------
Datum: Thu, 25 Jan 2007 15:12:03 +0100
Von: "rachid harradi" <ra...@gmx.net>
An: users@cocoon.apache.org
Betreff: from flowscript to pipline
> Dear All,
>
> i need your help. so i have following flowscript.
>
> function main()
> {
> try
> {
> var myXml = java.io.ByteArrayOutputStream();
> var pipeutil =
> cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
> var dbmanger=cocoon.getComponent("dbmanager.DBManager");
>
> var nodeDoc = dbmanger.runObjection_HTML();
> var filename = nodeDoc.getFilename();
> var pfad = new Packages.java.lang.String("E:/temp/"+filename);
>
> var psID_Idea=nodeDoc.getDocument_id();
> var psDocumentType= nodeDoc.getDocumenttype();
> var psCreator =nodeDoc.getCreater();
>
> var c_Persist_Ameli_IP=new
> Packages.wohland.de.ameli.Process.C_Persist_Ameli_IP();
>
> var c_Error=c_Persist_Ameli_IP.add_StandardDocument(
> psID_Idea,
> psDocumentType,
> psCreator
> );
>
> myXml= nodeDoc.serializeToOutputStream();
>
> ("Objection_HTML.js",{"path":pfad},myXml);
> myXml.close();
> cocoon.sendPage("success.txt", null);
> /** cocoon.sendPage("ok", {"model": model});**/
>
> } catch( ex ) {
> cocoon.log.error(ex);
> // Smth. went wrong. Sending a error.txt file to the browser
> cocoon.sendPage("error.txt", null);
> }
> }
>
>
>
> then i have this Sitemape:
>
> <map:pipeline>
>
> <map:match pattern="">
> <map:call function="main"/>
> </map:match>
>
>
> <map:match pattern="Objection_HTML.js">
>
> <map:generate src="module:flow-attr:myXml"/>
>
>
> <map:transform type="xslt" src="objection04.xslt"/>
>
> <map:transform src="saveFile.xsl">
> <map:parameter name="serializer" value="html" />
> <map:parameter name="filepath" value="{flow-attribute:path}"
> />
> </map:transform>
>
> <map:transform type ="savefiles"/>
> <map:serialize type="html"/>
>
> </map:match>
>
> <map:match pattern="success.txt">
> <map:generate type="jx" src="documents/templates/success.jxt"/>
> <map:serialize type="html"/>
> </map:match>
>
> <map:match pattern="error.txt">
> <map:generate type="jx" src="documents/templates/error.jxt"/>
> <map:serialize type="html"/>
> </map:match>
>
> </map:pipeline>
>
>
> when i call flowscript. there is on problem with to call the pipline
> "Objection_HTML.js". so i get error.text
>
>
> Rachid Harradi
> --
> "Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
> Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org