Varalakshmi Kollipara wrote:

Hi thank you for the reply. I am able to work with Source Writing
Transformer. But I have a new issue; how to redirect to another page after
using Source Writing Transformer or any other transformer or generator and
so on.


Cocoon is not intended to be used in that way. Once a pipeline has been build, and has started being processed, it is not possible to redirect it to another place - the pipeline has to complete.

There's three ways to achieve what you're talking about:
1) Send a page with a <meta http-equiv="refresh" content="0;http://server/newpage"/> entry in <head/>
2) Better - transform the results of the SWT into an HTML page that makes sense to its viewer.
3) Use flow - don't use SWT, just use some Javascript to write to your source, then you can redirect wherever you like.


Regards, Upayavira

Thanks,
Lakshmi

-----Original Message-----
From: Lars Huttar [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 3:04 PM
To: [EMAIL PROTECTED]
Cc: Varalakshmi Kollipara
Subject: RE: SourceWritingTransformer


I assume you have looked at the examples at
cocoon/docs/userdocs/components/transformers/sourcewriting-transformer.html


Here's what we use (under Cocoon 2.1.2). In the sitemap:

...
   <map:view name="source" from-label="source">
     <map:transform type="write-source">
       <!-- <map:parameter name="serializer" value="text" /> --><!--
unnecessary -->
     </map:transform>
     <map:transform src="transforms/post-write-source.xsl" />
     <map:serialize/>
   </map:view>
...
     <map:match pattern="*/*/cell/*/s*/*.xsl"> <!-- Stylesheet  to generate
Row 5 source code -->
       <map:generate src="cocoon:/base/{1}/{2}/{3}/s{4}" label="raw" />
       <map:transform src="archFrame/s{4}/{3}/{5}.xsl" label="source"> <!--
here -->
         <map:parameter name="system" value="{1}" />
       </map:transform>
       <map:transform src="transforms/source.xsl" label="raw2">
         <map:parameter name="system" value="{1}" />
         <map:parameter name="state" value="{2}" />
       </map:transform>
       <map:serialize type="html"/>
     </map:match>

So if the parameter ?cocoon-view=source is included on the request URL,
the output of the transform labeled "here" goes to the
SourceWritingTransformer;
otherwise it goes to a different transformer (post-write-source.html)
that formats it as human-friendly HTML.

An example of the input to the SourceWritingTransformer:

<pages xmlns:sil="http://www.sil.org/namespace/xsp-query";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";
xmlns:xsp="http://apache.org/xsp";
xmlns:source="http://apache.org/cocoon/source/1.0";>
 <system>Ethnologue</system>
 <architect>Gary S</architect>
 <date>2003-12-13</date>
 <role id="admin">Ethnologue editor</role>
 <source:write serializer="xml">

<source:source>context:/mount/gem/enterprise/systems/Ethnologue/admin/index.
xsp<source:source>
        <source:fragment>
         <xsp:page language="java" sil:dummy="" xsp-request:dummy="">
          <index-page>
                <system>Ethnologue</system>
                <role>Ethnologue editor</role>
...
          </index-page>
     </xsp:page>
   </source:fragment>
 </source:write>
 <source:write serializer="text"
xmlns:source="http://apache.org/cocoon/source/1.0";>
   <source:source>context:/mount/gem/ddl-out-oracle.sql</source:source>
   <source:fragment>
     <dummy>-- Oracle 9i database schema for Ethnologue
         -- Automatically generated from GEM system model
         -- Define the tables

                CREATE OR REPLACE TABLE Alternate_Dialect_Name (
...
         </dummy>
   </source:fragment>
 </source:write>
...
</pages>

-----Original Message-----
From: Varalakshmi Kollipara
Sent: Friday, January 09, 2004 4:05 PM
To: '[EMAIL PROTECTED]'
Subject: SourceWritingTransformer

Hello everyone can anyone send me some SourceWritingTansformer examples.

Thanks in advance,
Lakshmi.


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

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







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



Reply via email to