-
Notifications
You must be signed in to change notification settings - Fork 7
Web Site Layout
#Abstract This is an overview of how the MutopiaProject site is structured and updated.
##Basic Site Structure
The MutopiaProject site is predominantly a collection of static pages which are built when musical pieces are added or updated in the archive. There are 7 of these static pages, each one of them accessible from a menu item from the navigation bar. Dynamic pages are only created for results. There are only two CGI scripts that drive these dynamic pages,
-
cgibin/make-table.cgiused for broad search results -
cgibin/piece-info.cgiused to display a single piece
The scripts that build the web site, as well as the CGI scripts, are written in Perl.
###Datafiles
There are several datafiles and folders that the site uses to present pages to the user. These are listed here referencing the top (DOCUMENT_ROOT) of the site hierarchy.
-
datafiles/composers.dat- the list of valid composers that can be used in musical pieces. It has a simple twin-line structure designed to make it easy to load into an associative array. The key-value pairs in this case arename-taganddescription -
datafiles/styles.dat- a list of valid styles that can be used in pieces. Structured similarly tocomposers.datbut, since the description line is not used, they are done as matching pairs. They may be loaded into an associative array but are simply used as a hash table. -
datafiles/instruments.dat- a list of valid instruments, keys arenameanddescription. -
datafiles/collections.dat- a description of all collections. This is formatted as a colon-separated-list. -
ftp/- the main sheet music hiearchy. Each sub-folder underftp/is a composer name the format of which matches an entry incomposers.dat. -
images/- graphics (icons, logos, artwork, etc.) used by the website. -
css/mutopia.css- the main style sheet. -
bootstrap-3.3.5-dist- contains the bootstrap distribution. This is the minimum amount of css, fonts, and javascript necessary to use bootstrap. -
html-in- templates used during build but are not required on the server.
##How the site is built
The process of adding or updating a piece is important but covered elsewhere, it is sufficient that there exists an ftp/ folder containing music in the appropriate publication format. This process is entirely covered by a perl script called Update_website.pl.
- Get a list of all
RDFfiles under theftp/folder. - Build a data structure associating the filename with the
RDFcontents. - Build cache files.
-
musiccache.datcontains details of each piece (basically what you see as output from thepiece-info.cgicode. -
searchcache.datcontains a cross-reference table, matching various keywords to a piece-id relevant to that keyword. This table is used during advanced search.
-
- For each
html-in/*.html-intemplate file, build a finished site page.
The above process can be done whenever a change has been made to pieces in the ftp/ folder. If a new composer is submitted, the name is added to the datafiles/composers.dat file so that change is folded in as well. Once built, the server is synchronized with these new files.