Jump to content

XML file maintainer


Recommended Posts

First, this is the first PHP project of the sort I've come up with. So, I'm a noob. :-)

 

Ok, the basics of what this project will be:

 

My church uses a program to display the slides for the words to the music that uses a XML files to store the songs. Its a great system (program is called OpenSong), and we haven't run into any problems until now. See, we have several computers (four or five) that all have the program installed. We want them all to have all the song files, all the same version. We might catch a mistake in one file, and update it on one computer, but then we have to take the file to all the other computers via USB stick, and change them. The list gets very, very long after a few weeks. Not to mention the new songs we make.

 

So, I was wondering if I could build a PHP application that would store all the XML files, and I could make a very simple web front end to edit those files. Then, I could tell it to zip up and download all the songs (current versions), and extract those songs into the songs folder on the hard drive.

 

I know its possible. Just... how do I go about using it? I don't need any user authentication. Just a main page that lets you zip up and download the songs, and also has a dynamic text area with all the names of the songs, where you can select one and edit it. Or, I could have a link to another page, which generates hard links to the files, and from there I can click on them. Either way. I would also need a feature to create more songs from a blank template (with all the basic XML tags filled in already).

 

 

My idea:

 

<main page>

Main page lets you d/l the zip file

and links to list page

and links to create song page

</main page>

 

<list page>

PHP opens the song folder on the server, and generates hard links to every song file. When you click on the file, it sends you to edit page.

</list page>

 

<edit page>

Page that shows forms, already filled in with the song information and lyrics. You can edit as needed, and save

</edit page>

 

<create song page>

similar to edit song, but imports the blank file, and lets you edit, then saves as the title name

</create song page>

 

 

One catch is that the song files are XML without the XML extension. When I open them in notepad, I see the XML tags, etc, but they do not have file extensions.

 

 

Any suggestions??

 

Just want to make sure I'm on the right track here!

 

Thanks!

Link to comment
Share on other sites

What exactly are you asking after?  The application flow seems to make sense to me.  Also, for the XML I have found an amazing tool that I feel compelled to recommend.  It honestly made my life much easier, here's the link:

http://homework.nwsnet.de/products/69

It's free, open source, works on PHP 4 and I believe self explanatory.  It doubt the file extensions will be an issue.

 

As for how to go about hosting it...

 

Well you'll want some procedure/class to intercept $_GET or $_POST requests and direct them to a page controller.  The page controller should then get a directory listing or file and generate some HTML.

 

Let me know if you have more questions, or want more specific details.

 

// shameless plug, I also have some utilities that may be useful for you available (in my sig), but they're for php 5

Link to comment
Share on other sites

Well the class that I linked initially is a great tool for importing XML.  All you do is extend the class and create functions named handle_ then the tag name.  (this is explained in the class documentation) Then whenever that tag is hit the function is called.  You have access to the attributes etc, just look at the method signature.  At any rate you just instantiate the new class you've created, pass it a file or string of XML, and get the results.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.