WWP eXist-DB applications

From Digital Scholarship Group
Jump to navigation Jump to search

The Women Writers Project uses the eXist-DB database to query, transform, and publish XML files. Most of these "applications" are actually divided between eXist and the WWP server file system. In general, eXist is used to store and index XML files. The database also holds XQuery scripts which, on request, parse and return data in a web-friendly format (generally JSON or HTML).

On the server file system, an application mainly consists of an index HTML file and a Javascript file, as well as other web assets (CSS, images, etc.). The Javascript file is a Backbone.js application that makes calls out to the eXist application, using the responses to populate most pages in the browser. In fact, though the URL changes, a user navigating the WWP subproject site never actually leaves index.html. Instead, the Backbone app modifies the webpage and browser URL to match the conceptual "page" chosen by the user.

eXist-supported endeavors

WWP endeavors which have an eXist-DB component are:


Women Writers in Context

The code for the WWiC website can be found in Subversion at DEV/exhibits. (Unlike the other endeavors, WWiC has no separation of code from data.) On the server, the index page and assets are symlinked from the "exhibits" directory to WEB/context. As a result, WWiC is visible from both https://wwp.northeastern.edu/context and https://wwp.northeastern.edu/research/projects/exhibits.

WWiC is not an EXPath application, but it does use XQueries as REST endpoints. In eXist, the XML, XSLT, and XQueries can be found at /db/exhibits.

Exhibits encoders should have write access to this collection on the WWP-Test server, which enables easy pre-publication proofing. Publication on the production server requires a database admin.


Women Writers in Review

The code for the WWiR website can be found in Subversion at DEV/reception/utils. On the server, the index page and assets are symlinked from the "reception" directory to WEB/review. Unlike WWiC, Review is available only at https://wwp.northeastern.edu/review/index.html. The files are stored at https://wwp.northeastern.edu/research/publications/reception/utils/index.html, but the Backbone.js script will not work if accessed there.

WWiR is also an EXPath package, and uses RESTXQ to serve out data via an API. The XML files are stored in eXist at /db/reception-data, and the EXPath application will be installed at /db/apps/review. The base URI for the API is "http://www.wwp.northeastern.edu/exist/restxq/reception". For more information on the API endpoints available, see https://www.wwp.northeastern.edu/exist/restxq/reception/api-docs.


Featured Quotation

The Featured Quotation on the WWP home page is generated randomly, with a request to eXist from the Javascript file at WEB/utils/bin/javascript/wwp.js. The HTML response then populates the quote widget.

The code in eXist is not an EXPath application. The XQuery qotr.xq and XSLT qotd.xslt are maintained in WEB/utils/stylesheets, and are saved in eXist at /db/quotes. Unlike most other eXist endeavors, the XML source is not stored in eXist. Instead, the XQuery uses the quotography on the appropriate server (production by default) at WEB/utils/xml/quotography.xml.


Text Tracker

The Text Tracker is a small EXPath application that uses data from the Text Tracking Trello board to create a table of forthcoming WWO texts. The code is maintained at DEV/text-tracker. When installed into eXist, the XQuery and XSLT will be stored at /db/apps/text-tracker, and the collection /db/trello-data will be created, if it doesn't already exist.

Important: Because the Text Tracker requires a Trello user's credentials, the file at /db/trello-data/trello.xml must be readable only by database administrators. It is not checked into Subversion.

When the "forthcoming texts" web page loads, Javascript sends an AJAX request to get the table from the EXPath application. The Javascript file can be found at WEB/utils/bin/javascript/forthcoming.js.

Internal Documentation

The code for Internal Documentation is located in Subversion at WEB/research/publications/documentation/internal.

WWiC is not an EXPath application, but it does use XQueries as REST endpoints. In eXist, the XML, XSLT, and XQueries can be found at /db/wwpdoc.

Documentation maintainers should have write access to this collection on the WWP-Test server, which enables easy pre-publication proofing. Publication on the production server requires a database admin.


Inspectre

Maintaining eXist-supported endeavors

Updating XML data

If XML data is stored in eXist for transformation and publication, it can be updated by navigating to the eXist Dashboard, logging in, and uploading the newest files to the correct data folder.

Error creating thumbnail: File missing

For example, to add a new Exhibit to Women Writers in Context, you would log into the eXist Dashboard, as seen above. Then you would click on the "Collections" app, which shows the contents of the eXist database.

EXist-2.2-dashboard-collections-icon.png

Error creating thumbnail: File missing

You would navigate to the Exhibits XML collection at /db/exhibits/xml. It looks something like this:

Error creating thumbnail: File missing

The button to upload a new file is the cylinder with the plus sign, at the end of the row of buttons. EXist-2.2-dashboard-collections-upload-button.png Clicking that button will let you upload a file from your computer—in this case, a TEI file from the Exhibits ecosystem under Subversion.

Error creating thumbnail: File missing