I am working on an iOS app that needs to retrieve information about what competitions are currently going on different stages for a dance competition. I need to create a web interface to edit a plist file on my server that the app will download to update this information on the iDevice automatically. The page will basically be a grid of buttons, a single column for each stage. The buttons will switch the value for the competition between “TRUE”, and “FALSE”.
My problem is I don’t really know what language to use to do this. I started with PHP to create a basic web page for the program. I know that PHP only runs on page load. So I am now thinking about using AJAX, (Since I can update the user interface without refreshing the page.) I found that there is a nice plist editor for PHP, but not for AJAX. What would be the best way for me to do something like this? PHP, AJAX, Java? Could I have AJAX or Java run PHP scripts?
The plist looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Arena Hall</key>
<dict>
<key>1 : Round 1</key>
<true/>
<key>2 : Round 1</key>
<true/>
<key>3 : Round 1</key>
<false/>
</dict>
<key>Sycamore Hall</key>
<dict>
<key>4 : Round 1</key>
<true/>
<key>4 : Round 2</key>
<false/>
</dict>
I learned java and php and discovered the best way to do something like this.
I used jQuery to load a plist file into a string.
Using “Plist Parser” by theGoldenMule, I turn the plist into a JSON object.
Then I create a table of buttons using jQuery. Each button will run a javascript function.
This function send an AJAX query with the info to change to a php file.
Using CFPropertyList by Christian Kruse and Rodney Rehm, I change the values and save the plist file back to the server.