SM reported that commas were vanishing from her ARUN1 document. It turned out that the text() template I have for removing punctuation from text nodes immediately following quoted items (because the punctuation has been pulled into the quotes) was over-loose, matching contexts where it shouldn't (ancestor-or-self instead of self). I've fixed that in dev and live, and can't see any unwanted side-effects -- article titles in bibls are still processed correctly, for instance -- but will have to watch out for any changes in edge cases.
We now have a working gazetteer available in the live site (although it's not formally linked from anywhere yet). There is a page in info called gazetteer_intro.xml which is in draft, waiting for JJ to add text; this links on to the actual gazetteer pages. The file is in a new category called mdtEncyclopediaGazetteer, and is the sole member of that category, so in the Encyclopedia landing page it gets linked directly.
I also made some changes to mdtList.xql (dev and then live) to handle the case where there are no public documents within a category; in that case, the category won't be listed in a subcategory listing. If there's one document, it will create a direct link to the document rather than a category link; and draft documents can be viewed as though live by using the usual show=all.
Finally, KMF reported that the gazetteer table wasn't sortable, which it should have been. I discovered that this was because I was getting the serialization settings wrong; I was making two calls to util:declare-option, one for each component of the serialization options, but I should have been making only one, with the options space-separated:
let $opt := util:declare-option('exist:serialize', 'method=html5 media-type=application/xhtml+xml'),...
The result was that the doc was serialized as XML rather than HTML5, and therefore the browser was not running some JS that it should have been. This is now fixed.
Got the offline data generation down to a minute or so, and 3.5MB, and I've now implemented that on the dev site. Will move to live when we've figured out where we might want to link it from.
I completed the unfinished gazetteer page generation XQuery and tested it; it takes a horribly long time to run. After optimizing again, I still couldn't get it fast enough, so I've posted a message to the eXist list for any suggestions. In the meantime, though, I've implemented an XSLT approach which generates the file offline. I think that may be the best approach available. We can still manage it through SVN and upload it to the db periodically.
I have a working page that basically does what it should, on dev. It has two drawbacks: it's too slow, and it currently only lists the alternate spellings/names which begin with the same letter as the target letter. I need to look at the possibility of using Lucene indexes to speed it up, and then that should allow for pulling back the other names at the same time.
This is based on the SVN keyword properties at the head of the file, retrieved like this:
declare function local:getLastModInfo() as element(div)?{ let $docRoot := root($dataDoc), $svnProps := $docRoot/comment()[1], $docDate := substring-before(substring-after($svnProps, '$Date: '), '$'), $modifier := tokenize(substring-before(substring-after($svnProps, 'Id: '), ' $'), '\s+')[last()] return <div xml:id="lastModification">{$docDate} ({$modifier})</div> };
Needed a prompt from JW on the eXist list to remember root(), so posting this for myself to find when I forget again.
couple of core documents which have been in left in draft inadvertently, and fixed typos all over the place; added svn keywords to blogs and several other files.
Per the task in the previous post, draft documents are no longer displayed; instead, a boilerplate message is shown. A URL parameter allows editors or proofers to see the displayed document as normal.
Tasks for me from today's meeting:
- DONE 2014-03-12: Gazetteer page.
- DONE 2014-03-06: Last modified date and SVN keyword info in page footer (made a bit of a start on this).
- DONE: We will use multiple location elements with dating attributes and @source to encode georeferencing for places over time. Document how to do this, and tweak the schema appropriately.
- DONE 2014-03-06: Treat draft documents as if they were empty documents for the purposes of showing some boilerplate text, but make an option for a URL parameter that will show the document, for encoders working on it.
Per instructions from KM-F:
- A new document status called "assigned" is available and documented in the schema.
- A caption and explanatory text for it have been added to boilerplate.xml.
- All XQuery modules have been updated to respond to this status appropriately.
- XQuery libraries have now been largely rationalized to use a single central variable ($inc:publicDocuments) in includes.xql, which contains a list of the status values that we deem to be "public". This variable is now used everywhere. Previously, lists of document status values appeared wherever they were needed in the code, making it difficult to manage central changes such as the addition of a new value.
Tested on dev, then published to live.
I've added this to the schema, but of course none of the code which hinges on @status knows what to do with it yet. We need:
- a boilerplate label for mdtList pages
- a boilerplate explanation for the page itself
- fixes to all document rendering code to make it show up in lists etc. just like empty and stub documents do.