El vie, 16-06-2006 a las 13:38 +0200, Josias Thöny escribió: > On Fri, 2006-06-16 at 12:48 +0200, Thorsten Scherler wrote: > [...] > > > > It there no way to test in the usecase doCheckPreconditions() whether > > the upload is enabled? > > Only the CocoonServlet knows whether uploads are enabled or not. I > didn't find a way to get this information from a usecase class. > Either we have to patch cocoon or we have to read the value somehow from > a configuration file, which the build process would provide. (Or read it > directly from web.xml). > Or do you see any other options?
Yeah, breaking the encapsulation. ;) Anyway I reckon the quickest solution is to read out the build/webapp/WEB-INF/web.xml for the init-param[param-name='enable-uploads']/param-value/text(). Best practice is to create a helper class that could be easily contacted via a usecase and that returns whether upload is enabled or not. Every usecase that needs upload will then contact this helper in the doCheckPreconditions() and report failure in log and message object. wdyt? Oli can you provide a patch for such a helper and its usage in a usecase? TIA salu2 > > > Would it not work if we check whether the wrapping is possible or not? > > Same problem, only CocoonServlet knows if the request will be wrapped. > > Maybe we could ask on the cocoon ml. > > Josias > > > > > > salu2 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- thorsten "Together we stand, divided we fall!" Hey you (Pink Floyd) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
