Finished the source code documentation.
Category: "Activity log"
So that's it then. It's over.
The Administration Program User Guide is finished and online.
There is a new intro page for the Scraps demo site:
http://lettuce.tapor.uvic.ca/~scraps/demo/
You will note the "Download Scraps" button. That will get you a totally untested install package to play with. Good luck with that.
The Workflow Guide is not finished. The Technical Reference Manual is not stared. The source code documentation is not finished (well, it's pretty close...). So, what to do?
Because I am a nice guy (or maybe just a patsy), I will finish up at least the Workflow Guide and source documentation on my own time (nice guy? patsy?) at no cost to HCMC, McPherson Library, the Education department, or my mother (who can't afford me anyway). I will use the little bits of time when I am here but beholden to no one - before 8:30 AM, after 4:00 PM, lunch, fire drills, etc. No, no, don't try to talk me out of it. I am always happy to donate time to the old alma mater. You are welcome. No applause required. Or expected.
The Administration Program Users Guide is 99.3274% done. Just a bit to do in the User Manager, and some general cleanup.
Technically, this is my last day working on Scraps. However, my next project owes the Scraps project 4 hours (meetings snuck in during May), so Scraps gets tomorrow as well (yes, I know that's an extra 3 hours. So?). Lucky Scraps. I will, I hope, finish the Workflow Guide, and build an install package. After that, Scraps fans (both of you), you are on your own.
The Administration Program Users Guide is about 90%+ done. Just a bit of the Export Manager plus the XML Manager and User Manager to do, both of which are small. The documentation is online in the demo site.
Also fixed a few more small bugs, and cleaned up the documentation in more of the source files.
Running out of time, again... The programmer's project management maxim: "Everything takes longer and costs more."
The Administration Program Users Guide is now about 80% done.
The Workflow Guide is about 30% done (I got bored with the admin guide). I have repurposed chunks of the IMaP workflow guide, modifying them for Scraps, since both use digitized images and the Image Markup Tool.
Sorry, I didn't get the new stuff into the demo today.
The Administration Program Users Guide is now about 60% done.
I also fixed a few minor bugs, discovered while documenting.
The Administration Program Users Guide is now about 30% done.
Modified the document viewer to handle more than one level of sections within a chapter. One level was enough for the relatively simple Viewer Users Guide, but some of the chapters in the admin manual are too long and complex. It will now handle an "unlimited" depth of sections, though more than two or three would be silly.
I was going to build an install package today, but realized I was still changing stuff so would have to do it again later. I will build it late next week, and it will be the Scraps version 1.0 release.
The Administration Program User Guide is fully outlined and about 15% done. I have also added stuff to other documents. Everything is available on the demo site.
The Viewer User Guide is done. It is available in the demo.
Spent some fun time fighting with the DocBook XSLT + Oxygen PDF generator to get the PDF version of the Viewer User Guide looking more or less like the online version. The PDF version of the Install and Configuration Guide and the Viewer User Guide are also available on the demo site, administration program, Documentation Manager, "Documentation in other formats" section.
Review of the documentation followed by helpful comments would be nice...
The Viewer Program User Guide is now about 80% done. It is available on the administration program demo site, in the Documentation Manager.
The viewer program help facility is now working. When the help button is clicked, a previously hidden panel appears at the bottom of the browser window. On the left is a table of contents (a tree). On the right the chapters from the Viewer Program User Guide appear when a line in the table of contents is clicked. The help panel can be collapsed or closed.
Documentation: The Installation and Configuration manual is about done. The Viewer Program User Guide is about 20% done. The rest of the documentation is just outlines.
Documentation viewer: The documentation viewer in the administration program is pretty slick, if I do say so myself as shouldn't. You can see it in the demo (see URLs below). The combination of DocBook, PHP, and the Ext JS interface components works marvellously well. I like it. You will too.
Demo: The Scraps demo installation can now (mostly) talk to the Scraps PostgreSQL database. There is still a problem with some update permissions, so it is read-only at the moment. In any case, you can now view the demo of the Scraps viewer at:
http://lettuce.tapor.uvic.ca/~scraps/viewer/viewer.php?collection=ww_one&artifact=dodds_scrap
and the Scraps administration program at:
http://lettuce.tapor.uvic.ca/~scraps/admin
The username/password for the administration program is guest/guest. The only Collection/Artifact is for the Dodds scrapbook, and it is thoroughly locked down in read-only mode (yes, you may try to break in and hack it!) You can create new Collections and Artifacts, but I wouldn't recommend it until the permissions problem is resolved. The guest user has no access to the User Manager module (duh!) so if you want to see it, you will have to ask me.
Comments, criticisms, and bug reports expected. Assuming anyone actually reads this, and then actually looks at the demo...
DocBook continues to pose the occasional puzzle, but I am getting the hang of it. The Installation and Configuration manual is now about 75% complete.
Documentation Manager: Document chapters now display correctly, formatted with CSS. The chapter navigation buttons are working; the search is not. Essentially the Documentation Manager is functional. I found that dynamically transforming the XML documents each time they are requested was much too slow, so it now caches the HTML fragments the first time they are generated (and again if the source XML document changes), and subsequent requests use the cached copy. So the first request is slow, but after that it is fast.
Installation and Configuration Manual: This being the test case, it is moving along slowly as I get comfortable with DocBook. It is about 25% complete.
I have started producing the Scraps documentation. Most of today was spent researching DocBook XML and XSLT, and getting the Documentation Manager sort of working with DocBook. I have also started the Installation and Configuration manual, in DocBook format, which I am using as the test case for the Documentation Manager.
Documentation will all be in DocBook XML format, with one XML file per manual. The planned manuals/documents are:
- Installation and Configuration
- Administration Program User Guide
- Workflow Guide
- Viewer Program User Guide
- Technical Manual
With the documentation in DocBook XML, it is relatively easy to produce output documents in HTML and PDF formats.
With two weeks left in the available time for me to work on Scraps, development ends today. The next two weeks will be dedicated to documentation, of which there needs to be a great deal. So if it ain't done now, it won't get done. At least not in this phase. At least not by me.
The Viewer program demo is fully functional. The first two pages of the Dodds scrapbook displayed in the demo have most of the features available in Scraps. Hover the mouse over Objects; if the highlight is red, that Object has some special action. Click on it to see what it does.
- The photo of a broken artillery piece on Page 0 - 1 pops up an enlargement
- The photo of General Dodds on Page 0 - 1 links to another site (hold down shift when clicking to open the site in a new window/tab)
- The Divine Service booklet on Page 0 - 1 drops down a level in the hierarchy and lets you page through the wee booklet (click the up arrow button on the toolbar to go back)
- The partly hidden photo of some artillery officers on Page 2 - 3 will reveal itself when hovered over, as will a completely hidden item I will let you find for yourselves
- The partly hidden photo of some artillery officers on Page 2 - 3 when clicked lets you drill down through several levels of detail - up arrow button to go back up a level
The search is also functional, with the exception of wildcards, which the TSearch full-text search engine does not yet support.
- In the search box, you can enter single keywords and "phrases"
- You can link keywords with the booleans AND, OR and NOT (e.g. cat or dog and not wolf)
- You can order the terms with parentheses (e.g. cat or (dog and not wolf) )
- The Search Builder (click the button on the search toolbar) lets you select specific fields to search in, and to filter by categories
- Click a row in the search results grid to go to that Object
- Click the search navigation buttons in the toolbar above the tree to go to the next/previous search match in the tree
So there you go. WYSIWYG.
The demo of the administration program is not available yet, because the Scraps demo database is rejecting connections from the PHP "user" on Lettuce. Maybe Monday. I am not going to let you malicious hackers mess with my test data!
There are several features not implemented yet in both the Viewer and Administration programs, but what is there is enough to create a fully functional Scraps installation. The documentation will include a "future development" section outlining where I think Scraps needs enhancement. Who knows, maybe some of it will actually get done, someday.
The Export Manager is now complete, all functions working as expected. There are probably bugs, which someone will find and gleefully notify me of. I may even fix them.
The Viewer search now handles field searches correctly. As mentioned before, a field search requires two passes. Pass 1 extracts records from the database via TSearch; all terms in all specified fields are included in the select. This produces a set of records where the field terms appear, but not necessarily in the specified fields. Pass 2 goes through the pass 1 results and applies an XQuery to each record's metadata XML. Records that fail the XQuery check are removed from the result set. Even with the two steps, it is quite fast, at least with my limited test data (600+ records).
The XQuery filter used by the Viewer search is also used by the Export Manager when fields are specified; the export then does a similar two pass process to get the final result set to be exported.
Export Manager now allows selecting of individual Objects for export. The selection is done in the tree.
The field filter for the search and export now generates perfectly valid XPath query strings - for XPath 2.0. The queries work just fine in Oxygen. Unfortunately, PHP 5 supports (through libxml2) only XPath 1.0. So my valid XPath doesn't work. Yet. I need to find out how to use the contains() function in XPath 1; it seems to be different than in XPath 2.
The Export Manager is now fully operational, except for selecting Object records via field criteria. The module gathers up suitable records, extracts the metadata XML, tacks on wrapper tags as needed, adds a permalink if requested, transforms the resulting XML block with user-supplied XSLT, and ships the transformed XML back to the browser.
The field criteria are gathered and sent to the server, but filtering result sets by the field criteria is not done yet. This is the same filtering that is needed for the Viewer field search, so they will both be done together. The filter code is started but not yet working. It will use XPath queries to check if the metadata in a retrieved record matches the criteria, and reject record that don't. It would be better to do this as part of the original SQL select, but PostgreSQL does not yet have that ability.
The Export Manager module is partly working. It allows you to set some parameters, including a set of categories to filter the data on, then generates the export XML. At the moment only the raw XML is output; the XSLT transforms aren't ready yet. Also not done is selecting sets of individual Objects to export, and selecting by the content of one or more metadata fields. The field select will work much like the similar field selector in the Viewer search. How the individual Object select will work is still something of a mystery, but it will involve selecting Objects in the tree.
Downloading the resulting XML file is a bit awkward; there is no way to download and save a file on the client via AJAX methods. Instead it is a two step process: the first step generates the XML and saves it in a temporary file, then sends a response to the browser with a count of exported records and a URL pointing to a PHP module that can stream the file to the browser. Once the export response is received, a message box is displayed, containing the URL. Clicking the link starts the file download. The temporary XML file will be deleted when the user closes the message box.
Or as done as it's going to be for now. All functions are working:
- Displays a file/folder tree of selected server files under virtual folders
- Drag and drop copy/move of files, with restrictions on what can be moved/copied where
- Delete of one file or multiple files
- Rename a file
- Display of image files at actual size
- Formatted display of XML (markup) files
- Upload files via a configurable upload method (simple HTML form and multi-file Flash applet implemented, others can be added)
- Process to create thumbnail images from selected images
- Process to generate Viewer images in the configured sizes
- Permissions to restrict who can do what to what
Cleaning up small missing bits and bugs today... The administration program Artifact category editor is now completely working. In the File Manager module, drag and drop moving/copying of files from one folder to another is partly done. A few other bugs squashed. Ho hum.
Viewer: the field search is partly working. The first pass finds records with the specified keywords, but the second pass (filtering out records where field doesn't match) is not done yet, because I am not happy with the whole process. Messy, messy, MESSY! I have put it on the shelf for the moment to let my subconscious work on it.
Administration: Artifacts have a list of categories, harvested from the markup files. There was no way to manage the categories once they were in the database; now there is - a new tab on the Artifact edit form, with an editable grid of category titles, plus add and delete buttons (can't delete a category that is being used by any Object).
The Viewer search was getting too complicated, so I simplified it.
This is all online; try it at http://lettuce.tapor.uvic.ca/~scraps/viewer/viewer.php?collection=ww_one&artifact=dodds_scrap
The search toolbar now has two new buttons, marked F and C (F = fields, C = categories). When fields or categories are specified through the Search Builder (so click the Search Builder button already!), one or both buttons will light up, and hovering the mouse cursor over the lighted one(s) will display a list of the fields or categories selected. The fields and categories are no longer added to the search term input box; they are maintained internally and sent to the server when a search is triggered. The category search is working; the fields search is not quite working.
So to do a search, you can enter a search term in the search input box; a search term is any combination of keywords and phrases, optionally linked with Boolean operators (and, or, not). You can also use the Search Builder to select a set of categories; the search results will be restricted to Objects under those categories. Once it is working, specifying fields in the Search Builder will restrict the results to Objects where the term specified for a field is found in that field in the metadata. Because of the lack of XQuery support in PostgreSQL/MySQL, a field search requires two passes. The first pass concatenates all of the keywords from the search term and the fields and does a normal full text search on that, returning all Object records that have the keywords in the metadata, though not necessarily in the specified fields. The second pass loops through the pass 1 results and eliminates records where the field criteria are not met. Like I said, messy...
Phrase searching (eg: "calico cats" and green) has been implemented. In the Search Builder, the Category search is working and can be combined with the full text search. The field search generates the correct search terms, but field searching has not been implemented on the server yet (it's messy...). Searching XML fields in PostgreSQL (and probably MySQL) databases is not yet easy to do.
The search builder dialog is now showing everything it is supposed to, though the actual building of the search string is not done yet.
I have implemented the PostgreSQL full text search method TSearch for the Viewer search. It supports AND, OR and NOT, parentheses, and stemming, but (surprisingly) not wildcards. I found a PHP class that takes a friendly search string (this and that or those) and turns it into a TSearch query string (this&that|those), and also implements a hack to perform phrase searching, which TSearch does not support natively (surprise # 2). To handle wildcards, I am going to implement an optional normal PostgreSQL search with regular expressions; I am also going to have a fuzzy search option. The TSearch search is fast and works well; too bad about the wildcards.
The Search Builder is a non-modal dialog that is used to build complex search strings. You launch it from the wee toolbar on the Search panel of the Viewer. It has two tabs, plus a text area. The tabs are for Fields and Categories, both of which have a grid (the Category grid is for the moment mysteriously invisible). Each Fields grid row is a search term for the selected field, taken from the tags in the metadata XML. You can have as many fields as you want; click the "Add field" button above the grid to add another row. Select the options from the comboboxen in each row, fill in text to search for (wildcards allowed), click the Submit button, and presto! a search string is built for you. That's the plan, at least; doesn't actually work yet. The text area at the bottom is for entering general search terms (like "cat and mouse and not cheese"). That doesn't work yet either.
The demo site is functional again - it was just a configuration problem.
Working on the search and the search builder in the Viewer today. The search form is much improved, with an expandable search box, a toolbar, other cool stuff. The search builder is just an empty dialog at the moment, but it's a start. Unfortunately, the demo seems to be broken again... Works on my local system, does not work on Lettuce. Sigh...
The XSLT part of the XML Manager module is now fully functional. The DTD part is on hold until I figure out how the metadata formatting and validation should work. Not a trivial problem.
In the Viewer, I am preparing to do the advanced search/search builder thing. For PostgreSQL I will be using the TSearch2 full text search engine, which handles Boolean searches. The search builder will assist the user to create a search string, with Booleans and specific field searches. The normal search will also support these, and the user will be able to enter a complex search manually; the search builder is just to make it easier.
Working on the XML Manager module. This will allow DTDs and XSLT scripts to be set up and maintained. Everything is stored in the database. Each Collection has its own set of DTDs and XSLT scripts. The DTD (which will be a a custom sort of thing) is used to control input of Object metadata and to do validation. There are two types of XSLT: The display XSLT script is used to format the metadata for display; the export XSLT is used to transform the metadata to another XML structure for export to other systems. It will also be possible to copy definitions from one Collection to another, export them to text files, and import them from text files.
OK, now the uploader actually works. Bugs and browser silliness kept me busy on this all day. Also fixed a few other administration program bugs.
Brian Bell, head of the AlouetteCanada Open Digitization Initiative, was here for a demonstration of Scraps. He seemed very impressed, and suggested it could become part of the Alouette Toolkit, which is a planned set of software, standards and procedures for attaching metadata to digitized artifacts.
No posts recently, due to excessive late afternoon disruptions...
Configuration utility: There is a new configuration utility that sets up the initial install of Scraps. It is a wizard-style step by step interface that asks for the required parameters (mostly paths on the server) and creates the various configuration and authorization files. And no, there is no publicly accessible demo! I don't want random hackers messing things up. If you want to see it, I will show it to you.
Viewer: There is a new toolbutton that pops up a dialog with a URL that will display the current Collection, Artifact and Object. This is a permanent link URL which will also be included in exported data to allow other systems and searches to link directly to an Object.
Administration program: various bug fixes, plus enhancements to the File Manager. The file uploader works, though there are bugs left to squash. The Collection Manager is pretty much done; it just needs better metadata editing, which can't be implemented until the XML Manager is done. That module manages DTDs and XSLT code which is needed for validating and formatting the metadata.
Each Artifact has some information that is used to process and display images. This includes the image format (PNG, JPEG), and a list of sizes as a percentage of the full size. The markup loader uses this information to process image files, copying them from the dropbox folder to the Artifact's image folders, resizing as needed. The image folders are created when the Artifact is created. The user can later change both the image format and the list of sizes. When this happens, the processed image files may no longer match the Artifact's image parameters. The user will now be warned about this (before and after the change), and will be directed to use the File Manager to regenerate the images.
The File Manager now has (most of) a function that allows the user to generate sized images in the Artifact's image folders (using the same image processing code use by the markup file loader). The user can choose the source of the image files: all files in the Dropbox folder; selected files in the Dropbox folder; all files in the Artifact's 100% size folder; selected files in the Artifact's 100% size folder. The last two options allow the user to regenerate the sized images after messing about with the Artifact's image parameters, without having to re-upload the files. The regeneration process can take a long time, so the user can select sets of files to process, and can cancel the process at any time.
The File Manager module can now delete files (if the user has that permission). I have changed the folder/file tree to allow multiple files to be selected; all selected files will be deleted after confirmation. The Ext JS tree, which is otherwise marvellous, does not yet handle multiple selections very well -- you have to Control-click on the node icon, not on the text, and Shift-click does not work. I am hoping that gets fixed.
I have also started on a file uploader. Browsers have limited support for uploading, so to get multiple file uploading I am using Java applets and Flash. The system administrator will be able to configure the file upload method from several options. So far I have one (mostly) working: MultiPowUpload, a Flash-based program (free version). I will also implement at least one Java applet (JUpload), as well as the plain old HTML single file upload process.
The markup file loader is now working, with everything being loaded correctly. I think. Needs more testing. It now handles markup files being reloaded, either replacing the existing data or triggering an error, by user option.
The Image Manager module has morphed into a File Manager module, so it can work with markup files as well as images. Markup files are always in the dropbox folder, so that folder now has Images and Markup Files subfolders. Can't do much with the files yet, except view them.
The markup file loader uses the PHP DOM functions to parse the XML. There is a weirdness involving some of the namespace-qualified attributes in the IMT file; using the GetAttribute PHP function requires the namespace to be explicitly set on Lettuce (eg: xml:id, xlink:href) but not on my local system - in fact, my local system chokes it the prefix is given. This is odd. Also odd (though useful) is that accessing the same XML nodes via the PHP XPath functions works on both systems. This is good enough for me, so I changed all namespaced GetAttributes to XPath queries. Now the markup file loader works on my system and on Lettuce. Some day I really must find out why GetAttributes does not work. But not today.
I also fixed some bugs in the markup file loader, and resolved a permissions-setting issue when creating Artifact folders on Lettuce. To create subfolders in folders created with PHP, the permissions of the parent folder need to be set to 0770 (rwxrwx) not 0660 (rw-rw-).
The Image Markup File loader XML validation problem is caused by an older version of libxml on the lettuce server. The version there does not handle namespaces properly, so parsing the IMT XML fails. My local copy of the library is newer and the IMT loader works. The library should be updated next week; the demo of the administration program will usable then.
Today I cleaned up a bunch of code (even documented some of it), got some to do items done, fixed bugs, and was generally very productive.
The administration program demo is available, with limitations, at:
http://lettuce.tapor.uvic.ca/~scraps/admin/
The user name is "guest", password "guest".
The limitation is that something is broken in the Image Markup Tool file loader (the TEI XML files don't validate), so the demo Artifact has no Objects. You could create one manually... I will fix it tomorrow (I hope). I am not about to let you guest hackers into my Dodds test data, so it is cleverly hidden from you.
The other limitation is that you can't get into the User Manager module, for obvious reasons. There are also undoubtedly bugs in what you can access.
The Viewer is still available at:
http://lettuce.tapor.uvic.ca/~scraps/viewer/viewer.php?collection=ww_one&artifact=dodds_scrapThere are no significant changes in the Viewer.
The User Manager module is done. I didn't get all of the security features tested, so the administration program won't be ready for demo until tomorrow. Yes, I know I said that yesterday.
I have updated the Ext JS library to version 1.0 beta 1. Nothing broke (so far). The final version 1.0 release is due April 15.
I have built the shell of a Documentation module for the administration program. This has a tree of available documents on the left; each document will have section/chapter titles as sub-nodes. On the right is a blank area where the document text will be displayed. There will also be a search facility. All documentation will be in XML, probably TEI. XSLT will be used to generate requested pages as needed by the Documentation module. The XML will also be transformed into PDF and/or DocBook for offline viewing.
Left to do in the administration program:
- Collection Manager module - the Object metadata display/edit needs to be more friendly; the markup file loader needs a few tweaks; Artifacts need a couple of new properties; testing and bug fixing.
- Image Manager module - image sizing function is not started; file uploader not started; drag and drop copy/move of files not done.
- XML Manager module - not started yet.
- Export Manager - not started yet.
- Documentation Manager - XML formatter (XSLT); search facility.
The User Manager module is almost done; just some debugging to do. The security checks are in almost everywhere. I hope to allow guest/demo users into the administration program tomorrow.
No, not quite, but we are getting close. The security checks are in place for just about everything. The User Manager module has the beginnings of the group permission form, but it's not done yet. Collection and Artifact security is working completely now.
Putting in the global security today. Since everything has to be checked on the server to keep out silly Javascript hackers, many files need updating. It is mostly done. The last part yet to do is the User Manager groups create/edit/delete, which is easy except for all the permissions bits.
Everything done today was internal and thus invisible. Nothing to see here, folks; move along.
Security is a lot of work. Just ask George W. While we likely won't have terrorists with WMDs attacking Scraps, we still need to keep the foolish and casually malicious out. Security in Scraps is being implemented both on the client and on the server. On the client, the various buttons that trigger actions like add, edit and delete are enabled and disabled as required for the situation and the user's permissions. This keeps the user from being confused about what they can and cannot do, but it won't stop anyone with a bit of Javascript knowledge and Firebug in the browser, so permissions and appropriateness of actions are checked again on the server, where silly persons can't mess about. Unless they have server access. Which is not my problem.
Security is based on users and groups. Groups will have permissions for various actions; users do not have permissions individually, instead inheriting the permissions from the group they are in. A user can only be in one group. There is now a "super user", created manually when the system is set up, that has access to everything; this is to ensure some user can fix anything.
There is a second level of security on Collections and Artifacts that allows the Collection/Artifact owner to determine who can see and/or modify it. This is to allow several projects to use the same Scraps instance, with stuff users have no business messing with hidden from them.
The User Manager module can now create, modify and delete users. Some of the security stuff is in place in the Collection Manager. Several changes to the administration program have been done to enable security.
Filtering... Sadly, there is a problem with filtering a hierarchical structure that is built dynamically: one needs to know whether to keep a tree node based on the status of its children, when those children may not have been loaded yet. This can be done, but only by looking at all of the node's children, grandchildren, etc. when determining whether to keep that node, which would be dreadfully slow. If the node had 10 children, and each of those children had 10 children, we would have to examine 100 records just to see if the node is worth keeping. There has to be a Better Way.
Filtering is on hold.
In the administration program, the User Manager is about 40% done. I need to get the security and permissions stuff done before I can allow the administration program to be part of the demo site, which would be a Good Thing since the administration program is 75% of Scraps. The User Manager is the first part of the security system; the other parts are implementing it in the rest of the program.
I am trying to create a filtering facility in the viewer. The idea is that the filter would be applied to the Object tree, so that only matching items are shown. So, for example, the user could select one or more categories, and only Objects under those categories would be displayed. The filtering mechanism is easy, but the user interface for it is not. The filter is therefore not ready. It does have a nice button on the toolbar, though, if that is any consolation.
I also fixed a few more bugs in the administration program. I can't make it available on the demo site yet, because the security features are not all done. I don't want random strangers messing it up!
Various administration program fixes and additions. Collections, Artifacts and Objects can all be deleted. Collections cannot be deleted if they have Artifacts, Artifacts can't be deleted if they have Objects. Objects can always be deleted; deleting an Object deletes all of its children, grandchildren, etc. There were a few bugs in the Collection and Artifact add functions; I squashed them. Everything is pretty stable now.
Cleaned up the remainder of the administration program form elements, converting them to Ext JS form goodies. Added to the markup form loader; it now allows the load to be cancelled, which is a good thing since it can take a very long time.
The Collection, Artifact and Object forms are about 90% complete. The loader still needs some work, but it is about 80% complete. Overall, the Collection Manager module is about 75% complete, and the Image Manager module is about 30% complete. The viewer program has not changed much in the last few days.
Administration program:
- The image file name fields in the Object editor now have an attached button. When clicked, an image chooser dialog appears, showing the available image files as thumbnails. Selecting an image puts the file name in the image file name field. This uses the image chooser from the Ext JS library, and is very cool.
- The Object editor form now uses the form fields from the Ext JS library, so they look and work better. These fields have built-in validation.
- By deferring the creation of the action list grid in the Object editor until the tab it is on is activated, the display of the editor form is much faster.
- Fixed a few bugs, so the administration program is more stable.
The Ext JS library (formerly YUI-EXT) is a marvel; it makes impressive browser UIs a whole lot easier. Once it actually has complete documentation (it is still in beta) it will be even better! See http://www.jackslocum.com/blog/index.php.
Fixed a bug in the viewer search: When a search had already been done, and matching tree nodes were marked, doing another search did not clear the previously marked nodes. Tricky. I fixed it.
Got the thumbnail maker going in the administration program Image Manage module. Pretty slick. You'll like it.
- The stacking order (z-index) of Object rectangles can now be changed on the Object viewer page. The z-index controls whether rectangles are "on top" of other rectangles. The z-index can be changed by selecting a rectangle, then clicking the "bring forward" or "send back" button.
- Artifacts can be deleted if they have no Objects. After a confirmation dialog, the Artifact will be removed from the tree and from the database. If the Artifact has Objects, the delete button is disabled.
- The Object viewer now has zoom in and zoom out buttons.
- Various bugs fixed in the Object viewer.
- Various bugs fixed in the Artifact create function.
- The Image Manager shows all image folders and their contents correctly.
At Chris Petter's request I have produced an estimate of the time needed to complete Scraps. This came to 37 days, which is 24 days longer than I have remaining in my term of employment. Some might consider this a problem, others a challenge, still others an opportunity to keep me around a little while longer. I subscribe to the third viewpoint.
I have also produced an overview document for the proposed R. R. Bayne architectural materials project (Maltwood Gallery and McPherson Special Collections), which will probably be able to use the Image Markup Tool and Scraps. (Another reason to finish Scraps!)
The administration program Image Manager module is partly working. It now displays all image files (in a tree) for Artifacts, under the Artifact's dropbox and display image folders. It also displays the image itself, and image information, when the image filename is clicked in the tree. Yet to do is the image sizer function, rename/delete functions, and a file uploader.
I had a brief meeting with Martin Segger regarding his architectural drawing project. I showed him the Scraps viewer, and he thought it would work for him. He has some 19th century architectural sketches and drawings, as well as a set of related diaries, that are to be digitized. His students are doing research projects on the materials, and Scraps would work well to display the results. Some customization may be needed.
I have been beefing up the security features in the Scraps administration program. The existing methods of keeping bad people out were a bit weak. Some of the "servelettes" called by AJAX methods could possibly allow info leaks, and now they can't.
I also started work on the Image Manager module. This will display the image files for Artifacts. It presents the user with a directory tree made up of the dropbox and sized image folders on the server (the user can't see other files). There will be facilities to view images, resize them, copy, move and delete them, and upload them to the server.
Administration: Several bugs fixed today. I also got image processing during markup file loads working. This looks for the image linked in the markup file, sizes it as needed, and stuffs the sized images into the appropriate folders. This functionality will also be part of the Image Manager when (if?) it gets done.
Viewer: Fixed a few bugs. Also added the "link" action: clicking on an item with action set to link will cause a hyperlink to the specified page. By default the new page loads in the same window; holding down the shift key while clicking loads it into a new page or tab. Try it in the demo by clicking/shift clicking the picture of Dodds at the left on Page 0 - 1.
Viewer: the "drill down" functionality is now all working. Clicking on an Object (that has been enabled) will display the image for that Object, and will enable the "parent Object" button that takes you up one level. Clicking on an Object that has been marked as being a multi-part Object (e.g. multi-page booklet) will display the first part; clicking the next/prior buttons will go to the appropriate page. This has been implemented in the Scraps demo: go to Page 0 - 1 and click on the "Divine Service" booklet (middle of left page). Clicking the "up" button will move up to the "Divine Service" Object, then the "Page 0 - 1" Object.
Administration: the "add Object" function is working, except for actions, which don't get posted to the server.
Also a few bugs fixed here and there.
Demo: http://lettuce.tapor.uvic.ca/~scraps/viewer/viewer.php?collection=ww_one&artifact=dodds_scrap
Administration program: all of the Ext 1.0 upgrades are done, and the Object create function mostly works. There is still a problem with getting action list changes posted to the server.
Viewer program: if an Object is multi-part (e.g. a multi-page booklet pasted onto a scrapbook page), clicking that Object will go to the first sub-Object of that Object, and the navigation buttons will go to the next and prior sub-Objects. That is (using the multi-page booklet example), clicking the booklet Object on the scrapbook page will take you to the first page of the booklet, and you can click the arrow buttons to move to the next and prior pages of the booklet. This is sort of working, though there are a few glitches. (Of course this only works if the Object data and actions have been set up to do it.)
The viewer is now Ext 1.0 ready, and the administration program is almost there. The revised viewer is now online in the demo site. This means I can get back to adding features instead of just getting features working again.
The viewer program is now working completely with the Ext 1.0 library code (that is, as completely as it was with the .40 code). The administration program is mostly working with Ext 1.0, but there are problems with the action list editor grid, and a few cosmetic problems. All will be resolved soon.
Also found and squashed a few bugs and cleaned up some messy code.
Sorry, nothing new to see today; it was all internal changes. Maybe tomorrow.
The YUI-EXT library, now called Ext, is approaching its version 1.0 release. There are many changes from the version 0.4 I have been using, so today I decided to bite the bullet and upgrade (have to do it sooner or later). For the most part it is not difficult to make the changes, but there are a few areas causing me problems. However, the viewer program is mostly working under Ext 1.0, and now that I have most of it figured out, the administration program should be a faster upgrade.
I fixed a few bugs in the viewer search results processing. Also added buttons for "first match"/"last match".
In the administration program, I modified the markup file loader so that it can keep the user informed about progress. Previously, it sent the complete list of selected files to the server, where they were all processed and the results returned in a batch. Now the client side creates a list of the selected files, then sends them one at a time to the server. While the process is going on, a modal dialog box appears (so the user can't mess with things), with a progress bar that marches across as the files are completed. The status for each file is also displayed as they complete. There will also be a Cancel button on the dialog, which will cause the process to halt after the current file is complete.
The viewer program is now about 80% complete. The administration program is not so far along, at about 50% complete.
The viewer search client-side functions have been enhanced. Clicking a row in the search results grid will select the Object in the tree; display the metadata; and load the Object's image, or if it doesn't have one, load its parent Object's image and highlight the Object's rectangle. The matched Objects will be marked with a different icon in the tree. On the tree toolbar are two new buttons, 'select next match' and 'select previous match', that move through the matched Object's, selecting and highlighting as appropriate. The search back end has not been changed, so it still does a boring keyword search.
In the tree, when clicking Objects with no image of their own (i.e. they are just rectangles on their parent image) - which were formerly disabled in the tree - will now load their parent Object (if necessary) and highlight the Object's rectangle.
All of these enhancements are in the online demo.
Also fixed a few messy bugs, made some icons, and was generally productive.
Simple search is working, with limits. It only searches for single keywords, and finds them anywhere in the metadata, even in the tags. In other words, the search backend is crude. It will support Boolean operators, phrase searching, maybe fuzzy search, etc. The advanced search will add searching limited to specified tags in the metadata.
The client side is farther along. The Search panel has a text field; enter a keyword and press Enter to start the search. Search results (if any) will appear in a grid below the text field. Clicking on a row in the grid will select the corresponding node in the tree, will load the Object's metadata, and will load the Object's image if it has one. All of the matched nodes will also be marked with a different icon in the tree (note: I seem to have broken that... fix tomorrow). Yet to be added are buttons that let you move to the first, next, prior and last matched nodes in the tree.
The demo data has been cleaned up a bit. Any Object that does not have an image (most of the second level Objects) will have its tree node disabled; clicking a disabled node will do nothing at the moment. This will change soon, so that clicking an Object that does not have an image will cause the parent Object's image to be displayed, and the clicked Object's rectangle to be highlighted.
The (limited) search is available now in the online viewer demo. Click on the Search tab at the bottom left to begin.
http://lettuce.tapor.uvic.ca/~scraps/viewer/viewer.php?collection=ww_one&artifact=dodds_scrap.
I have started work on the viewer search function. This is not the lamented "quick find" but a full search of all metadata fields. The actual searcher is crude so far - it just finds the entered word anywhere - but will become more sophisticated. Ideally the user will be able to search any metadata field using Boolean operators, regular expressions, and other goodies.
Displaying the search results is tricky. At the moment the search just causes the tree icons for found Objects to change to indicate that Object matches the search criteria. There will also be a grid of search results (with KWIC?) and a "next match/prior match" set of buttons to move through the matches. In principle the Object tree could also be filtered to show only matching Objects.
I built a "quick find" for the viewer, to find titles in the Object tree. It works, but... it can only find Objects if they have already been loaded, and they are only loaded if the parent Object has been previously expanded. Sigh... This will require further thought.
I added some buttons to the header of the administration page. They don't do anything yet, but are intended to load the other administration function pages (Image Manager, Schema Manager, etc.). Those functions don't exist yet, which is why the buttons don't do anything.
Also fixed a few bug and cleaned up some messy code.I have updated the viewer program to show the tree and the metadata at the same time. It was a bit annoying to have to switch between them all the time. The "west" part of the viewer now has two panels: tree on the top, metadata and everything else in tabs on the bottom. There is a splitter between them to allow them to be resized. The bottom panel can be collapsed; I haven't figured out how to do that for the top panel (the layout manager won't allow all of the panels to be collapsible).
Also, the selection in the tree now tracks the visible Object when the arrow buttons are used to navigate. Nodes in the tree are disabled if the Object doesn't have an associated image to display. Note that because the data is wonky, some of the nodes that should be disabled aren't, so clicking them displays a useless second copy of the parent Object image. I will fix the data "soon".
Also some bug fixes done in both the viewer and administration programs.
In the demo site, try going to page 2-3, click on the half-hidden photo of Dodds (to the right, the one that pops to the front when hovered over), then click on Dodds to get to the next image, then click on Dodds's boots. Just shows how you can drill down several levels.
The markup file loader got broken when I switched to the new GUI. Now it is working again, better than ever. It can load markup as child records of any Artifact or Object, and creates a set of actions for each Object. Options on the loader panel allow the default actions to be set as needed. I also fixed problems with loading the child Objects, which were getting the image name and other properties from their parent, which made no sense. This is why when many of the child Objects in the tree view in the viewer demo are clicked, they display their parent's image, but have no rectangles, which is confusing. The child Object images are supposed to be the full size image of just that Object (the image that can be shown when the Object is clicked), but these can't be loaded automatically, since the loader has no way to know where they are - there is no link to them in the markup file.
While the metadata schema maintenance tools are not yet done, I needed someplace to stash the XSLT used to format the metadata for display. The schema table created for each collection seemed like a good place for it, so I added a 'display_xslt' field to it. A future maintenance tool in the administration program will deal with the schema table; right now it has to be maintained directly in the database.
Administration program: the Object edit function is working, except for metadata editing which is waiting until I figure out the metadata schema issue. Creating new Objects isn't ready yet. There are also several additions to displays of Artifacts and Objects, and a bunch of internal stuff.
Viewer program: the zoom in/zoom out functions are working. This is a simple "make it bigger, make it smaller" system. The administrator defines a set of sizes for an Artifact, as percentages of the full size image, and the viewer user can step from one size to the next. The viewer user doesn't work with percentages, just "bigger" and "smaller". The reveal function is now dynamic (the reveal file name was hard coded for testing). The administration program is used to define the reveal image for an Object.
Images: Scraps uses many images. There is an image for each "parent" object, plus reveal images and child Object images, with one copy of each image for each zoom size. The image folder structure is created by the administration program for each Artifact. The top level folder is named with a concatenation of the Collection prefix and Artifact prefix. Below that is a set of folders for each size, and within them a folder for reveal images. The size folders are named size01, size02, size03, size..., with the full size (100%) images in size01. The viewer can then find the correct image file by knowing the file name (from the Object data) and the current size index (01, 02, ...), without caring what percent zoom it is.
Mostly internal work today, filling in missing bits. The viewer program now can display the formatted metadata, and actions all work. The Object create/edit forms are working; they post back to the server, but Objects are not yet correctly updated (validation does work). The XSLT for formatting Dublin Core metadata needed a few tweaks; it is still a bit crude, but it works well enough.
The Object panel in the administration program now shows the full Object data, including the metadata and actions list. The edit and create forms also display, but don't yet post changes back to the server. The metadata editor is not ready, so for the moment the metadata tab just displays the raw XML in a text area input field.
The action lists can now be posted to the server, where they are updated correctly in the database. I have made a slight change to the action list actions, splitting some combined ones into separate actions to allow for finer control. The Highlight action has been split into Highlight, Hide Highlight and Select actions; the Reveal action has been split into Reveal and Hide Reveal actions; and Show Metadata has been split into Show Metadata, Show Metadata Delayed, and Hide Metadata actions. Any action can be connected to any trigger (mouse click, mouse over, mouse out), though some combinations would be silly.
I have built a somewhat rudimentary Object metadata formatter, to allow the display of the metadata in a readable form. This uses the PHP XSLT processor functions to transform the raw Object XML into XHTML for display. I have built XSLT for the Dublin Core metadata. The display is used in the administration program and will be used in the viewer program. The XSLT will be provided by the Scraps user to format arbitrary XML metadata as desired; it will be stored in the database, with an administration program front end to maintain it. There will be a few prebuilt XSLT stylesheets available, probably just Dublin Core and METS.
Bit more work on actions and action lists. The administration program now displays action lists for Artifacts and Objects. Object properties are also displayed. The viewer program now handles actions, more or less correctly.
It is noon and I am going home with a cough that everyone says "sounds bad". It feels worse than it sounds.
The Action List editor component is now in the Artifact edit/create form. It now has drag and drop reordering of grid rows. There are also a few updates to the rest of the forms (e.g. resizable text areas), and a clump of new internal code.
The next big issue is how to handle the XML metadata for Objects. The metadata is now created in the Image Markup Tool as free-form XML; the user can enter anything, as long as it is well-formed XML. The XML is not validated against a DTD or schema, and there are no constraints on tags, data types or content. This makes it exceedingly difficult for a program to work with the data, since there is no way to know what any part of it represents.
The original plan was to use DTDs or XML schemas to regulate the metadata. After studying the Dublin Core and METS DTDs/schemas, I have come to the conclusion that they are way too complicated, while not providing all the required features. Still, some sort of schema will be needed - schema in this sense not meaning W3C XML Schema Language, but a custom schema/descriptor language, XML based, that provides the resources I need while eliminating the complexity of "standard" descriptor languages.
I will be defining this over the next few days, but as a general outline the schema language will need at least the following:
- A way to define element names
- A way to define element labels (for display)
- A way to define element validation rules (data type, required data, etc.)
- Ability to handle nested elements
- Ability to handle attributes
- Ability to handle mixed markup/text data (like TEI)
- Ability to handle unstructured data
The development of this schema language is needed before I can write the components to handle the metadata in both the administration and viewer programs.
The Action List editor component is now working. It displays the action list in a grid, and allows fields to be changed. An attached toolbar has buttons to add and remove actions. The list can be put into read-only mode so actions can be displayed but not changed. The action list also gets posted to the server correctly. The only thing left to do is the drag and drop reordering of action list rows in the grid.
Actions are the things that happen when a user interacts with sub-Objects in the viewer. Three action triggers are defined: Mouse Over, Mouse Out, and Mouse Click (more are possible, like shift+click). Each Object and sub-Object can have a set of actions, which are executed when the trigger event occurs (e.g. the user moves the mouse over a sub-Object). Various things can happen when an action is triggered, like highlighting the Object, showing metadata, revealing hidden Objects, and several others.
The Action List editor component is well under way. It displays the actions in a grid, which has inline editing to allow the user to change the values. Changes are validated automatically. Left to do is sending the modified action list back to the server to update the database, and a toolbar to allow actions to be added and removed. The Action List component is created dynamically as needed, and loads itself with data automatically, so it can be used where needed.
The problem with upside down tab panel tabs has been resolved - it was a CSS error. All of the form panels now have tabs to separate fieldsets. A problem with enabling and disabling toolbar buttons when editing Collections and Artifacts has also been resolved.
This AJAX stuff takes some getting used to. Today I have been struggling with the concept of loading HTML forms dynamically into dynamically created tab panels. This is needed because some of the forms are too big to just splash across the page. It is sort of working, but it is a bit more complicated than I like.
I also started working on the action list editor, which is used for Artifacts and Objects and by the Markup File Loader. Since it is used in three places, it will be generated by a PHP module that can be called via AJAX. I am planning on implementing it as a grid where the fields can be edited in line.
The Collection form is entirely working, and the Artifact form is just missing the action list editor. The Object form isn't started yet, but it should be relatively quick. It will use the action list editor, and a new metadata editor/displayer that will also be used by the viewer application.
The viewer and administration programs have both received some enhancements, mostly internal. The viewer now displays an "Artifact notes" page when the Artifact is selected in the tree; the Artifact node is automatically selected when the tree is loaded. The forms in the administration program will be inside sets of tabs so they take up less screen space and are easier to use. The Collection edit form does that now (though for some reason the tabs are upside down!).
The demo site is not yet on the server; the server is not ready. Chris Petter was here to see a live demo, so I guess I met my "demo by Friday" target.
I have pretty much finished building the viewer object. This is embedded in the administration program. I also cleaned up some more of the administration program and squashed some bugs.
Using the objects I built for the administration program, I started on a sample viewer program. Using the YUI-EXT library, it took about 3 hours to build. It doesn't do all that much yet, but it does display Objects and sub-Objects (with highlighting, etc.) and an Object hierarchy tree. The navigation buttons (first, next, prior, last) also work. No metadata yet.
Most of today was taken up with turning my existing Object viewer and other code into PHP classes and Javascript objects. This encapsulates the properties and methods, and makes it easier to use the same classes and objects for both the administration program and the viewer program.
The Javascript code for all of the functions that are used by the Object viewer component are now in a single Javascript object (ObjectView). There will only be one of these objects at any time, since only one Object can be viewed at a time. The ObjectView object keeps track of which sub-Object is highlighted and/or selected so other functions can just say "highlight that" and ObjectView deals with highlighting it and removing the highlight from everything else.
The Object viewer component itself is a block of HTML code that is retrieved from the server via AJAX calls. It consists of an image (the Object image) and a set of rectangle divs, one for each sub-Object. The rectangle divs have event handlers for mouse-over and/or mouse-out and/or mouse-click events, which allow the user to interact with the rectangles. All of this is built dynamically, with the same builder used for both the administration program and the viewer program. The event handlers are generated by a set of user-selected actions that can be set up for each sub-Object. This allows the possible interaction methods to be expanded easily.
Still on track for a demo site by the end of the week!
Object viewer is working, at least in the administration program, which is a start. It is not fully implemented, but it does display the Object and sub-Objects, with highlighting rectangles and other stuff. All of the Object actions need to be combined into a Javascript object, so they can be reused by the main viewer. Some of the other old Javascript needs to be cleaned up; then I can produce a viewer object that can be used by both the administration program and the viewer program.
The administration program clearly needs optimizing. It is slow to load, and some of the actions once it is loaded are also slow. Optimizing will mean consolidating Javascript code, and only creating components the first time they are needed; right now most of the components are created at load time, even though many of them are not visible yet.
The administration program Collection and Artifact display, add and edit functions are all working now. They need a few tweaks and improved error handling, but basically they are ready.
The scrolling problem is fixed. All of the regions now scroll as they should. There are several layers of scrolling support, and the trick is to find the right ones to use.
Artifact property display, and "new" form and "edit" form display are all working. Some of the backend code is not entirely stable yet. The markup file loader is very close to working; I just need to add the function to load the markup items as children of another object.
My current goal is to have some sort of demo available by the end of the week. It won't have all the features working, but the administration program and viewer should be usable, though maybe not pretty.
Well, some forms are working. I can now post a form via AJAX, have it processed on the server, and get a response back. This has meant repackaging a bunch of (previously) working code to return JSON-encoded packets instead of raw HTML fragments. The packets include a status flag and messages along with the HTML fragment, so the client side code can tell if the form processing succeeded or not. If it was not OK, the status messages can be displayed.
One problem I have not yet solved is the scrolling of fixed height divs when the content is too big to fit. The YUI-EXT package is supposed to handle this, but I can't get it to work consistently. I have posted a message on the YUI-EXT forum asking for help.
The "create Collection" function is now working again. Edit is not quite ready, and the Artifact create and edit still need repackaging. Once all that is done, I will have much of the code I need to do the Object functions.
Some day I will put up a demo site for all to marvel over, but this is not that day.
... if I do say so myself. The administration program is looking more like a traditional desktop application all the time.
I made a slight change in how the Collection and Artifact functions work. Previously, when you clicked on a Collection or Artifact in the tree, the edit form for that item would be displayed. That was not very elegant and was potentially harmful, since you could change things without meaning to. The new procedure is to show the Collection or Artifact properties in a list on a click in the tree. The list is not changeable. There is a new Edit button to go with the New button; clicking one of these fetches the appropriate form data from the server and puts the interface in "edit mode". While in that mode, most other functions are (or will be) disabled, so you have to explicitly either save or cancel the form before you can continue. While in edit mode, two new buttons, Save and Cancel, are visible. Save will post the form to the server; Cancel throws the form away and reloads the property list.
Some functions are enabled or disabled depending on the state of the application. For example, when a Collection is selected in the tree, the Collection tab is fully enabled, the Artifact tab only allows Artifacts to be created, and the other tabs are disabled. Clicking on an Artifact fully enables the Artifact page, and also enables the markup file loader, which requires an Artifact or Object to be selected. This keeps the user from messing about on pages that are not appropriate at the time.
So, at this point these things are working:
- The tree is fully functional in read-only mode (no drag and drop yet).
- The tab panel containing the Collection, Artifact, Object and other pages is functional.
- The toolbars on the Collection and Artifact pages react to changes in application state as they should.
- The Collection and Artifact forms load correctly from the server; posting them back is not working.
- The Collection and Artifact property lists display correctly.
- The markup file loader retrieves and displays a list of available files in the correct Artifact drop box. The loading process has not yet been integrated into the new interface (the code does work, though).
Still working on the administration program... In case you were wondering (and I know you were) why the administration program is taking so long, it's because that is the biggest part of Scraps. The viewer is actually relatively simple by comparison, and will use some of the components developed for the administration part. Now you know.
Today I got more bits of the new interface working. It can now display the full Collection - Artifact - Object tree (with pretty icons), load the Collection and Artifact creation and editing forms, display the list of files for the markup file loader, and control all of it transparently to the user. Next I will get the forms and markup loader working again; they broke when stuffed into the new interface, but should be easily fixable. Then it's on to the Object functions.
Worry not, impatient reader, you will see all this on a demo site in due time. If you want to see it now, you will have to visit me!
The administration program is moving along, using the new interface. It is proving relatively easy to package my existing code for the new AJAX style of processing. The tree panel is working well, and the Collection, Artifact and Object panels are partly working.
Most of today was spent learning to use the YUI-EXT library, which is complex. It is well documented at the class and object level, but there is little "here's how you do it" documentation, so one is left to analyze the examples for clues. A steep learning curve, but worth it, I think.
I have started using the marvellous YUI-EXT library for the administration program. Almost all of the code I have written will plug straight in to the new interface, though some will need to be repackaged. The new interface is fully AJAX, so some code that was being called procedurally needs to be encapsulated in appropriate AJAX wrappers. The new interface is remarkably easy to code for, once the basic concepts are understood. Setting up the layout involves only a half-screen of Javascript code and a bit of XHTML. So far I have the hierarchy tree working right from the Collection level to the Object level. Next I need to plug my existing code for creating Collections and Artifacts into the proper places, and modify the markup file loader to link with the tree.
This new interface resolves several problems with the old interface, so things should progress more quickly now.
I am also going to use the YUI-EXT library for the viewer, so I can re-use some of the objects I have built/will build for the administration program. This will replace the existing viewer prototype, which is little more than a test environment, though as with the administration program most of the existing viewer code can be plugged into the new interface.
Looks like I've decided to use the YUI-EXT TreePanel widget. I have implemented it in the administration program, and it is slick. Having a way to display all of the Objects in an Artifact in a tree view will make it much easier to work with Objects. The tree will be used in the administration program to:
- Select an Object to load sub-Objects under
- Select an Object to change the control properties of (action, type, etc.)
- Select an Object to modify the metadata of
- Rearrange Objects to set their display sequence and stacking order (using drag and drop)
The tree will also be used in the viewer as one way of selecting the Object to view and to navigate through the Object hierarchy.
I will probably also use the YUI-EXT layout widget, which is part of the same Javascript library as the TreePanel. I may use it for the viewer as well, at least as one possible template.
Started work on Actions, which are what happens when the user clicks on an Object or hovers the mouse over it. Each Object can have multiple actions which are executed in sequence. The defined actions are:
- Show metadata - metadata appears in its window after a short delay
- Show object - the object is shown, replacing the parent object
- Reveal object - objects hidden behind other objects are brought to the front
- Show popup - shows the metadata in a popup near the object
Show metadata, Show object and Reveal object are partly working. Reveal is cool!
The Scraps data is hierarchical and so is best presented as a tree. The administration program needs to show the Object tree for several functions, and the tree needs to support moving Objects around via drag and drop. There are two open source Javascript tree widgets that have the required facilities: TafelTree and YUI-EXT TreePanel. TafelTree is more mature, but TreePanel is much more sophisticated. I spent some time today looking at both; I leaning toward TreePanel. Stay tuned.
I also got more of the administration program working, and added functions to the Object class to handle the next, prior, first and last actions in the viewer. The prototype viewer now supports moving from object to object, displaying the Object title list, and displaying (raw) metadata.
Getting there ... slowly. Today it seemed like two steps forward, two steps back, turn left, take one baby step, repeat. There are conceptual challenges to deal with, and they are time consuming. Still, there was some progress.
I added a couple of fields to the Artifact table: image_type (PNG, JPEG, etc.) and image-sizes (the percent scaling factors to show the base image at various sizes). This required modifications to the Artifact management functions.
I spent some time figuring out how to best handle the Object hierarchy. I have started an Object class, which will encapsulate all the properties of the current Object and its immediate children. This class will be responsible for generating the image with its overlaid rectangles and their actions. This is the core of the Object display process, so once this is done things should progress faster.
I have been working on the process for loading IMT files into the Scraps database. Processing the IMT files for a project one file at a time would be a pain. A batch process is preferable, but this means all the files to be processed in the batch need to be on the server.
There are limitations that make this difficult. The IMT files will be on a local machine. Browsers have severe restrictions on what they can do with a local file system. The single file upload form input tag is all there is; there is no way to select multiple files for upload using just the browser. There are Java applets available that will upload multiple files, but Java applets are not accepted by everyone. The HTML POST method also has restrictions on maximum file size, as does PHP on the server. The best upload method is FTP (or secure FTP or SCP), but that requires an FTP/SCP client on the local machine, and requires that the user have access to the server.
So... Scraps will take the easy way out: the user is responsible for getting the files onto the server. The process will then look like this:
- During Scraps configuration, a "drop box" folder is set up on the server. The folder needs to allow writes only, though whether it has read access is up to the user.
- The user creates an Artifact. Part of the creation process creates a new folder under the configured drop box folder. The new folder is named with the concatenation of the Collection prefix and the Artifact prefix. Therefore, each Artifact has its own drop box.
- The user uploads the IMT files to the drop box for the Artifact. How is not Scraps's concern, though if there is time in this project there may be a function in Scraps to do it.
- The user opens a Collection and an Artifact.
- When the user goes to the Load Markup page, a list of the XML files in the Artifact's drop box is displayed as a series of checkboxes. The user checks the files to be processed, and clicks the Load button.
- The files are processed one by one. Error messages are display if there are problems. The number of objects loaded from each file is displayed at the end.
- The processed files are (optionally) removed from the drop box.
Batch loading now works, but is not complete. So far only the first level of the object hierarchy can be loaded. There will need to be a way for the user to specify the parent object that the objects in the file will become children of; I have not yet worked out how that will be done.
I have also done some work on the configuration of Scraps, and created a process to display are report on Artifacts.
Sorry... no demo site this week.
Added a field to the object table to specify the object type. There are two types: SIMPLE and MULTIPART. A SIMPLE object is one that is a single thing, without parts (e.g. a photograph), that may be marked up but physically is all one thing. A MULTIPART object is one that can be further divided into parts (e.g. a booklet, a multipage letter), and the parts can be marked up individually. The child objects of a SIMPLE object are derived from the markup of the parent object (e.g. each marked up person in a photograph), taken from the same IMT file as the parent (i.e. the IMT file that defines the parent). The child objects of a MULTIPART object are a sequence of the parent object's parts, and each is derived from a separate IMT file that defines that part and its markup. Either type can have children and grandchildren that are either SIMPLE or MULTIPART.
Scraps objects at a given level in the hierarchy have a specific sequence. An example of the sequence is the pages in a book; page 1 is followed by page 2. While Scraps does not define what the sequence represents, it does maintain the sequence of objects. To accommodate the batch loading of IMT files into Scraps, I have added a facility to determine the sequence from the file name (e.g. dodds_sb_0001, dodds_sb_0002,...) or from a tag in the IMT file itself. This needs further work.
Various other refinements to the admin program were also finished today.
Today I got far enough with the administration program to load data into a test database, and also roughly modified the Scraps prototype viewer to display that data. The data isn't complete, there are still issues to be resolved, and the display isn't pretty or fully functional, but it does show that the basic Scraps concept is workable.
Perhaps by the end of the week I will be able to put up a demo site...
The Collection and Artifact sections of the administration program are now basically working. There are some functions that are just roughed in for now, so that I can carry on with development. The goal is to be able to load IMT XML files into the Collection - Artifact - Object hierarchy so I can test the basic concepts, before locking in with code that may need to change.
I also spent some time looking at XML Schemas and RelaxNG schemas, since Scraps will need some sort of schema to control the metadata. Upon examining the very complex METS schema and the less complex Dublin Core schema, I began to think full XML Schemas are going to be way too messy to work with, and perhaps RelaxNG would be better.
The choice of schema structure is important because it will not only be used to validate the metadata, it will be used to generate HTML input forms to modify the data, HTML tables for reports, and various HTML/CSS stuff to format and display the metadata in the Scraps viewer. Whatever schema type is used, it has to support data typing as well as XML structure control. My understanding of how all this will work is as yet a bit fuzzy.
Much frustration today, trying to get PHP objects to behave as I want them to. The problem is still with embedded objects (objects referring to other objects) not being serialized when they are stored in a session. This means the embedded object has to be re-instantiated each time, which is a pain.
Started working on the Artifact functions, which are more complex than the Collection functions. Artifacts will define the metadata schema, so I also spent some time (re)learning XML schemas. The idea is that the metadata will be described by a schema, which will be used to generate update forms in HTML, and maybe in IMT. I was hoping to find some PHP code for a schema generator GUI, but no luck, so I will have to write one if Scraps is to have one. The other option is to force the user to create the schema outside Scraps, using a tool like Oxygen, and just load the finished schema into Scraps. Some schemas (e.g. Dublin Core and METS) already exist, and they are horrible long things, so maybe the external creation is the way to go. Comments?
The Collection maintenance functions of the administration program are mostly complete. Missing is a function to delete a Collection, a dangerous operation that needs extensive safeguards. Creating, opening and modifying a collection is all working.
I have also revised the user log in process to use the Authorization object instead of session variables. The Authorization object contains all of the information from the authorization XML file, plus control information that is set when a user logs in. The Authorization object is saved as a session variable to maintain the log-in status of the user between requests.
I was saving the Collection DOMDocument object (produced when a Collection XML file was loaded and parsed) as a property of the Collection object, so it would only need to be parsed once. However, when the Collection object is serialized upon being saved to the session, the DOMDocument object gets lost. This means the XML file needs to be parsed each time a Collection object method is called that needs the DOMDocument object. I think I have read something about objects embedded in objects and session serializing, but I can't find it at the moment, so this slight inefficiency persists.
The administration program can now successfully create Collections, including the writing of a valid Collection XML file and the automated creation of the five required database tables. All validation of form data and error handling also works.
The database and collection classes have been updated with several new methods. A new PHP library was started, to handle form processing tasks (validation, set up, etc.).
This post is actually for 10 Jan 2007; if I'd have written it up yesterday, I'd have missed my bus...
The form data input on the Create/Change Collection form is partly validated client-side and partly server-side. If there are errors in the form data, the field in error is highlighted and a short error message appears next to the field label. Hovering the mouse over the message shows a longer error message. The validation of the Collection form is strict, since the data relates to the structure of the database.
I have created several new library functions to support validation and error reporting for forms.
Part of the validation is an attempt to connect to the database with the connection parameters provided on the form. During testing of this, I discovered that the PHP PostgreSQL connect function (pg_connect) only returns FALSE if the connection fails, but does not supply error codes or messages to say why. It is possible to let the raw PHP error appear in the browser, but that is ugly and unfriendly. So far, I have found no way to capture that raw error message so I can deal with it properly.
Met with Chris Petter to discuss the overall conceptual design. Chris had some concerns with the structure and metadata, mostly due to a miscommunication as to what the Collection->Artifact->Object diagram represents. It is the structure that the Scraps engine will work with, and has nothing to do with the metadata structure. The Scraps engine is entirely agnostic with regards to the metadata; it sees it as a block of text to be stored, possibly validated, and provided to shells above the engine.
- 1
- 2