12b
Functions
Fulfulling the requirements...
The specification requires that the final solution can:
- retrieve sermon information from storage
- navigate through the different sermons stored
- search for particular sermons via sermon title
- edit/update/amend information about the particular sermon found in the search
- append sermon data as new
- delete sermon data
- process and output sermon data into different formats
- FTP the files generated to web server
Design
The following functions will help achieve the goals just listed:
Function TimeTest() As String

This function tests the radio buttons and turns result into the appropriate string so it can be called later by some of the routines so they can plonk "AM" or "PM" into the XML string loaded in memory.
Public Function UpdateMe(NodeNum As Integer)

This function parses the parameter of the sermon node number that needs to be updated. In doing so it then uses it to search the XML DOM tree using XPath for the node that needs to be amended. It then turns the current contents of the form into XML and using the replaceChild method it deletes what's in the archive and inserts the new XML generated from the form in its place.
Public Function RemoveMe(NodeNum As Integer)
This function is similar to the UpdateMe(NodeNum As Integer). However, it doesn't clone anything and instead of using the replaceChild method it uses the removeChild method.
Public Function AddNewSermonNode(NodeName As String)
This function is even more similar to UpdateMe() than RemoveMe() is. It will load the XML then clone the latest sermon node, but this time it will append the clone to the document element using the appendChild method in MSXML.

Public Function TransformXML(ByRef XSLStyleSheet As String, ByRef InputXML As String, ByRef OutputXMLDeriv As String)

This function parses three different parameters: the path and name of the XSL stylesheet, XML archive and the Output filename. It makes use of the Microsoft XML 3.0's transformation processor. The functionality is simple: Input a file, process a file according to instructions and output a new file.
Public Function QuerySermonNode(NodeNum As Integer)
This function queries the XML sermon archive using an XPath string with the embedded variable/parameter 'NodeNum'. QuerySermonNode() is called within many different routines and thus responds effectively to many different events. When a NodeNum is parsed through it, it pushes the text content of each of the current sermon node's child nodes (title, book, chapter, etc) and attributes (day, month, year and time) to the GUI.

Function FTPScr(FileName As String, Optional FileName2 As String, Optional FileName3 As String, Optional FileName4 As String, Optional FileName5 As String, Optional FileName6 As String, Optional Filename7 As String)
This function builds the instructions ready to be shelled out to ftp.exe! If if there are 2 files to be uploaded (just RSS feeds) it will build instructions for just two files. If there are 5 files to be uploaded (if just XHTML files) it will build instructions for 5 files to be uploaded. Or if all files need to be uploaded it will build instructions for 7 files.
All instructions are saved in .scr (screensaver) format locally because ftp.exe is able to read that kind of file via the COM.
Click next to continue...
« BACK | Back to top | NEXT »
