Re: upload file-overwrite permission(Waiting for reply...)
Hi, There's currently no other way than to set ALLOW_OVERWRITE to true and recompile cocoon. Someone may want to make this configurable from web.xml Jeroen - Original Message - From: Niket Anand [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 12:43 PM Subject: upload file-overwrite permission(Waiting for reply...) Hello All, I am able to upload any file to /WEB-INF/work/image-dir directory as specified in web.xml file. If I want to upload same file again, it saves to directory with 1_image.gif name(it saves with new file name by appending 1_ before actual file name). I donot want to save it with new name but I want it to overwrite the previous saved file. How can I do this? as in CocoonServlet.java, it restrict the permission as private static final boolean ALLOW_OVERWRITE = false; Please suggest any solution such that it can overwrite the file. Thanks, Niket - 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: Return BLOB Value
Title: Return BLOB Value You can use a Reader to implement this (That's what i did). (Stripped) Example: public class Reader extends AbstractReader implements Poolable, Composable { Request request = null;Response response = null;Context context = null;ComponentManager manager = null; public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException {super.setup(resolver, objectModel, src, par);context = ObjectModelHelper.getContext(objectModel);request = ObjectModelHelper.getRequest(objectModel);response = ObjectModelHelper.getResponse(objectModel);} public void generate() throws IOException, SAXException, ProcessingException {try {response.setHeader("Cache-Control", "no-cache");response.setHeader("Pragma", "no-cache");response.setDateHeader("Expires", 0); // out is the outputstream to write your blob data to. ((OutputStream)out).write('The blob data'); }} catch (Exception e) {throw new ProcessingException("Error in reader: "+e);}} public String getMimeType() {return context.getMimeType(source.substring(source.lastIndexOf("/") + 1));} } - Original Message - From: Sascha Kulawik To: [EMAIL PROTECTED] Sent: Friday, July 26, 2002 10:07 PM Subject: Return BLOB Value Hello, I'm trying to implement a File-Upload / Download for a small Forum written in Cocoon XSP. Currently Ive no idea how to implement the FileDownload. The easiest way for that would be to write the data to a mySQL Ressouce and read the data because of Userpermissions and so on. Is it possible, to returm plain BLOB Data from a Database to the User for a Download ? Is there a better way to implement that in Cocoon ? Thank you very much, Greetings, Sascha
Re: [Q] SunSpot Portal Demo Error(NullPointerException) in Cocoon 2.0.2 and 2.1-dev
I had this problem too. Catalina uses -Djava.endorsed.dirs=${CATALINA_HOME}/common/lib to override the default endorsed dirs. - Original Message - From: Carsten Ziegeler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 02, 2002 12:14 PM Subject: RE: [Q] SunSpot Portal Demo Error(NullPointerException) in Cocoon 2.0.2 and 2.1-dev -Original Message- From: Tom von Schwerdtner [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 02, 2002 5:03 AM To: [EMAIL PROTECTED] Subject: Re: [Q] SunSpot Portal Demo Error(NullPointerException) in Cocoon 2.0.2 and 2.1-dev On Monday 01 July 2002 03:07 am, Carsten Ziegeler wrote: Yes, this problem is related to JDK 1.4. You can either switch to JDK 1.3 or you have to put the versions of Xalan and Xerces shipped with Cocoon into the lib/endorsed direcoty of your JRE 1.4. There is a section in the installation docs about running Cocoon with JDK 1.4. FYI: I was having this problem with 1.4 on linux (Gentoo) and I had to add '-Djava.endorsed.dirs=${JAVA_HOME}/jre/lib/endorsed' to my CATALINA_OPTS because it wasnt looking there by default. The JDK 1.4 should look there by default. Strange. Carsten - 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: Upload/HTTP-Post-Request
You can't. Nicola Ken suggested that the upload mechanism should be rewritten. I'm willing to do this (including some major speedups of the multipart parser) but i could use some pointers how to do this. Jeroen - Original Message - From: Lutz Lenzen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 14, 2002 10:35 AM Subject: Upload/HTTP-Post-Request Hi, I have a question about uploads. When cocoon receives any HTTP-post-request with an upload-file (multipar/form-data), the file is uploaded in the default-upload-dir even if the request causes a server-error (and no pipeline is initiated). So it seems, that the upload is done by cocoon before any pipeline is initiated. How can I prevent the upload, or where can I intervene and control the HTTP-Request. Thanks in advance Lutz -- * Lutz Lenzen Institut fuer Reine und Angewandte Mathematik RWTH Aachen Templergraben 55 52062 Aachen E-mail: [EMAIL PROTECTED] Tel.: 0241/80-94513 bzw. 030/314-22698 * - 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]
Problem with org.apache.avalon.excalibur.xml.Parser
Hi, I'm trying to get the latest CVS (HEAD) webapp to work but there seems to be a problem with the JaxpParser. I'm using tomcat 4.0.4 on Win98. The exception is as follows: org.apache.avalon.framework.component.ComponentException: Could not set up Component for role: org.apache.avalon.excalibur.xml.Parser at org.apache.avalon.excalibur.component.ExcaliburComponentManager.addComponent (ExcaliburComponentManager.java:646) at org.apache.cocoon.Cocoon.initialize(Cocoon.java:259) at org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1237 ) at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:435) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91 8) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3279) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3421) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:478) at org.apache.catalina.core.StandardHost.install(StandardHost.java:738) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:155) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131) at org.apache.catalina.core.StandardHost.start(StandardHost.java:638) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) java.lang.NullPointerException at org.apache.avalon.framework.configuration.AbstractConfiguration.getAttribute AsInteger(AbstractConfiguration.java:272) at org.apache.avalon.framework.configuration.AbstractConfiguration.getAttribute AsInteger(AbstractConfiguration.java:315) at org.apache.avalon.excalibur.component.PoolableComponentHandler.init(Poolab leComponentHandler.java:135) at org.apache.avalon.excalibur.component.PoolableComponentHandler.init(Poolab leComponentHandler.java:116) at org.apache.avalon.excalibur.component.ComponentHandler.getComponentHandler(C omponentHandler.java:70) at org.apache.avalon.excalibur.component.ExcaliburComponentManager.getComponent Handler(ExcaliburComponentManager.java:587) at org.apache.avalon.excalibur.component.ExcaliburComponentManager.addComponent (ExcaliburComponentManager.java:629) at org.apache.cocoon.Cocoon.initialize(Cocoon.java:259) at org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1237 ) at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:435) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91 8) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3279) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3421) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:478) at org.apache.catalina.core.StandardHost.install(StandardHost.java:738) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:155) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131) at org.apache.catalina.core.StandardHost.start(StandardHost.java:638) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) at java.lang.reflect.Method.invoke(Native Method) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) 2002-06-14 14:43:15 ERROR
Re: Vadim : RE: XSP Upload example - I do not understand
Hi, You can use an action to move the attachment to where you want. Here's how: http://marc.theaimsgroup.com/?l=xml-cocoon-devm=101878098524370w=2 Jeroen - Original Message - From: Chitharanjan Das [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 12, 2002 12:32 AM Subject: RE: Vadim : RE: XSP Upload example - I do not understand Thanks a million I understand it now... Let me try to clarify 1. Upload directory is read from init parameter. Hence it is kinda fixed . 2. We do not get the control of uploaded files. As soon as the Cocoon gets a request. The request is processed for Multipart request processing. Is this how it has to be processed ? The only way to change this is to provide my own version of multi-part request processing factory. However, the problem is that you can have utmost one kind of behaviour. 3. In my implementation, I need to store the files in different directories, depending upon the type of files uploaded. How do you suggest I go ant it... Thanks in advance, Chiths -Original Message- From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 1:18 PM To: [EMAIL PROTECTED] Subject: RE: Vadim : RE: XSP Upload example - I do not understand From: Chitharanjan Das [mailto:[EMAIL PROTECTED]] Hello Vadim... If you might explain the upload functionality ... 1. Form with multipart data is submitted to upload.xsp 2. The form parameters have to be processed. I changed the form variable name from uploaded_file to files and still it works. 3. If I have to do additional processing like throw error if the file exists or the file needs to be stored in a specific pattern say $upload_directory/date/user/filename_uniqueId. How can I customize it. Look into the source. Start with CocoonServlet: HttpServletRequest request = RequestFactory.getRequestFactory(requestFactoryClass).getServletRequest( req, CocoonServlet.SAVE_UPLOADED_FILES_TO_DISK, this.uploadDir, CocoonServlet.ALLOW_OVERWRITE, CocoonServlet.SILENTLY_RENAME, this.maxUploadSize); 4. If there are additional form elements, how do I process them. 5. Where is the upload functionality being invoked.. Its kind a vague (for my intellect). From the servlet, see line(s) above. Vadim Thanks in Advance, Chiths -Original Message- From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 6:51 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: XSP Upload example - I do not understand From: Stefan Riegel [mailto:[EMAIL PROTECTED]] Hello, everybody, I do not understand the XSP upload example. Yes, it works fine, but I would like to understand as much as possible. I guess their is some magic behind the scene. I did some reading of the API Javadoc, but I'am still not experienced enough reading source code. What to do? Should I give up learning Cocoon :-( Try reading Java source code generated from the XSP. The example XSP-Source follows. I added comments about what I don't understand. ?xml version=1.0 encoding=ISO-8859-1? !-- CVS: $Id: upload.xsp,v 1.3 2002/02/09 06:21:57 vgritsenko Exp $ -- !-- QUESTION: the namespace declarations for request, response and log are not used and could be omitted? Is this correct? -- If not used then can be omitted. xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-request=http://apache.org/xsp/request/2.0; xmlns:xsp-response=http://apache.org/xsp/response/2.0; xmlns:log=http://apache.org/xsp/log/2.0; xsp:structure !-- QUESTION: Same with the XSPUtil import. Am I right? -- Same. xsp:includeorg.apache.cocoon.components.language.markup.xsp.XSPUtil/x sp:i nclude xsp:includeorg.apache.avalon.framework.context.ContextException/xsp:i nclu de /xsp:structure !-- QUESTIONS: I do not understand this part. Who calls conceptualize? Contextualize. Avalon does. See http://jakarta.apache.org/avalon/framework/reference-the-lifecycle.html Where does context (org.apache.cocoon.generation.ServletGenerator.context?) come from? Avalon gives. http://jakarta.apache.org/avalon/api/org/apache/avalon/framework/context /Context.html And the get method of context? See link above. Their must be some build in upload functionality, please explain if You are patient enough. Yes, there is. And it uses maybeupload library, or Multipart request parser. See org.apache.cocoon.components.request package. Vadim -- xsp:logic
Re: Upload
This problem is fixed in the latest development versions (2.0.3 and 2.1). Jeroen - Original Message - From: Marc Schüpbach [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 07, 2002 2:26 PM Subject: Upload hello, i'm doing a file upload using cocoon2.0.2-dev. it works fine (file will get uploaded) but the sitemap receives no request parameters (even not uploaded_file). when i try the upload sample with the cocoon dist it works fine. can anybody help me ? thanks marc - 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]
Sunrise authentication
Hi, I'm trying the sunRise stuff from the latest2.1 code(checked out today) but i can't get it to work. It seems the AuthenticationManager which is defined in authentication.xconf is not loaded. My question is: - Should this code be working? If yes, what did i forget? PS. I'm using a parent component manager. Thanx in advance, Jeroen
Re: Sunrise authentication
Thanks for the quick reply, - Original Message - From: Carsten Ziegeler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 2:07 PM Subject: RE: Sunrise authentication Hi, what are you exactly trying? Did you build the webapp target and try to run the sample? The CVS from today works for me that way. Or do you try to manually get it working. I'm trying to adding it manually using this http://radio.weblogs.com/0103021/stories/2002/02/28/usingTheSunriseComponent s.html example. In that case you have to hand-edit your cocoon.xconf and add the AuthenticationManager component by hand. How do i do that? I grepped all xmap's for AuthenticationManager for an example but got no results. PS: Please use plain text emails and not html. Oops, thought i turned that off... Carsten Carsten Ziegeler Chief Architect Open Source Group, SN AG -- Cocoon Consulting, Training and Projects -- mailto:[EMAIL PROTECTED] http://www.s-und-n.de http://ziegeler.bei.t-online.de -Original Message- From: Jeroen ter Voorde [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:44 PM To: [EMAIL PROTECTED] Subject: Sunrise authentication Hi, I'm trying the sunRise stuff from the latest 2.1 code (checked out today) but i can't get it to work. It seems the AuthenticationManager which is defined in authentication.xconf is not loaded. My question is: - Should this code be working? If yes, what did i forget? PS. I'm using a parent component manager. Thanx in advance, Jeroen - 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: Newbie Please Help
Probably a typo but: /map:pipeline /map:pipelines map:match pattern=test/*.pdf Isn't correct - Original Message - From: Hahn Kurt (CHA) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 22, 2002 8:38 AM Subject: RE: Newbie Please Help Hi, if you have a proper and standard installation (Cocoon is already working, isn't it?), you should be able to use this example which will probably answer some of your questions: http://www.cocooncenter.org/cc/documents/resources/hot-plugging/index.html . -Message d'origine- De: Patrick Russell [mailto:[EMAIL PROTECTED]] Date: lundi, 22. avril 2002 04:01 À: [EMAIL PROTECTED] Objet: Newbie Please Help I am new to Cocoon and I am trying to transform a simple xml document into a pdf format. Although its seems like I have Cocoon properly installed (JDK 1.4, TOMCAT 4.0.3, Cocoon 2.0.1), I cannot seem to figure were to install my files to serve my pages up correctly. I keep on getting a resource not found error. I performed the following steps: 1. Created the following directories under the cocoon directory within the TOMCAT_HOME/webapps/ directory: test/ content/ resume.xml resume.dtd styles/ resume.xsl sitemap.xmap 2. I copied the sitemap.xmap from the samples directory, deleted the pipelines section and then added my own as follows /map:pipeline /map:pipelines map:match pattern=test/*.pdf map:generate src=content/pqr_resume.xml/ map:transform src=style/pqr_resume.xsl/ map:serialize type=fo2pdf/ /map:match /map:pipeline /map:pipelines 3. I even tried to add the map to the samples hello-world example, adjusted the map to match the others in the example, and moved my files corresponding locations as the others in the example, but I still get the same error. Any help you could provide would be greatly appreciated! - 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] - 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]