Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

refreshing a spry xml file from mysql

New Here ,
Feb 16, 2010 Feb 16, 2010

hello. i am trying to get a dynamic region on a page to refresh from a mysql query. and, get the query to run periodically against the database to check for changes while the user is on the page.

based on searches and reading these two links:

http://labs.adobe.com/technologies/spry/articles/data_set_overview/

http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html

i think i understand how to:

1. create the javascript object

2. bind it to an xml file on the server side

3. create the dynamic region on the html page

4. create an initial xml file with the results of the mysql query to the database

5. force the js object to refresh its view of the xml file from the server periodically

what i can't seem to get to is how to get the xml file itself to keep getting refreshed by re-querying the database to see what has changed in the table every n seconds. do you know how?

thanks in advance.

TOPICS
Server side applications
970
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 16, 2010 Feb 16, 2010

The Spry dataset constructor allows you to specify various of options. One of these options is loadInterval. See API documentation for more information: http://labs.adobe.com/technologies/spry/articles/data_api/apis/dataset.html#constructor

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 16, 2010 Feb 16, 2010

Arnout - thanks, i'm with you on that piece. but let me check whether i understand it right. changing the load interval exclusively affects the link between my browser and the xml file on the server, correct?

if yes, got that part.

i'm stuck on how do i force my xml file itself to be refreshed with the latest contents from the mysql database?

thanks for any pointers,

jk

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 18, 2010 Feb 18, 2010

If you are using the solution on http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html, there is no XML file. It queries the database directly every time the page is accessed, and generates the XML dynamically.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 18, 2010 Feb 18, 2010

so if i access the page once, and remain on that page for say an hour, and the database records are changing, it doesn't look like my results will get refreshed as the database changes. am i reading that code correctly? that's what i'm after, getting the table on my page to refresh itself periodically to show the latest snapshot of the table but without having to click the browser's refresh button. will the setup in that link do this?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 18, 2010 Feb 18, 2010
LATEST

Arnout can tell you how the Spry end of it works. The point about the XML is that no physical file is created. Each time the URL is requested, a query is sent to MySQL, and the XML output reflects the current state of the database.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines