Re: [RT] Webdavapps with Cocoon
Marc Portier wrote: Gianugo Rabellino wrote: snip/ Even the simplest XSLT transformation can't be reversely applied, so now there is no way to understand how an resource should be treated in a symmetric way when requested or uploaded. Oh yes, you can hm, do we really need to look at it as symmetric? I know we are tempted to do so, but is it a must? Is it imposed by current webdav enabled editors? (they want to put back where they got I assume?) snip/ isn't this aggregate example just showing that some GET-URI's are to be considered as read-only? (not to be abused for a PUT that is) I agree. This everlasting strive to ultimate symmetry feels like an anti-pattern to me. It may lead to mixing of concerns. If you have to aggregate several items it's likely you've put them separate for a reason. snip/ Now for the big question: should we leave this discussion for now, focusing on the upcoming release and take webdavification as one of the major challenges for the next generation (this alone might be a good reason for Cocoon 3.0 IMHO), or shoud we have some more fun on the topic here and now? hehe, the avalanche has already started :-) managing the change into timing/planning and releases is a different aspect, they can (and should) run in parallel IMHO the bigger challenge of being 10 years ahead is that these fast, wild, non-domesticated, associated thoughts here and now aren't mature enough to pull of anything and the discussion dries up before it started... we shouldn't add a management constraint onto that IMHO All this once more indicates that the most important step forward for the next Cocoon version is the blocks implementation. This will also allow for a different management model (don't know a better word), which will be needed if the Cocoon community maintains the current growth rate. Guido -- Guido Casper - SN AG, Competence Center Open Source Tel.: +49-5251-1581-87 Klingenderstr. 5mailto:[EMAIL PROTECTED] D-33100 Paderborn http://www.s-und-n.de -
cvs commit: cocoon-2.1/lib jars.xml
cziegeler2003/07/26 06:26:47 Modified:.gump.xml src/java/org/apache/cocoon/components/store/impl DefaultStore.java src/deprecated/java/org/apache/cocoon/components/store JispFilesystemStore.java JispStringKey.java lib jars.xml Added: lib/core jisp-2.5.1.jar excalibur-store-20030726.jar Removed: lib/core excalibur-store-20030317.jar jisp-2.0.1.jar Log: Updating to latest jisp and excalibur store Revision ChangesPath 1.71 +2 -2 cocoon-2.1/gump.xml Index: gump.xml === RCS file: /home/cvs/cocoon-2.1/gump.xml,v retrieving revision 1.70 retrieving revision 1.71 diff -u -r1.70 -r1.71 --- gump.xml 14 Jul 2003 02:52:25 - 1.70 +++ gump.xml 26 Jul 2003 13:26:47 - 1.71 @@ -984,7 +984,7 @@ Java Indexed Serialization Package /description home nested=lib/core/ -jar name=jisp-2.0.1.jar/ +jar name=jisp-2.5.1.jar/ /project project name=jing 1.3 +2 -2 cocoon-2.1/src/java/org/apache/cocoon/components/store/impl/DefaultStore.java Index: DefaultStore.java === RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/store/impl/DefaultStore.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- DefaultStore.java 14 Jul 2003 19:09:00 - 1.2 +++ DefaultStore.java 26 Jul 2003 13:26:47 - 1.3 @@ -78,7 +78,7 @@ * @author a href=mailto:[EMAIL PROTECTED]Vadim Gritsenko/a * @version CVS $Id$ */ -public final class DefaultStore extends AbstractJispFilesystemStore +public class DefaultStore extends AbstractJispFilesystemStore implements org.apache.excalibur.store.Store, Contextualizable, ThreadSafe, 1.3 +7 -423 cocoon-2.1/src/deprecated/java/org/apache/cocoon/components/store/JispFilesystemStore.java Index: JispFilesystemStore.java === RCS file: /home/cvs/cocoon-2.1/src/deprecated/java/org/apache/cocoon/components/store/JispFilesystemStore.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JispFilesystemStore.java 27 Apr 2003 15:16:15 - 1.2 +++ JispFilesystemStore.java 26 Jul 2003 13:26:47 - 1.3 @@ -50,435 +50,19 @@ */ package org.apache.cocoon.components.store; -import com.coyotegulch.jisp.BTreeIndex; -import com.coyotegulch.jisp.BTreeObjectIterator; -import com.coyotegulch.jisp.IndexedObjectDatabase; -import com.coyotegulch.jisp.KeyNotFound; -import com.coyotegulch.jisp.KeyObject; - -import org.apache.avalon.framework.activity.Initializable; -import org.apache.avalon.framework.context.Context; -import org.apache.avalon.framework.context.ContextException; -import org.apache.avalon.framework.context.Contextualizable; -import org.apache.avalon.framework.logger.AbstractLogEnabled; -import org.apache.avalon.framework.parameters.ParameterException; -import org.apache.avalon.framework.parameters.Parameterizable; -import org.apache.avalon.framework.parameters.Parameters; -import org.apache.avalon.framework.thread.ThreadSafe; -import org.apache.cocoon.Constants; -import org.apache.cocoon.util.IOUtils; - -import java.io.File; -import java.io.IOException; -import java.io.Serializable; -import java.util.Enumeration; +import org.apache.cocoon.components.store.impl.DefaultStore; /** * This store is based on the Jisp library * (http://www.coyotegulch.com/jisp/index.html). This store uses B-Tree indexes * to access variable-length serialized data stored in files. - * + * + * @deprecated Use the [EMAIL PROTECTED] org.apache.cocoon.components.store.impl.DefaultStore} instead. + * * @author a href=mailto:[EMAIL PROTECTED]Gerhard Froehlich/a * @author a href=mailto:[EMAIL PROTECTED]Vadim Gritsenko/a * @version CVS $Id$ */ -public final class JispFilesystemStore extends AbstractLogEnabled -implements org.apache.excalibur.store.Store, - Contextualizable, - ThreadSafe, - Initializable, - Parameterizable { - -protected File m_workDir; -protected File m_cacheDir; - -/** - * The directory repository - */ -protected File m_directoryFile; -protected volatile String m_directoryPath; - -/** - * The database - */ -private File m_databaseFile; -private File m_indexFile; - -private int m_Order; -private IndexedObjectDatabase m_Database; -private BTreeIndex m_Index; - -/** - * Sets the repository's location
cvs commit: cocoon-2.1/src/blocks/woody/samples/flow woody_flow_example.js
bruno 2003/07/26 07:05:05 Modified:src/blocks/woody/java/org/apache/cocoon/woody/acting HandleFormSubmitAction.java src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript woody.js src/blocks/woody/java/org/apache/cocoon/woody/transformation WidgetReplacingPipe.java WoodyTemplateTransformer.java src/blocks/woody/samples/flow woody_flow_example.js Log: removed hardcoded locales Revision ChangesPath 1.7 +7 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/acting/HandleFormSubmitAction.java Index: HandleFormSubmitAction.java === RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/acting/HandleFormSubmitAction.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- HandleFormSubmitAction.java 16 Jul 2003 13:59:12 - 1.6 +++ HandleFormSubmitAction.java 26 Jul 2003 14:05:05 - 1.7 @@ -60,6 +60,7 @@ import org.apache.cocoon.woody.FormContext; import org.apache.cocoon.woody.FormHandler; import org.apache.cocoon.woody.formmodel.Form; +import org.apache.cocoon.i18n.I18nUtils; import org.apache.excalibur.source.Source; import java.util.Map; @@ -86,6 +87,11 @@ String formAttribute = parameters.getParameter(attribute-name); String formHandlerClassName = parameters.getParameter(formhandler, null); +Locale locale = Locale.getDefault(); +String localeStr = parameters.getParameter(locale, null); +if (localeStr != null) +locale = I18nUtils.parseLocale(localeStr, locale); + Source source = resolver.resolveURI(formSource); try { Form form = formManager.createForm(source); @@ -101,7 +107,7 @@ form.setFormHandler(formHandler); } -FormContext formContext = new FormContext(request, Locale.US); +FormContext formContext = new FormContext(request, locale); boolean finished = form.process(formContext); request.setAttribute(formAttribute, form); 1.7 +10 -6 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript/woody.js Index: woody.js === RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/flow/javascript/woody.js,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- woody.js 25 Jul 2003 09:05:35 - 1.6 +++ woody.js 26 Jul 2003 14:05:05 - 1.7 @@ -104,12 +104,16 @@ return this.formWidget; } -Form.prototype.show = function(uri, validator) { +Form.prototype.show = function(uri, validator, locale) { var lastWebCont = this.lastWebContinuation; // create a continuation, the invocation of which will resend // the page: this will be used to implement automated back // navigation var wk = this.start(lastWebCont); + +if (locale == null) +locale = java.util.Locale.getDefault(); + while (true) { if (cocoon.request == null) { // this continuation has been invalidated @@ -117,7 +121,7 @@ handleInvalidContinuation(); Woody.suicide(); } -var thisWebCont = this._show(uri, wk); +var thisWebCont = this._show(uri, locale, wk); // _show creates a continuation, the invocation of which // will return right here: it is used to implement // automated next navigation @@ -126,9 +130,9 @@ handleInvalidContinuation(); suicide(); } + var formContext = -new Packages.org.apache.cocoon.woody.FormContext(this.woody.request, - java.util.Locale.US); +new Packages.org.apache.cocoon.woody.FormContext(this.woody.request, locale); var finished = this.form.process(formContext); var evt = formContext.getActionEvent(); if (evt != null) { @@ -145,10 +149,10 @@ } } -Form.prototype._show = function(uri, lastWebCont, timeToLive) { +Form.prototype._show = function(uri, locale, lastWebCont, timeToLive) { var k = new Continuation(); var wk = this.woody.makeWebContinuation(k, lastWebCont, timeToLive); -var bizData = { woody-form: this.form }; +var bizData = { woody-form: this.form, locale : locale }; this.lastWebContinuation = wk; this.woody.forwardTo(uri, bizData, wk); Woody.suicide(); 1.6 +34 -16
cvs commit: cocoon-2.1/src/blocks/woody/samples welcome.xml
bruno 2003/07/26 07:05:40 Modified:src/blocks/woody/samples welcome.xml Log: * moved binding examles into own group * added locale samples Revision ChangesPath 1.5 +19 -2 cocoon-2.1/src/blocks/woody/samples/welcome.xml Index: welcome.xml === RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/samples/welcome.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- welcome.xml 23 Jul 2003 15:20:14 - 1.4 +++ welcome.xml 26 Jul 2003 14:05:40 - 1.5 @@ -12,13 +12,30 @@ Currently the documentation is available on the Cocoon Wiki./sample /group - group name=Woody Samples + group name=Basic Samples sample name=Various href=form1This sample shows validation, event handling and various Woody features./sample sample name=Flowscript href=form1.flowThe same sample as above using Flowscript./sample - sample name=Registration href=registrationA simple registration form./sample + /group + + group name=Binding Samples + note +Woody has a binding framework which assists in copying Java-bean or XML (DOM) data into a Woody form and back. + /note sample name=XML Binding href=form2xml.flowA form for just editing an XML file./sample sample name=Bean Binding href=form2bean.flowA form for just editing a Java bean/sample + /group + + group name=Locales + note +The samples below are the same as the basic flowscript sample but now use different locales. +The locale can affect things like date and number formatting. +You can try out other locales by supplying other values for the locale parameter in the URL. + /note + sample name=Flowscript href=form1.flow?locale=fr-FRFrance/sample + sample name=Flowscript href=form1.flow?locale=it-ITItaly/sample + sample name=Flowscript href=form1.flow?locale=de-DEGermany/sample + sample name=Flowscript href=form1.flow?locale=nl-BEBelgium (dutch)/sample /group /samples
cvs commit: cocoon-2.1/src/test/org/apache/cocoon/components/source SourceResolverAdapter.java
cziegeler2003/07/26 07:48:39 Modified:src/test/org/apache/cocoon/components/source SourceResolverAdapter.java Log: Organizing imports Revision ChangesPath 1.8 +1 -6 cocoon-2.1/src/test/org/apache/cocoon/components/source/SourceResolverAdapter.java Index: SourceResolverAdapter.java === RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/components/source/SourceResolverAdapter.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SourceResolverAdapter.java24 Jul 2003 07:18:25 - 1.7 +++ SourceResolverAdapter.java26 Jul 2003 14:48:39 - 1.8 @@ -55,15 +55,10 @@ import java.net.MalformedURLException; import java.util.Map; -import org.apache.avalon.framework.component.Component; -import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentManager; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.environment.Source; import org.apache.cocoon.environment.SourceResolver; -import org.apache.excalibur.xml.sax.SAXParser; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; import org.xml.sax.SAXException; /**
cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/store/impl DefaultStore.java
cziegeler2003/07/26 08:17:25 Modified:src/java/org/apache/cocoon/components/store/impl DefaultStore.java Log: Updating to latest jisp and excalibur store Revision ChangesPath 1.4 +2 -11 cocoon-2.1/src/java/org/apache/cocoon/components/store/impl/DefaultStore.java Index: DefaultStore.java === RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/store/impl/DefaultStore.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- DefaultStore.java 26 Jul 2003 13:26:47 - 1.3 +++ DefaultStore.java 26 Jul 2003 15:17:25 - 1.4 @@ -67,7 +67,6 @@ import org.apache.cocoon.Constants; import org.apache.cocoon.util.IOUtils; import org.apache.excalibur.store.impl.AbstractJispFilesystemStore; -import org.apache.excalibur.store.impl.JispStringKey; /** * This store is based on the Jisp library @@ -171,21 +170,13 @@ getLogger().debug(Datafile exists: + databaseExists); } super.m_Database = new IndexedObjectDatabase(databaseFile.toString(), !databaseExists); -// TODO: change to getNullKey when updating to latest store super.m_Index = new BTreeIndex(indexFile.toString(), -order, new JispStringKey(), false); +order, this.getNullKey(), false); super.m_Database.attachIndex(super.m_Index); } catch (KeyNotFound ignore) { } catch (Exception e) { getLogger().error(Exception during initialization of jisp store., e); } -} - -/* (non-Javadoc) - * @see org.apache.avalon.framework.activity.Initializable#initialize() - */ -public void initialize() throws Exception { -// TODO Remove this when we update to latest store } }
processing flow for map:call resource=/ (was: map:serializetype={1}/)
(Moving this discussion to dev list because it implies an more or less important change - wanted or not.) The problem: Does the processing return to a calling pipeline after map:call resource=/? The docu at http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html#Calling+resources and http://wiki.cocoondev.org/Wiki.jsp?page=Resources says no (to whatever reasons). But I saw Marc's example at http://wiki.cocoondev.org/Wiki.jsp?page=CleanerSiteMapsThroughResources and he tested it again and it worked, i.e. the processing flow *does* return to the calling pipeline. Is this change implied? What were the pros and contras of this behaviour? I only know the old behaviour and, yes, the return makes the sitemap pipeline snippets more flexible. And who updates the docu ;-) Can anybody say something about it? Joerg Marc Portier wrote: Hmm, much of the code on this page is wrong or at least misleading: map:resource name=generate-data-xml map:generate type=myCSVGenerator src=http://csv-server.domain/getData/ /map:resource map:resource name=generate-data-svg map:call resource=generate-data-xml/ map:transform src=xsl/datafilter.xsl/ map:transform src=xsl/data2svg.xsl/ /map:resource A map:call resource=/ is a one way ticket. The processing does not return to the calling pipeline. Or do I miss anything? I think it does... (at least it did at the time of writing since I tested the code out) resources are pieces of pipelines that take up roles see also the accompanied page at http://wiki.cocoondev.org/Wiki.jsp?page=ResourceNaming If that's true it must be more a bug than a feature I guess: It is true. Just did a simple test (using cvs head) by wrapping a generator inside a resource and replacing the map:generate by the fresh map:call/@resource in a particular pipe (followed by transformers and serializer of course) as for the documentation: http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html#Calling+resources. I've spent some time to figure out if the wording 'calls to a resource never return' could be interpreted in any other way but I'ld have to concede that the doco is not in sync with code reality here... Maybe the docos are still reflecting how the previous sitemap implementation was handling things? Anyone out there aware of the history of things? (I never tested this with anything else then the treeprocessor) In any case I think this behavior is generaly useful (as the wiki page tries to argument) and not harmful in any way... regards, -marc=
cvs commit: cocoon-2.1/src/documentation/xdocs/userdocs/flow tutor.xml api.xml book.xml jxforms.xml velocity.xml
coliver 2003/07/26 12:29:08 Modified:src/documentation/xdocs/userdocs/flow api.xml book.xml jxforms.xml velocity.xml Added: src/documentation/xdocs/userdocs/flow tutor.xml Log: Added Tony Collen's Flowscript tutorial taken from Cocoon wiki Revision ChangesPath 1.21 +6 -2 cocoon-2.1/src/documentation/xdocs/userdocs/flow/api.xml Index: api.xml === RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/api.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- api.xml 20 Jul 2003 05:48:18 - 1.20 +++ api.xml 26 Jul 2003 19:29:07 - 1.21 @@ -695,7 +695,7 @@ emFunction/em code[Boolean] isInfoEnabled()/code /p p - Returns whether information message logging is enabled + Returns whether information message logging is enabled. /p /s3 /s2 @@ -710,7 +710,11 @@ /p s3 title=id pemProperty/em code[String] id/code/p -pReturns the unique string identifier of this continuation./p +pReturns the unique string identifier of this Web Continuation./p +/s3 +s3 title=continuation +pemProperty/em code[Continuation] continuation/code/p +pReturns the JavaScript continuation associated with this Web Continuation./p /s3 s3 title=getParent p 1.10 +1 -0 cocoon-2.1/src/documentation/xdocs/userdocs/flow/book.xml Index: book.xml === RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/book.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- book.xml 13 Jul 2003 19:53:14 - 1.9 +++ book.xml 26 Jul 2003 19:29:08 - 1.10 @@ -15,6 +15,7 @@ menu-item label=Continuations href=continuations.html/ menu-item label=How does it work? href=how-does-it-work.html/ menu-item label=Usage href=using.html/ +menu-item label=Tutorial href=tutor.html/ menu-item label=Sitemap href=sitemap.html/ menu-item label=JavaScript API href=api.html/ menu-item label=Views href=views.html/ 1.7 +39 -18cocoon-2.1/src/documentation/xdocs/userdocs/flow/jxforms.xml Index: jxforms.xml === RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/flow/jxforms.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- jxforms.xml 20 Jul 2003 05:48:18 - 1.6 +++ jxforms.xml 26 Jul 2003 19:29:08 - 1.7 @@ -87,7 +87,7 @@ // process the form's values: if (model.method == cash) { ... - } else if (model.method == credit) { + } else if (model.method == cc) { } /source @@ -100,11 +100,11 @@ pThe JXForms tags are defined in the following namespace:/p sourcehttp://apache.org/cocoon/jxforms/1.0/source pJXForms supports the following controls:/p - s2 title=form - pThe JXForms codelt;formgt;/code element represents the overall form. It also corresponds to a validation emphase/em in your link href=#Validationvalidation/link rules. It has no direct counterpart in W3C XForms./p + anchor id=form/s2 title=form + pThe JXForms codelt;formgt;/code element represents one page of the overall form. It also corresponds to a validation emphase/em in your link href=#Validationvalidation/link rules. It has no direct counterpart in W3C XForms./p pExample:/p source![CDATA[ - form id=form-feedback view=userIdentity + form id=form-feedback view=userIdentity action= labelPersonal Information/label error violations class=error/ @@ -121,13 +121,10 @@ ul licodeid/code/li licodeview/code/li + licodeaction/code/li /ul p - The codeid/code attribute must match the codeid/code Sitemap parameter passed to the link href=#jxFormjxForm/link function in link href=#Sitemaplt;map:callgt;/link. The codeview/code attribute must match the codeid/code of a codelt;phasegt;/code element in your Schematron link href=#validationvalidation/link rules. - /p - /s2 - s2 title=error - pThe JXForms codelt;errorgt;/code element has no counterpart in W3C XForms. If present under the codeform/code element it serves as a placeholder for validation error messages associated with the entire form. + The codeid/code attribute must match the codeid/code Sitemap parameter passed to the link href=#jxformjxform/link function in link href=#Sitemaplt;map:callgt;/link. The codeview/code attribute must match the codeid/code of a codelt;phasegt;/code element in your Schematron link href=#validationvalidation/link rules. For HTML forms the
cvs commit: cocoon-2.1/src/documentation/xdocs/userdocs index.xml
coliver 2003/07/26 17:59:54 Modified:src/documentation/xdocs/userdocs index.xml Log: Added paragraph about flowscript Revision ChangesPath 1.3 +5 -0 cocoon-2.1/src/documentation/xdocs/userdocs/index.xml Index: index.xml === RCS file: /home/cvs/cocoon-2.1/src/documentation/xdocs/userdocs/index.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- index.xml 2 Jul 2003 06:16:11 - 1.2 +++ index.xml 27 Jul 2003 00:59:54 - 1.3 @@ -23,6 +23,11 @@ form handling, authentication or even developing your own portal, have a look at the link href=../developing/webapps/index.htmlweb application documentation/link./p p + If you've been writing web applications with any other system you should + also take a look at Cocoon link href=flow/index.htmlFlowscript/link, + which makes writing complex Web applications easy with Cocoon. Complex multi-page interactions can be described easily as blocking function calls. + /p + p Come back often...this guide is being updated regularly. /p