Re: name an output-file dynamically in cocoon?
Hi Konstantin, I thought that I've already answered to this. See my previous post on your question. Generally, the 'type' attribute cannot be dynamic, because the pipeline is constructed before processing. I asked because you posted this before: *** This won't work, you should use nested actions in such cases. Actions work like an if ... else ... statement: if an action returns a non-null value then it's contents is processed, otherwise the following part is processed. In your particular case it'd be much better to return two values from the action, just you different keys in the HashMap to do it: results.put(xsl-choice, style.xsl); results.put(format, pdf); //shouldn't it be fo2pdf and then use it in your sitemap like this: map:match pattern=blabla map:act type=allSelect map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{xsl-choice}.xsl/ map:serialize type={format}/ /map:act /map:match This one should work fine. But it'd be even better if you've used input modules instead of an action. Something like this: map:match pattern=blabla map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{request-param:report_id}{request-param:service_id} _{reques t-param:output_id}.xsl/ map:serialize type={request-param:output_id}/ /map:match -- Konstantin Ok. Now I know that its impossible. Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Konstantin | | | Piroumian | | | kpiroumian@apach| | | e.org | | || | | 01/31/03 09:17 AM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: name an output-file dynamically in cocoon? | --| From: [EMAIL PROTECTED] Hi again, is it possible to name an output-file dynamically in cocoon. E.g. a pdf is created that has the name report_31_01_2003.pdf because its the 31 Jan 2003 (or report_GSM.pdf because I got a parameter with the value GSM). Is this possible at runntime? What do you mean by the output file name? Is it the Content-Disposition header? For this you should use an action, otherwise you would need to extend the serializer, but serializers cannot get runtime parameters (at lease it was so in 2.0.3). To keep up an other question, about why map:serialize type doesn't like my {xxx}-returns: I thought that I've already answered to this. See my previous post on your question. Generally, the 'type' attribute cannot be dynamic, because the pipeline is constructed before processing. -- Konstantin In your particular case it'd be much better to return two values from the action, just you different keys in the HashMap to do it: results.put(xsl-choice, style _16); results.put(format, fo2pdf); and then use it in your sitemap like this: map:match pattern=blabla map:act type=allSelect map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{xsl-choice} _{format}.xsl/ map:serialize type={format}/ /map:act /map:match The map:transform src={xsl-choice}_{format}.xsl/ part works great. But the map:serialize type={format}/ doesnt work. I always get
2 return values from an action?
Hi, thanks to you guys I got my action running finally. Now I have another question. For example: I have 1 xml file that could be displayed in 15 xsl-Stylesheets (in various formats: html, pdf, xls). Currently in my first action I choose the corresponding file. package test.acting; import java.util.Map; import java.util.HashMap; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.acting.AbstractAction; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.environment.ObjectModelHelper; import org.xml.sax.EntityResolver; public class XslSelection extends AbstractAction { public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters){ Map results = new HashMap(); Request request = ObjectModelHelper.getRequest(objectModel); String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); String output_id = request.getParameter(output_id); // Now choose the suitable XSL for the output if(report_id.equals(16) output_id.equals(html)) results.put(xsl-choice,report_16_html); else if(report_id.equals(16) output_id.equals(pdf)) results.put(xsl-choice,report_16_pdf); ... else if(report_id.equals(17) service_id.equals(GSM) output_id.equals(html)) results.put(xsl-choice,report_17GSM_html); else if(report_id.equals(17) !service_id.equals(GSM) output_id.equals(pdf)) results.put(xsl-choice,report_17_pdf); ... else results.put(xsl-choice,error); ... return results; } } In the other action I choose the output format. package test.acting; import java.util.Map; import java.util.HashMap; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.acting.AbstractAction; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.environment.ObjectModelHelper; import org.xml.sax.EntityResolver; public class OutputSelection extends AbstractAction { public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters){ Map results = new HashMap(); Request request = ObjectModelHelper.getRequest(objectModel); String output_id = request.getParameter(output_id); // Now choose the suitable XSL for the output if(output_id.equals(html)) results.put(output-choice,html); else if(routput_id.equals(pdf)) results.put(output-choice,pdf); ... else results.put(output-choice,html); ... return results; } } Thats how I use it in the sitemap: ... map:match pattern=blabla map:generate src=sampleoutput.xml/ map:act type=xslSelect map:transform src=stylesheets/{results}.xsl/ /map:act map:act type=outputSelect map:serialize type={output-choice}/ /map:act /map:match ... My question: Can I handle this somehow in one action (something like 2 return values)? Or do it somehow else? Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Re: 2 return values from an action?
Cool. Thanks for the quick response Konstantin. This one should work fine. But it'd be even better if you've used input modules instead of an action. Something like this: map:match pattern=blabla map:generate src=sampleoutput.xml/ map:transform src =stylesheets/{request-param:report_id}{request-param:service_id}_{reques t-param:output_id}.xsl/ map:serialize type={request-param:output_id}/ /map:match Do I have to place something extra in my sitemap for this solution? Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Konstantin | | | Piroumian | | | kpiroumian@apach| | | e.org | | || | | 01/30/03 09:32 AM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: 2 return values from an action? | --| From: [EMAIL PROTECTED] Hi, thanks to you guys I got my action running finally. Now I have another question. For example: I have 1 xml file that could be displayed in 15 xsl-Stylesheets (in various formats: html, pdf, xls). Currently in my first action I choose the corresponding file. skip what=first_action_code/ In the other action I choose the output format. skip what=second_action_code/ Thats how I use it in the sitemap: ... map:match pattern=blabla map:generate src=sampleoutput.xml/ map:act type=xslSelect map:transform src=stylesheets/{results}.xsl/ /map:act map:act type=outputSelect map:serialize type={output-choice}/ /map:act /map:match This won't work, you should use nested actions in such cases. Actions work like an if ... else ... statement: if an action returns a non-null value then it's contents is processed, otherwise the following part is processed. In your particular case it'd be much better to return two values from the action, just you different keys in the HashMap to do it: results.put(xsl-choice, style.xsl); results.put(format, pdf); and then use it in your sitemap like this: map:match pattern=blabla map:act type=allSelect map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{xsl-choice}.xsl/ map:serialize type={format}/ /map:act /map:match This one should work fine. But it'd be even better if you've used input modules instead of an action. Something like this: map:match pattern=blabla map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{request-param:report_id}{request-param:service_id} _{reques t-param:output_id}.xsl/ map:serialize type={request-param:output_id}/ /map:match -- Konstantin ... My question: Can I handle this somehow in one action (something like 2 return values)? Or do it somehow else? Jonny -- -- This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above)
How to open 2 windows (again)?
Hi, I asked this before and I got an good answer. I want to open 2 windows on one event. The xsp (I mean the data) would be the same, but the output would be: first window html, second window pdf. I was told that I couldn't handle this in the sitemap. I'd rather put an open(thePdf) in the onLoad-event of the html-page. Ok. Makes sense. But in the beginning I'm passing parameters to the xsp to create the data dynamically. So this would mean I would have to again pass the parameters to the html-page, which would pass them again to the xsp page. The data there would now get created a second time (and the pdf would be created). Because its much data (reports with maybe up to 10.000 - 50.000 entries) this is somehow a lousy solution. Isn't there a simpler way to solve this problem? Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Re: 2 return values from an action?
Hi again, In your particular case it'd be much better to return two values from the action, just you different keys in the HashMap to do it: results.put(xsl-choice, style _16); results.put(format, fo2pdf); and then use it in your sitemap like this: map:match pattern=blabla map:act type=allSelect map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{xsl-choice} _{format}.xsl/ map:serialize type={format}/ /map:act /map:match The map:transform src={xsl-choice}_{format}.xsl/ part works great. But the map:serialize type={format}/ doesnt work. I always get a Resource not found error. If I type in the type manually (e.g. map:serialize type=fo2pdf/ ) it works. What could cause this problem? I wonder, because the {format} in map:transform src =stylesheets/{xsl-choice}_{format}.xsl/ works. Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Konstantin | | | Piroumian | | | kpiroumian@apach| | | e.org | | || | | 01/30/03 09:32 AM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: 2 return values from an action? | --| From: [EMAIL PROTECTED] Hi, thanks to you guys I got my action running finally. Now I have another question. For example: I have 1 xml file that could be displayed in 15 xsl-Stylesheets (in various formats: html, pdf, xls). Currently in my first action I choose the corresponding file. skip what=first_action_code/ In the other action I choose the output format. skip what=second_action_code/ Thats how I use it in the sitemap: ... map:match pattern=blabla map:generate src=sampleoutput.xml/ map:act type=xslSelect map:transform src=stylesheets/{results}.xsl/ /map:act map:act type=outputSelect map:serialize type={output-choice}/ /map:act /map:match This won't work, you should use nested actions in such cases. Actions work like an if ... else ... statement: if an action returns a non-null value then it's contents is processed, otherwise the following part is processed. In your particular case it'd be much better to return two values from the action, just you different keys in the HashMap to do it: results.put(xsl-choice, style.xsl); results.put(format, pdf); and then use it in your sitemap like this: map:match pattern=blabla map:act type=allSelect map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{xsl-choice}.xsl/ map:serialize type={format}/ /map:act /map:match This one should work fine. But it'd be even better if you've used input modules instead of an action. Something like this: map:match pattern=blabla map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{request-param:report_id}{request-param:service_id} _{reques t-param:output_id}.xsl/ map:serialize type={request-param:output_id}/ /map:match -- Konstantin ... My question: Can I handle this somehow in one action (something like 2 return values)? Or do it somehow else? Jonny -- -- This electronic message contains information from the mmo2 plc Group which may be privileged
name an output-file dynamically in cocoon?
Hi again, is it possible to name an output-file dynamically in cocoon. E.g. a pdf is created that has the name report_31_01_2003.pdf because its the 31 Jan 2003 (or report_GSM.pdf because I got a parameter with the value GSM). Is this possible at runntime? To keep up an other question, about why map:serialize type doesn't like my {xxx}-returns: In your particular case it'd be much better to return two values from the action, just you different keys in the HashMap to do it: results.put(xsl-choice, style _16); results.put(format, fo2pdf); and then use it in your sitemap like this: map:match pattern=blabla map:act type=allSelect map:generate src=sampleoutput.xml/ map:transform src=stylesheets/{xsl-choice} _{format}.xsl/ map:serialize type={format}/ /map:act /map:match The map:transform src={xsl-choice}_{format}.xsl/ part works great. But the map:serialize type={format}/ doesnt work. I always get a Resource not found error. If I type in the type manually (e.g. map:serialize type=fo2pdf/ ) it works. What could cause this problem? I wonder especially because the {format} in map:transform src =stylesheets/{xsl-choice}_{format}.xsl/ works. Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Re: Cocoon use worldwide
Sorry! Could we stop this talk about USA vs. Europe. I have a German and U.S. citizenship and I'm sad how the relationship is developing right now. Pointing out the weaknesses and advantages of these cultures won't improve it. ;-) Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Miles Elam | | | miles@pcextremis| | | t.com | | || | | 01/31/03 08:08 AM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Cocoon use worldwide | --| Niclas Hedhman wrote: I think I would agree with your initial assessment that there may be underlying values that infuence the mind set. Exactly what it is, I am not sure, but I don't think it is Microsoft in this case. Perhaps more reasonable is the overall american attitude of I'm the best, I'm the greatest, I'm gonna get rich., which promotes proprietaryship and commercialization of good ideas. Europeans at large are more modest and humble, and have stronger need of being part of than in control of. Hey! Let's not get all morally superior here least someone bring up the location of the two largest wars in the last century. And let's not forget that there are a few natives of the United States patching the Linux kernel, working on the various BSDs, hanging around on these lists, etc. Modest and humble indeed... ;-) - Miles - 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] - 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]
How to use an action correctly?
Hi, I've written an action and compiled without errors. package test.acting; import java.util.Map; import java.util.HashMap; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.acting.AbstractAction; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.environment.ObjectModelHelper; import org.xml.sax.EntityResolver; public class XslSelection extends AbstractAction { public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters){ Map results = new HashMap(); Request request = ObjectModelHelper.getRequest(objectModel); String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); // Now choose the suitable XSL for the output if(report_id.equals(16)) results.put(report_16,report_16); else if(report_id.equals(17) service_id.equals(GSM)) results.put(report_17GSM,report_17GSM); else if(report_id.equals(17) !service_id.equals(GSM)) results.put(report_17,report_17); else if(report_id.equals(19)) results.put(report_19,report_19); else if(report_id.equals(18)) results.put(report_18,report_18); else results.put(error,error); return results; } } I put as a jar in the Cocoon/Web-Inf/lib. This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Using an action correctly?
Hi, I have written an action and compiled it successfully. I put it in the cocoon/WEB-INF/lib folder as a jar: package test.acting; import java.util.Map; import java.util.HashMap; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.acting.AbstractAction; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.environment.ObjectModelHelper; import org.xml.sax.EntityResolver; public class XslSelection extends AbstractAction { public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters){ Map results = new HashMap(); Request request = ObjectModelHelper.getRequest(objectModel); String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); // Now choose the suitable XSL for the output if(report_id.equals(16)) results.put(report_16,report_16); else if(report_id.equals(17) service_id.equals(GSM)) results.put(report_17GSM,report_17GSM); else if(report_id.equals(17) !service_id.equals(GSM)) results.put(report_17,report_17); else if(report_id.equals(19)) results.put(report_19,report_19); else if(report_id.equals(18)) results.put(report_18,report_18); else results.put(error,error); return results; } } In the sitemap I import it as follows. ... map:actions !-- here is the class defined that is used for choosing the right xsl for the output -- map:action name=xslSelect src=test.acting.XslSelection/ ... /map:actions Thats how I use it in the sitemap: ... map:match pattern=blabla map:generate src=sampleoutput.xml/ map:act type=xslSelect map:transform src=stylesheets/{results}.xsl/ map:serialize type=fo2pdf/ /map:act /map:match ... But I only get the error that cocoon can't find the page (Resource not found). Invoking the different stylesheets manually is no problem, but using the action. Since it is my first action, I don't know where to look for the error. Another question. Can't I just give back a String? My XSLs are called report_16.xsl, report_17.xsl, report_18.xsl, report_19.xsl, error.xsl Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
How to open 2 windows?
Hi, I want to open 2 windows on one event. The xml/xsp (I mean the data) would be the same, but the output would be: first window html, second window pdf. e.g. my dummy sitemap: ... !-- on submit generate *.html and *.pdf output -- map:match pattern=html-pdf map:generate type=serverpages src=html-pdf.xsp/ !-- generate a window with html output map:transform src=html.xsl/ map:serialize -- !-- generate another window with pdf output map:transform src=pdf.xsl/ map:serialize type=fo2pdf/ -- /map:match How can I manage this? Can I mange this from my sitemap? Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Whats wrong with my action?
Hi, I'm trying to write an action for cocoon. the code: package o2germany.SolutionDelivery.FraudManagement.actions; import java.util.Map; import java.util.HashMap; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.acting.AbstractAction; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.environment.ObjectModelHelper; import org.xml.sax.EntityResolver; public class xslSelect extends AbstractAction { public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters){ Map results = new HashMap(); Request request = ObjectModelHelper.getRequest(objectModel); String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); // Now choose the suitable XSL for the output if(report_id.equals(16)) results.put(report_16); else if(report_id.equals(17)) results.put(report_17GSM); else if(report_id.equals(19)) results.put(report_19); else if(report_id.equals(18)) results.put(report_18); else results.put(error); // some other crap return results; } } Somehow the compiler does't like the HashMap in there. Somehow the compiler doesn't like the AbstractAction (I'm not even sure if this is right for my action) I want to simply give back these Strings to my sitemap. Could anybody tell me what i'm doing wrong? cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
RE: Different stylesheets called on runtime?
Hi Geff, thanks for your help again. I had a day off, so there was no response from me. I still don't get a couple of parts from your answer: /* the class***/ package o2germany.SolutionDelivery.FraudManagement.actions; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentSelector; import org.apache.avalon.framework.parameters.Parameters; import org.apache.avalon.framework.activity.Disposable; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.ObjectModelHelper; import org.apache.cocoon.acting.ConfigurableComposerAction; import org.apache.avalon.excalibur.datasource.DataSourceComponent; public class StylesheetSelection extends ConfigurableComposerAction implements Disposable { protected ComponentSelector dbselector; DataSourceComponent datasource; public Map act(Redirector redirector, SourceResolver resolver, MapobjectModel, String source, Parameters parameters) throws Exception { HashMap results = new HashMap(); Request request = ObjectModelHelper.getRequest(objectModel); // Get the passed parameters (if there are any) int whichXSL; String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); String nbt_pattern_id = request.getParameter(nbt_pattern_id); String search_txt = request.getParameter(search_txt); // Check against a database, bla, bla //e.g whichXSL = 2; ... whichXSL = 2; ... // Now I want to choose the suitable XSL if( whichXSL == 1) // Choose number1.xsl results.put(number1); else if( whichXSL == 2) // Choose number2.xsl results.put(number2); else if( whichXSL == 3) // Choose number3.xsl results.put(number3); else results.put(default); return results; } /*/ But I don't still get where to place these methods (and what they are): /*/ public void compose(ComponentManager manager) throws ComponentException { ... } public void configure(Configuration conf) throws ConfigurationException { ... } public void dispose() { ... } /*/ Where do they belong??? Is the sql-Part in the class or somwhere else? ... String nbt_pattern_id = request.getParameter(nbt_pattern_id); String search_txt = request.getParameter(search_txt); // Check against a database, bla, bla //should the sql be in here ; ... whichXSL = 2; ... I'm asking because you put the sql-part to the end. Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Geoff Howard | | | cocoon@leveragew| | | eb.com | | || | | 01/23/03 10:24 PM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: RE: Different stylesheets called on runtime?
@Geoff: Different stylesheets called on runtime?
Hi Geoff, thanks for your help again. I had a day off, so there was no response from me. And my mail yesterday did't seem to come through somehow. I still don't get a couple of parts from your answer: /* the class***/ package o2germany.SolutionDelivery.FraudManagement.actions; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentSelector; import org.apache.avalon.framework.parameters.Parameters; import org.apache.avalon.framework.activity.Disposable; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.SourceResolver; import org.apache.cocoon.environment.ObjectModelHelper; import org.apache.cocoon.acting.ConfigurableComposerAction; import org.apache.avalon.excalibur.datasource.DataSourceComponent; public class StylesheetSelection extends ConfigurableComposerAction implements Disposable { protected ComponentSelector dbselector; DataSourceComponent datasource; public Map act(Redirector redirector, SourceResolver resolver, MapobjectModel, String source, Parameters parameters) throws Exception { HashMap results = new HashMap(); Request request = ObjectModelHelper.getRequest(objectModel); // Get the passed parameters (if there are any) int whichXSL; String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); String nbt_pattern_id = request.getParameter(nbt_pattern_id); String search_txt = request.getParameter(search_txt); // Check against a database, bla, bla //e.g whichXSL = 2; ... whichXSL = 2; ... // Now I want to choose the suitable XSL if( whichXSL == 1) // Choose number1.xsl results.put(number1); else if( whichXSL == 2) // Choose number2.xsl results.put(number2); else if( whichXSL == 3) // Choose number3.xsl results.put(number3); else results.put(default); return results; } /*/ But I don't still get where to place these methods (and what they are): /*/ public void compose(ComponentManager manager) throws ComponentException { ... } public void configure(Configuration conf) throws ConfigurationException { ... } public void dispose() { ... } /*/ Where do they belong??? Is the sql-Part in the class or somwhere else? ... String nbt_pattern_id = request.getParameter(nbt_pattern_id); String search_txt = request.getParameter(search_txt); // Check against a database, bla, bla //should the sql be in here ; ... whichXSL = 2; ... I'm asking because you put the sql-part to the end. Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Geoff Howard | | | cocoon@leveragew| | | eb.com | | || | | 01/23/03 10:24 PM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: RE: Different
Different stylesheets called on runtime?
Hi, I have for example an XSP and various XSLs for the output (of the data from that XSP). In the xsp:logic-part it should/is deceided on runtime, which one of the XSLs to use for the output. Where do I have to manage that? I mean, how/where do I tell cocoon which XSL to use(In the sitemap?Can the xsp handle that?)? Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
RE: Different stylesheets called on runtime?
Hi Geff, thanks for your help. Ok. Example: _ My XSP, that should choose which XSL to use.: ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-request=http://apache.org/xsp/request/2.0; xsp:structure xsp:includejava.sql.*/xsp:include^ /xsp:structure results !-- Get the passed parameters (if there are any) -- xsp:logic int whichXSL; String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); String nbt_pattern_id = request.getParameter(nbt_pattern_id); String search_txt = request.getParameter(search_txt); ... // Check against a database, bla, bla ... // Now I want to choose the suitable XSL if( whichXSL == 1) // Choose number1.xsl else if( whichXSL == 2) // Choose number2.xsl else if( whichXSL == 3) // Choose number3.xsl ... // data data ... ... Part of sitemap: ... map:match pattern=differentXSLs map:generate type=serverpages src=differentXSLs.xsp/ !-- if whichXSL == 1 -- !-- map:transform src=number1.xsl/-- !-- if whichXSL == 2 -- !-- map:transform src=number2.xsl/-- !-- if whichXSL == 3 -- !-- map:transform src=number3.xsl/-- ... map:serialize/ /map:match So how and where should I place my action (and how should it look like)? How should my xsp look like then? How should my xsl look like then? Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Geoff Howard | | | cocoon@leveragew| | | eb.com | | || | | 01/23/03 04:27 PM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: RE: Different stylesheets called on runtime? | --| -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 9:47 AM To: [EMAIL PROTECTED] Subject: Re: Different stylesheets called on runtime? Thanks for the quick and helpfull response. Thats the answer I kind of expected and feared most. That means for me: Getting comfortable with actions. Well, the good news is that in my opinion (and experience) actions are about as easy as it gets when extending cocoon. There's only one method to implement, and the only contract you need to code for is to return null if the action fails and return a Map of the key-value pairs you need to reference in the sitemap if the action is successful. (or any empty map if you don't need to reference values in the sitemap). Ask some specific questions here about what problems you have getting started. Geoff Howard Cheers Jonny - 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] - 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
Re: Different stylesheets called on runtime?
Unfortunately, you've skipped the crucial part i.e. how the xsl is chosen :-| I think I don't understand you right., but this should be just an dummy example. So if(whichXSL == 1) then the number1.xsl should be choosen for output, else if(whichXSL == 2) then the number2.xsl should be choosen for output, bla, bla. I hope this is clearer. around one transform and use a returned value as file name, e.g. map:act type=sel-style map:transform src={file}.xsl/ /map Ok. But I don't get the part (in combination with the xsp) how, if for example number2.xsl is choosen, to choose it. How do I produce the return value in the xsp? How should my xsl look like then? no change. Copypaste mistake. Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+-- | | Christian Haul | | | [EMAIL PROTECTED]| | | rmstadt.de| | | | | | 01/23/03 06:14 PM | | | Please respond to | | | cocoon-users | | | | |-+-- --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Different stylesheets called on runtime? | --| On 23.Jan.2003 -- 05:42 PM, [EMAIL PROTECTED] wrote: int whichXSL; String report_id = request.getParameter(report_id); String service_id = request.getParameter(service_id); String nbt_pattern_id = request.getParameter(nbt_pattern_id); String search_txt = request.getParameter(search_txt); ... // Check against a database, bla, bla ... // Now I want to choose the suitable XSL if( whichXSL == 1) Unfortunately, you've skipped the crucial part i.e. how the xsl is chosen :-| ... map:match pattern=differentXSLs map:generate type=serverpages src=differentXSLs.xsp/ !-- if whichXSL == 1 -- !-- map:transform src=number1.xsl/-- !-- if whichXSL == 2 -- !-- map:transform src=number2.xsl/-- !-- if whichXSL == 3 -- !-- map:transform src=number3.xsl/-- ... map:serialize/ /map:match So how and where should I place my action (and how should it look like)? around one transform and use a returned value as file name, e.g. map:act type=sel-style map:transform src={file}.xsl/ /map How should my xsp look like then? rip out everything related to the XSL How should my xsl look like then? no change. Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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] - 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]
Re: Different stylesheets called on runtime?
OK, now I have to think of an other way, how to choose my XSLs. or The different XSLs are choosen from request parameters and an resulting database query. Is there a way to do that in an action or somewhere else? Cheers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+-- | | Christian Haul | | | [EMAIL PROTECTED]| | | rmstadt.de| | | | | | 01/23/03 06:51 PM | | | Please respond to | | | cocoon-users | | | | |-+-- --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Different stylesheets called on runtime? | --| On 23.Jan.2003 -- 06:35 PM, [EMAIL PROTECTED] wrote: Unfortunately, you've skipped the crucial part i.e. how the xsl is chosen :-| I think I don't understand you right., but this should be just an dummy example. So if(whichXSL == 1) then the number1.xsl should be choosen for output, else if(whichXSL == 2) then the number2.xsl should be choosen for output, bla, bla. I hope this is clearer. You cannot change the transformation with data from the XSP. Period. Before you reach that part of the XSP, the pipeline has been setup and the transformation has already begun. If you told us how the style is chosen, we might have been able to point you to some existing components to use instead. around one transform and use a returned value as file name, e.g. map:act type=sel-style map:transform src={file}.xsl/ /map Ok. But I don't get the part (in combination with the xsp) how, if for example number2.xsl is choosen, to choose it. How do I produce the return value in the xsp? You don't. It's impossible. (sort of) Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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] - 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]
URL-bar (the bar where you type in the URLs in the browser) question
Hi, I want to avoid that in the URL-bar (the bar where you type in the URLs in the browser) certain URLs are displayed. For example: My sitemap: ... map:pipelines map:pipeline map:match pattern= map:redirect-to uri=login/ /map:match map:match pattern=login map:generate type=serverpages src =stylesheets/login.xsp/ map:serialize/ /map:match map:match pattern=interactive map:generate type=serverpages src=interactive.xsp/ map:transform src=interactive.xsl/ map:serialize/ /map:match My aim is, that if I e.g. map:match pattern=interactive is called I don't have http://localhost:8080/cocoon/example/interactive; standing in the URL-bar. Instead I want http://localhost:8080/cocoon/example/; (or something else) standing there. How can I do that? Cheeers Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
RE: xsp:structure - question
OK. Still not running. web.xml: init-param param-nameextra-classpath/param-name param-valueWEB-INF/classes/fraud_management/param-value /init-param java-Class in .../cocoon/Web-Inf/classes/fraud_managment: package fraud_management; class execute_report { public String get_fraud() { String hello = Servus; return hello; } } xsp: ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xsp:structure xsp:includefraud_management.execute_report/xsp:include /xsp:structure results xsp:logic execute_report er = new execute_report(); String hello = er.get_fraud(); option xsp:logic xsp:attribute name =blaxsp:exprhello/xsp:expr/xsp:attribute /xsp:logic /option /xsp:logic /results /xsp:page I have a feeling that I don't get the entries in the web.xml param-valueWEB-INF/extra-classes1:/[YOU-ABSOLUTE-PATH-TO]/own.jar/param-value Do I have to insert additionally the class name? e.g. for Windows systems param-valueWEB-INF/classes/fraud_managment;C:/Apache.../fraud_managment/execute_report.class/param-value Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Geoff Howard | | | cocoon@leveragew| | | eb.com | | || | | 01/15/03 07:37 PM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: RE: xsp:structure - question | --| -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 15, 2003 11:45 AM To: [EMAIL PROTECTED] Subject: xsp:structure - question Hi, I want to include my own Java-Class in my XSP-Page snip/ ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xsp:structure xsp:include !-- Meine Klasse execute_report --/xsp:include /xsp:structure correct. results xsp:logic String hello = null; hello = get_g(); option xsp:logic xsp:attribute name=blahello/xsp:attribute change the last line to: xsp:attribute name =blaxsp:exprhello/xsp:expr/xsp:attribute You don't state what doesn't work but if you mean the page returned only a literal attribute bla=hello then this should be your only problem from what I can see. /xsp:logic /option /xsp:logic /results /xsp:page Where do I have to place my Java-Class. Under .../cocoon/Web-Inf/classes (where I hava placed it right now!)? yes, that works - make sure that if your class is declared part of a package that you replicate the directory structure under WEB-INF/classes (many people seem to make that mistake) How do I call methods, like my method get_g()? The same way you would from any java class (your usage above should work fine) since XSP generates and compiles a java file the first time your page is executed. I would highly recommend going to take a look at it. It's under your servlet container's work directory - most likely $TOMCAT_HOME/work/Standalone/localhost/cocoon/cocoon-files/org/apache/cocoon /www/jonny/filename_xsp.java - you may have to browse around for it if I've made incorrect guesses. HTH, Geoff Howard - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To
xsp:structure - question
Hi, I want to include my own Java-Class in my XSP-Page for example: execute_report.class : class execute_report { public String get_g() { String hello = Hi there; return hello; } public static void main(String[] args) { System.out.println(Yo); } } My XSP in Folder: .../cocoon/jonny/xsp : ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xsp:structure xsp:include !-- Meine Klasse execute_report --/xsp:include /xsp:structure results xsp:logic String hello = null; hello = get_g(); option xsp:logic xsp:attribute name=blahello/xsp:attribute /xsp:logic /option /xsp:logic /results /xsp:page Where do I have to place my Java-Class. Under .../cocoon/Web-Inf/classes (where I hava placed it right now!)? How do I call methods, like my method get_g()? My approach doesn't work. Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
ESQL and JavaScript
I have a Javascript-Function, which gets a parameter passed. I want this parameter now in my ESQL-Statement. Is there a way to do this? My (Example)-Function: function insert(ID) { esql:connection esql:poolcdr/esql:pool esql:execute-query esql:query SELECT * FROM table_1 WHERE id_1 = Here I want the Parameter (ID) /esql:query esql:results esql:row-results ... /esql:row-results /esql:results esql:no-results ... /esql:no-results esql:error-results ... /esql:error-results /esql:execute-query /esql:connection } Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Re: ESQL and JavaScript
Hi, I know its not the (to be harmless) nicest way, but my ESQL in JavaScript works fine. I just wanted to know if it is possible in Javascript-Functions to place passed parameters in ESQL-Statements. Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+-- | | Christian Haul | | | [EMAIL PROTECTED]| | | rmstadt.de| | | | | | 01/08/03 11:30 AM | | | Please respond to | | | cocoon-users | | | | |-+-- --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: ESQL and JavaScript | --| On 08.Jan.2003 -- 10:53 AM, [EMAIL PROTECTED] wrote: I have a Javascript-Function, which gets a parameter passed. I want this parameter now in my ESQL-Statement. Is there a way to do this? Javascript (if client side) is completely unrelated to XSP and ESQL in particular. Server side Javascript (i.e. flow script) can pass parameters to the XSP. See examples (e.g. calculator) for this and in particular jpath.xsl. Passing values using request attributes is also possible. For dynamic queries with ESQL please see the docs. Starting with 2.0.4 there is a section dedicated to this on the ESQL page. http://xml.apache.org/cocoon/userdocs/xsp/esql.html Chris. Please follow up summarizing your problem and which suggested solution / information worked for you when you consider your problem solved. Add SUMMARY: to the subject line. This will make FAQ generation and searching the list easier. In addition, it makes helping you more fun. Thank you. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 - 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] - 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]
Re: ESQL and JavaScript
Hi, just like this: ... script type=text/javascript language=JavaScript function example() { i=0; esql:connection esql:poolxxx/esql:pool esql:execute-query esql:query SELECT description, service_id FROM report WHERE report_id = xsp:exprreport_id/xsp:expr) ORDER BY display_order /esql:query esql:results esql:row-results document.getElementById (SERVICE_ID).options[i++] = new Option(esql:get-string column =description/,esql:get-string column=service_id/); /esql:row-results /esql:results esql:no-results document.getElementById (SERVICE_ID).options[i++] = new Option(,); /esql:no-results esql:error-results ... /esql:error-results /esql:execute-query /esql:connection service_dropdown_change(); } /script ... Jonny |-+ | || |-+ --| | | --| On 08.Jan.2003 -- 11:50 AM, [EMAIL PROTECTED] wrote: Hi, I know its not the (to be harmless) nicest way, but my ESQL in JavaScript works fine. I just wanted to know if it is possible in Javascript-Functions to place passed parameters in ESQL-Statements. I'm missing something here: how do you manage to have ESQL in javascript? AFAIK there is no logicsheet for esql + javascript XSP. Chris. - 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]
Comparison in ESQL doesn't work
Hi, I have a strange problem. I'm trying to compare two values in the esql:row-results-Part with an if-compare, but somehow the if-construct is never entered even if there are matches. (I put the System.out's to see if there are matches. There are some.) Here my XSP: ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-request=http://apache.org/xsp/request/2.0; xmlns:esql=http://apache.org/cocoon/SQL/v2; interactive !-- Get the passed parameters (if there are any) -- xsp:logic String report_id = xsp-request:get-parameter name =report_id/; String service_id = xsp-request:get-parameter name =service_id/; /xsp:logic main report_id esql:connection esql:pool/esql:pool esql:execute-query esql:query SELECT DESCRIPTION, ID FROM REPORT /esql:query esql:results esql:row-results option xsp:attribute name=value esql:get-string column=ID/ /xsp:attribute xsp:attribute name=description esql:get-string column=description/ /xsp:attribute xsp:logic System.out.println(\' + report_id + \' == \' + esql:get-string column=ID/ +\'); if(report_id == esql:get-string column =ID/) { System.out.println(Yipie); xsp:attribute name=selected/ } /xsp:logic /option /esql:row-results /esql:results esql:no-results /esql:no-results esql:error-results /esql:error-results /esql:execute-query /esql:connection /report_id /main /interactive /xsp:page Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Sessions and xsp:logic
Hi, I'm checking in the xsp:logic part if a xsp-session is valid. If yes load this, else load that. Is there a way to do some kind of that. I'm trying to restrict a page. Or is there a other approach. My non functioning approach: ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; html head title Portal /title xsp:logic if(xsp-session:get-attribute name=userid/ != null) { /head body bottomMargin=0 leftMargin=0 ... ... } else { meta http-equiv=refresh content=5;url=login/ /head body p Login failed /p /body } /xsp:logic /html /xsp:page Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Re: Sessions and xsp:logic
Unfortuneatly I don't know anything about( container based authentication). I tried cocoon authentification, but it didn't work. I pretty new to web-based stuff and cocoon. regards, Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | SAXESS - Hussayn | | | Dabbous | | | [EMAIL PROTECTED]| | | om | | || | | 12/20/02 09:56 AM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Sessions and xsp:logic | --| [EMAIL PROTECTED] wrote: Hi, I'm checking in the xsp:logic part if a xsp-session is valid. If yes load this, else load that. Is there a way to do some kind of that. I'm trying to restrict a page. Or is there a other approach. If you only want to restrict a page, why not simply setting up an authentication framework? I did it with container based authentication, but never tried with cocoon-authentication. If you want to differently on different restricted pages, my approach does not work well. Maybe this can be done much better with cocoon authentication. By the way, does it make sense to split this task as follows: use the container for authentication use cocoon for authorisation By this i could build up very sophisticated authorisation schemes while letting the container bother with the login... If this makes sense i would be interested how this could be set up. regards, hussayn My non functioning approach: ?xml version=1.0 encoding=ISO-8859-1? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; html head title Portal /title xsp:logic if(xsp-session:get-attribute name=userid/ != null) { /head body bottomMargin=0 leftMargin=0 ... ... } else { meta http-equiv=refresh content =5;url=login/ /head body p Login failed /p /body } /xsp:logic /html /xsp:page Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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] - 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]
meta http-equiv=refresh question
Hi, I wann have a refresh: meta http-equiv=refresh content=5;url=login/ after 5 seconds on my xsp page. The url=login is a page that is listed in my sitemap. Trying it this way doesn't work. What am I doing wrong? Greetings Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Re: still stuck with esql connection pool
Hi, I had the same problem, till I read this thread (http://www.mail-archive.com/avalon-users@jakarta.apache.org/msg00101.html). I use JDK 1.41. I compiled Cocoon under 1.41 and now it works fine. I read that this wass a bug in Cocoon. I hope I could help. Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. |-+ | | Nils Leßmann | | | [EMAIL PROTECTED]| | | annheim.de | | || | | 12/19/02 06:15 PM| | | Please respond to| | | cocoon-users | | || |-+ --| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: still stuck with esql connection pool | --| Hi! Sorry to bother you again, but I still can't get that esql-connection to work, I've tried three different databases up to now... Whenever I use esql:pool I get the following exception: Could not get the datasource org.apache.avalon.excalibur.datasource.NoValidConnectionException: No valid JdbcConnection class available Using esql:dburl etc. works just fine. I can see in the database monitor that cocoon _has_ established the connection to the database using the parameters I set up in cocoon.xconf. Is there a way to get some more information in order to hunt down what I'm doing wrong? Something like a list of connections cocoon has set up, some status info or whatever. Thankful for any hints, Nils - 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]
User Authentication?
Hi, I'm having a hard time understanding the tutorial on authentication from the coccon website. My case: I have a loginpage (login) with a field for user and password. If the user is logged in successfully, he should be redirected to services, which is protected. My questions: How / Where do I check the parameters, if I wanna check the parameters with entries in a database. If I try to access the page services now directly, I get the following error message: The org.apache.cocoon.www.file_.C_.Apache_Group.Tomcat_4_1.webapps.cocoon.mount.fraud.sitemap_xmap notifies that org.apache.avalon.framework.component.ComponentException says: UnnamedSelector: ComponentSelector could not find the component for hint [auth-protect] More precisely: org.apache.avalon.framework.component.ComponentException: UnnamedSelector: ComponentSelector could not find the component for hint [auth-protect] Here is my sitemap: map:matchers default=wildcard/ /map:components !-- === Pipelines = -- map:pipelines map:component-configurations authentication-manager handlers handler name=userPortal redirect-to uri=login/ authentication uri =userLogin/ /handler /handlers /authentication-manager /map:component-configurations map:pipeline map:match pattern=login map:generate type=xsp src=login.xsp/ map:serialize/ /map:match map:match pattern=userLogin map:act type=auth-login map:parameter name=handler value =userPortal/ map:parameter name=parameter_userid value ={request:user}/ map:parameter name=parameter_password value={request:password}/ map:redirect-to uri=services/ /map:act !-- authentication failed: Back to login-page -- map:generate type=xsp src=login.xsp/ map:serialize/ /map:match map:match pattern=services map:act type=auth-protect map:parameter name=handler value =userPortal/ map:generate type=xsp src=services.xsp/ map:serialize/ /map:act /map:match Greetings Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Re: Problems with fo:external-graphic
Hi, have you tried for example the path on your harddisc: fo:external-graphic src=file:///C:\images\logo.gif/. I had the same problems, and this was the only way it worked. Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
Submit and xsp-request:get-parameter name ...
Hi, I have a select box with several entries (with values). An onCange - event should post the the value of the selected entrie. I'm trying to do this in as much javascrit as possible. Here my code so far: !-- This should post the value of the selected entrie to the interactive xsp-page, but I don't know if this is the right approach form name=reportFrm method=post action=interactive select name=report_id onchange=document.reportFrm.submit(); option value=XX/option !-- This should get the passed parameters (the value of the selected entrie) function passedParameter() { xsp:logic String value = xsp-request:get-parameter name=report_id /; /xsp:logic ... Thanks Jonny This electronic message contains information from the mmo2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. - 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]
esql and javascript in xsp
Hi, I' having problems with JavaScript functions in XSP-Pages. This is part of my funnction: function populate_service_dropdown(report_id) { report_id = document.reportFrm.report_id.options[document.reportFrm.report_id.selectedIndex].id; i=0; esql:connection esql:driveroracle.jdbc.driver.OracleDriver/esql:driver esql:dburljdbc:oracle:thin:@XX::X/esql:dburl esql:usernameX/esql:username esql:passwordXX/esql:password esql:execute-query esql:query SELECT description, service_id FROM report_services WHERE report_id = '16' AND active_ind = 'Y' ORDER BY display_order /esql:query esql:results I want the passed parameter (report_id) put in the select-statement like this: WHERE id = report_id I was told it would work something like this: WHERE id = xsp:exprreport_idxsp:expr. But this didnt't help. Do I have to store the passed parameter first in a variable? What should I do? Thanks Jonny - 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]