Re: problems with flash-integration
"Roberto Saccon" <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <002c01c291dd$5851c8f0$0122dccb@laptop> |
Hello Malcolm and Geoff, thanks for your advices. After a few failed attempts I did as you suggested, and now, flash-client is able to communicate via XML-RPC with Tapestry. I took the the ActionLink-Component and ActionService as base, sticked all the URL-serviceContext (which is expected from my ActionService-derivate) into the flash client request, added the flash-request-evaluation and method-invocation to the service and thats'it !!! This appoach did not work with Flash-Remoting, which Macromedia sells for $ 1000 per CPU and which works different than XML-RPC and seems only to be useful for pure flash applications. If there is interest, I can povide details. I will put some of my stuff on sourceforge soon, then maybe, if Howard likes that kind of flash-interoperabbility, the flashService and the FlashComponent could be added to the mainstream build, its just a few lines of code, the Apache XML-RPC-jar is also very small (on the other hand, I don't like blown-up frameworks, if I do not need the particular feature) regards Roberto ----- Original Message ----- From: "Malcolm Edgar" <[email protected]> To: <[email protected]> Sent: Monday, November 18, 2002 6:50 AM Subject: Re: [Tapestry-developer] problems with flash-integration > Hi Roberto, > > This sounds like a fun project. The approach I would be thinking about here > is creating a FlashService to handle the Flash POST requests. > > The FlashService would parse the POST parameters and call from your > FlashComponent. I would look at using the > net.sf.tapestry.engine.ActionService as template for this service. > > Then register the new flash service in .application file: > > <service name="flash" class="com.mycorp.engine.FlashService"/> > > regards Malcolm > > >From: "Roberto Saccon" <[email protected]> > >Reply-To: "Roberto Saccon" <[email protected]> > >To: <[email protected]> > >Subject: [Tapestry-developer] problems with flash-integration > >Date: Sun, 17 Nov 2002 00:36:19 +1000 > > > >Hello Howard and community > > > >First, thanks for all the efforts put into this great Web-Framework. > > > >Second, I try to add a new dimension to it by creating a general > >flash-component. You might ask, what is that good for. Well, I have created > >a Flash-Texteditor with may features (for weblog-application). This is much > >easier to do in Flash than in DHTML/Flashscript and with FlashRemoting > >(propietary) or Apache XML-RPC the Editor can talk to a servlet and even do > >things lilke spell-checking. But here comes my problem. After studying for > >two days the Tapestry RequestCycle, my Flashcomponent was neither capable > >to store the URL nor to initialize propperly a ActionListener. > >To handle that stuff in a simple servlet would be very easy, because the > >FlashClient simple puts an attributes into the HttpServletRequest, which is > >used as argument for invoking serverside-functions, and then puts the > >result back in the HttpServletRequest. So I created a very simple > >FlashComponent which just handles the HTML-Tage for embeding the > >flash-object and I put all the Logic into the servlet by overiding the > >doService-Method in the ApplicationServlet, see my codefragments commented > >es flash-ugly-hack-1 and flash-ugly-hack-2. > >Obviously, this is NOT how components should be created. But how can I > >create a real Component with a listener which is triggered when I "submit" > >form the flashclient ? I tried to modify the Link- and Form-Componentts, > >but without success. Any help is highly appreciated. > > > >regards > >Roberto > > > > > >abstract public class FlashApplicationServlet extends ApplicationServlet > >{ > >... > >... > >protected void doService(HttpServletRequest request, HttpServletResponse > >response) > >throws IOException, ServletException > >{ > > //flash-ugly-hack-1 > > boolean flashRequest = false; > > String flashParameter0 = null; > > Object o = request.getAttribute("FLASH.PARAMS"); > > if ( o != null) > > { > > flashRequest = true; > > List args = (List) o; > > flashParameter0 = (String) args.get(0); > > } > > > > RequestContext context = null; > > try > > { > > // Create a context from the various bits and pieces. > > > > context = new RequestContext(((ApplicationServlet) this), request, > >response); > > // The subclass provides the engine. > > IEngine engine = getEngine(context); > > > > // flash-ugly-hack-2 > > if (flashRequest) > > { > > String result = flashParameter0 + ((Visit) > >engine.getVisit()).getUser().getEmail(); > > request.setAttribute("FLASH.RESULT", result); > > } > >....... > > > _________________________________________________________________ > Add photos to your e-mail with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf