6 Replies Latest reply on Oct 9, 2006 9:11 PM by nicetim

    FDS HELP!!!!!!!!!!!!!

    nicetim
      Hi all,
      i am new to Flex and very new to FDS.
      I have been playing with the Contact and Dashboard samples.
      We have some CF Flash Forms that have data grids.
      I want to turn those into Flex apps that use FDS to display the data in the grids.

      There are several other CFC's and other apps that modify the underlying database and i want those updates pushed out to the subscribers of the data. How can i accomlish this?

      From what i have seen so far the only way the contact sample can push the updated data, is by updating the data through FDS. is this correct?

      TIA

      Tim
        • 1. Re: FDS suggestion
          knallore_adobe Level 1
          >>There are several other CFC's and other apps that modify the underlying database and i want those updates pushed out to the subscribers of the data. How can i accomlish this?

          You should be able to use the CF adapter to reuse those CFCs.


          >>From what i have seen so far the only way the contact sample can push the updated data, is by updating the data through FDS. is this correct?

          correct


          HTH
          Kumaran
          • 2. Re: FDS suggestion
            nicetim Level 1
            Hi and thank you for the reply.
            Can you give me some detail on using the "CF Adapter to reuse those CFC's" ?

            Is there a function i can call after my other CFC's modify the data?
            like: <cfquery...> update table...</cfquery> somefunction.update()??

            Or is there some sort of data watcher event gateway that can watch for database changes and push out / sync with the FDS subscribers?

            thanks again
            tim
            • 3. Re: FDS suggestion
              knallore_adobe Level 1
              Here are some articles that might help you:
              http://www.adobe.com/devnet/flex/flex_cf.html
              • 4. Re: FDS suggestion
                nicetim Level 1
                I have read through all the articles, but i can not find an answer to this.
                How can i publish data changes without using a Flex front end?
                In other words, I have many existing CFC's that update and insert data.
                I need a way for those CFC's to update the ArrayCollection in the FDS..

                Please help
                Thanks
                tim
                • 5. Re: FDS suggestion
                  nicetim Level 1
                  For example:
                  Lets say i have a DAO that watches my users table.
                  It displays all changes to the users data when changed in the Flex app.

                  But when a user logs into the entire applicaiton (CF & Flex) some updates are done on that users record in the users table.
                  The updates are done via a CFC.
                  I need the update function to instead update the data through the DAO CFC, which i have working now. but since it is calling it directly and not through the Assembler which contains the functions that update the Flex ArrayCollection (I think)..

                  SO can someone give me some documentation on the Change Object that is used in the "sync" function of the CFC's that are generated with Flex Builder 2?
                  Or tell me how i can create a changeObject myself and pass it to the sync() function????

                  Please please??

                  TIA

                  Tim
                  • 6. Re: FDS HELP!!!!!!!!!!!!!
                    nicetim Level 1
                    I found a solution. but i am not sure this is the correct way to handle this.

                    First let me explain exactly what i am attempting and what i am working with and what i did to somewhat fix the issue i was having.

                    Ok, i have modified the contacts sample app to read from my data source and display the data in a single grid.
                    I used FB to create the CFC's for the DAO.
                    I updated all the code to work with my model.
                    So i have a single datagrid and thats it for display from the contacts sample.
                    I used all the same as functions and renamed them accordingly as well as the contact.as file.

                    Now in CF, i again used the DAO that was created for me.

                    Now i have a working project with my test data.

                    The problem i ran into was getting updates into my flex project.
                    After the suggestion in this post, i went back to another sample i modified to work for my environment the SessionTracker.
                    It uses a CF Event gateway to publish changes to consumers.

                    I made a new GateWay instance in CF Admin, i added a new destination in the messaging-config.xml, i made a new CFC for the GateWay from the basic example in the docs:
                    [code]
                    <cfcomponent displayname="sendUpdates" hint="echo messages from the event gateway">
                    <cffunction name="onIncomingMessage" output="no">
                    <cfargument name="CFEvent" type="struct" required="yes">
                    <!--- Create a return structure that contains the message. --->
                    <cfset retValue = structNew()>
                    <cfset retValue.DestinationID = arguments.CFEvent.OriginatorID>
                    <cfset retValue.MESSAGE = arguments.CFEvent.Data.MESSAGE>
                    <!--- Send the return message back. --->
                    <cfreturn retValue>
                    </cffunction>
                    </cfcomponent>
                    [/code]
                    Then in my Flex app, i added the consumer exactly how it is in the sessionTracker but with my new Destination.
                    And a eventListener to refresh the fill.

                    In my original CFC's that update the database, i simply do the following:
                    [code]
                    <cfset msg=StructNew()>
                    <!--- Build body structure --->
                    <cfset msg.body=StructNew()>
                    <cfset msg.body.sendUpdate = true>
                    <cfset msg.destination="CFDispatchGateway">

                    <cftry>
                    <cfset SendGatewayMessage("Flex2CF", msg)>
                    <cfcatch type="any" />
                    </cftry>
                    [/code]