RE: Dynamic sql in xsp
Vadim, And so I plug in: map:generate type=serverpages src=FileWithCIncludedXspRightNow.xsp map:parameter name=GeneratedSQL value=cocoon:/generatedSQL.sql/ /map:generate But all I get on the console is: param is: cocoon:/generatedSQL.sql Yes sure, what you put there is what you get. And no, (answering your next email), this won't be substituted, never. Oops. I guess I misunderstood the messages! I will move my code over the SQL Transformer. Thank you again for all your help and steering me towards the right path. Steve - 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: Dynamic sql in xsp
From: Stephen Ng [mailto:[EMAIL PROTECTED]] I need some advice. I have an xsp which is using esql. The query in the esql is dynamically generated (based upon the request string). I use cinclude to inject the dynamic sql into the esql element. Something like this: esql:execute-query esql:query cinclude:include src=cocoon://sql/generateSomeSql.sql/ /esql:query So, I have an xsp that is dynamic. This work just peachy. Problem is, it's slow--the java compiler has to rebuild the xsp every Of course it's slow :) time the sql changes, which is costing me 1/2 a second (and is pretty pointless, it's only the string that is changing). How can I get the xsp to load the string in some other way, so I that I can use a static xsp, and not have the compilation overhead? Why not generate SQL string *in* this XSP? That's would give the best performance. Or, other way is to obtain this SQL string into String programmatically, without using include. Vadim Thanks, Steve - 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: Dynamic sql in xsp
Why not generate SQL string *in* this XSP? That's would give the best performance. Or, other way is to obtain this SQL string into String programmatically, without using include. Okay I understand the suggestion but it doesn't work that well in my case. The reason is that the sql string is generated as a series of xslt transforms: map:match pattern=dynamicSql.sql map:generate type=request/ map:transform src=stylesheets/requestQuery.xslt/ map:serialize type=text/ /map:match And I like this approach, especially since I much prefer writing in XSLT than in Java. But in theory I could redo my (not trivial) xslt scripts in Java. Could I take the dynamic xslt-generated sql string and shove it into a cocoon parameter, and then read the parameter inside my xslt? Other place I thought about about sticking the sql was inside the session or (shudder) inside a file. Steve - 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: Dynamic sql in xsp
From: Stephen Ng [mailto:[EMAIL PROTECTED]] Why not generate SQL string *in* this XSP? That's would give the best performance. Or, other way is to obtain this SQL string into String programmatically, without using include. Here I mean do not use include to include your XSLT generated SQL, but access cocoon programmatically and get this SQL into String. Then, you will have static XSP source. Okay I understand the suggestion but it doesn't work that well in my case. The reason is that the sql string is generated as a series of xslt transforms: Have you considered SQL transformer? It works best here. map:match pattern=dynamicSql.sql map:generate type=request/ map:transform src=stylesheets/requestQuery.xslt/ map:serialize type=text/ /map:match And I like this approach, especially since I much prefer writing in XSLT than in Java. But in theory I could redo my (not trivial) xslt scripts in Java. Could I take the dynamic xslt-generated sql string and shove it into a cocoon parameter, and then read the parameter inside my xslt? Do you mean inside my XSP? Yes, you can do something like this. Vadim Other place I thought about about sticking the sql was inside the session or (shudder) inside a file. Steve - 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: Dynamic sql in xsp
Vadim, Here I mean do not use include to include your XSLT generated SQL, but access cocoon programmatically and get this SQL into String. Then, you will have static XSP source. Sounds good to me but I have absolutely no idea how to do this :-(. Can you give me a pointer? Have you considered SQL transformer? It works best here. Hmmm, no, will check this out. Could I take the dynamic xslt-generated sql string and shove it into a cocoon parameter, and then read the parameter inside my xslt? Do you mean inside my XSP? Yes, you can do something like this. Sorry, you are right; that's what I meant. I am having some trouble though which is probably related to your first suggestion. I found this code in the archives: String myParam = ; try{ myParam = parameters.getParameter(GeneratedSQL); System.out.println(param is: + myParam); } catch (Exception e) {} And so I plug in: map:generate type=serverpages src=FileWithCIncludedXspRightNow.xsp map:parameter name=GeneratedSQL value=cocoon:/generatedSQL.sql/ /map:generate But all I get on the console is: param is: cocoon:/generatedSQL.sql Thanks for your help, Steve - 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: Dynamic sql in xsp
Stephen, Maybe the SQL-Transformer can help you. Reinhard -Original Message- From: Stephen Ng [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 09, 2002 8:55 PM To: Vadim Gritsenko; [EMAIL PROTECTED] Subject: RE: Dynamic sql in xsp Why not generate SQL string *in* this XSP? That's would give the best performance. Or, other way is to obtain this SQL string into String programmatically, without using include. Okay I understand the suggestion but it doesn't work that well in my case. The reason is that the sql string is generated as a series of xslt transforms: map:match pattern=dynamicSql.sql map:generate type=request/ map:transform src=stylesheets/requestQuery.xslt/ map:serialize type=text/ /map:match And I like this approach, especially since I much prefer writing in XSLT than in Java. But in theory I could redo my (not trivial) xslt scripts in Java. Could I take the dynamic xslt-generated sql string and shove it into a cocoon parameter, and then read the parameter inside my xslt? Other place I thought about about sticking the sql was inside the session or (shudder) inside a file. Steve - 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: Dynamic sql in xsp
Maybe the SQL-Transformer can help you. Reinhard No doubt I should move to this eventually (I was just getting to like esql!)--as I understand it this would clearly eliminate the java compilation step since there is no xsp involved. Nevertheless I think short term I should be able to get a nice speed-up by peeling the sql off the cocoon parameter. I see people on the mailing list doing stuff like this: map:generate type=serverpages src=FileWithCIncludedXspRightNow.xsp map:parameter name=GeneratedSQL value=cocoon:/generatedSQL.sql/ /map:generate And expecting, I think, to have cocoon:/generatedSql.sql replaced by the pipeline results. But I only get the literal cocoon:/generatedSQL.sql. This should work, shouldn't it? Steve - 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: Dynamic sql in xsp
From: Stephen Ng [mailto:[EMAIL PROTECTED]] Vadim, Here I mean do not use include to include your XSLT generated SQL, but access cocoon programmatically and get this SQL into String. Then, you will have static XSP source. Sounds good to me but I have absolutely no idea how to do this :-(. Can you give me a pointer? Pointer: this list archive or dev list archive, this week, something about resolver. Have you considered SQL transformer? It works best here. Hmmm, no, will check this out. Please do, it is more suitable for you. Could I take the dynamic xslt-generated sql string and shove it into a cocoon parameter, and then read the parameter inside my xslt? Do you mean inside my XSP? Yes, you can do something like this. Sorry, you are right; that's what I meant. I am having some trouble though which is probably related to your first suggestion. I found this code in the archives: String myParam = ; try{ myParam = parameters.getParameter(GeneratedSQL); System.out.println(param is: + myParam); } catch (Exception e) {} And so I plug in: map:generate type=serverpages src=FileWithCIncludedXspRightNow.xsp map:parameter name=GeneratedSQL value=cocoon:/generatedSQL.sql/ /map:generate But all I get on the console is: param is: cocoon:/generatedSQL.sql Yes sure, what you put there is what you get. And no, (answering your next email), this won't be substituted, never. Vadim Thanks for your help, Steve - 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]