Re: InputStream as source or generator
Craig Christophersen wrote: The data I will be getting from the bean is xml tagged. Most of it will be a full section of a document, tagged by sectionparagraphlineword, etc. I am hoping to find a way to stream that into the pipeline and output as an html page. Looking at Betwixt I am not sure that is the right solution. Would I be on the right track in altering something like the StreamGenerator? Do you mean you have a String in your bean with unparsed xml? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Heads-Up] List Etiquette Return Recipts (Was: Re: Asking again Portal framework login issue)
Sylvain Wallez wrote: Tony Collen wrote: This is a just general FYI for anyone who posts to the user and -dev lists: *Please un-set the option which causes your mail client to request a return receipt!* ... A good way to invite people to disable this option is for everybody to send the return receipt. I'm sure receiving several hundreds of confirmations will make them run to their mailer preferences to disable the feature ;-) As this is controlled by the Disposition-Notification-To header (IIUC) can ezmlm be configured to strip this off all messages before relaying to the list? I hate these things too, but know that some people use them for most business communication and probably can't pick settings per-email. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem: Enabling uploads
Tuomo L wrote: Ok. I see. I managed to catch the file with a custom component and save it in db. Has anyone noticed, that if you change the location of upload-dir from web.xml, the files get stuck on that dir? It seems that Cocoon cannot delete the files if it's not the default location. If you can confirm that, please enter a bug report on bugzilla. Shouldn't be hard to track down but I can't personally do it now, and don't want it to get lost. Geoff On Tue, 20 Apr 2004, Geoff Howard wrote: Steve Schwarz wrote: Tuomo I believe the behavior changed in 2.1 so that that is no longer true: http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon2.1 Steve Exactly - and the general security weakness of the old system (unlimited uploads to any url handled by any cocoon server with uploads enabled) was deemed to be serious enough to warrant such an incompatible change. Geoff But if autosave-uploads=true, the the file should be saved in the upload-dir permanently, right? -Tuomo On Tue, 20 Apr 2004, Steve Schwarz wrote: Hi Tuomo IIRC the file will only exist for the duration of the pipeline invoked by the form action. So you need to process it within that pipeline as cocoon deletes it right afterwards. HTH, Steve Hi, We're having some serious problems with Cocoon upload mechanism. Nothing ends up in the upload-dir. The form enctype is set to multipart/form-data, enable-uploads=true and autosave-uploads=true in web.xml. What could be the problem? Running Cocoon 2.1.4 on Tomcat 4.1.24. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Flowscript to Uploadfile
Jeroen Reijn wrote: Hi, maybe i'm thinking in the wrong direction, but the error messege says that it's getting a String. Is your form type correct(multipart) ? Just my 2 cents. That (String) can also happen if uploads are not turned on in web.xml - in case these are different webapps, or on different servers. Geoff -Original Message- From: olivier demah [mailto:[EMAIL PROTECTED] Posted At: Tuesday, April 20, 2004 6:23 PM Posted To: Cocoon User List Conversation: Flowscript to Uploadfile Subject: Flowscript to Uploadfile Hi, i try to upload some images and i use = http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithFlow it's working on some js but failed on one : this one works : var role = 'org.apache.cocoon.components.upload.FileUploadManager'; function upload_shop_photo() { var uploader = cocoon.getComponent(role); var part_shop = cocoon.request.get(shop_photo); try { uploader.setUploadFolder(/home/fox_cocoon/build/webapp/vieira/images/shop); uploader.upload (part_shop); cocoon.sendPage(success.html); } catch (Exception) { cocoon.sendPage(failure.html); } } this one does not : var role = 'org.apache.cocoon.components.upload.FileUploadManager'; function upload_player_photo() { var uploader = cocoon.getComponent(role); var part = cocoon.request.get(player_photo); try { uploader.setUploadFolder(/home/fox_cocoon/build/webapp/vieira/images); uploader.upload (part); cocoon.sendPage(success.html); } catch (Exception) { cocoon.sendPage(failure.html); } } my sitemap with the javascript and pipeline : map:match pattern=do-*-*.html map:generate src=xsp/{2}.xsp type=serverpages map:parameter name=action value={1}/ /map:generate map:select type=request-parameter map:parameter name=parameter-name value=upload/ map:when test=news map:call function=upload_news_photo/ /map:when map:when test=shop map:call function=upload_shop_photo/ /map:when map:when test=gallery map:call function=upload_gallery_photo/ /map:when map:when test=player map:call function=upload_player_photo/ /map:when /map:select map:transform type=cinclude/ map:transform src=xsl/admin.xslt/ map:serialize type=html/ /map:match /map:pipeline /map:pipelines map:flow language=javascript map:script src=js/upload_gallery.js / map:script src=js/upload_photo.js / map:script src=js/upload_player.js / map:script src=js/upload_shop.js / /map:flow the diff between upload_player and upload_shop is the name of the function of course and the var part where the name differ. the following error occurs : file:/home/fox_cocoon/build/webapp/vieira/admin/js/upload_player.js, line 8: Can't find method org.apache.cocoon.components.upload.FileUploadManagerImpl.upload(string). i already met this problem before and just change the var part = cocoon.request.get(player_photo); to something like var part_shop ; but here nothing goes better. any ideas are welcome. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem: Enabling uploads
Steve Schwarz wrote: Tuomo I believe the behavior changed in 2.1 so that that is no longer true: http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon2.1 Steve Exactly - and the general security weakness of the old system (unlimited uploads to any url handled by any cocoon server with uploads enabled) was deemed to be serious enough to warrant such an incompatible change. Geoff But if autosave-uploads=true, the the file should be saved in the upload-dir permanently, right? -Tuomo On Tue, 20 Apr 2004, Steve Schwarz wrote: Hi Tuomo IIRC the file will only exist for the duration of the pipeline invoked by the form action. So you need to process it within that pipeline as cocoon deletes it right afterwards. HTH, Steve Hi, We're having some serious problems with Cocoon upload mechanism. Nothing ends up in the upload-dir. The form enctype is set to multipart/form-data, enable-uploads=true and autosave-uploads=true in web.xml. What could be the problem? Running Cocoon 2.1.4 on Tomcat 4.1.24. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Serving arbitrary OutputStreams with Cocoon
Oscar Picasso wrote: Hi, I have a Java application that can generate Postscript or PDF to OutputStreams. I would like to be able serve these OutputStreams with Cocoon. I have looked at ReaderResource but it seems to read resources from the file system. I also looked at implementing a Serializer but it needs to handle SAX events which is not the case here. I could also simply do it outside Cocoon by using the Servlet API but I would prefer to stay inside Cocoon. Any idea? Thanks. Oscar Implement a custom Reader, similar to ResourceReader and the other Readers such ImageReader, DatabaseReader in the database block, etc. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xml file caching ??
Jim Emerson wrote: Hi All, I'd like an example of how to cache an xml file in a pipeline, I haven't found any examples online, the documentation helped a little but didn't explain how to do it. I have this in my sitemap componenents: map:pipes default=caching map:pipe name=caching src=org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline/ map:pipe name=caching-point src=org.apache.cocoon.components.pipeline.impl.CachingPointProcessingPipeline autoCachingPointOn/autoCachingPoint /map:pipe map:pipe name=noncaching src=org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline/ /map:pipes And this is my pipeline: map:pipeline type=caching map:match pattern=xsl-display-story map:generate src={defaults:story-path}{request-param:storyid}.xml/ map:transform src={defaults:xsl-path}{request-param:gateway}_displaystory.xsl/ map:parameter name=servletPath value={request:servletPath}/ map:parameter name=sitemapURI value={request:sitemapURI}/ map:parameter name=contextPath value={request:contextPath}/ map:parameter name=wwwroot value={defaults:www-root}/ map:parameter name=docid value={request-param:storyid}/ map:parameter name=monthdir value={request-param:monthdir}/ map:parameter name=regname value={request-param:regname}/ map:parameter name=regionsfile value={defaults:regions-file}/ map:parameter name=gateway value={request-param:gateway}/ map:serialize type=html/ /map:match /map:pipeline I need to cache the entire transformation, and only run it again if the xml file has been updated. It is aready cached automagically from what I can see for each unique combination of parameters. If you still have the samples running, you can see what is cached by going to the /status sample page. You will probably also see a difference in response time after the first request. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging all HTTP Requests to a database
Steve Krulewitz wrote: Surjan Singh wrote: I already have a Component that can be called in an action which logs request details asynchronously to a database. What I'd like to do, is to somehow use the same Component to log _all_ requests. I'm not sure if this is the answer you're looking for, but maybe you should be doing this in a servlet filter? It will be able to intercept all HTTP requests. Couldn't you do this by just adding a new jdbc log target in logkit.xconf? http://wiki.cocoondev.org/Wiki.jsp?page=ConfiguringTheLogs Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebGate Availability
This continues to look good - wish I had time right now to play with it. I'm curious about how you integrated the wordnet dictionary searching. It looks like they are written in C - did you use JNI, or Runtime.exec(), direct database access, etc? Geoff [EMAIL PROTECTED] wrote: I just wanted to send this out to anyone who was interested in my content aggregation project (previously called Sentinel) based on Cocoon. I've made a (very) initial release available on the sourceforge.net project page: http://webgate.sourceforge.net and http://www.sourceforge.net/projects/webgate Current features implemented: * Webmail interface (for use with Apache James JDBC stores) * RSS Reader (slashdot, google, etc) * Blogger.com reader (via atom-rss xslt) * Current weather conditions * Dictionary Searching * IMDB Searching * Google Searching * Television Grid (uses XMLTV data) And its all skinnable and configurable (although with this initial release theres just the one main skin). The documentation is quite lacking I'm sorry to say. Just havent had time to create any real fancy docs. Right now its a basic README.txt for an overview, INSTALL.txt for installation instructions, and JAMES.txt for those interested in getting the webmail piece working. You can check out screenshots here: http://webgate.sourceforge.net/screens.php Thanks, - Brent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Strange errors with IE and multipart forms - HELP!!
Mark Lundquist wrote: On Mar 30, 2004, at 10:42 AM, Marcin Okraszewski wrote: Hi, Users of Internet Explorer experiences a strange error using my webapp. Sometimes it works, and sometimes the IE says (a translation from Polish): It isn't possible to find server or an error of DNS in Internet Explorer. What is even more confusing, the Mozilla doesn't seem to have such problems at all (it is heavily tested with Mozilla, since I use it for developing webapp). I'm not quite sure, but I have a feeling that it is caused by multipart forms and SSL used together. Well, it is only suspicion, and I can't really prove it. Ouch IE purportedly has bugs relating to POST over SSL. This was discussed extensively on the Jetty-support mailing list in February (for some reason, searching the gmane archive only turned up 3 articles, but there were a lot more). See http://support.microsoft.com/default.aspx?kbid=831167 and see if that looks like it might be related... Unfortunately, I can confirm that this does appear to be related to IE, POST, and SSL. I have quite a bit of experience observing this problem in an application totally unrelated to Cocoon. In that case, it's on Netscape Enterprise Server - not sure where the SSL support comes from if it's not native to NES. The point is, doesn't appear to be related to anything on the server. In our testing, the POST never arrives in some cases. In other cases, it appears to arrive with no POST body (i.e., it's truncated). The MS KB article above does seem to be related to at least some aspects of the problem - though I need to go back and find out if we applied the advice related to keep-alives. HTH, Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 95 Warnings later...
George Hester wrote: Building the latest Cocoon. Why and how to fix. Thank George Hester Probably no need. What were the warnings? Did the build report that it was successful or failed? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calendar Generator
Alan wrote: * Geoff Howard [EMAIL PROTECTED] [2004-03-23 12:27]: Alan wrote: I asked this question. Now I'm back. :^) Would the above simply generate a calendar without an iCal source? My blog entries are not stored in iCal. Nope. But in this case, you'd need to find a way to convert a list of your entries to whatever intermediate format and then take advantage of the rest of the bits of the puzzle being considered. I think there is value to a generator that simply produces a blank calendar, with dates grouped by month and week. How else would one do calendar based navigation? I think this would be possible to initiate with an empty intermediate format document in the proposed scenario. The point is one would generally want to start with a list of events (calendar entries) and decorate that with the calendar (date) data around it. If you start with the caledar, you would probably have a clumsy or inefficient time getting the event data. With made up xml in your case, cal:calendar start-date=03-01-2004 view=month /cal:calendar might result after the decoration step in what you want, something like: cal:calendar start-date=03-01-2004 view=month month name=March week number=1 leading-days month=February day name=Sunday date=29/ /leading-days day name=Monday date=1/ day name=Tuesday date=2/ ... /week ... /month /cal:calendar If you want to indicate where your blog entries actually are (by linking those dates, but not the others for example), it will be better/easier/more-resuable IHMO to start with a list of them, rather than start with the calendar and do it the other way around. If you're in a hurry though, you may want to just do something that works for you. I can't implement this kind of thing right now even though I'm interested in the discussion and it wouldn't be a long project after the details of the formats are worked out. BTW, I have heard there was such a calendar thing in Cocoon 1. Has anyone dug that up and looked at it? cant-resistOf course it may be out of date now!cant-resist Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [RT] Re: Calendar Generator
Ryan Hoegg wrote: Geoff Howard wrote: Alan wrote: I'd like to generate an XML calendar for navigation of my blog. Is there a Calendar generator for Cocoon? One doesn't yet exist - how would you picture it working? Geoff WARNING: I tried to compress many hours of brainstorming over two occasions into this twenty minute e-mail. Since we are all tossing ideas around anyway, I don't apologize for the disorganization of the ideas. I have some rather involved notes in one of my idea books. I envision this as a transformer, really, but then I remember a long conversation at Starbucks about the generator mindset vs. the transformer mindset with you and Jack. I think parts of this problem fit each mindset. The transformer would look for something like cal:calendar/. As seen in many PIM programs, the resulting content has many different incarnations. Conceptually, I envision this as a view of some time period, subdivided arbitrarily. A view of the current month would probably be the default output, with alternatives being multiple months, a single week or multiple weeks, or even a single day with multiple time slices being displayed. Additionally, I could see the transformer looking for content inside the element, for example [1]. (I read somewhere that footnotes in e-mail is bad for some reason.. anyone know why?) I think this is one of the cool parts of the idea... a calendar is really a representation of a set of events. Therefore the input to the transformer would be a set of events and some parameters for how to display them. So, now to think about output. Since I see this as a view component, the goal of the output is to balance a certain amount of layout information with a certain amount of display flexibility. Here's a shot at the single month output: [2]. The reason for all the layers here is that I'd like to be able to suck in an ical, an apache log file, or anything else one could think of as a set of events. I have two mid-term use cases: 1. visualization of timesheet data 2. shared calendar display (using webdav for shared versioned access to ical files I think) Well, I'd love to hear some thoughts from people who have done more with Cocoon than I... yes you Geoff :) See my response in the other part of this thread - what do you think of going xcal for step one? I'll have to comment on the below later, but I think it's the job of the transformer (step two in my other email) to fill in information related to dates, day names, etc. and the following xsl just to translate to html/whatever display. I don't want to have to figure out whether the current february has 28 or 29 days in xsl for example. Geoff [1] cal:calendar type=month start=2004-04-01 event type=day start=2004-04-01 descriptionApril Fool's Daydescription typeholiday/type !-- hmm, wouldn't it be neat to have inheritance? holiday could be a subtype of day -- /event event type=day start=2004-04-18 Mom's Birthday !-- not sure whether the description should just be a text node... -- /event event start=2004-04-10T12:00:00 end=2004-04-10T13:30:00 Lunch with Geoff !-- I chose a bastardized ISO8601 for now, but am very open to alternatives... should time be a separate attribute? Should the start time and duration information be moved to a nested element? -- /event event start=2004-04-20T19:00 Mom's Birthday Party !-- How would you denote that the end time is unknown? Perhaps even allow endpoints to be time ranges? that smacks of Speculative Generality... -- /event /cal:calendar [2] month name=April year=2004 firstday=sunday !-- maybe it should be calendar type=month/... not sure -- week !-- there are three days in the first week displayed. Not sure whether to include their date, it could be inferred from the ordinal position -- day type=holidayApril Fool's Day/day day/ day/ /week week !-- trying on inclusion of date numbers different ways -- day date=4/ day date=5 name=monday/ daydate6/date/day daydate number=7//day day date=8weekday name=thursday//day day date=9/ day date=10Lunch with Geoff - 12:00pm to 1:30pm/day /week week !-- this one just occurred to me, as we specified the first day of the week in a month attribute -- !-- depending on ordinal position (would need some fancier logic in the transformer/stylesheet) -- sunday/monday/ !-- explicit dates -- tuesday date=13/wednesday date=14/thursday date=15/friday date=16/saturday date=17/ /week week !-- a more minimalist approach is also possible, including only dates that have events in this document and leaving it to the display to fill in the blanks -- !-- Idea 1, use something from the above ideas -- date number=18Mom's Birthday/date !-- Idea 2, just dump the events in here and let the display handle it... feels like passing the buck though -- event start=2004-04-20T19:00Mom's Birthday Party/event /week week!-- with that idea, an empty week would be an empty element --/week /month
Re: Calendar Generator
John Lianoglou wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 MAN, I have been meaning to get around to this for the longest! It seems to me that one would want to stand on the shoulders of giants; I would suggest that a Calendar Generator leverage the efforts of the IETF iCal / xCal working group. That is my instinct as well. Unfortunately, everything seems to use iCal (mozilla, outlook, apple iCal) and from what I can find xcal seems to be stuck between draft 2 (from 2002?) and draft 3 which may change things up significantly if it is ever finished. These are just conclusions from browsing the ietf-calendar and xcal-dev archives, so please correct me if anyone has a better pulse on where things are really at. (see thread at http://www.imc.org/ietf-calendar/mail-archive/msg11885.html) So, we are probably looking at 1) a generator to transform ical to some intermediate format (probably xcal?) as you note below. If someone happens to have native xcal lying around, they could then just feed it right into the next steps. By the same token, if someone has a custom non-ical format (i.e., database, exchange server, etc.) they can stick some other generator in here. 2) a transformer to take this format and decorate it with calendar data (transforming to yet another intermediate) and 3) possibly a utility stylesheet for transforming this to a pretty html format. The last one would be generally application-specific, but a well designed root stylesheet could go a long way toward simplifying that process. This will allow Cocoon to make extensive use of published iCalendar files from, well, obviously wherever! :) That'd be great. In fact, a sample providing a webav location for ical publishing and a few pipelines to view that data would probably be a big hit. This is admittedly an idea very informed by the circumstances that raised the idea for myself, but I imagined such a generator to read an icalender file and make a SAX stream as xcalendar format (which the working group has already fleshed out and published for us)! What works for you will probably work for others unless you have oddball requirements - so that's not a bad thing. One problem I see with the ical/xcal standard is that it's not designed to be a database - for example when selecting one week out of a calendar covering a year you may need to parse (and generate sax for) the whole thing though it would be otherwise unnessary. Geoff Here are some links: http://www.calsch.org/ http://www.calsch.org/ietf/archives/rfc2445.txt http://www.calsch.org/ietf/archives/draft-ietf-calsch-many-xcal-02.txt jL John Lianoglou | Vice President | ARACHNEdesign http://www.arachnedesign.net On Mar 20, 2004, at 6:40 PM, Geoff Howard wrote: Alan wrote: I'd like to generate an XML calendar for navigation of my blog. Is there a Calendar generator for Cocoon? One doesn't yet exist - how would you picture it working? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Revising Documentation (not as off-topic as one might think)
John Lianoglou wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey folks, I know there's a whole mailing list dedicated to the documentation, but I've tried posting there in the past, and it doesn't seem very productive, as it winds up being a sea of Wiki update notifications... In fact, we've decided to use the docs list only for those update notifications. ... I've taken it upon myself to classify this issue as *important* because this error is provides information that is exactly *opposite* to the actual behavior. Based on the information printed on the docs, I spent a couple hours and concocted a hack to overcome this documentented shortcoming, only to realize that it wasn't necessary at all. I'm confident that a revision could save a number of people some valuable time in the future :) Documentation issues are handled through bugzilla same as coding issues. Can you enter a bug there for this, and even supply a diff -u patch if you're willing and able? See the contributing page at the cocoon site for more info. Thanks, Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calendar Generator
Alan wrote: I'd like to generate an XML calendar for navigation of my blog. Is there a Calendar generator for Cocoon? One doesn't yet exist - how would you picture it working? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: performance with transformation on BIG xml files
[EMAIL PROTECTED] wrote: So nobody ever served big xml files with Cocoon ? Don't confuse no answer given with no answer existing. I have not personally (although I was involved with using Cocoon to present the bible in xml format - but we split it up into 66 files - one file per book - instead of one big file) but many have. What have you found in the archives for this list and the dev list? In the end, this is an issue with any xsl transformation of large files which generally involves putting a bloated dom representation in memory. If you don't have enough memory (sounds like the case) you will get a lot of paging out to disk which will lead to abysmal performance. Look for solutions people have tried involving variously saxon, stx (joost), momento, and memory tuning. Geoff [EMAIL PROTECTED] wrote: Hello, I would like to know if anybody used cocoon for transforming big XML files and which were the tunings to be made in order to make performance acceptable. My case: I do a little digital library projet; among the books in this online library, I have a Bible in TEI format which I present to the reader as a nicely formatted HTML with a tree-like table of contents on the left side, navigation buttons (previous/next) etc. The Bible is no little book, that is true, but the performance is terrible. In order to suck out the static version I use wget -m http://my.local.cocoon.instalation:8080/cocoon/...; (I publish a static version online, not the Cocoon dynamic one as I don't have free Cocoon hosting) --- generating all the HTML little files for that Bible may take a day. I does work ok for smaller works like novels, poetry books. The Bible includes all its chapters as entities. Please feel free to ask for more information, if you need it. I'll paste at the end of this mail my transformation sitemap, in case anybody has any ideas. Thanks in advance for your ideas. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HSQLDB Trigger
Johannes Goerke wrote: Hello, I've written a Trigger for my HSQLDB. Trigger classes in HSQLDB are Java - classes implementing org.hsqldb.Trigger. They have to be in the CLASSPATH of the JVM that is running HSQLDB. Normally something like java -classpath hsqldb.jar;MyTriggers.jar org.hsqldb.Server -database cocoondb (I've tested this, it works). But when I try this with Cocoon, my triggers are not found by the HSQLDB - instance of Cocoon, even if I add them to hsqldb.jar in cocoon/WEB-INF/lib/ (by something like jar -uf hasqldb.jar Mytrigger.class ). Where could I put an additional *.jar-file so that the HSQLDB - instance has it available in its CLASSPATH? How/where can I manipulate HSQLDBs CLASSPATH? Don't have a solid answer but I can give a few hints which may help you find your own: The samples in either the database block, jms block, or eventcache block (check them in that order) define a trigger. Perhaps the method there would be useful? Apart from that, if you are quite sure that your class is really not recognized when put in the right WEB-INF/lib folder (build/webapp/WEB-INF/lib) then my next guess would be to look at the hsqldb Avalon component - how it uses its configuration provided in cocoon.xconf. Perhaps there's a clue there. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eventcache - Invalidate from XSP?
Thomas Zehetbauer wrote: Is it possible invalidate cache entries from an XSP page? Yes, but I'm not sure it should be encouraged According to the samples one can either use flowscript (event.js) or the CacheEventAction to invalidate entries. I would however prefer to raise the necessary events directly from a XSP page, but while there is an implicit cocoon object in flowscript that enables one to get access the event-aware pipeline implementation I could not figure out how to implement cocoon.getComponent() in XSP. Hopefully you meant an XSP action. XSP Generators and XSP actions both inherit a reference to the ComponentManager/ServiceManager which you can use to look up the Cache just as the CacheEventAction does. One could also override the inherited compose() method and several other lifecycle methods which would make this feasible. A generator is IMILHO (in my increasingly less humble opinion :) ) just plain the wrong place to do this. If you are using actions, though you should seriously consider using nested actions to do this: map:act type=updateYourDatabase map:act type=uncacheEvent map: !-- rest of your pipeline if successful -- and so on. In this case, I'm not sure why you wouldn't just use the existing CacheEventAction. If you need to modify its behavior, it really should be trivial to do in a subclass. If not, explain why and it can probably be fixed. To make myself more clear, I have a database which is queried from an XSP with the output being cached in an event-aware pipeline. Another XSP page modifies this database and wants to expire the affected cache entries. Is this possible? How? So, yes - possible but maybe not necessary. However, depending on the database you're using I'd seriously look at the option to fire these events directly from a db trigger on update of your database. This way you are free to have any other process manipulate the database and not have to worry about invalid cache. In real life, I have often had to resort to direct database manipulation and the confidence that all necessary events are fired right from there automatically is a great help. Not all DBs will support this (I think Mysql does not yet) but worth taking a look. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eventcache - Invalidate from XSP?
Thomas Zehetbauer wrote: On Fre, 2004-03-12 at 08:40 -0500, Geoff Howard wrote: Hopefully you meant an XSP action. No, I mean an XSP page. I use a Java bean to update the database and output a XML document containing some information about this update. Do you recommend another approach for this task? I'd reccomend using actions or flow for the update, xsp (or some other flavor of generator) just to generate the xml version of the model. Doing otherwise mixes concerns IMHO. What I have and like is the ability to call update.html?databases=a,b or update.txt?databases=a,b and accordingly invalidate pages depending on these. I guess using actions for would make it far more difficult or even impossible to generate this output. ?? Don't see why this is difficult with or without actions. Have you looked over the modular db actions samples, for example? I wonder how it is possible to get a reference to cocoons event-aware cache implementation from an database trigger, do you have any working example for this? No, no. You wouldn't use a direct reference to Cocoon's cache from there - you'd either fire off a jms message (see the jms block for examples) or you'd use http to call a pipeline which executes the action. JMS is the way to go hands down if you ever need to load balance across several Cocoon front-ends. I'm being terse just because I don't have a lot of time ATM. Feel free to keep asking questions. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jetty/Cocoon Config Question
Steve Schwarz wrote: Hi I've been using the 2.1 bundled Jetty and would like to change the configuration to remove the cocoon from the uri as described here (for Tomcat): http://cocoon.apache.org/2.1/faq/faq-configure-environment.html#faq-N10005 Can someone give me the clue for how to setup the bundled Jetty in the same way? Thanks, Steve ? The bundled jetty puts cocoon on the defualt context (i.e., without the /cocoon). Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Indexing cocoon for search engines
Schultz, Gary - COMM wrote: After trying to get this working, I've determined I'm having trouble getting cocoon indexed properly outside of the Lucene example. Eventually I need to have Cocoon indexed by Google, Inktomi etc. Yesterday someone posted a reply showing that something served by Cocoon can be indexed by Google. But how does one get this setup? I've looked at the Wiki and other documents without success. If I can't get indexing to work, management will force me away from Cocoon to a Microsoft ASP based solution, which I would prefer to avoid. Any and all assistance is greatly appreciated. Can you explain what is going wrong and how you know it is? Do you see google's bot showing up in your logs? Is it not spidering out to your other pages? Do the links in your output html look like normal html a href=... links? Geoff Gary T. Schultz Web Technical Administrator / GIS Coordinator Wisconsin Department of Commerce 6th Floor P.O. Box 7970 Madison, WI 1-608-266-1283 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Component initialization at cocoon startup
Torsten Curdt wrote: Viswashanti Kadiyala wrote: Thanks for the reply. I did readup on Avalon lifecycle doc. And I also implmented the Configurable interface. But the problem i am facing is that cocoon loads up Components dynamically (i.e) when they are first referred. What i want is cocoon to instantiate these components at startup time , not dynamically... unless I am missing something drastically. No you did not ...this is done for components that implement ThreadSafe HTH You might be better off explaining why you need them instantiated at startup time and then maybe we can map that to the appropriate Avalon life cycle concept. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Q: I wrote my custom component - and now?
Francesco Rossi (Milano, Italy) wrote: Hi y'all I just finished writing my own custom component - a transformer - following precious advice I found in the book Cocoon: building XML applications everything went pretty smooth so far what got me a little stuck is: what JAR files in the WEB-INF/lib directory should I add to the classpath so that they're available to the compiler??? my transformer is pretty run-of-the-mill: it extends the AbstractTransformer class and it implements the Parameterizable and the Poolable interfaces (I'm using Cocoon 2.1.3 running on Tomcat 5.0) thank you in advance! Francesco It is easiest if you add all of them. If for some reason you don't want to do that, it's impossible to know without seeing your import list. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Packages naming best practises
Oscar Picasso wrote: Hi, I am writing a Cocoon application. I would like to avoid renaming my packages in case there are useful for the cocoon community. Let's say I have the following classes: // Sitemap components - com.mycompany.cocoon.generation.CacheableVelocityGenerator - com.mycompany.cocoon.action.DefaultPathAction // An avalon component (but not a sitemap one) - com.mycompany.cocoon.components.DefaultPathProvider 1- Is it recommended or discouraged to use 'org.apache.cocoon... instead of 'com.mycompany.cocoon...' if I make the code publicly available? 2- In case the 'org.apache.cocoon' naming is recommended and supposing my classes are aimed at easing the creation of web sites. Is it better to name them like this: - org.apache.cocoon.generation.CacheableVelocityGenerator - org.apache.cocoon.action.DefaultPathAction or something like that: - org.apache.cocoon.sitebuilder.generation.CacheableVelocityGenerator - org.apache.cocoon.sitebuilder.action.DefaultPathAction This boils down to a licensing question. As I understand it, you cannot use org.apache.cocoon package name unless your code is donated to Cocoon. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems Loading Generator Component
Joel Sookram wrote: Thanks for your response. I'm using the Jetty server provided with Cocoon 2.1.3. I did restart the server several times but I keep getting the same error. I know this could be a deployment problem but it is quite stubborn. Is there a location besides the 'build\webapp\WEB-INF\lib\'directory for deploying new or customized classes? That's going to be irrelevant. Deploying new classes is trivial and should work right off. I'd bet dollars to doughnuts you either put the new class into the jar incorrectly (jar tvf should turn that up) or you have a typo in a config file somewhere. Geoff -Original Message- From: Hildebrandt, Ole [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 10:16 AM To: [EMAIL PROTECTED] Subject: AW: Problems Loading Generator Component Hi, From the stacktrace I would say that Cocoon was unable to load your Registration-Class. (NoClassDefFound) Make sure, that you have deployed it properly. Have you restarted TomCat? Ole -Ursprüngliche Nachricht- Von: Joel Sookram [mailto:[EMAIL PROTECTED] Gesendet: Montag, 8. März 2004 15:03 An: [EMAIL PROTECTED] Betreff: Problems Loading Generator Component Hello everyone, I' m currently working on a school project in which I'm trying to develop a web site with news portals. I had modified the class ConfigurationGenerator and called it 'Registration' to allow users to register themselves before logging in to the portal web site. After I had compile the modified class, I had added it to 'cocoon-authentication-fw-block.jar' in WEB-INF/lib directory. The main sitemap was updated as 'map:generator label=content name=reg-conf src=org.apache.cocoon.webapps.authentication.generation.Regis tration/' under the components section. When I fired up the cocoon servlet I got the following message: Internal Server Error Message: null Description: No details available. Sender: org.apache.cocoon.servlet.CocoonServlet Source: Cocoon Servlet Request URI FCB1.2/ cause org.apache.cocoon.webapps.authentication.generation.Registration request-uri /FCB1.2/ Apache Cocoon 2.1rc1 Attached is the error log. I have tried many approaches to solve this problem but nothing seems to work. Could someone give me some hints as to what I am doing wrong? I am fairly new to Cocoon and I am currently using Cocoon 2.1.3. Thanks, Joel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.1.4 and ProcessingException error with 'large' xml file ?
Stefan Geelen wrote: Hi, when indexing some XML files I get this strange error: org.apache.cocoon.ProcessingException: Failed to execute pipeline.: org.apache.cocoon.ProcessingException: Cannot parse!: org.xml.sax.SAXParseException: The string -- is not permitted within comments. column: 18 line: 872 cause: org.xml.sax.SAXParseException: The string -- is not permitted within comments. The problem is that there are no -- characters at the specified location (in fact, there are no -- characters in the .xml document at all). Playing around it seems that this error is reported when indexing 'large' xml files. The xml file has a size of 270 kb . Reducing it to 1/3rd seems to solve the problem. Is there a limit on the size of an xml file Cocoon can process (as it is a org.apache.cocoon.ProcessingException error). I'm using Tomcat 4.0.6, Cocoon 2.1.4 and Windows XP Do you mean indexing with the bundled lucene indexer? Lucene is a separate apache project (http://jakarta.apache.org/lucene I think) so if you don't get an answer here, you should check there - bugzilla first, their archives next, then post to their users list. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set properties for jdbc connection
Vlad Ali wrote: hi all again! i read docs on coocoon.org cocoon.wiki but i hasn't found answer on may question I need to set two properties for my jdbc connection (for xsp page) (mySQL driver) useUnicode = true; characterEncoding = Cp866 if i use xsp:logic... connInfo.put(useUnicode,true); connInfo.put(characterEncoding,Cp866); con = DriverManager.getConnection(url); ... then all work as need, but i think that is not good way because i don't have pool coonnection controling cocoon.. and i think that best way is set this props in cocoon conf (may be cocoon.xconf?) if i write in cocoon.xconf jdbc name=mytest pool-controller max=10 min=5/ dburljdbc:mysql://localhost:3306/test/dburl userdummy/user useUnicodetrue/useUnicode characterEncodingCp866/characterEncoding it don't work Have you any suggestion to help me? Read the mysql connector/j docs - you append parameters like this to the jdbc url (other jdbc connectors do this too). Try this in cocoon.xconf: jdbc name=mytest pool-controller max=10 min=5/ dburljdbc:mysql://localhost:3306/test?useUnicode=trueamp;characterEncoding=Cp866/dburl userdummy/user /jdbc The amp; is only necessary because of the xml format of jdbc. When the parser reads it and hands it to Cocoon (and therefore the driver) it will just be a good old character. Geoff - Original Message - From: Antonio Gallardo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 05, 2004 5:19 AM Subject: Re: How to set properties for jdbc connection Hi Vlad: Vlad Ali dijo: I need to set properties for database connection in java code i write: Properties connInfo = new Properties(); connInfo.put(useUnicode,true); connInfo.put(characterEncoding,Cp1251); con = DriverManager.getConnection(url, connInfo); but i don't know how to do same in cocoon configuration See this doc: http://wiki.cocoondev.org/Wiki.jsp?page=DatabaseConnectionOverview Best Regards, Antonio Gallardo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: binding params in dynamic queries in ESQL
Joel McConaughy wrote: It WOULD be interesting if that's what I did. I actually didn't end up using any bound parameters; just dynamically created the statement. Are you required to use a prepared statement? If so, I'd be interested in why -- it may be somethig I need to do with my app as well. Sorry I can't be more help... How are you protecting against SQL Injection attacks? esql:queryselect * from foo where foo.x = 'xsp-request:get-parameter name=bar/'/esql:query if you take myVar in any way from a request parameter, what happens if I pass in a value like bar=abc;delete%20from%20foo (try it on your app). if you are not _very skillfully_ protecting against unexpected injection of unwanted sql in that form and every variant of it using escaped characters, funny unicode, etc. then you are wide open to sql injection. parameterized statements in jdbc provide a very good measure of protection against this kind of stuff. Geoff I ran into the same problem and ended up building the entire sql statement in a String variable within an xsp:logic block. When you did this, where you also using the esql:parameter tags to bind parameters? If you were, it sounds like many people would be interested in seeing the example. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: binding params in dynamic queries in ESQL
Geoff Howard wrote: How are you protecting against SQL Injection attacks? esql:queryselect * from foo where foo.x = 'xsp-request:get-parameter name=bar/'/esql:query if you take myVar in any way from a request parameter, what happens if I pass in a value like bar=abc;delete%20from%20foo (try it on your app). Oops, changed my example without changing all references - myVar is supposed to be bar obviously. I don't have many soapboxes but this is one of them - I have inherited applications crippled by problems like this. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [XConfToolTask] java.net.ConnectException: Connection timed out: connect
Alex Romayev wrote: I have 2.1.4 label. My internet connection is fine (proved by this email ;-)). I suppose the server it's trying to look up is down... if web.xml is the culprit (you should see which file is being patched in the console) that'd be sun's site. Do you think if I CVS HEAD, it'll fix it? Maybe - we did upgrade to Xerces 2.6.2 from 2.6.1 about six days ago. You may just try upgrading Xerces (I think Xpatch will use the version in tools/lib??) Geoff Thanks, -Alex --- Geoff Howard [EMAIL PROTECTED] wrote: Alex Romayev wrote: Hi, Most of the time when I run XConfToolTask, it works fine, but sometimes I get the following error: IOException: java.net.ConnectException: Connection timed out: connect Any idea what's the problem here? Which version of Cocoon? The xpatch task is supposed to disable resolving of remote dtds but the underlying xalan/xerces feature was broken. To be honest, I don't remember where it left off, when it broke or if/when it was fixed. But that's probably the issue. While the problem exists, it is impossible to run the xpatch task against an xml file with a dtd reference (web.xml for example) if no interet connection is present, and probably if the dtd request fails. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [XConfToolTask] java.net.ConnectException: Connection timed out: connect
Joerg Heinicke wrote: On 02.03.2004 21:48, Geoff Howard wrote: Alex Romayev wrote: Hi, Most of the time when I run XConfToolTask, it works fine, but sometimes I get the following error: IOException: java.net.ConnectException: Connection timed out: connect Any idea what's the problem here? Which version of Cocoon? The xpatch task is supposed to disable resolving of remote dtds but the underlying xalan/xerces feature was broken. To be honest, I don't remember where it left off, when it broke or if/when it was fixed. It was Xerces 2.6.0, but fixed for Cocoon 2.1.4. Thanks, Joerg. I had it in my head that it was fixed but the problem didn't go away. Am I loonier than I thought? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NullPointerException @ cocoon+ mysql //thank you!
Liqiao Han wrote: I set up a mysql server in my own machine. and it work fine with my cocoon. does it say that mysql driver works fine? I am almost frustrated... That is a strong indication that the IP access permissions are not set up correctly. What you posted before looked correct, but it's been a while since I've done that myself. Check the mysql manual carefully and maybe ask on the mysql user group. It may help to create a very simple standalone jdbc test class which just connects and performs a simple query so you can eliminate any interaction with Cocoon as a factor. I like that security feature of mysql but a lot of people seem to get caught on it including me and you apparently... Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NullPointerException @ cocoon+ mysql //thank you!
Liqiao Han wrote: Textor, thank you for your reply, actually i set a user and password, still doesn't work I just find the message sent by my machine contains no data at all following is what I get from windump. I don't know if this has something to do with the different os of my machine and my boss' machine I am using Win-xp and my boss is using Unix. That should have nothing to do with it. Have you set up mysql to allow connections from your ip as that user? See mysql docs. Are you sure this has anything to do with mysql? The error you quote is about namespace - are you trying to use the sql transformer without declaring the namespace?? Geoff 16:10:45.523255 IP my-Domain.1473 boss-domain.3306: S 61218 3295:612183295(0) win 64240 mss 1460,nop,nop,sackOK (DF) 16:10:45.523576 IP boss-domain.3306 my-Domain.1473: R 0:0(0 ) ack 612183296 win 0 - Original Message - From: Johannes Textor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 28, 2004 2:20 PM Subject: Re: NullPointerException @ cocoon+ mysql //thank you! Han, you have to setup user name and password according to the mysql user settings. The default settings are user root and no password (), but I would strongly advise you to change this. Greetings Liqiao Han wrote: I have struggled with cocoon+mysql for a week and failed to make themwork! I am new to mysql and cocoon both. now I totally have no idea what to do. What I did: 1. I copied the mysql-connector-java-3.0.11-stable-bin.jar to $COCOON_HOME/WEB-INF/lib 2. add the following to the web.xml !-- For MySQL Driver: -- com.mysql.jdbc.Driver 3. add the following to the cocoon.xconf jdbc name=YourPoolName pool-controller min=5 max=10/ dburljdbc:mysql://boss.mylab.org:3306/tbdb?autoReconnect=true/dburl userYourUsername/user passwordYourPassword/password /jdbc in fact I am not quite sure the database name, user name and password above. A the database server doesn't require an user name or password to use the database, but it dos require an account to login in to the OS, I don't know how to set the user and password here? B I am not sure the database name too. After I login on to the server by ssh, I can type mysql use tbdb and then, I can inquery the table I want, so is tbdb the one I should set after the port number? 4: here is what I add to the sitemap.xmap map:match pattern=allUsers map:generate src=allUsers.xml / map:transform type=sql map:parameter name=use-connection value=YourPoolName / map:parameter name=show-nr-of-rows value=true / map:parameter name=clob-encoding value=UTF-8 / /map:transform map:serialize type=xml / /map:match 5, here is the allUsers.xml ?xml version=1.0 ? document execute-query xmlns=http://apache.org/cocoon/SQL/2.0; query name=allUsers select uid from users; /query /execute-query /document So I started the server and input the Url, the response is very veryslow(about 5 minutes) and what I got an null pointer error. I looked at the error log, it says: java.sql.SQLException: Failed to obtain connection. Made 5 attempts with 5000ms interval at org.apache.cocoon.transformation.SQLTransformer$Query.getConnection(SQLTrans former.java:1038) at org.apache.cocoon.transformation.SQLTransformer.executeQuery(SQLTransformer. java:326) at org.apache.cocoon.transformation.SQLTransformer.endExecuteQueryElement(SQLTr ansformer.java:493) I used tcpdump to see the data transfer between my machine and the server,actually the tcp messages were sent out and the server acked it. but I doubt if jdbc has sent out the query because according to the tcpdump the messagecontains no data like following: my-domainName.1234 server-domainName.3306 S 123456:123456(0) win 6424 (mss 1460, nop,nop, sackOK) (DF) server-domainName.3306 my-domainName.1234 R 0:0 ack 123457 win 0 Now I totally have no idea why Thanks for your help and time! following is the error stack: Failed to execute pipeline. org.apache.cocoon.ProcessingException: Failed to execute pipeline.: java.lang.NullPointerException Original Exception: java.lang.NullPointerException at org.apache.xml.serializer.ToStream.ensurePrefixIsDeclared(ToStream.java:2675 ) at org.apache.xml.serializer.ToStream.startElement(ToStream.java:1777) at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(Transforme rIdentityImpl.java:1073) at org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:130) at org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:130) at org.apache.cocoon.transformation.AbstractSAXTransformer.startTransformingEle ment(AbstractSAXTransformer.java:692) at org.apache.cocoon.transformation.SQLTransformer.start(SQLTransformer.java:80 1) at
Re: Aggregating unknown sources
Alex Romayev wrote: I'm trying to parse an html page, which contains links to other pages, which I need to aggregate. I understand I can develop a pipeline like this: map:match pattern=links map:generate type=html src=http://foo.org/ map:transform src=create-links.xsl/ map:serialize type=xml/ /map:match This will produce: links linkhttp://foo.org/page1.html/link linkhttp://foo.org/some-other-page.html/link linkhttp://foo.org/and-another-page.html/link /link Now, at this point, I need to be able to aggregate all of pages via html generator into one page. Use cinclude or xinclude transformer step. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Aggregating unknown sources
Alex Romayev wrote: Oh, good point... feel silly now ;-) :). Don't. --- Geoff Howard [EMAIL PROTECTED] wrote: Alex Romayev wrote: I'm trying to parse an html page, which contains links to other pages, which I need to aggregate. I understand I can develop a pipeline like this: map:match pattern=links map:generate type=html src=http://foo.org/ map:transform src=create-links.xsl/ map:serialize type=xml/ /map:match This will produce: links linkhttp://foo.org/page1.html/link linkhttp://foo.org/some-other-page.html/link linkhttp://foo.org/and-another-page.html/link /link Now, at this point, I need to be able to aggregate all of pages via html generator into one page. Use cinclude or xinclude transformer step. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Starting problem with Cocoon
Liesen, Dr. Arndt wrote: Hello, here is an absolute novice to Cocoon trying to get running 2.0.4 under Tomcat 3.2. Instead of the Welcome page http://localhost:8080/cocoon gets me a (judging from the format: cocoon - ) page Internal servlet error indicating Cocoon was not initialized. Cannot process request. from sender org.apache.cocoon.servlet.CocoonServlet. I do not find anything about what and where to initialize. Anybody out there to help? The situation you describe means that Tomcat couldn't start Cocoon, which usually means an environment problem. If you are using jdk 1.4 see the FAQ in the wiki, or archives about the endorsed libs problem. If not, you'll need to check tomcat's logs to see what the problem is -- it could be permissions, incompatible binary version, etc. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL update and select statements in the same map:match problem
It's not a bug -- and I wouldn't recommend using a workaround like the one below (which would probably work). Don't try to modify the data model while it's being turned into sax (the job of the generator). Other non-MVC friendly frameworks force this but Cocoon almost forces you not to because of all the problems it can cause in real-world applications. In your case, either use flow to call logic which modifies your database (beyond scope of my response) or use an action. Actions and flow are both guaranteed to execute before the pipeline is assembled and are designed to be the place for data manipulation (with the exception of the side-effect transformers like the SQLTransformer, also out of scope). If you already have an xsp which does the job, turn it into an xsp action and you're done. Geoff Christopher Painter-Wakefield wrote: I don't know anything about the internal workings of the map:aggregate, but I would guess it is not waiting for the first part to complete before opening a connection for the second part. This would make sense, for performance reasons, and there is no particular reason for cocoon to expect the parts to be dependent on each other. So I don't think it is necessarily a bug, nor a caching mechanism, just that map:aggregate doesn't imply sequential processing. Just curious, should the map:aggregate have an element attribute specifying the root element for the combined output? Also, what does strip-root='yes' do? I couldn't find it in the documentation (http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html#Aggregating). You could probably make things sequential (and still achieve aggregation) by using either a cinclude transformer, or even more simply by using an XSLT transform step with the document() function, e.g., ... xsl:template match=output-of-update-point new-root xsl:copy-of select=./ xsl:copy-of select=document('cocoon:/xml/exec.get_point')/ /new-root /xsl:template ... with a sitemap like map:generate src=cocoon:/xml/exec.update_point/ map:transform src=aggregate-get-point.xsl/ or some such. -Christopher hi people i have the folow code : map:aggregate map:part src=cocoon:/xml/exec.update_point strip-root=yes/ map:part src=cocoon:/xml/exec.get_point strip-root=yes/ /map:aggregate where i call 2 .xsp 1. update_point.xsp where i update a record in my database 2. get_point.xsp where i get the updated record the problem is that this aggregation update the database record (i have check the content) but generate output (get_point) with the before update values is this a caching mechanism case, is it possible to bypass this problem or it's just a bug? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error compiling fresh CVS download
Johan Kok wrote: Got the following error trying to compile cocoon after CVS download: C:\Apache\cocoon\cocoon-2.2\src\java\org\apache\cocoon\components\flow\AbstractI Don't use 2.2 yet. http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=107600552608370w=2 Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: having fun with wiki ?
Stéphane Delort wrote: Hello, As I'm trying to understand how to run actions, I had a look at this wiki page : http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadWithAction Once I downloaded the file attached I had the surprise to discover that the .jsp was in fact a .jpeg : $file cnoteDetails.jsp cnoteDetails.jsp: JPEG image data, JFIF standard 1.01 If there was originally a real interesting .jsp file that have been replaced please, upload it and remove this winter's image. I can't think of why a jsp would ever have been on that page - it would be totally off topic. In fact, I see someone else agrees with this diagnosis and had already added it to the list of items to be deleted by the wiki admin: http://wiki.cocoondev.org/Wiki.jsp?page=DeleteMe Wiki abuse is annoying. A lot of people actively monitor the updates and regularly revert malicious edits but don't catch them all. A simple authentication scheme is being investigated IIRC but that is very non-wiki and will be thought through pretty carefully. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Flow] Releasing components
Andreas Hartmann wrote: Hi Cocoon community, I just took a look at the cron block sample. It obtains a component: cocoon.getComponent(Packages.org.apache.cocoon.components.cron.JobScheduler.ROLE); but I can't find the place where it is released. Is this done automatically now? Not (yet?) done automatically. Use cocoon.releaseComponent(componentVar). See http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=107708176218215w=2 Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Incomplete image requests
beyaNet Consultancy wrote: forgot to attach the the svg file, here it is I just looked quickly at your xsp and before we get any further into this, can you explain why you're not using an image/database reader for this? Is it because of the hibernate support? I don't see any purpose for putting this into svg (as base64 jpeg) just to re-serialize as jpg. I've seen about a million messages go by about this general topic so you may just need to quickly summarize the issue. Assuming you have some need to do it this way though, I'd recommend putting some logging (or just System.out.println which should get spit out in your terminal console) to see what is going on internally. Are you sure you're getting data back in each case fo example? Geoff many thanks in advance On 21 Feb 2004, at 18:36, beyaNet Consultancy wrote: Hi, I have constructed a pipe which handles image requests and spits out an svg. On the page in question there are 3 images. The pipe is: map:match pattern=unframe/*/*.jpg map:generate type=serverpages src=xsp/svg.xsp map:parameter name=imageNum value={2}/ map:parameter name=artistID value={3}/ /map:generate map:serialize type=svg2jpeg/ /map:match The image link is built up in my xsp page as: artists-photo1 xsp:element name=img xsp:attribute name=srcartistImage/1/xsp:exprartistID/xsp:expr.jpg/xsp:attribute /xsp:element /artists-photo1 So I have 3 images on one page which are built up in that format. What is happening is that the first image call is made no problem, and the image is displayed on the page. The second image is now requested but the image is never loaded and the browser just sits there waiting for an image to load. What is causing this, and what can I do to resolve it? My svg page is attached. The html format of the calling xsl page is: . snippet . tr td valign=top align=centerxsl:apply-templates select=//artists-photo1//td /tr tr td valign=topxsl:apply-templates select=//artists-photo2//td /tr /table /body /html /xsl:template xsl:template match=artists-photo1 xsl:apply-templates/ /xsl:template xsl:template match=artists-photo2 xsl:apply-templates/ /xsl:template many thanks in advance On 19 Feb 2004, at 12:31, Simon Mieth wrote: On Thu, 19 Feb 2004 12:19:13 + beyaNet Consultancy [EMAIL PROTECTED] wrote: Hi Simon, I think I am coming closer to the answer I have been having with the svg canvas size not changing. If I make a request for the image outside of the iframe it is loaded into, (http://www.mysite.com/cocoon/beyarecords/artistImage/1/4 6.jpg), then the image changes according to the sizes I give it. If i try and call the image so that it loads within the iframe, then no matter what values you give the height and width of the svg tag no change to the canvas size takes place. Any ideas? Hi Andrew, maybe you have inside your html-source image width= height= -statements, then the browser scale the image allways to this size. If the image is larger or smaller, the browser scale ever to this size. If so, remove the width= and height= and have allready img src= / and the browser will diplay the size from your image. Best Regards, Simon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: combining coocon with my web application
reza x wrote: hi all. I am going to combine cocoon with my current framework and web application.I don't want use the WAR file which is ready in cocoon distribution. how can i do this combination? This might be an area where if you have to ask, I don't recommend you try might apply. the only need i want to meet by cocoon is to give it an XSL file and an input xml file and generate some html and pdf format outputs.please guide me how can i do this. You don't need Cocoon for this. Just read the fop or itext docs, and a general book on java and xml. You could steal some xsl from Cocoon and Forrest if it helps. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUploadsWithFlow problem
Mark Lundquist wrote: On Feb 16, 2004, at 5:03 AM, Bert Van Kets wrote: Hmmm... well, it looks like if you use a relative path there, it's relative to the working directory of the process that started the servlet container. I'm using Jetty on Unix, so YMMV. Anyway, I do this: upload_manager uploadfoldersite/WEB-INF/work/upload/uploadfolder /upload_manager Apparently Windows has a different behavior and needs the full path. :-( You might try putting something like (new File (destination)).getAbsolutePath() into a debug log message, and find out how Winblows is interpreting the relative path? ~ml Guys - I don't have time at the moment to look into this further, but a lot of this is handled well in a cross platform way using the Source and SourceResolver interfaces. For hints on its usage, try looking at the SourceCopyAction. The source resolver itself is an avalon component and so can be looked up using its ROLE. By the way, if you are able to switch to 2.1.4 now that it's out, the new method setDisposeWithRequest may simplify this greatly if you have simple needs (all uploads go to one directory configured in web.xml). HTH, Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Processing issue.....
beyaNet Consultancy wrote: Hi, I am having problems with an image string which prints the string to the screen instead of loading the image! 1. in my xsp page I first build up the image string as so: xsp:logic String num = 39; StringBuffer sb = new StringBuffer() .append(lt;img src=\) .append(num) .append(.jpg\ border=\0\ width=\200\ height=\200\ /gt;); String artist1 = sb.toString(); /xsp:logic Simple - a Cocoon pipeline is a pipeline of sax events. Sax is an event based representation of pre-parsed xml, and so handles element events and character events separately. The code you showed results in inserting character events into the sax stream which will never be interpreted as element events. Look into xsp:element and xsp:attribute to accomplish what you are trying to do. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.cocoon.transformation.SourceWritingTransformer
Anthony Davies wrote: Hi, I'm trying to get this transformer working so that I can write xml on the fly on my server. Unfortunately, I can't get this component to work. What error do you get? The relevant sitemap bits as I have them are: ... altersubmit.xsl is: ... xsl:template match=/ source:write create=true source:sourcefile://poo.xml/source:source source:fragment xsl:apply-templates/ /source:fragment /source:write /xsl:template Seems you are creating a whole file here in which case the whitespace after source:fragment could be causing a problem (not sure how the xsl would affect that) Try : source:fragmentxsl:apply-templates//source:write Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: upload dir cleared at Cocoon startup
Bert Van Kets wrote: Hi all, I have a very annoying problem regarding uploads. To be able to do multi part uploads I went to web.xml and set the enable-uploads init-param to true and the upload-directory to data (no quotes of course). As I need ony one upload directory, it looked like the obvious choice to me to have Cocoon handle the uploads. Since I set these parameters, my upload directory is cleared totally when I restart Tomcat. This is totally unusable of course. It worked perfectly in an older version of Cocoon, but with a very recent CVS HEAD the upload dir is cleared. I have looked all over the web.xml file, but can't see any indication of this being settable. I'm not talking about uploading a file and processing it. The whole directory is cleared at Cocoon startup. Any ideas? I can't find any mention of it anywhere. Not much time now, but: 1) Make sure you've read and understood the link provided in the response from Askild. Sounds like knew that already though. 2) What was the older version of Cocoon approximately? 2.1.3? pre 2.1.0? 2.0.x? 3) Where is your upload dir, and did you switch from tomcat to jetty? 4) If you stop the container (jetty, tomcat, etc.), place a file in the upload dir, start the container, check for the file replace if missing, upload a file, check for both files replace the original if missing (the uploaded file should not be there after the request finishes), stop the container, check for the original file what happens? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excel Spreadsheet Generator|Transformer
Sure - submit a patch to bugzilla and we'll take a look at it. Won't make it in 2.1.4 which now looks once again like it'll be this week, but it'd be considered after that. Geoff JD Daniels wrote: Yes!! I was just about to start something like it. :) JD Derek Hohls wrote: I think it would be useful for many of us; maybe the comitters can add it to the scratch area of Cocoon? D Hohls Environmental Systems Developer CSIR Environmentek PO Box 17001 Kwa-Zulu Natal South Africa 4013 www.csir.co.za [EMAIL PROTECTED] 02/11/04 7:16 PM Whoops! I meant to reply to Daniel directly. FWIW, I could supply my transformer to the list (minus a project specific block of code). Anyone else need something like this? We've found it quite usefull. It takes some config XML as input to tell it how to process the Excel file (it gets from a multipart upload). David Quoting Dave Kavanagh [EMAIL PROTECTED]: There wasn't when I looked, so I made the HSSFTransformer (that membership uses). David Quoting Daniel McOrmond [EMAIL PROTECTED]: Is there are Generator|Transformer that produces xml from an excel document? Perhaps something utilizing Jakarta POI-HSSF? -Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Windows/Tomcat/Cocoon Installation --htm attached.
Michael Wolf wrote: what about putting the info on the wiki-page? So people don't have to keep this email and people not in this list can access the information too. That'd be great, but there is very little here which is specific to your set up. These same instructions should work for: 1) any recent tomcat 2) any jdk1.4 3) any cocoon release or cvs snapshot. 4) any windows environment (except probably 95, 98, maybe ME) Sometimes specifying too much version specific information makes people feel that the instructions they need aren't present because they are using a slightly different version - in this case just not true. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUploadsWithFlow problem
Bert Van Kets wrote: Hi all, I have finally gotten the FileUploadsWithFlow sample working without errors, but I still can't see anything arriving on the server. :-( Finally got a chance to look at this tonight, and I think I have answers. I have not tested any of this, so it's all fresh from 5 minutes in the patch code, and cvs (all while watching a very interesting show on the Medicis...). Point is, check what I'm saying - I could be wrong. I get no error anywhere. Not in the console, not in the browser, not in the logs. The Flow script throws me to the success page, which should mean the object was successfully created. I think you're right. The logs should go into core.log, but the default logging level (set in logkit.xconf, modified if desired by build properties) is WARN or ERROR now. So, to see the .debug() level as in this case, you need to modify it to lower to DEBUG. From what I read in the FileUploadManager.java file the upload directory is taken from the context. But regardless of what I set in web.xml I see nothing hapening there. I know that Cocoon removes the files from the upload directory at the end of teh request, but is this also the case here? After all the file is manually written to disk. Yes, this is a flaw of the upload manager component as written - because it uses the upload dir in web.xml as the default destination dir, the default behavior is to rename a PartOnDisk to the same file name. When the files are cleaned up at the end of the request in 2.1.3 and before all PartOnDisks in the Request are looped over and the underlying File deleted (even though you've resaved it). Ironically, because the code in 2.1.3 looks for PartOnDisk, if you set autosave to false the PartInMemorys will be skipped over during cleanup and the file would survive. To use the component as is, simply configure a different upload dir, which you can do from reading the component info by adding this somewhere as a top-level child in cocoon.xconf: upload_manager !-- from shorthand in roles file -- uploadfolder/any/other/dir/uploadfolder /upload_manager There is a new feature in current cvs, about to be released in 2.1.4 which mitigates this issue, but the component needs to be modified to take advantage of it. Three new methods are added to Part, but the important one is called setDisposeWithRequest(boolean) which you can use to signal the framework to leave this item alone. The default if you do not set it is true (erase at end as now). So, with this you no longer need a component for the simplest case: uploading all files to one directory, set in web.xml. You could in your flowscript just get the Part as described now on the wiki and call part.setDisposeWithRequest(false). C'est tout. What do I need to set in the web.xml file to get things running? Do I need to copy the file to a different directory again after the FileUploadMagager has already written it to disk? Just to make sure you understood the above, you should be able to provide several interesting answers to these questions yourself now... If I get this running I promise I'll update the Wiki page so it's more usable for newbies like me. Please do. There is also a problem with the component example code at the bottom - I posted a fix for that recently on the list (within the last week). Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is it possible to have poolable actions ?
MAHE Vincent FTRD/DIH/REN wrote: Do you mean that every action already implements the Poolable interface ? If so, why do I have these messages about decommissioning instance of ? Some of the base action classes do, so it depends on your inheritance tree. If your action just implements Action and extend Object (default) then you have to make it implements Action, Poolable. Poolable should be a pure marker interface (i.e., it defines no methods which must be implemented) so that may be all you need to do. However, you will need to make sure that your action is in a clean state the next time it is used. Study the actions which ship with cocoon - you'll find many answers there. Geoff -Message d'origine- De : Nicolas Toper [mailto:[EMAIL PROTECTED] Envoyé : lundi 9 février 2004 17:28 À : [EMAIL PROTECTED] Objet : Re: Is it possible to have poolable actions ? Well, yes you have to implement actions interface :=) See the archives and the wiki Le Lundi 09 Février 2004 17:23, MAHE Vincent FTRD/DIH/REN a écrit : Hi, I'm using When I test my webapp in DEBUG mode, I have the following lines in the sitemap.log file : DEBUG (2004-02-09) 11:11.41:727 [sitemap] (/test/) tcpConnection-80-0/DefaultComponentFactory: ComponentFactory creating new instance of mobivisit.acting._common.SessionIsValidAction. DEBUG (2004-02-09) 11:11.41:727 [sitemap] (/test/) tcpConnection-80-0/DefaultComponentFactory: logger attribute is sitemap.action.session-isvalid DEBUG (2004-02-09) 11:11.41:727 [sitemap] (/test/) tcpConnection-80-0/DefaultComponentFactory: ComponentFactory decommissioning instance of mobivisit.acting._common.SessionIsValidAction. If I had pool-min or pool-max parameters in my sitemap, it doesn't change anything. Isn't it possible to have a Cocoon action poolable ? I have seen in the doc that there are such actions like AbstractXMLFormAction which implements the excalibur.pool.Poolable interface. Do you think I can have better performances if I implement this interface in my actions ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A notebook for Cocoon development
John L. Webber wrote: We're using 2.1.3 as well, though we've seen this behaviour with earlier versions. I second what Brent said -- the memory problems show up if the webapps are frequently redeployed. We haven't noticed any problems in a production environment (we haven't gone live yet). This is odd, as it would seem logically that restarting the webapp should reset all memory usage. There is of course some state which is persisted between startups but I'm most suspicious that this is a container issue. - John, do you also use Tomcat? Which version do you both use? - For a trial, do you get the same behavior deployed on Jetty? (either the bundled version or the full version from mortbay.org) - Are there any symptomatic errors in cocoon's or tomcat's logs? - How do you restart? - Which Cocoon blocks do you have installed? Geoff Geoff Howard wrote: Brent L Johnson wrote: I've noticed something very similar. I've got a production box running right now out of Florida and it runs Cocoon with Tomcat just fine.. been running for well over a month now (with small amounts of traffic though, since it isnt scheduled to go live until next month). But my development machine (which is the same as the production machine, just no RAID and only 512MB ram) really starts choking if I'm repeatedly restarting Tomcat (4-5 times in a day I mean). Let's hope I dont have this problem on the production machine since this is for a government contract :) Which version of Cocoon? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Leak with Tomcat (was Re: A notebook for Cocoon development)
Brent L Johnson wrote: None that I've noticed. But unlike John, I dont wait for OutOfMemory.. once performance drops I can't stand it so I just restart Tomcat. I thought you were saying this problem spanned restarts - obviously we're talking about re-deploys in a running container then. So how do you redeploy? Drop a new war in? Using the tomcat manager app? It does span restarts.. but the first few restarts work fine. The way *I* fix the problem is I have to completely kill tomcat, and check for any running java processes and kill them.. let the machine sit and start Tomcat back up again. It's really weird, but I never really worried about it too much. Ah. Gotcha. This sort of rings a bell - I don't suppose you have checked tomcat's bug list? If you wait long enough after shutdown without manually killing processes, do they clear up on their own? If it helps any.. the first thing that signals a problems is that the site gets very slow for no apparent reason (and Tomcat is sucking up 90% of the CPU of a 2.4Ghz Xeon processor). Then Batik stops rendering images.. I get broken images in the browser. Then, usually, the site completely stops responding. If I then just do a quick shutdown.sh (sleep 2) startup.sh.. it may or may not work.. sometimes I have to run a shutdown and wait a few minutes and start it back up (maybe 2 second sleep isnt enough time). Ah, I missed batik before. That's another possibility, especially if John is using it too. Can you check cocoon's bugzilla for issues related to batik? The standard Tomcat shutdown.sh and startup.sh commands. And that fixes the problem? So we're talking about a memory leak on reload which could either be on tomcat's end or our end, but I'm assuming this would be a well known problem if it were tomcat. It does if I shut it down manually (without my script that just does a shutdown.sh, sleep 2, startup.sh).. wait about 30 seconds then start it back up again. Or I can use my script, but I may have to run it 3-4 times before everything works correctly. I can tell it didnt work correctly if 1) batik still isnt rendering images, or 2) I get no response from the server. That may answer my earlier question? If I've got all this right, can you file a bug report in bugzilla on this? If you summarize our observations and link to these messages at marc.theaimsgroup.com that should be perfect. I have very little time to dig in personally right now, but someone will probably be able to soon. Sure - I'll see if I can reproduce it and make more detailed observations. A fairly minimal set of blocks. Specifically: authentication-fw, batik, databases, fop, html, jsp, poi, and session-fw. Ok, I think there are others which are forced in by dependency, IIRC. Are you using flow? I meant to erase the bit about the forced dependencies - not sure there are in your case. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassNotFoundException and not unique container name : cocoon-portal
Bert Van Kets wrote: Hi all, I just did an update of my CVS Head and built the whole thing (clean built!). Checking the logs I saw that I got an ClassNotFoundException org.exolab.jms.jndi.InitialContextFactory. So, I go to Sourceforge, get the needed classes, build and add the lib to Cooon. Now, when I start up Cocoon again, I get a stack trace (see below) complaining about a duplicate container name called cocoon-portal. A text search on this string doesn't give me anything. So I'm stuck (again). :-( Isn't there supposed to be a dummy class for the openJMS classes??? Is the container name hard coded? If so, it's never goign to be unique is it? :-/ I can live without JMS, but it seems there's something wrong here. Yes, this comes from the jms block which by default is configured to use OpenJMS but we do not bundle it with Cocoon. If you don't plan on using jms either exclude the jms block, or ignore the warning. If you do need jms, either get OpenJMS, start it, and put its client jar in WEB-INF\lib (and/or in %COCOON_HOME%\optional so it's added there after any future rebuilds) AFAIK, the rest of the issue below has to do with the portal and has nothing whatsoever to do with the jms block. If you don't get answers on it, it's because you've mixed issues in one email and the people who know about the portal issue (not me) skipped past the message. Geoff P.S. Using JDK 1.3.1_6 and Tomcat 4.1.29 on WinXP java.lang.IllegalArgumentException: The given container name is not unique: cocoon-portal at org.apache.pluto.PortletContainerServices.createReference(PortletContainerSe rvices.java:53) at org.apache.pluto.PortletContainerImpl.init(PortletContainerImpl.java:101) at org.apache.cocoon.portal.impl.PortletPortalManager.initContainer(PortletPort alManager.java:211) at org.apache.cocoon.portal.impl.PortletPortalManager.initialize(PortletPortalM anager.java:173) at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil .java:282) at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(De faultComponentFactory.java:313) at org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize( ThreadSafeComponentHandler.java:143) at org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(E xcaliburComponentManager.java:558) at org.apache.cocoon.components.CocoonComponentManager.initialize(CocoonCompone ntManager.java:547) at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil .java:282) at org.apache.cocoon.Cocoon.initialize(Cocoon.java:340) at org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil .java:282) at org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1371 ) at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:514) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:93 5) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:210) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643)
Re: ClassNotFoundException and not unique container name : cocoon-portal
Sorry, didn't finish my sentence: Geoff Howard wrote: If you do need jms, either get OpenJMS, start it, and put its client jar in WEB-INF\lib (and/or in %COCOON_HOME%\optional so it's added there after any future rebuilds) or configure the JMS block in cocoon.xconf to use some other jms implementation. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassNotFoundException and not unique container name : cocoon-portal
Bert Van Kets wrote: Checking the logs I saw that I got an ClassNotFoundException org.exolab.jms.jndi.InitialContextFactory. So, I go to Sourceforge, get the needed classes, build and add the lib to Cooon. Yes, this comes from the jms block which by default is configured to use OpenJMS but we do not bundle it with Cocoon. If you don't plan on using jms either exclude the jms block, or ignore the warning. If you do need jms, either get OpenJMS, start it, and put its client jar in WEB-INF\lib (and/or in %COCOON_HOME%\optional so it's added there after any future rebuilds) As mentioned in my mail, I had already put the open JMS lib in the WEB-INF/lib folder, which in turn brought to light the bug mentioned by JD. As the bug is already filed, there's nothing else to do at this time but try to find the time to tackle it and file a patch. Sorry, I understood your message to be linking the two issues - perhaps I didn't read carefully enough. Which bug are you referring to? I don't see a related message from JD. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ClassNotFoundException and not unique container name : cocoon-portal
Ok, that's bizarre. Can anyone else confirm this? There are very few logical places where any interaction between the jms and portal block should be happening. You're saying that the portal block works as long as you remove the openJMS library? Geoff Bert Van Kets wrote: Oops, my bad. JD was not refering to the problem I reported. :-/ The cocoon-portal duplicate container name only appears when you add the openJMS library to Cocoon, so that is why I reported it in one mail. Bert - Original Message - From: Geoff Howard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 09, 2004 4:21 PM Subject: Re: ClassNotFoundException and not unique container name : cocoon-portal Bert Van Kets wrote: Checking the logs I saw that I got an ClassNotFoundException org.exolab.jms.jndi.InitialContextFactory. So, I go to Sourceforge, get the needed classes, build and add the lib to Cooon. Yes, this comes from the jms block which by default is configured to use OpenJMS but we do not bundle it with Cocoon. If you don't plan on using jms either exclude the jms block, or ignore the warning. If you do need jms, either get OpenJMS, start it, and put its client jar in WEB-INF\lib (and/or in %COCOON_HOME%\optional so it's added there after any future rebuilds) As mentioned in my mail, I had already put the open JMS lib in the WEB-INF/lib folder, which in turn brought to light the bug mentioned by JD. As the bug is already filed, there's nothing else to do at this time but try to find the time to tackle it and file a patch. Sorry, I understood your message to be linking the two issues - perhaps I didn't read carefully enough. Which bug are you referring to? I don't see a related message from JD. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A notebook for Cocoon development
Brent L Johnson wrote: I've noticed something very similar. I've got a production box running right now out of Florida and it runs Cocoon with Tomcat just fine.. been running for well over a month now (with small amounts of traffic though, since it isnt scheduled to go live until next month). But my development machine (which is the same as the production machine, just no RAID and only 512MB ram) really starts choking if I'm repeatedly restarting Tomcat (4-5 times in a day I mean). Let's hope I dont have this problem on the production machine since this is for a government contract :) Which version of Cocoon? Geoff -Original Message- From: Marcin Okraszewski [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 3:56 PM To: [EMAIL PROTECTED] Subject: Re: A notebook for Cocoon development At work with a 1.6 P3 and 512 MB I usually have to restart Tomcat at least once a day due to a memory leak. I have the same problem. I found that it only happens after reloading webapp (after several reloads). If I leave it to running without reloading there are no problems with Out Of Memory Regards, Marcin Okraszewski P.S. I'm working on Gentoo Linux. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUpload with Cocoon
Nicolas Toper wrote: Hi, I'm writing an XSP to manage uploading of file and I'm wondering how do you know which class is used between PartOnDisk and PartInMemory? I thought the wiki page answered this pretty clearly. PartOnDisk is used when autosave-uploads is set to true, PartInMemory when it is false. You can find out which by using instanceof, or you can use them polymorphically as objects of their common superclass, Part which exposes getInputStream(). autosave-uploads param in web.xml used to mean that uploaded files in the request were _permanently_ saved to disk. Because this behavior is either on or off for the whole application (for now) it was decided that this may become a security hole and the behavior was changed to temporarily cache the file out to disk, but to remove it at the end of the request. Actually I want to do a pretty simpel things: get the file and copy it to the user defined location... I was thinking of writing this XSP :=) Unless you're doing this in an xsp action, be aware that this is not how generators are meant to be used. Generators are the expression of your data model for a page in xml sax format. Don't use them to do things just because you can. Generally you should use flow or actions (and in some cases transformers with side effects). There is in the archive posted a file upload action which does exactly what you want to do, and plans are in the works for an easier way to do this out of the box with flow. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [BUG ?] ModuleHelper is not setup correctly
Found that the input module logicsheet was broken in 2.1.3. Just now committed a fix for this which will be in the imminent 2.1.4 release. see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26754 Geoff Luca Morandini wrote: Today I tried to switch from 2.1.2 to 2.1.3. After the compilation and installation, I fired up an application of mine (which worked perfectly under 2.1.2)... which seemed to work still fine, but... when I re-loaded the same URI, Cocoon gave me an Internal server error and the following on error.log: (2004-02-04) 23:08.23:045 : Internal Cocoon Problem org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate(): java.lang.RuntimeException: ModuleHelper is not setup correctly. at org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:274) ... Caused by: java.lang.RuntimeException: ModuleHelper is not setup correctly. at org.apache.cocoon.components.language.markup.xsp.XSPModuleHelper.getInputModule(XSPModuleHelper.java:105) at org.apache.cocoon.components.language.markup.xsp.XSPModuleHelper.get(XSPModuleHelper.java:152) at org.apache.cocoon.components.language.markup.xsp.XSPModuleHelper.getAttribute(XSPModuleHelper.java:233) at org.apache.cocoon.components.language.markup.xsp.XSPModuleHelper.getAttribute(XSPModuleHelper.java:244) at org.apache.cocoon.www.file_.c_.web.noria.noriadev.xsp.presentation.locate_index_html_xsp.generate(org.apache.cocoon.www.file_.c_.web.noria.noriadev.xsp.presentation.locate_index_html_xsp:123) at org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:262) This behaviour is consistent: when I re-start the Servlet container (Jetty), first time the app works (I mean, the page is loaded correctly), second time (and subsequent) it crashes. Could someone shed some light on this ? Regards, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Encoding Params in the Sitemap
Brent L Johnson wrote: Is there a way I can encode the {request-param:paramname} in a sitemap? I'm trying to use a request parameter in the HTMLGenerator as part of a GET request, but using {request-param:paramname} decodes the parameter. So if the parameter has a space - instead of putting a %20 back into the GET it gets decoded back into an actual space character. Check the archives for this one - I know its been discussed several times but don't remember the solution. An input module is the likely cure. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart form upload
Chris Wilder-Smith wrote: Geoff, On Thu, 2004-02-05 at 19:45, Geoff Howard wrote: Chris Wilder-Smith wrote: snip I get ** request class: org.apache.cocoon.environment.http.HttpRequest Right - and that's the point. Sorry I didn't explain more, but a change was made to the environment and request abstraction handling such that the assumption in the wiki that you can tell whether uploads are successfully enabled is no longer correct. So, you'll notice in my proposed code that I ignore the type of request. Try it and let me know what happens. If you just println inside each condition block you'll have a major clue. I took a look through the HttpRequest code and can see how that is supposed to work on the request wrapper inside the HttpRequest. I checked the content type and get multipart/form-data so that seems correct: content-type=multipart/form-data;boundary=--7d41541f902a8 If I instrument the MultipartHttpServletRequest code so I can see what's in the 'values' Hashtable - I just get two parameters with string values - there are no Part objects in there. Do you think that means that the form-data really isn't getting parsed? I also just threw it at a requestgenerator but don't get any insights there. hmmm, I would be suspicious that uploads were broken in 2.1.3 but I really don't think so. Can you triple check that the web.xml used in this case really has enable-uploads set properly? After that, i'd break out a debugger, set a break point on cocoon servlet where it creates the request, or RequestFactory, etc. and see what is going on. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart form upload
Chris Wilder-Smith wrote: Geoff, On Fri, 2004-02-06 at 11:42, Geoff Howard wrote: snip hmmm, I would be suspicious that uploads were broken in 2.1.3 but I really don't think so. Can you triple check that the web.xml used in this case really has enable-uploads set properly? After that, i'd break out a debugger, set a break point on cocoon servlet where it creates the request, or RequestFactory, etc. and see what is going on. Okay, this seems pretty weird, or at least counter-intuitive... This is what I'm seeing. When I post the audio file to cocoon, I can see a RequestFactory.getServletRequest() occur. Then, it goes through the parsing process until it finds the file part and then appears to save the file to disk at the appropriate place. (it puts an attribute in place called 'file' whose value is the resolved path to the file it saves. Now, I'd expect that the next thing I'd see would be my custom generator that is sitting on this pipeline get the request object, but that doesn't happen. Instead, I see a second getServletRequest() call, also with multipart/form-data encoding, but a different boundary and as such I think a completely different request. (Actually I know it's a different one, because I can see the constructor call) The whole parsing routine takes place and there is no file part to this request. It is the result of this second getServletRequest that arrives at the generator, and it doesn't have the 'file' attribute. In addition, the file has been deleted, one way or another (I know it is transient - only for the life of the request, which must already have been cleaned up) Clearly something odd is going on... Any ideas? Are you using cinclude or something like it? Can you send the relevant bit of your pipeline? Also, try the upload sample if you have it or can hack it into your set up (really just a pipeline and associated xsp file). Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart form upload
Chris Wilder-Smith wrote: Geoff, On Fri, 2004-02-06 at 14:08, Geoff Howard wrote: snip Are you using cinclude or something like it? Can you send the relevant bit of your pipeline? Also, try the upload sample if you have it or can hack it into your set up (really just a pipeline and associated xsp file). No, we're not using cinclude in here. It was wrapped by an action, but it reacts the same with or without the action. I tried the upload sample xsp and of course, it works as specified - so something else is going on. Next, I hacked on the file upload example to have it send to my pipeline. Here, it appears to work as expected -- the file path is in the parameters and I can access it. So, that leads me to believe that there's something unique on the client side. This piece of the application we're building uses an audio recording applet to record student responses to activities, then sends the audio file to the server where it is stored. The applet is something of a blackbox from freedom audio. We have it working successfully in a pure servlet environment, but perhaps there are nuances to the way it does the request that cocoon doesn't like. I still don't understand the mechanism by which two requests could come through and only have one get to the I don't remember everything in the request generator output but I have in the past posted to it to determine issues like this (I think you tried something like this earlier). Do you see any interesting difference between the request gen output if you point the upload sample to it, and then point the applet at it? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cocoon +jetty +vhosts
[EMAIL PROTECTED] wrote: hi, How can i configure Jetty to have a particular sub-sitemap mounted on a given vhost? eg: vhost1 - mounts sitemap in dir1 vhost2 - mounts sitemap in dir2 ... You can do that in the root sitemap with a host matcher. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javax.servlet.http.HttpSession access from XSP?
Phil Blake wrote: Ok, I think the proposal to do this is not going to go anywhere, but there is a solution. You'll probably need to give more info (or remind us of it) of what code you are calling this from (action, flow, generator, transformer, etc.). While you are at it, can you give more info about what part of the Cayenne API relies on this? It is odd that they need an http session object - what if you wanted to use this code outside of a webapp? From what I can see, cayenne is simply using the HttpSession as a key to associate with the database session. In my case I am wanting to do something like this: xsp-session:set-attribute name=dataContext xsp:exprhookToCayenne().getDataContext(session)/xsp:expr /xsp-session:set-attribute However, this is where it goes south because session is not an HttpSession. I like the suggestion that Session implements HttpSession - that looks like a fairly trivial change and is likely to support any framework that requires one. No, this proposal has been vetoed (and discussed before and vetoed then too). See the dev archives for more info. Any suggestions. This is currently a show-stopper so I need an answer - however, I am not a maintainer (yet) and I don't know how to go about having a change like this pushed through quickly. Do you have any advice? Try this: xsp:logic javax.servlet.http.HttpSession realSession = null; Object o = objectModel.get(org.apache.cocoon.environment.http.HttpEnvironment.HTTP_REQUEST_OBJECT); if (o != null) { javax.servlet.http.HttpServletRequest realRequest = (javax.servlet.http.HttpServletRequest)o; realSession = realRequest.getSession(); } /xsp:logic xsp-session:set-attribute name=dataContext xsp:exprhookToCayenne().getDataContext(realSession)/xsp:expr /xsp-session:set-attribute and let us know what happens. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javax.servlet.http.HttpSession access from XSP?
Phil Blake wrote: While you are at it, can you give more info about what part of the Cayenne API relies on this? It is odd that they need an http session object - what if you wanted to use this code outside of a webapp? From what I can see, cayenne is simply using the HttpSession as a key to associate with the database session. Yes, I looked up the only reference to HttpSession I could find in Cayenne's api and found the session-specific context config. I don't know how well you know Cayenne (I don't at all) but are you sure you need this feature? Is your config really different for each unique session? Second, if they are just using the Session as a unique key, I think they would be open to the more general-use suggestion of using an Object as key passed in instead of requiring an HttpSession for the same basic reason we have abstracted our environment in Cocoon. Couldn't Cayenne users want this feature in other environments besides webapp? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: samples
James Cummings wrote: Hi there, I checked out cocoon-2.2-dev from CVS today, and build seem to go fine. I then was looking at the samples and some seem to work and others didn't. Simple: don't use 2.2 yet. It is still in the middle of a massive reworking including replacing the underlying framework and is nowhere near in usable condition. Additionally, because the blocks system is going to be evolving significantly from a static compile-time construct to dynamic deploy-time one, the block code is not even in the 2.2 repository and to my knowledge is not a part of the 2.2 build. 2.1 branch is stable and under active development still. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart form upload
Chris Wilder-Smith wrote: Hi, We're trying to use a multipart/form-data post to upload audio files recorded on the client machine to our cocoon-based backend. All of the web.xml file upload params seem to be set correctly: request-factory=org.apache.cocoon.components.request.MultipartRequestFactoryImpl enable-uploads=true upload-directory=WEB-INF/work/upload-dir autosave-uploads=true overwrite-uploads=rename upload-max-size=1000 According to the wiki pages, I should see the request type as MultipartHttpServletRequest when it comes through, but it is a regular cocoon HttpRequest. According to the example, this implies that uploads still aren't enabled. I do see other parameters that come through on the request, it's picking up the correct generator, etc. Which Cocoon version, which wiki page? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart form upload
Chris Wilder-Smith wrote: Sorry, Cocoon 2.1.3 and this wiki page... http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithFlow 1) request-factory should be ignored in 2.1, but get rid of it in case it was left in for compatibility and is screwing you up. The fact that you have it in implies that you are basing your understanding off a mix of 2.0 and 2.1 documents. Make sure you read the note at the top of http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon, ignore the rest of that page and follow the link to the 2.1 specific info. 2) Did you change web.xml in the src/webapps directory (wrong) or the build/webapps directory (right) or some other deployed directory (right)? There is also a build property in build.properties to set this automatically. You can run just the config changes by changing that setting (via local.build.properties - see INSTALL.txt) and just running build custom-conf. See http://wiki.cocoondev.org/Wiki.jsp?page=CustomConfigTarget. 3) Did you restart the servlet container after editing web.xml? 4) Did you say you were getting a HttpRequest? That brings up a change to the Request stored in the objectModel which may make that code on the wiki no longer work as written. Try this: Request request = ObjectModelHelper.getRequest(obj); Object o = request.get(blah); if (o == null) { // parameter missing from request } else if (o instanceof Part) { Part part = (Part) o; // do something with it } else if (o instanceof String) { // upload is disabled - I think. } Geoff On Thu, 2004-02-05 at 16:35, Geoff Howard wrote: Chris Wilder-Smith wrote: Hi, We're trying to use a multipart/form-data post to upload audio files recorded on the client machine to our cocoon-based backend. All of the web.xml file upload params seem to be set correctly: request-factory=org.apache.cocoon.components.request.MultipartRequestFactoryImpl enable-uploads=true upload-directory=WEB-INF/work/upload-dir autosave-uploads=true overwrite-uploads=rename upload-max-size=1000 According to the wiki pages, I should see the request type as MultipartHttpServletRequest when it comes through, but it is a regular cocoon HttpRequest. According to the example, this implies that uploads still aren't enabled. I do see other parameters that come through on the request, it's picking up the correct generator, etc. Which Cocoon version, which wiki page? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart form upload
Chris Wilder-Smith wrote: On Thu, 2004-02-05 at 17:23, Geoff Howard wrote: Chris Wilder-Smith wrote: snip the sanity check stuff. all sounds right. 4) Did you say you were getting a HttpRequest? That brings up a change to the Request stored in the objectModel which may make that code on the wiki no longer work as written. Try this: Request request = ObjectModelHelper.getRequest(obj); Object o = request.get(blah); if (o == null) { // parameter missing from request } else if (o instanceof Part) { Part part = (Part) o; // do something with it } else if (o instanceof String) { // upload is disabled - I think. } this is basically what I'm doing. When I print out something like this: System.err.println( ** request class: + request.getClass().getName()); I get ** request class: org.apache.cocoon.environment.http.HttpRequest Right - and that's the point. Sorry I didn't explain more, but a change was made to the environment and request abstraction handling such that the assumption in the wiki that you can tell whether uploads are successfully enabled is no longer correct. So, you'll notice in my proposed code that I ignore the type of request. Try it and let me know what happens. If you just println inside each condition block you'll have a major clue. I'm assuming that request.get(str) is functionally different from request.getAttribute(str) - is there an equivalent to request.getAtrributeNames() - I would like to verify that I'm not just doing something stupid, like using the wrong key on the 'get'. I'll go dig through the source. First, don't confuse request attributes with parameters. Parameters are the things that come in via GET or POST. But yes, there is an imporant difference. Use getParameter(String key) to get at normal string parameters. get(String key) returns Object and so has to be used to get at uploaded Files which have been parsed by Cocoon and added to the request parameter collection as Part objects. Use Enumeration request.getParameterNames() (not request.getAttributeNames()! ) if you want to check that the field is present at all. Geoff On Thu, 2004-02-05 at 16:35, Geoff Howard wrote: Chris Wilder-Smith wrote: Hi, We're trying to use a multipart/form-data post to upload audio files recorded on the client machine to our cocoon-based backend. All of the web.xml file upload params seem to be set correctly: request-factory=org.apache.cocoon.components.request.MultipartRequestFactoryImpl enable-uploads=true upload-directory=WEB-INF/work/upload-dir autosave-uploads=true overwrite-uploads=rename upload-max-size=1000 According to the wiki pages, I should see the request type as MultipartHttpServletRequest when it comes through, but it is a regular cocoon HttpRequest. According to the example, this implies that uploads still aren't enabled. I do see other parameters that come through on the request, it's picking up the correct generator, etc. Which Cocoon version, which wiki page? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileGenerator making two HTTP requests
Teator, Michael wrote: So, how do I make it stop??? Not good when the XML is dynamically generated. -Original Message- From: Ivo Limmen [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 2:00 AM To: [EMAIL PROTECTED] Subject: Re: FileGenerator making two HTTP requests My take: 1) HTTP GET for XML file. 2) HTTP GET for DTD file (Witch is locally stored in a catalog). Teator, Michael wrote: I have an issue with my cocoon where I have a url specified in the generate source (type=file) like: src=http://localhost/whatever.xml; For some reason it makes TWO requests to this file every time. Any ideas? If I change the generate type to html then it only makes one request, How about once for the last modified, once for the content. How are you generating the content? If it's a cocoon pipeline, why not use cocoon: pseudo-protocol? If not, try switching to uncached pipeline. There may be a bug in the way the http protocol handler is working with last-modified - which could of course already be fixed in cvs, so make sure you check bugzilla and/or the cvs head (will soon be released as 2.1.4). Also, if your dynamic process is not able to generate last modified info without going through its whole process then you'll need to either not cache the cocoon end, or look into the event-based cache (eventcache block). Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javax.servlet.http.HttpSession access from XSP?
Geoff Howard wrote: Phil Blake wrote: By the way, it's important that people know the basic reason Cocoon doesn't give you an HTTP session. Cocoon abstracts the environment so that it can be run from many different environments, not just http/servlet. Currently the command line interface is the only other implemented environment but even there dependency on servlet jar and HttpSession obviously makes no sense. Examples of other potential environments which have been discussed are email (via James) and JMS. Now, that doesn't mean it should be impossible to get to the HttpSession if you are in that environment and that's what we need to see. I think the method which is used in the other environment abstractions (Request for example) won't work here, but I don't see a reason cocoon's session couldn't implement HttpSession. Right now, it seems the only methods unimplemented from the javax interface are the deprecated methods. Another alternative would be to use JDK 1.3 dynamic proxy which may work if the code you pass the proxy to doesn't call the deprecated methods (I can't remember for sure if this is true). Good point Geoff. This is a specialised case. I think you'd only want access to the HttpSession for this kind of integration. Perhaps a _wrappedSession() method on org.apache.cocoon.environment.Session is too easy to abuse. A little opinionated documentation could help with that. :) Any comments? I was thinking more of just declaring that the cocoon HttpSession implements the javax interface as I mention above. It would be easiest to implement the deprecated methods to just throw an exception. Does Cayenne need them? If we do this, you could just pass the cocoon session along with a possible cast depending on how you got it. I've started a proposal on the dev list about this if you want to pipe in or follow along there. Oh, and for the record - there is now a third environment implementation: a portlet environment. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javax.servlet.http.HttpSession access from XSP?
Geoff Howard wrote: Phil Blake wrote: By the way, it's important that people know the basic reason Cocoon doesn't give you an HTTP session. Cocoon abstracts the environment so that it can be run from many different environments, not just http/servlet. Currently the command line interface is the only other implemented environment but even there dependency on servlet jar and HttpSession obviously makes no sense. Examples of other potential environments which have been discussed are email (via James) and JMS. Now, that doesn't mean it should be impossible to get to the HttpSession if you are in that environment and that's what we need to see. I think the method which is used in the other environment abstractions (Request for example) won't work here, but I don't see a reason cocoon's session couldn't implement HttpSession. Right now, it seems the only methods unimplemented from the javax interface are the deprecated methods. Another alternative would be to use JDK 1.3 dynamic proxy which may work if the code you pass the proxy to doesn't call the deprecated methods (I can't remember for sure if this is true). Good point Geoff. This is a specialised case. I think you'd only want access to the HttpSession for this kind of integration. Perhaps a _wrappedSession() method on org.apache.cocoon.environment.Session is too easy to abuse. A little opinionated documentation could help with that. :) Any comments? I was thinking more of just declaring that the cocoon HttpSession implements the javax interface as I mention above. It would be easiest to implement the deprecated methods to just throw an exception. Does Cayenne need them? If we do this, you could just pass the cocoon session along with a possible cast depending on how you got it. I've started a proposal on the dev list about this if you want to pipe in or follow along there. Ok, I think the proposal to do this is not going to go anywhere, but there is a solution. You'll probably need to give more info (or remind us of it) of what code you are calling this from (action, flow, generator, transformer, etc.). While you are at it, can you give more info about what part of the Cayenne API relies on this? It is odd that they need an http session object - what if you wanted to use this code outside of a webapp? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC-Driver and web.xml
Nicolas Toper wrote: What do you mean if cocoon doesn't run as a webapp? Cocoon is not tied to the servlet environment, and can be run from an arbitrary environment in theory. In practice, there are two (three?) environments: servlet/http and command-line. IIRC the command-line environment handles db config differently to account for this - see the CLI/CocoonBean docs (wherever they may be - wiki?) Geoff Well, JDBC drivers are registered somewhere :=) cf the Servlet Spec for more details :=) Le Lundi 02 Février 2004 17:02, Stephan Coboos a écrit : Hello, I have a simple question: Why ist it necessary to register the jdbc driver in web.xml? Is it possible to use the driver without this registration? What happens if Cocoon runs not as webapp? So web.xml is not accessible, isn't it? Thank you. Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Evaluation of Cocoon
Ralph Goers wrote: You are under a slight misperception. In a clustered environment all requests must go to the cluster, but to any server in the cluster - not just the one the user logged into. Cocoon needs to make sure that it either a) stores what it needs in the session so that the session can be replicated b) always handles null values by reloading the correct data. My understanding is that if you use flow with continuations, this is a non-trivial situation. A totally stateless app doesn't need them, and so should be able to use any type of load-balancing (e.g., dns round-robin). Geoff -Original Message- From: Brent L Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 10:15 AM To: [EMAIL PROTECTED] Subject: RE: Evaluation of Cocoon Subsequent requests may be routed to different servers. Here I see a possible problem with Cocoon The same problem will apply to any site that uses sessions. Yes, though most application servers have some mechanism for replicating sessions. Having 'sticky' sessions is certainly a good idea for performance reasons, but if one machine goes down in such a setup no one is affected. Umm.. someone can correct me if I'm wrong. But I believe things like sticky sessions and session replication have nothing to do with Cocoon. This all depends on the servlet container you're using to serve up cocoon correct? Also - at least from my experience with the terminology sticky sessions.. this usually has to do with a load balancer and sending requests to one particular machine. I.e. user1 connects to the website on server2 and gets a session.. from then on that session's requests are all processed by the same server (server2) until the session expires. So - I may be wrong, but I think most of these requirements that you have are probably not dependent on Cocoon itself but your infrastructure and servlet container. Anyways, in our case the servers are located at different sites, and the application is completely stateless. Well.. I dont think this should affect Cocoon anymore than any other Servlet/JSP web development. - Brent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: javax.servlet.http.HttpSession access from XSP?
Joerg Heinicke wrote: On 02.02.2004 23:20, Phil Blake wrote: How do I access the javax.servlet.http.HttpSession from within XSP? I know I have xsp-session but it is a org.apache.cocoon.environment.Session And request.getSession() also returns a org.apache.cocoon.environment.Session I've seen that the org.apache.cocoon.environment.http.HttpSession is created from the javax.servlet.http.HttpSession but I can't see how to access it from there. I don't know exactly as I do not have written the code, but I think hiding the HttpSession was intended. You only shall access the Cocoon specific Session. What exactly do you want to do? I am using the database framework Cayenne. Like most web based client/server frameworks, it requires that you pass it an HttpSession to retrieve a context for that HttpSession. As there is no option here, I must supply the HttpSession, the question is - does cocoon provide access to it? I guess I could re-create a standard HttpSession from the cocoon HttpSession, but usually when I'm backed into such an ugly hack, it's because I haven't found the proper way. I'm assuming that cocoon would not completely obscure the standard HttpSession - even if it's wrapped it. Does anyone know the real story? Cocoon's HttpSession is just a wrapper around standard servlet HttpSession, but does not really give access to it. Have a look into the source code: http://cvs.apache.org/viewcvs.cgi/*checkout*/cocoon-2.1/src/java/org/apache/cocoon/environment/http/HttpSession.java?content-type=text%2Fplainrev=1.2 As the wrappedSession field has only default access and the class is even final there remains only the way of adding an additional class in the same package to get the unwrapped HttpSession - that's obviously the ugly hack. I cc Carsten as he wrote the Cocoon HttpSession, maybe he knows of a more standard way to get the unwrapped HttpSession. By the way, it's important that people know the basic reason Cocoon doesn't give you an HTTP session. Cocoon abstracts the environment so that it can be run from many different environments, not just http/servlet. Currently the command line interface is the only other implemented environment but even there dependency on servlet jar and HttpSession obviously makes no sense. Examples of other potential environments which have been discussed are email (via James) and JMS. Now, that doesn't mean it should be impossible to get to the HttpSession if you are in that environment and that's what we need to see. I think the method which is used in the other environment abstractions (Request for example) won't work here, but I don't see a reason cocoon's session couldn't implement HttpSession. Right now, it seems the only methods unimplemented from the javax interface are the deprecated methods. Another alternative would be to use JDK 1.3 dynamic proxy which may work if the code you pass the proxy to doesn't call the deprecated methods (I can't remember for sure if this is true). Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [HELP]Unable to get transformer handler for factium/.xsl
Antonio Gallardo wrote: Hi: Can you be more specific? Please show the a snipet of the sitemap. But from: Unable to get transformer handler for factium/.xsl ^ Seems like a wildcard is not well given. Best Regards, Antonio Gallardo van der Weide dijo: Description:org.apache.cocoon.ProcessingException: Unable to get transformer handler for factium/.xsl: org.apache.excalibur.xml.xslt.XSLTProcessorException: Exception in creating Transform Handler Wat's the problem? Please help meI can not see the bill I'll get from you. I seem to remember a question before from an end-user of a product by factium. Based on that and the mention of a bill I'm guessing that the person writing (van der Weide) is not a developer but a user of software built for him, and probably not subscribed to the list (so I've CC'd). If so, you'll need to contact Factium directly (http://www.factium.com/index.php?topic_id=12link_id=90clicked_id=88). If not, please accept my apologies and give more information. Now, for people using Cocoon to deliver software to clients: make sure you edit or replace the stock cocoon error2html.xsl to remove the link to the cocoon users list in case of an unexpected error. Otherwise, it will be very confusing to your end users who can't be expected to discern where your application ends and the framework begins. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: build targets
John L. Webber wrote: Try ant -projecthelp build -projecthelp if you don't have ant in your classpath [EMAIL PROTECTED] wrote: hi are somewhere (in any file in cocoon distribution) all available build targets build build war ?? build ?? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [SOLVED] Calling an external http resource from an HTML anchor
[EMAIL PROTECTED] wrote: Hi Sorry, simple error, someone had typed url as http//: rather than http:// Cocoon was just adding its path to something that it saw wasnt a proper http address ... Clever Cocoon :) Correction: your browser was doing it. Look at the html source to confirm. Cocoon isn't messing with your xml-xslt transformation. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems creating file......
beyaNet Consultancy wrote: Hi, I am in the process of re-building cocoon 2.1.3 (binary dstribution) and have forgotten how to create a war file. Could someone kindly refresh my memory as I can't find the howto details in the documentation. I am using OS X 10.3. ./build.sh war this was asked a lot recently - do you search the arcives at marc.theaimsgroup.com for this list? I'd highly recommend it. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FLOW inserting data to SQL
Joerg Heinicke wrote: On 27.01.2004 13:14, Joose Vettenranta wrote: Hello, I've seen lot's of discussion back and forward on the subject how to to save/retrieve data from SQL-server from flow-script but I have never really seen any answers how to do that. So, how can I do simple UPDATE command to database from flow script? Don't do this in the FlowScript because it is only the controller. Updating the model is part of business logic and so do this stuff in Java classes that you call from the flow script: Separation of Concerns. The problem though is that there is no out of the box component to make this easy for the newbie. What would be great is something like the database actions framework built to be used from the flow. The closest thing to it is the O/R framework (ojb block) support, right? Geoff basic structure of my flow script is: do { SendPageAndWait (foo, page: page); if (cocoon.request.get (stuff) matches logical expression)) { UPDATE table SET stuff=valueFromForm page++; } } while (page 10); that is the basic structure of the flow script I'm trying to create. - Joose - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Large XML File as Generator
Brent L Johnson wrote: Does anyone know why I get the following when I attempt to use a large XML file as a generator? (a blank page in my browser that looks like this...) !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META http-equiv=Content-Type content=text/html; charset=utf-8/HEAD BODY/BODY/HTML I get no errors or anything else.. this only happens with large files. If I cut the file down it works just fine. I've seen this behavior on different machines for different projects (the last time was trying to use XSP/esql to process about 10K database rows). Where have you looked for the errors? Make sure you look in your servlet container (jetty, tomcat, whatever) logs, as well as all cocoon logs. The console (depending on how you started the container) may have some as well. Generally I think empty pages like that happen under some error conditions I don't quite remember. Maybe when no handle-errors section is defined? Maybe under really bad exceptions like out of memory (which is likely to be your problem here). Geoff I'm using Cocoon to process XMLTV results to view a television grid. I have DirecTV with quite a few channels, and 7 days of TV data in XML format turns out to be a 5.8MB file. I think I'll probably just write something that just parses this file and dumps the data into a database and go from there.. but this is the second time I've noticed this behavior. Thanks, - Brent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Building of 2.1.4-dev problem
Peter Velychko wrote: Hello, I try to build current cvs version of the cocoon 2.1.4-dev but it is unsuccessful. I have the message: BUILD FAILED D:\java\cocoon-2.1\tools\targets\webapp-build.xml:75: Following error occured while executing this line D:\java\cocoon-2.1\build\cocoon-2.1.4-dev\temp\blocks-build.xml:8535: IOException: java.net.Socket Exception: Connection reset by peer: connect Total time: 1 minute 30 seconds Could anyone help me to solve the problem? Many thanks in advance. Do you have an internet connection active during the build? There is a bug in an xml library which currently requires an internet connection (to resolve dtd references) during some build operations. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple DB Inserts for XSP?
Brent L Johnson wrote: Sorry, I have no clues on your main question but I just had to pipe in on this strategy. Most people would really recommend that you not use a generator to perform actions. That's what flow (and Actions) are for. I think I'll take this advice and modify the code that do these actions to use DatabaseAction's instead. I just havent found a good tutorial/doc/example of using DatabaseAction's yet (and havent looked too hard yet). For the short term I'm using XSP generators to perform the actions.. based on some sql error, I either do a redirect back to some url, or display the error message. But I think I'll just move DatabaseActions up to a higher priority on my change list and see if that fixes my multiple login problem. Seriously look into flow as well. Right now though the current trend has been to not directly out of the box provide raw jdbc functions from the flow (that is, without an O/R (object/relational db mapping) layer - see the samples) so you may not find that easily understood if you don't want to get into O/R too. IIRC, the wiki, the official docs, javadocs, and especially the samples, provide a pretty good start at working with the database actions. I'd look at the Modular database actions. They are named that because they provide support for Input Modules which may not seem important, but it's a good thing and they have seen the most active development. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: parameter in a pipeline
Vincent Charlot wrote: Hi! I'm using an XSP to get the value of a parameter (called num_recup) from a SQL database. I'd like to use this parameter at the end of the same pipeline with a redirect: map:redirect-to uri=cocoon:id_data.html?num={num_recup}/ The problem is that I don't know how to recover the value within the pipeline. I tried with a xsp action, but I didn' succeed... Go back to the action and figure out what was wrong there. You cannot redirect after a generator. Do you understand the basic contract with actions and sitemap parameters? This page: http://wiki.cocoondev.org/Wiki.jsp?page=XSPAction should have all you need. Make sure you call action:set-success/ after you use set-result. I don't know about action:redirect-to but it may work for you. You should also look into flow which in many cases will be superior to actions. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I post to this list, without getting mail
Steven Noels wrote: On Jan 25, 2004, at 7:19 AM, Guy Worthington wrote: I couldn't find a no-mail option, so I'm off to bother the mail administrator. Just unsubscribe and post from your non-subscribed address. If it's legitimate mail, we'll moderate you through and add you to the no-mail list. Or you could subscribe yourself to that list by sending mail to [EMAIL PROTECTED] The -allow option is not described in the automated help response. Are you saying that it subscribes you in the sense of allowing unmoderated posts, but without getting the mail from the list? If so, how could we add that to the response from users-help@ ? Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple DB Inserts for XSP?
Brent L Johnson wrote: I'm using the authentication framework to handle logins on the site I'm working on. When the login is handled successfully the pipeline should do a map:generate for an XSP that does a database insert into a login_log table. Sorry, I have no clues on your main question but I just had to pipe in on this strategy. Most people would really recommend that you not use a generator to perform actions. That's what flow (and Actions) are for. What happens when the insert fails for example? You'll then want to be able to redirect from within a generator. This kind of pattern is common in jsp, php, etc. but isn't necessary in Cocoon and similar frameworks designed to allow a separation of content from business logic. But - when I login.. I get TWO rows into the database, for one single insert. I'm not sure how this is happening.. sometimes the timestamp between the inserts is 2-3 seconds. The only thing I can suggest here is to add a healthy bit of logging to help track down where this is coming from. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload/Multipart form
Lionel Crine wrote: The code is complicated because, at some moment we have to check which content-type was coming and what to do. I don't know if it was a good choice but it worked. now, it's useless. So I did what you said and here is a new example : try { Object oXml = this.request.get(moduleXml); Part pod = (Part) oXml; InputStream is = pod.getInputStream(); ] catch .. The getAttribute method returns null. Are you saying your new code above works now or doesn't? The getAttribute must have been a typo - that would never work. The code above should be all you need. If not, write back with more info on what is wrong. Geoff Lionel At 07:51 23/01/2004 +0100, you wrote: Lionel Crine wrote: Here is a sample code : HttpServletRequest request = (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT); contentType = request.getContentType(); if (contentType == null) { contentType = parameters.getParameter(defaultContentType, null); } if (contentType == null) { throw new Exception(ERROR); } else if (contentType.startsWith(application/x-www-form-urlencoded) || contentType.startsWith(multipart/form-data)) { String parameter = parameters.getParameter(FORM_NAME, null); if (parameter == null) { throw new Exception(ERROR); } String sXml = request.getParameter(parameter); inputSource = new InputSource(new FileInputStream(sXml)); } else if (contentType.startsWith(text/plain) || contentType.startsWith(text/xml) || contentType.startsWith(application/xml)) { len = request.getContentLength(); if (len 0) { PostInputStream anStream = new PostInputStream(request.getInputStream(), len); inputSource = new InputSource(anStream); } else { throw new SyspeoException(ERROR); } } else { throw new SyspeoException(ERROR); } InputStream is = inputSource.getByteStream(); Hello Lionel, sorry, but I don't know why you use this complicated code to realize uploads in cocoon. There is a solution which is very very easier! 1.) Set enable-uploads to true in web.xml. 2.) Get the uploaded file with request.getAttribute(filename_on_the_form); 3.) After that you will receive an object of type PartOnDisk for example. Use getFile() to receive the uploaded file. Thats it. Isn't it easy? More informations: http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon2.1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon 2.1.3 on WebLogic 8.1: CocoonServlet does not have a d efault constructor
Ralph Goers wrote: But with your sitemap? I build Cocoon with only the blocks I want and then use the generated sitemap (except that I remove references to finding stuff in users home directories - the build should be able to be made to disable that!). This can be done of course with an xpatch file - if you work one up, contribute it and it can be an optional part of the build. I personally use an xpatch file to remove all pipelines and most component definitions before adding my stuff back in. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation for Dummies
Derek Hohls wrote: Does this mean that if you start Cocoon from the command line (as described), it will then be running in a system window; from which you can use the Ctrl+C prompt? FYI this is only in the stripped down Jetty we bundle for convenience. The full version uses a shutdown listener and script as I recall. Geoff [EMAIL PROTECTED] 2004/01/19 09:03:09 AM Derek Hohls dijo: Linc Can you describe how to shut down Cocoon after starting it up this way ?? Ctrl+C (in Jetty). Best Regards, Antonio Gallardo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: slow pipeline (svg, aggregation)
Jorg Heymans wrote: Why is the svgserializer making an http call to web5.w3.org every time a template is rendered? Would the used doctype be the culprit here? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.0//EN http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd; Look at the catalog support in the examples and docs to provide a local copy of the dtd. Yes, this is standard xml behavior - except IIRC the mechanism to turn off dtd resolving is somewhat broken in the xml libraries most people use (xerces/xalan). Geoff Batik seems quite picky about which doctype to use so i don't have many options here. This could ofcourse explain the random behaviour in rendering times (now they are rendered in about 10-30 seconds). Additionally would I need to worry if a)i run this in a closed environment ie no external internet available b)this w3.org domain goes down Is this a general XML feature that can be switched off? Jorg Jorg Heymans wrote: You can tell my problem from this line in the access log: INFO(2004-01-19) 14:00.15:336 [access] (/my.svg) http8080-Processor8/CocoonServlet: 'my.svg' Processed by Apache Cocoon 2.0.4 in 3.6660166 minutes. So one SVG takes about 3.5 minutes to render. Now if i was rendering the surface of mars in svg i'ld be happy with this response time. For a 100k svg file i'm not. On faster machine i get like 50-150 seconds, depends (on what?) Sitemap.log reveals the delay starts with the contentaggregator DEBUG (2004-01-19) 13:56.35:405 [sitemap] (my.svg) http8080-Processor8/ContentAggregator: ContentAggregator: generating aggregated content DEBUG (2004-01-19) 14:00.13:763 [sitemap] (my.svg) http8080-Processor8/ResourceLimitingPool: Put a mypackage.CachingRequestGenerator back into the pool. Core.log points to the JaxpParser DEBUG (2004-01-19) 13:56.35:406 [core.manager] (/app/cod/12L0101GE/render/heart_ginko_22_132x176.svg) http8080-Processor8/ResourceLimitingPool: Got a org.apache.avalon.excalibur.xml.JaxpParser from the pool. DEBUG (2004-01-19) 14:00.13:739 [core.manager] (my.svg) http8080-Processor8/ResourceLimitingPool: Put a org.apache.avalon.excalibur.xml.JaxpParser back into the pool. My pipeline is an aggregated one map:match pattern=*/render/*.svg map:aggregate element=aggregation map:part src=file://{1}/{2}.svg/ !-- we need this part because of the aggregator caching bug -- map:part src=cocoon:/aggregate/{2}.svg?p1={request-param:param01}amp;p2={request-param:param02}amp;p3={request-param:param03}amp;p4={request-param:param04}amp;p2={request-param:param05}amp;p2={request-param:param05}amp;p6={request-param:param06}amp;p7={request-param:param07}amp;p8={request-param:param08}amp;p9={request-param:param09}amp;p10={request-param:param10}/ /map:aggregate map:transform src=stylesheets/make_svg.xsl/ map:serialize type=svg2png/ /map:match map:match pattern=aggregate/*.svg map:generate type=cachingrequest/ map:serialize type=xml/ /map:match - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTML Editor for Woody
Patrick Hess wrote: [EMAIL PROTECTED] wrote: this javascript editor support IE or not yet ? btw linotype sample does not work for a long time I've tested it on a fresh 2.1.3 yesterday and it worked for me. It supports (only) Mozilla because of using the midas editor (http://www.mozilla.org/editor/). It worked (at least partially with IE) in the past and it has always been the plan to support IE. I have not looked into this in quite some time and don't know mozilla editor well, but IIRC midas just creates an implementation of the contenteditable=true (or was it designmode=on...) and apart from implementation inconsistencies should in theory work in both browsers. Still, HTMLArea integration would probably be a popular feature as well. They fill different needs. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: missing jar file/s
beyaNet Consultancy wrote: Hi, I wondered whether you could shine some light on this issue for me. I have built an action which retrieves some data from a database, and am now trying to compile the java file. I get the following error message: GetUserDetail.java:4: package org.apache.avalon.framework.componet does not exist import org.apache.avalon.framework.componet.ComponentException; ^ you misspelled component in all your packages in the avalon imports. if you copied this off a tutorial or something, let us/them know so it can be fixed. You know, eclipse never spells wrong ;) Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Excel Generator
Johan Kok wrote: I've used chaperon for csv transformations, but are a long way from something usable. - Hopefully chaperon's new version for csv tranformation on cocoon would be usable, and provide a base to work from. Geoff: I would be interested in what you have done thus far. ... I'll review what I did (it's been almost a year) but as I recall I chose to use the event model in poi and mapped the row and cell events in my case to calls creating a dom (actually I used jdom). In a generator for general use you'd want to map them to sax events. Off the top of my head, I remember the following which may be of use early on if you're not familiar with Poi or excel internals (I knew neither when I started). - The data for empty cells is not reported (and presumably not stored). - All strings in the document are kept in a common table (not unlike the internals of java class files) and pointed to by each event. - The events do proceed left to right, top to bottom, sheet 1 to sheet n, so your proposed A1, A2, A3, ... B1, B2 ... structure should be easily mapped from poi event to sax event. - I did not touch formatting data or formulas but my vague recollection was that they complicated things to a degree (formulas to a fairly good degree). I can't remember if I mentioned that the work I did I'm not free to share and it was very specific to a given problem anyway. I did get some experience working with the poi event model and I know Cocoon generators and I'm of course free to share that experience. I'll try to get a chance to look back over the poi notes and be ready for some more specific discussion. Geoff Geoff Howard wrote: Yves Vindevogel wrote: And through XSP ? xsp:logic Code in Java to open the file with POI and generate xml?/xsp:logic -Original Message- From: Joerg Heinicke [mailto:[EMAIL PROTECTED] Sent: donderdag 8 januari 2004 21:40 To: [EMAIL PROTECTED] Subject: Re: Excel Generator On 08.01.2004 18:15, [EMAIL PROTECTED] wrote: Is it possible to use Excel files as input for a pipeline ? No, it isn't. I guess POI itself is able to do it, but it's not implemented in the Cocoon components. I've done something like this but in context just needed to put out a final document (not sax stream) and so used dom and did not implement it as a Generator. I almost went ahead and did a separate implementation for Cocoon but started feeling like the various ways one might want to interpret a series of excel spreadsheets as xml was too infinitely variable to warrant a quick solution of general use. Because my parsing requirements were complex, it would not be of general use even if I were free to release the code (which I'm not). Still, if you (or someone else) want to tackle it I could help. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xml select own stylesheet?
Conal Tuohy wrote: Mark, for one technique, see my message from about 12 hours ago (sitemap logic depending on pipeline content). Aside from the technique in Conal's message, this is generally not possible. The technical reason is that a pipeline is assembled before processing starts. Only certain pipeline elements can influence construction of a pipeline (matchers, selectors, actions, and flow). This is an intentional design decision to help enforce separation of the model (content) from controller and presentation (selection of stylesheet being one aspect of those). Another aspect to this is caching which would be impossible (or useless) if processing had to start in order to figure out if a cached response had already been generated. You can peek into the intended source file with an action or flow, or even possibly one of the xml-based input sources to accomplish the same sort of thing. If you have the flexibility to restructure your data, you can also consider finding some other way to store and signal that information. HTH, Geoff -Original Message- From: Mark Lundquist [mailto:[EMAIL PROTECTED] Sent: Sunday, 11 January 2004 18:37 To: [EMAIL PROTECTED] Subject: xml select own stylesheet? Dear People Who Know More About Cocoon Than I Do, I would like to determine which stylesheet to call for (i.e., the src in a map:transform) based on the value of an element in the XML source data itself. That would mean the pipeline has to be able to see into the stream it's processing, right? Maybe that's totally normal and I just don't know how to do it... So, is there a way to query the source XML from within the sitemap? Thanks for putting up with me noob questions :-) ~mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why a Selector is evaluated at beginning of pipeline?
Sebastian Klamar wrote: * Sebastian Klamar [2004-01-10 18:49 +0100] wrote: map:transformer type=bla/ !-- here the session attribute is generated -- map:transformer type=myexaminer/ map:select type=session-attribute map:parameter name=attribute-name value=foo/ map:when test=okay map:transform type=bar/ map:otherwise map:transform type=bar2/ map:otherwise map:select Given my example, is it right that the selector is evaluated at the beginning of the pipeline (after the match when the pipeline is constructed), that means BEFORE bla and myexaminor transformer? Why that? Yes, first any matchers/selectors (they can be infinitely nested) are executed or better evaluated, then the Generator-Transformer*-Serializer pipeline begins processing. So, your session attribute selector cannot rely on any side effects of the generator and transformers which preceed it when reading the sitemap. I think I've already given the answers about why but once again, a pipeline generator-transormer-serializer is generally thought of like the model and view of the well known MVC pattern and therefore are not designed to be used as a controller. You have matchers, selectors, flow and actions for that. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File Upload using cocoon. Unable to catch FilePartFile object from request object
1) in your sitemap below, I don't see where you are calling the xsp. As far as I can see it's not running at all. 2) I'd really recommend _not_ using an xsp generator to do business logic (like saving an uploaded file). If you're stuck in 2.0x use an action (which can also be coded using xsp though i've never done it personally). If you can move to 2.1 (which I would consider a must for any new development) use flow. 3) In your xsp below you only have to do a file.renameTo() to move the file - does that not get what you want? Geoff bajji m wrote: Hi Stephan, Thanks for info. pls have a look at my code as follows web.xml init-param param-nameupload-directory/param-name param-valueE:\upfiles/param-value /init-param init-param param-nameautosave-uploads/param-name param-valuetrue/param-value /init-param init-param param-nameoverwrite-uploads/param-name param-valuerename/param-value /init-param init-param param-nameupload-max-size/param-name param-value1000/param-value /init-param i put autosave-uploads true also. HTML form --- form method=post enctype=multipart/form-data name=sayHello action=fileUpload.html bFile:/binput type=file name=uploadfile size=25/ /tr input type=submit value=Upload name=button / /form And sitemap.xmap entry as follows -- map:match pattern=body-*/fileUpload.xml map:act type=sunRise-auth map:parameter name=handler value=videopro-handler/ map:generate type=wapi map:parameter name=wsdlURL type=String value=http://localhost:8080/ssfsoap/services/VideoproService?wsdl/ map:parameter name=methodName type=String value=uploadFile001 / map:parameter name=secure type=String value=false / /map:generate map:transform src=content/xdocs/services/xsl/fileUploadResult2Html.xsl map:parameter name=use-request-parameters value=true/ /map:transform map:transform src=content/xdocs/session2html.xsl/ map:transform type=sunShine/ map:call resource=skinit map:parameter name=type value=document2html / /map:call /map:act /map:match And 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; -- xsp:structure xsp:includejava.io.File/xsp:include xsp:includejava.util.Enumeration/xsp:include xsp:includejava.util.Collections/xsp:include xsp:includejava.util.Map/xsp:include xsp:includeorg.apache.cocoon.environment.*/xsp:include xsp:includeorg.apache.cocoon.components.request.multipart.*/xsp:include /xsp:structure uploadFile001 xsp:logic Request request = ObjectModelHelper.getRequest(objectModel); System.out.println(1+request); FilePart filePart = (FilePart) request.get(uploadfile); System.out.println(2+filePart); File file = ((FilePartFile)filePart).getFile(); System.out.println(2+file.getCanonicalPath()); //getLogger().debug(Uploaded file = + file.getCanonicalPath()); statusFile...uploaded/status /xsp:logic /uploadFile001 /xsp:page But here my problem is the file was succssfully uploaded to the uploaded-dir ( E:\uploadfile\) which i gave in web.xml file. But i need to store that file into dynamically created directory name based on the user who uploads that file. so i want to catch that File object from the FilePartFile object from the request object. But my doubt is according to wikki they are cathing that file object in action class. But i am invoking or catching in XSP file. Is this request object comes to XSP page with file object? pls clarify me? Pls look my sitemap.xmap entry and all files. pls let me know where i am doing wrong. Thanks bajji */Stephan Coboos [EMAIL PROTECTED]/* wrote: Stephan Coboos wrote: bajji m wrote: Hi Stephan, Thanks for help. But i am using cocoon 2.0 version. So i do't have enable-uploads tag in my web.xml file. So according to wikki document on cocoon 2.0 i followed that document steps. i thibk this enable-upload tag was in 2.1 version. so let me the further steps pls. so how can i proceed it? pls help me? Regards bajji OK. In 2.0 I had not used uploads but let me see your HTML-Form and I hope I can help you. Did you take a look into your log files? Regards Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Next try: Have you tried autosave-uploads=true? Form the wiki-docs about the action example: *Examples*
Re: Excel Generator
Yves Vindevogel wrote: And through XSP ? xsp:logic Code in Java to open the file with POI and generate xml?/xsp:logic -Original Message- From: Joerg Heinicke [mailto:[EMAIL PROTECTED] Sent: donderdag 8 januari 2004 21:40 To: [EMAIL PROTECTED] Subject: Re: Excel Generator On 08.01.2004 18:15, [EMAIL PROTECTED] wrote: Is it possible to use Excel files as input for a pipeline ? No, it isn't. I guess POI itself is able to do it, but it's not implemented in the Cocoon components. I've done something like this but in context just needed to put out a final document (not sax stream) and so used dom and did not implement it as a Generator. I almost went ahead and did a separate implementation for Cocoon but started feeling like the various ways one might want to interpret a series of excel spreadsheets as xml was too infinitely variable to warrant a quick solution of general use. Because my parsing requirements were complex, it would not be of general use even if I were free to release the code (which I'm not). Still, if you (or someone else) want to tackle it I could help. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocon as a XSP parser only
Upayavira wrote: Frans Thamura, Intercitra wrote: anyone know how to make cocoon only parse an xsp only, and the rest will become tomcat standard, so i can use struts, turbine, webwork inside my context can you help me? First a disclaimer: I've never used XSP. AFAIK, XSP in Cocoon is a set of XSL stylesheets that transform XSP into Java. That java is then compiled end executed. The java that is created is in the form of a Cocoon Generator. If you want to extract the XSP handling, you would need to get those stylesheets from within Cocoon's codebase, and amend them to produce the code that you want instead. I've no idea how easy or hard that would be, nor why you would want to do this. If I interpret the question right, you'd have to edit the servlet mapping in web.xml - currently, Cocoon maps every request under its context root to the cocoon servlet - you could change that to some other pattern. And add whatever handlers you need for your other frameworks in there. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]