Skip to content
Glen Larsen edited this page Nov 17, 2015 · 1 revision

#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,

  1. cgibin/make-table.cgi used for broad search results
  2. cgibin/piece-info.cgi used 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 are name-tag and description
  • datafiles/styles.dat - a list of valid styles that can be used in pieces. Structured similarly to composers.dat but, 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 are name and description.
  • 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 under ftp/ is a composer name the format of which matches an entry in composers.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 RDF files under the ftp/ folder.
  • Build a data structure associating the filename with the RDF contents.
  • Build cache files.
    • musiccache.dat contains details of each piece (basically what you see as output from the piece-info.cgi code.
    • searchcache.dat contains 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-in template 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.

Clone this wiki locally