ok, following Christian's piece of advice/explaination (creating a *_new
instance_*) made it work although I have some bugs I will check tomorrow.

My only worry about global-parameters was that the initial proposal implied
a {/name_of_param} path that doesn't work for now (I did not look into the
code though).

I also have a pretty complicated (long) pipeline (pasted below but now with
the use of input modules, so everything prefixed by "baepp"  may be also a
global parameter), and use of global parameters with level 6 depth in the
path kept failing : {../../../../../../taminoserver}. I tried step by step,
every level. Anyway it was unreadable this way... and I could not reach my
XML database. How strange.

Sorry I am not very knowledgeable :-(

Barbara

   <!-- default generation of license (4) : shows a form to fill-->
   <!--
   Create form validation descriptor
   from template (tamino query)
   then try to validate form.
   If form validation fails generate form, if success
   generate licence and license info form.
    -->
   <map:match pattern="defaultgenerationform2fill">
    <!-- this will have to deal with error messages added by form check
(5) -->
    <!-- be sure one gets the request parameters -->
    <map:act type="request">
     <map:parameter name="parameters" value="true"/>
     <!-- authenticate as usual -->
     <map:act type="auth-protect">
      <map:parameter name="handler" value="baepphandler"/>
      <!-- this wraps with action that checks whether
      "submittedOnce" request parameters exist, if so performs
      form validation since form has been submitted
      at least once, else generate input form -->
      <map:act type="request-exists">
       <map:parameter name="parameters" value="submittedOnce"/>
       <!-- form validation -->
       <map:act type="form-validator">
        <map:parameter name="descriptor"
value="cocoon://getdescriptor/{../../template}"/>
        <map:parameter name="validate-set" value="default"/>
        <!-- ok so generate license and show it -->
        <map:act type="genlickey">
         <map:parameter name="taminoUri"
value="http://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baepp:tami
nocollection}"/>
         <map:aggregate element="page">
          <map:part element="template"
src="xmldb:tamino://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baep
p:taminocollection}/#Template[@Id='{../../../../template}']"/>
          <map:part element="reqparam" src="cocoon://httprequest"/>
          <map:part element="session" src="xml/getxml.xml"/>
         </map:aggregate>
         <map:transform type="session"/>
         <!-- create xml license excepted license key set to 32*0 -->
         <map:transform src="xsl/genlickey.xsl">
          <map:parameter name="use-request-parameters" value="true"/>
          <map:parameter name="serialNumber" value="{serialNumber}"/>
          <map:parameter name="timeStamp" value="{timeStamp}"/>
          <map:parameter name="dateLicense" value="{dateLicense}"/>
          <map:parameter name="error" value="{error}"/>
         </map:transform>
         <!-- add MP5 key -->
         <map:transform src="xsl/MP5.xsl"/>
         <!-- insert in Tamino -->
         <map:transform src="xsl/insertandkeep.xsl"/>
         <map:transform type="xmldb"/>
         <!-- add session info -->
         <map:transform src="xsl/addsessioninfo.xsl"/>
         <map:transform type="session"/>
         <!-- treat response and
         either show license info or error page
         if insertion failed -->
         <map:transform src="xsl/dbresp.xsl">
          <map:parameter name="taminoUri"
value="http://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baepp:tami
nocollection}"/>
          <map:parameter name="adminemailfrom" value="<snip>"/>
          <map:parameter name="adminemailto" value="<snip>"/>
          <map:parameter name="server" value="{baepp:taminoserver}"/>
          <map:parameter name="smtp" value="<snip>"/>
         </map:transform>
         <map:serialize type="html"/>
        </map:act>
        <!-- license generation failed -->
        <map:redirect-to uri="error?code=422003"/>
       </map:act>

       <!-- form validation failed so show input form -->
       <map:aggregate element="page">
        <map:part element="mlform" src="cocoon://mlform"/>
        <map:part element="template"
src="xmldb:tamino://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baep
p:taminocollection}/#Template[@Id='{../../template}']"/>
        <map:part element="lickeymat"
src="xmldb:tamino://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baep
p:taminocollection}/#licKeyMat[@number='{../../licKeyMat}' and
version/@versionnb='{../../version}']"/>
        <map:part element="plugging"
src="xmldb:tamino://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baep
p:taminocollection}/#Plugging[@product='{../../licKeyMat}' and
@version='{../../version}']"/>
        <map:part element="checked" src="cocoon://getcheckedplugs"/>
        <map:part element="session" src="xml/getxml.xml"/>
       </map:aggregate>
       <map:transform type="session"/>
       <!-- generates form to fill -->
       <map:transform src="xsl/genlicform2fill.xsl">
        <map:parameter name="use-request-parameters" value="true"/>
       </map:transform>
       <!-- keeps request params but not errors added
      by form validation -->
       <map:transform type="simple-form"/>
       <map:serialize type="html"/>
      </map:act>
      <!-- no form validation occured ever, generates input form -->
      <map:aggregate element="page">
       <map:part element="mlform" src="cocoon://mlform"/>
       <map:part element="template"
src="xmldb:tamino://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baep
p:taminocollection}/#Template[@Id='{../template}']"/>
       <map:part element="lickeymat"
src="xmldb:tamino://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baep
p:taminocollection}/#licKeyMat[@number='{../licKeyMat}' and
version/@versionnb='{../version}']"/>
       <map:part element="plugging"
src="xmldb:tamino://{baepp:taminoserver}/tamino/{baepp:taminodatabase}/{baep
p:taminocollection}/#Plugging[@product='{../licKeyMat}' and
@version='{../version}']"/>
       <map:part element="checked" src="cocoon://getcheckedplugs"/>
       <map:part element="session" src="xml/getxml.xml"/>
      </map:aggregate>
      <map:transform type="session"/>
      <!-- generates form to fill -->
      <map:transform src="xsl/genlicform2fill.xsl">
       <map:parameter name="use-request-parameters" value="true"/>
      </map:transform>
      <map:transform type="simple-form"/>
      <map:serialize type="html"/>
     </map:act>
    </map:act>
   </map:match>


----- Original Message -----
From: "Piroumian Konstantin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 3:30 PM
Subject: RE: how to use Input Modules ?


> Please let us know if you have any improvement suggestions or some real
> use-cases regarding the input modules (or global parameters)
>
> >
> > Please, do you have an idea when I can fully use sitemap
> > global parameters ? With {../../ ... } it gets messy to read,
> > and {/param} doesn't work for now... (10/03 CVS).
>
> Speaking frankly, I have no idea. Although, I've proposed the global
> parameters idea, but they were implemented by Carsten.
>
> IMO, input modules cover almost all the tasks that global parameters solve
> (except for the propogating values to sub-sitemaps in map:mount).
>
> --
>   Konstantin
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to