El vie, 14-10-2005 a las 19:05 +0200, Sylvain Wallez escribió:
> Felix Röthenbacher wrote:
> 
> > Hi Thorsten
> >
> > Thorsten Scherler wrote:
> >
> >> Hey all,
> >>
> >> lenya just added the dynamic repeater example to the default pub. The
> >> problem with it is, that if we use ajax="true" and submit the form we
> >> lose the focus on the flow script.
> >> It shows the form (form.show()) and then after submitting the form it
> >> does not return to the flow script (usecase.js). 
> >
> >
> > The browserupdater.js used with Ajax checks for the header
> >
> > X-Cocoon-Ajax = continue
> >
> > If true, a request is sent back to the server so it exits from
> > Form.showForm(). Unfortunately, the request is not compatible with
> > Lenya's usecase management (needs a parameter lenya.usecase to know
> > which usecase it is in). Additionally, Ajax expects the continuation
> > id in "continuation-id" whereas Lenya uses "lenya.continuation" for
> > that.
> >
> > Maybe browserupdater.js can be made more generic so that
> > it also fits for Lenya?
> >
> >>
> >> Instead I get http://pastebin.com/393378
> >> java.lang.IllegalStateException.
> >
> >
> > The problem is that in
> >
> > ./src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/Form.js
> >
> > cocoon.sendStatus(200);
> >
> > seems to close the OutputStream while the following code tries
> > to write to this same OutputStream -> IllegalStateException.
> > A cheap workaround is to comment the workaround for safari ...
> > I wonder why I didn't see this exception when running the cocoon
> > samples ... ?
> 
> 
> This isn't what happens, as sendStatus() calls setStatus() on the 
> HttpServletResponse, but doesn't close the stream.
> 
> Thorsten, can you provide us with some useful extract of the sitemap?

Sure, Sylvain. Thx for offering your help. :)

Here it goes (beware many involved components):
Background documentation of the usecase-fw 
http://lenya.apache.org/1_4/reference/usecase-framework/index.html

Small how-to of cform integration into the usecase-fw
http://wiki.apache.org/lenya/HowToCFormsInLenya1%2e4

usecase-sitemap:
http://svn.apache.org/viewcvs.cgi/lenya/trunk/src/webapp/lenya/usecases/usecase.xmap?view=markup
...
<map:match pattern="view/*/**" internal-only="true">
        <map:generate type="jx" src="fallback://lenya/{2}"/>
        <map:transform type="browser-update"/>
        <map:transform type="cinclude"/>
        <map:transform type="forms" />
        <map:transform type="i18n">
          <map:parameter name="locale" value="{request:locale}"/>
        </map:transform>
        <map:transform src="cocoon://lenya-screen.xsl"/>
        <!-- Strip xhtml namespace from <head> and <body> element -->
        <map:transform 
src="fallback://lenya/xslt/cforms/strip-xhtml-namespace.xsl"/>
        <map:transform 
src="fallback://lenya/xslt/cforms/forms-samples-styling.xsl">
          <map:parameter name="resources-uri" value="/cforms"/>
        </map:transform>
        <map:transform 
src="fallback://lenya/xslt/cforms/add-xhtml-namespace.xsl"/>
        <map:match pattern="view/menu/**">
          <map:transform 
src="cocoon://lenya-page/{page-envelope:publication-id}/{page-envelope:area}/default.xml"/>
        </map:match>
        <map:select type="request-parameter">
          <map:parameter name="parameter-name" value="cocoon-ajax"/>
          <map:when test="true">
            <map:serialize type="xml"/>
          </map:when>
          <map:otherwise>
           <map:transform 
src="fallback://lenya/xslt/util/strip_namespaces.xsl"/>
            <map:serialize type="xhtml"/>
          </map:otherwise>
        </map:select>
     </map:match>
    </map:pipeline>

    <map:pipeline>
      <map:match type="request-parameter" pattern="lenya.continuation">
        <map:call continuation="{1}"/>
      </map:match>
      <map:match type="usecase" pattern="*">
        <map:call function="executeUsecase"/>
      </map:match>
    </map:pipeline>

Flow script (usecase.js)
http://svn.apache.org/viewcvs.cgi/lenya/trunk/src/webapp/lenya/usecases/usecases.js?view=markup
Search for "cforms".

Sample cform module:
http://svn.apache.org/viewcvs.cgi/lenya/trunk/src/modules/cforms/?rev=321097

Templates:
http://svn.apache.org/viewcvs.cgi/lenya/trunk/src/modules/cforms/usecases/?rev=321097

Since the provided example should be written to the cms the starting doc
(used for the binding) can be found
http://svn.apache.org/viewcvs.cgi/lenya/trunk/src/modules/cforms/samples/cforms.xml?view=markup

This are more or less all involved components that are for our usecase
interesting. Please do not hesitate to ask further questions.

Thx again

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to