Hi,

I am using cocoon forms to edit xml documents. The forms are set up
using jsp's to retrieve the relevant template information from a
document stored in an Xindice database. The jsp's then forward on to
the cocoon forms, with variables being set in the session so that they
can be retrieved later on. This works fine.

The problem I have is that when the forms are displayed, a new session
is created. This means that session variables that have been stored
prior to accessing cocoon are no longer accessible - they are in a
different session - and these are needed to upload the document back
into Xindice using the sitemap.xmap.

Is there anyway of keeping the existing session when using cocoon? I
have tried using the  <map:parameter name="create-session"
value="false"/> in my sitemap (although it may be in the wrong place
:).

I am using cocoon 2.1.4 running within tomcat 4.1.27.

My sitemap is as follows (entry point is the <map:match pattern="*xml.flow">):

<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>
 <map:components>
  <map:transformers default="xalan">    
    <map:transformer name="i18n"
src="org.apache.cocoon.transformation.I18nTransformer">
      <catalogues default="forms">
        <catalogue id="other" name="OtherMessages" location="messages"/>
        <catalogue id="forms" name="FormMessages" location="messages"/>
      </catalogues>
      <cache-at-startup>true</cache-at-startup>
    </map:transformer>
  </map:transformers>

  <map:actions>
    <map:action name="make-form"
src="org.apache.cocoon.forms.acting.MakeFormAction"
logger="forms"/>
    <map:action name="init-form"
src="org.apache.cocoon.forms.samples.InitForm1Action"
logger="forms"/>
    <map:action name="handle-form-submit"
src="org.apache.cocoon.forms.acting.HandleFormSubmitAction" logger="forms"/>

  </map:actions>
 </map:components>

 <map:resources>
   <map:resource name="simple-page2html">
     <map:transform
src="context://gridcast/forms/xsl/html/simple-page2html.xsl">
       <map:parameter name="contextPath" value="{request:contextPath}"/>
       <map:parameter name="servletPath" value="{request:servletPath}"/>
       <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
       <map:parameter name="file" value="{file}"/>
       <map:parameter name="remove" value="{../0}"/>
     </map:transform> 
   </map:resource>
 </map:resources>

  <!-- indicates what flowscript to attach to this sitemap -->
  <map:flow language="javascript">
    <map:script src="flow/binding_example.js"/>
  </map:flow>

 <map:pipelines>
   <map:pipeline>

     <map:match pattern="">
      <map:generate src="welcome.xml"/>
      <map:transform
src="context://gridcast/forms/xsl/html/simple-samples2html.xsl">
         <map:parameter name="contextPath" value="{request:contextPath}"/>
      </map:transform>
      <map:serialize/>
     </map:match>

<!-- Display forms -->

     <map:match pattern="*.continue">
       <map:call continuation="{1}"/>
     </map:match>

     <map:match pattern="*-display-pipeline">
       <!-- pipeline to show the form -->
       <map:generate src="forms/{1}_template.xml"/>

       <map:transform type="form"/>
       <map:transform type="i18n">
         <map:parameter name="locale" value="en-US"/>
       </map:transform>
       <map:call resource="simple-page2html">
         <map:parameter name="file" value="forms/{1}_template.xml"/>
       </map:call>
       <map:transform src="resources/forms-samples-styling.xsl"/>
       <map:serialize/>
     </map:match>

     <map:match pattern="*xml.flow">
       <map:call function="forms">
           <map:parameter name="create-session" value="false"/>
         <map:parameter name="function" value="{1}xml"/>
         <map:parameter name="form-definition" value="forms/{1}_model.xml"/>
         <map:parameter name="documentURI" value="forms/{1}_data.xml"/>
         <map:parameter name="bindingURI" value="forms/{1}_bind_xml.xml"/>
       </map:call>
     </map:match>

        <map:match pattern="*-editing-pipeline">
        <map:generate src="forms/dbedit.xml"/>
        <map:transform type="jx"/>
        <map:transform type="cinclude" />
        <map:transform type="xmldb">
            <map:parameter name="base"
value="xmldb:xindice://{session-attr:dbConnection}:8080/db" />
        </map:transform>
        <map:serialize/>
    </map:match>

    <map:match pattern="*">
        <map:redirect-to uri="{1}/"/>
    </map:match>


    <map:match pattern="*/**">
     <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
   </map:match>
   </map:pipeline>
 </map:pipelines>
</map:sitemap>

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

Reply via email to