Title: RE: actions using XML

Do the following

Create a actionset

<map:action-sets>

  <map:action-set name="handle-requests">

        <map:act type="htmlReqHandler" action="HTML"/>

      <map:act type="flashReqHandler" action="FLASH"/>

  </map:action-set>

</map:action-sets>

Use this action set in Ur pipeline definition.

In the htmlReqHandler, you convert the parameters into a XML and set it into the HttpRequest object.

In the flashReqHandler, you store the request XML and set it into the httpRequest object.

Note: ensure that the XML formats are the same.

Now the request object accessed by your Generator will have the XMK in its attribute regardless whether the action is html or flash.

Hope this is clear


 -----Original Message-----
From: RAJU RAO [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 11:27 PM
To: [EMAIL PROTECTED]
Subject: actions using XML

Hi to All,

We have been using C2 for the last many weeks. We have a peculiar need.

Our application has two interfaces. One is pure html and the other is

Flash.

The buttons on the form of our web applications call up actions defined in

C2 and via the pipeline work as desired. These are Java codes that perform

things like update, saves etc.

In flash the same buttons are desired. Here we use the flash (v 5) XML send

and load method (which calls another Java code accepting the XML sent by

flash and return the result as XML to flash). The problem is that for the

same functionality I write two different codes since the input is the

parameterised form in the web and in case of flash it is an xml.

The question I have is whether there is a way in which the action can

receive the input as an XML (today it uses request parameters to process

the information from the form). The obvious adv to us is that the same java

code can be used both in html and flash.

we were exploring of not using actions but calling a different uri on a

button press. This uri would go to a pipeline that would generate an XML

using the request type (thereby getting all the parameters in XML). Then

calling some sort of a Java code transformer (with the actual bean as a

parameter) which can suck in the XML sax stream generated and use it in the

bean and the result of the bean can move on to any serialiser.

Don't know if it is advisable to approach like this. Wondering if a Java

code transformer exists?

Any help would be appreciated,

Thanks,

Raju


---------------------------------------------------------------------

Please check that your question has not already been answered in the

FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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

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

Reply via email to