Hi Robby,


2009/12/15 Robby Pelssers <robby.pelss...@ciber.com>:
> Hi all,
>
>
>
> I’ve setup some Pipelines which transform some xml documents into DITA
> format.  So what I and up with is a <map> and several <topic>’s.
>
>
>
> The user should be able to render a html preview or download the DITA result
> fragments as zip-file.
>
>
>
> So in my flowscipt I check which submitbutton the user hits and dynamically
> determine the pipeline which needs to get invoked:
>
>       var view =
>
>             submitId.equals("viewXML")
>
>             ? "datasheetContainer"
>
>             : productId + ".zip";
>
>
>
>       //generate xml snippet which lists the selected topics and start the
> complete datasheet process from there
>
>       cocoon.sendPage(
>
>             view,
>
>           {
>
>             "data": viewData2
>
>           }
>
>       );
>
>
>
>
>
> My relevant sitemap snippets:
>
>       <map:match pattern="datasheetContainer">
>
>         <map:generate src="data/datasheet.jx" type="jx" label="step-1"/>
>
>         <map:transform type="cinclude" label="step-2"/>
>
>         <map:transform src="xslt/includePackageAndProductXml.xslt"
> label="step-3"/>
>
>         <map:transform type="cinclude" label="step-4"/>
>
>         <map:transform src="xslt/addGroupId.xslt" type="saxon"
> label="step-5"/>
>
>         <map:transform src="xslt/createMapAndTopics.xslt" type="saxon"
> label="step-6"/>
>
>         <map:transform src="xslt/sortNonQuantitativeTables.xslt"/>
>
>         <map:transform type="cinclude" label="step-7"/>
>
>         <map:transform src="xslt/replaceBoxDimensions.xslt" type="saxon"
> label="step-8"/>
>
>         <map:transform src="xslt/mergeParametricTableCells.xslt"
> type="saxon" label="step-9"/>
>
>         <map:transform src="xslt/cleanup.xslt" type="saxon"/>
>
>         <map:transform src="xslt/escapeHtml.xslt" type="saxon"/>
>
>         <map:serialize type="productxml"/>
>
>       </map:match>
>
>
>
>       <map:match pattern="*.zip">
>
>         <map:generate src="cocoon://datasheetContainer"/>
>
>         <map:transform src="xslt/datasheet2zip.xslt" type="saxon"
> label="zip"/>
>
>         <map:serialize type="zip"/>
>
>       </map:match>
>
>
>
> The problem I am facing is that the download dialogue now pops up with
>
> U have chosen to download the file xxxyyyyzzzz.continue
>
>
>
> But what I wanted was PH3330L.zip for example.
>
>
>
> Anyone who knows if I can change this behaviour somehow?

Yes, use the set-header action
In map:components
          <map:actions>
            <map:action name="set-header" logger="sitemap.action.set-header"
src="org.apache.cocoon.acting.HttpHeaderAction"/>
          </map:actions>

In the map:pipeline
                  <map:match pattern="*.zip">
                    <map:act type="set-header">
                      <map:parameter name="Content-Disposition" 
value="attachment;
filename={1}.zip"/>
                    </map:act>

BTW you're doing 3 includes inside the datasheetContainer pipeline.
It's better to split that one up into 3 pipelines with 1 include each
(you'll notice when you measure the response times).

Regards

Jasha Joachimsthal

j.joachimst...@onehippo.com - ja...@apache.org

www.onehippo.com
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 185 H Street, suite B, Petaluma CA
94952 +1 (707) 7734646

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

Reply via email to