ajax and auto-save cocoon 2.1.x
Hi, I did post this on the users list: http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=115554355602544w=2 I have not heard anything yet. If anybody has thought about or implemented an auto-save feature in a cocoon-forms application I would like to hear about it. This is like the concept of auto-save/backup in MS-Word. The application crashes before a save, but there is a restore file. In a webapp instead of application crash it is browser-crash/close or session timeout. I am thinking ajax in cforms could be part of the solution. This is an appliation where the user can be on one form for 5 to 20 minutes. I would appreciate any ideas, thanks, Chris
Re: Cocoon and Axis
If you're looking to do mapping stuff there is a whole body of specifications, and open source implementations, to do exactly what you want. To get a map you can use the Web Map Service specification - there is a Java implementation called GeoServer - http://geoserver.sourceforge.net and a strong C implementation called MapServer - http://mapserver.gis.umn.edu/ The specs are done by the Open Geospatial Consortium - http://opengeospatial.org - and the WMS one is quite mature, at the time they developed it SOAP was quite young - they're making soap bindings for their web services now. WMS spec is here: http://portal.opengeospatial.org/files/?artifact_id=5316 Unfortunately there is no real good intro to the WMS spec, when I find time I may just do one. There is a not very good 'cookbook' here: http://www.opengeospatial.org/resources/?page=cookbooks And I'm happy to answer any further questions on the geoserver lists. A WMS will easily return maps as gifs, or other formats, and indeed there are many clients that will allow you to zoom and navigate, and to overlay the map you're requesting with maps from other WMS servers. You make requests generally with key value pairs in the url, or through XML post requests. (sorry for the random post without introducing myself - I'm mostly lurking on the list for the discussion of micro kernel stuff - we're thinking about many similar issues in the context of geoserver, wanting a plug-in architecture for geospatial applications.) best regards, Chris On 6/3/05, Sebastien Arbogast [EMAIL PROTECTED] wrote: BTW I forgot to mention something. The purpose of my webservices is not to create some RPC interface to my business code. In fact I want to use the document style to generate XML documents using Cocoon sitemap facilities and feed them into my SOAP responses. And of course I want to use parameters I can extract from the SOAP request message body as parameters for the code that generates those documents. For example I receive this kind of SOAP request : SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; SOAP-ENV:Header/ SOAP-ENV:Body wifilist location x=23.764578 y=87.875468 z=.7688/ range radius=1000 unit=meters/ /wifilist /SOAP-ENV:Body /SOAP-ENV:Envelope And I want to send back a SOAP response with a graphic map in attachment spotting all the wifi hotspots 1000meters around the specified position. Maybe something like : soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; soapenv:Body html soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; body img src=map.gif/ /body /html /soapenv:Body /soapenv:Envelope With map.gif in attachment of course. I know it's not very frequent as a usage of webservices but I need something like that. I hope it gives you a better idea of what I'm trying to achieve... -- Sebastien ARBOGAST
RE: Integratign a W3C XForms implementation into the Cocoon Project?
Surprised you didn't see this: http://sourceforge.net/project/shownotes.php?group_id=20274release_id=150523 I haven't looked at in depth so it might not be what you're after, but the Chiba site has a Chicoon project that is labeled as an integration of Cocoon and Chiba. -Original Message- From: Robert Simmons [SMTP:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 4:31 PM To: [EMAIL PROTECTED] Subject: Integratign a W3C XForms implementation into the Cocoon Project? Greetings, One thing that I would like to see is Cocoon supporting the XForms 1.0 standard as described on W3C. http://www.w3.org/MarkUp/Forms/ There is currently a product in the open source community called Chiba that accomplishes a good portion of this integration. This could be built upon using the higher developer resources to the benefit of Cocoon. http://chiba.sourceforge.net/ I think it might be worth it to have Cocoon and Apache talk to the developer of Chiba about integrating it into the Cocoon project. Although XMLForms is useful, it simply isnt the standard anymore. Why implement what is already most of the way working? -- Robert
RE: Cocoon in Business Environements and its shortfalls
2) Monitoring is not intuitive. If you are deploying a business application with 20 cocurrent Cocoon instances, you need a way to cohesively monitor the health of the entire cluster. Separate log files just arent sufficient. Something like JMX instrumentation would be ideal. Understood. Keep in mind that Cocoon does have some instrumentation available to it through Avalon's instrumentation package. It has a nice client that can connect to remote servers. That way you can monitor your Cocoon instances from your desk, and see their relative happiness. (More appropriate for the User's list, yes, but since it was mentioned here...) Is there any documentation on this? How to use/access? I don't remember reading anything about this on the Cocoon site... For reference, I'm currently just using the bundled version of Jetty. Thanks, Chris
RE: Personality in docs (Was: Re: 'Production' build for Cocoon?)
Being the guy that started this little storm I thought I'd wade in with my 2 cents worth... I don't mind the humour in the install.txt. I thought it was refreshing to see somebody who admits that by-and-large, developers hate reading docs and would rather just dive in and figure it for themselves. Granted, if the reader is not a developer, but somebody less tech-savvy (say, a Project Manager) then I could certainly see where the humour could be lost on them and make a bad first impression. I think everything could be improved with slightly better organization. I was looking for information on building a Production build. So I looked for build or deploy documents. I didn't think of going back to the install.txt (after all, I had already installed it, right?), although I had read the entire file when I downloaded and installed it the first time. If it were up to me (and yes, I know it could very well be if I had the time!), I would create a readme.txt that would point the user to one of install.txt, build.txt, deploy.txt and maybe an overview.txt or welcome.txt. The install could be left pretty much the same (just make sure there's a link to the website with all the version-specific helps). The build.txt could cover the modifications to the local.build.properties and maybe go into a bit more detail (sentence each) on what the various things control. The welcome/overview could be targeted at the less tech-savvy crew (with appropriate language/tone). So, my vote would be to keep the personality, just flesh out what's there a little more and maybe make a concessionary personality-free doc for the non-developer audience that expects sterile business language. Cheers, Chris -Original Message- From: Tony Collen [SMTP:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 12:54 PM To: [EMAIL PROTECTED] Subject: Personality in docs (Was: Re: 'Production' build for Cocoon?) Roger I Martin PhD wrote: Right now INSTALL.txt needs some things cut out of it: [stuff-snipped] I'd like to point out a few Theses of the Cluetrain which apply here: 14. Corporations do not speak in the same voice as these new networked conversations. To their intended online audiences, companies sound hollow, flat, literally inhuman. 15. In just a few more years, the current homogenized voice of business - the sound of mission statements and brochures - will seem as contrived and artificial as the language of the 18th century French court. 16. Already, companies that speak in the language of the pitch, the dog-and-pony show, are no longer speaking to anyone. 17. Companies that assume online markets are the same markets that used to watch their ads on television are kidding themselves. 18. Companies that don't realize their markets are now networked person-to-person, getting smarter as a result and deeply joined in conversation are missing their best opportunity. 19. Companies can now communicate with their markets directly. If they blow it, it could be their last chance. 20. Companies need to realize their markets are often laughing. At them. 21. Companies need to lighten up and take themselves less seriously. They need to get a sense of humor. 22. Getting a sense of humor does not mean putting some jokes on the corporate web site. Rather, it requires big values, a little humility, straight talk, and a genuine point of view. I don't mind making the docs a little more pofessional sounding but I'd really, really hate to see the personality stripped from them as well. We're all people here, not robots. I'd rather read someone's genuine opinion about why Cocoon kicks so much ass instead of reading about the latest buzzword of the day. Tony
Production build for Cocoon?
Just wondering if there's any easy way of making a Production build of Cocoon. The default build compiles all of the samples and makes them available which is fine for development. However, when we eventually go live, we'd like to be able to deploy a minimal build that doesn't have the samples or javadoc, etc. We took a quick stab once at trying to remove the samples after doing the full, default build but started running into various file-not-found problems as the master sitemap tried to load various sample-related items. We're okay with using the master Cocoon sitemap (saves us a lot of declaring and configuring) and letting it mount our stuff, but we'd like to be able to do a build that leaves out all of the samples, etc. Is this possible? Is it already there or are there some straightforward instructions on what to delete from the full build and still have things work? Thanks, Chris
RE: Production build for Cocoon?
Thanks. I had read it, but I'd forgotten about the properties files as it was some time ago and the install.txt isn't something I generally go back and read after I've finishing installing something and it's working. -Original Message- From: Giacomo Pati [SMTP:[EMAIL PROTECTED] Sent: Friday, August 22, 2003 9:25 AM To: [EMAIL PROTECTED] Subject: Re: Production build for Cocoon? Ever read the INSTALL.txt? On Fri, 22 Aug 2003, Chris Clark wrote: Just wondering if there's any easy way of making a Production build of Cocoon. The default build compiles all of the samples and makes them available which is fine for development. However, when we eventually go live, we'd like to be able to deploy a minimal build that doesn't have the samples or javadoc, etc. We took a quick stab once at trying to remove the samples after doing the full, default build but started running into various file-not-found problems as the master sitemap tried to load various sample-related items. We're okay with using the master Cocoon sitemap (saves us a lot of declaring and configuring) and letting it mount our stuff, but we'd like to be able to do a build that leaves out all of the samples, etc. Is this possible? Is it already there or are there some straightforward instructions on what to delete from the full build and still have things work? Thanks, Chris -- Giacomo Pati Otego AG, Switzerland - http://www.otego.com Orixo, the XML business alliance - http://www.orixo.com
RE: Checkboxes in JXForms - javascript OK, java NOT
I think there may be a bug then... When I try to use a String array in my Java class, I get the following error: Exception trying to set value with xpath validchecks; Cannot modify property: elrsproto.FormBean.validchecks; Cannot convert value of class java.lang.String to type class [Ljava.lang.String;; Cannot convert class java.lang.String to class [Ljava.lang.String; That's why I tried to use just a straight String. And it works, except that it only gets the value of the first check. Whether I use the nodeset or not, I get the same behaviour. I did verify that I don't need to use the nodeset if I specify all of the controls ahead of time in the form definition. Thanks. For now my work-around is to use a javascript array object for the form and then copy it into my Java class. That works. Odd. -Original Message- From: Giacomo Pati [SMTP:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 3:06 AM To: [EMAIL PROTECTED] Subject: Re: Checkboxes in JXForms - javascript OK, java NOT On Wed, 20 Aug 2003, Chris Clark wrote: Based on the samples, I've been looking at checkboxes in JXForms and have a few questions... Given the following snippet from an xform definition: xf:select ref=validchecks appearance=full xf:labelCheck if field is Present amp; Legible/xf:label xf:itemset nodeset=fieldset xf:label ref=key/ xf:value ref=value/ /xf:itemset /xf:select 1) Do you have to use the nodeset? This is fine if you want multiple checks, but if I just want one checkbox? I tried a number of things, but none worked. e.g. an xf:input with a hard-coded type=checkbox. This displayed okay, but the checked/unchecked state wasn't recorded anywhere that I could find. If you don't need the nodeset, is there a sample and/or docs? IIRC no. See below 2) I got the above to work in javascript with the following structure. var modelObj= { validchecks: [], // define a nodeset (list of all checkboxes in a group) fieldset: [{key:Description, value:desc},// key=what to display, value=what to store in var {key:Name, value:name}, etc... }; form.setModel(modelObj); form.sendView(form/form-submit.xml); You can do: xf:select ref=validchecks appearance=full xf:labelCheck if field is Present amp; Legible/xf:label xf:item xf:labelDescription/xf:label xf:valuedesc/xf:value /xf:item xf:item xf:labelName/xf:label xf:valuename/xf:value /xf:item ... /xf:select When I hit submit, the validchecks is filled out with the value of anything that was checked. 3) Instead of using an object defined in javascript, I wanted to use my own Java Bean (to facilitate access to the form data after submit). The javascript now looks like: var modelObj = new Packages.elrsproto.FormBean(); form.setModel(modelObj); form.sendView(form/form-submit.xml); The FormBean looks like this: public class FormBean { private String validchecks; private FieldBean[] fieldset = { new FieldBean(Description, desc), new FieldBean(Name, name), etc... }; ... FieldBean is a helper class that contains two strings named key and value. This displays correctly on screen (i.e. looks the same as the totally javascript version). The plain edit controls on the form and their String representations in the FormBean (not shown) work fine. However, only the value of the first selected checkbox shows up. If I check five checkboxes, I only see one value in the validchecks variable. When I do this in javascript, I see a comma-delimited list with all of the selected values. Does this fall under the heading of you aren't supposed to do that, so don't? Is this a bug? Do I just have the syntax wrong? (I tried a number of things, like making the validchecks an array, but they all threw errors of varying sorts.) You have to use a String array for validchecks to get all checked keys. This is also used for prepareing all checkboxes for display with values in validchecks switched on (have a look at the hobby part in the jxform samples). -- Giacomo Pati Otego AG, Switzerland - http://www.otego.com Orixo, the XML business alliance - http://www.orixo.com
RE: Checkboxes in JXForms - javascript OK, java NOT
I'm using xf:itemset at the moment. Never seen the jx:ForEach before which gets back to one of my original questions: Are there any docs for jxForms yet? If so, where? Regardless of whether I use the itemset or not, I can get my checkboxes to display correctly on the screen. The problem comes when I want to capture the state of the checkboxes. If I define my model in javascript with a var results[] then it works okay. I get back an array of strings. If I define my model in a Java Bean and pass it to the form after instantiating with var model = new Packages.path.class(), then it doesn't work. If the bean defines the results as a String[], then I get the cast exception (previous email). If I define results as a single String, then I get the id of the first checked checkbox, but none of the others. I tried initializing my array of Strings in my java class but it didn't make a difference whether it was or not. Right now I'm going with the slightly kludgy workaround of using a javascript model for the form and then copying it to my Java Bean after submission. -Original Message- From: Christopher Oliver [SMTP:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 2:21 PM To: [EMAIL PROTECTED] Subject: Re: Checkboxes in JXForms - javascript OK, java NOT Why not use xf:itemset in this case instead of jx:forEach? Giacomo Pati wrote: On Thu, 21 Aug 2003, Chris Clark wrote: I think there may be a bug then... When I try to use a String array in my Java class, I get the following error: Exception trying to set value with xpath validchecks; Cannot modify property: elrsproto.FormBean.validchecks; Cannot convert value of class java.lang.String to type class [Ljava.lang.String;; Cannot convert class java.lang.String to class [Ljava.lang.String; That's why I tried to use just a straight String. And it works, except that it only gets the value of the first check. Whether I use the nodeset or not, I get the same behaviour. I did verify that I don't need to use the nodeset if I specify all of the controls ahead of time in the form definition. Thanks. For now my work-around is to use a javascript array object for the form and then copy it into my Java class. That works. Odd. Ok, let check: We use a Java Bean that has a: private String [] m_roles; which gets initialized with an array from a database and the array size fits the numbers of item we've stored in the database (even a 'm_roles = new String[ 0 ]' works for us). with setter/getter public void setRoless( String [] roles ) { m_roles = roles; } public String [] getRoless( ) { return m_roles; } and the form snipped we use look like: xf:select ref=/roless appearance=full xf:labeli18n:textROLE/i18n:text/xf:label jx:forEach var=role items=${allRoles} xf:item xf:label${role.name}/xf:label xf:value${role.name}/xf:value /xf:item /jx:forEach /xf:select Hope this helps. -- Giacomo Pati Otego AG, Switzerland - http://www.otego.com Orixo, the XML business alliance - http://www.orixo.com
Checkboxes in JXForms - javascript OK, java NOT
Based on the samples, I've been looking at checkboxes in JXForms and have a few questions... Given the following snippet from an xform definition: xf:select ref=validchecks appearance=full xf:labelCheck if field is Present amp; Legible/xf:label xf:itemset nodeset=fieldset xf:label ref=key/ xf:value ref=value/ /xf:itemset /xf:select 1) Do you have to use the nodeset? This is fine if you want multiple checks, but if I just want one checkbox? I tried a number of things, but none worked. e.g. an xf:input with a hard-coded type=checkbox. This displayed okay, but the checked/unchecked state wasn't recorded anywhere that I could find. If you don't need the nodeset, is there a sample and/or docs? 2) I got the above to work in javascript with the following structure. var modelObj= { validchecks: [], // define a nodeset (list of all checkboxes in a group) fieldset: [{key:Description, value:desc},// key=what to display, value=what to store in var {key:Name, value:name}, etc... }; form.setModel(modelObj); form.sendView(form/form-submit.xml); When I hit submit, the validchecks is filled out with the value of anything that was checked. 3) Instead of using an object defined in javascript, I wanted to use my own Java Bean (to facilitate access to the form data after submit). The javascript now looks like: var modelObj = new Packages.elrsproto.FormBean(); form.setModel(modelObj); form.sendView(form/form-submit.xml); The FormBean looks like this: public class FormBean { private String validchecks; private FieldBean[] fieldset = { new FieldBean(Description, desc), new FieldBean(Name, name), etc... }; ... FieldBean is a helper class that contains two strings named key and value. This displays correctly on screen (i.e. looks the same as the totally javascript version). The plain edit controls on the form and their String representations in the FormBean (not shown) work fine. However, only the value of the first selected checkbox shows up. If I check five checkboxes, I only see one value in the validchecks variable. When I do this in javascript, I see a comma-delimited list with all of the selected values. Does this fall under the heading of you aren't supposed to do that, so don't? Is this a bug? Do I just have the syntax wrong? (I tried a number of things, like making the validchecks an array, but they all threw errors of varying sorts.) Help. Thanks, Chris
JXForm w/ Schematron namespaces - oversight or bug?
Using the 2.1m2 Scratchpad JXForm sample as I base, I managed to get my own forms with JXForm working. I then tried to implement validation with Schematron. Everything went reasonably smoothly except that the error messages would not display on screen like they do in the sample. I finally tracked the problem down to the following line that XMLSpy had inserted into my xhtml source file: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; When I deleted this, everything worked just fine. As near as I can figure, something (browser, Jetty, ??) assumed that the error tag belonged to the xhtml namespace instead of the JXForm one and this broke the XSLT. The problem is that the error tag under the xf:form tag has no namespace associated with it when it gets returned from the generator. The xf:violations tag is also odd in that it's defined as xf:violations in the form source file, but for some reason it gets changed to violation xmlns=... when the form comes back to you. Anyway, it would be nice to see the error tag get an explicit namespace in the future. It'd be especially nice if it worked as xf:error. Not sure if this qualifies as a bug so I haven't put it in bugzilla. It just seems to be a very odd oversight, but something that I thought the community should know about. -- Chris
JXForms Concerns/Questions
I'm involved in a large development project that will involve a lot of large form filling out/processing. We are planning on using Cocoon and have laid out a UI model. Currently we're trying to decide on a form architecture and after looking at samples and docs, there are a few things we'd like to raise here--don't need to focus on how-to's, but rather architectural implications. 1) Do you need a separate flowscript and therefore a separate sitemap for each JXForm? The samples imply that each form has to have a script and each script is associated with a sitemap. This would lead to a huge number of subdirectories and sub-sitemaps for our project which is not desirable. We can live with one java class/form as XMLForm seems to need, but one directory with a script and associated pages per form is unacceptable. 2) For a simple, one-page form, do you need to have a script? Is there a sample of a single-page form using JXForm? 3) Do you have to use javascript with flow or can you substitute something else (a java class)? We don't have any experience with javascript and were hoping to keep our development technologies limited to XML/HTML, XSLT and Java classes. 4) Is it possible to dynamically pre-populate a JXForm from a database? The sample has the data hard-coded and as we're not javascript fluent, we don't know if it's possible. 5) We have some concerns with the continuation model's scalability. Making the assumption that there is something memory-resident on the server side, how does one clean up old continuation objects? what is the lifecycle? what is the memory footprint? 6) Regarding the recent discussions of refactoring JXForm and XMLForms and possible deprecation of the Cocoon XMLForm codebase. If we embark on an XMLForm development effort - which we were planning to do, we are concerned about impact to our project. Will the Cocoon committers consider continued support of XMLForms? 7) If XMLForms code base is retained, is the community considering refactoring enhancements in XMLForm.org code base back into Cocoon XMLForm codebase? We would be very interested in this. And one specific question: 8) JXForm documentation in general - is there any/where is it? (I haven't been able to find anything.) Sorry for the length, but we're at a crucial decision point in our project and as Cocoon seems to be at a similarly crucial decision point, we felt it worthwhile to ask these questions. Thanks, J. Chris Clark Senior Developer Teraview Development Teranet Inc. 1 Adelaide St. E. Toronto, ON, M5C 2V9 416.360.8863x2413 [EMAIL PROTECTED] Proud to be one of Canada's Top 100 Employers 2003 http://www.teranet.ca/corporate/news/top100.html The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.