Having previously looked at the Word Add-in deposit tool, this post illustrates the second of the deposit tools developed in the DepositMO project, the Watch Folder, which uses common file manager services.
Computer systems provide users with file manager tools, such as Windows Explorer or Mac Finder. This organises lists of files, and folders containing files, stored on the computer. Mostly these are fairly static services. Users can save files to designated directories and folders, and can move and copy files to different locations using short-cut keys of drag-and-drop.
We want to make use of this process of copy or drag-and-drop to initiate repository deposit. It works on the basis of a ‘watch folder’. Essentially this folder contains a script that monitors user actions in adding files or folders to the directory containing the watch folder. Figure 1 shows the active directory containing the watch folder, and also the script that runs when you click on the watch folder.
Fig.1 Active directory containing the Watch Folder script
When a new file is added to the directory containing the watch folder the script initiates a session with the selected repository and copies the file there as well. To complete this process the general script needs some information from the user, the same information used in the Word Add-in example:
- Direction, or url, for the repository
- User login for the repository
This information is provided via a simple text form that is launched by clicking on the CONFIG file in the same directory (see Figure 2). This information only needs to be provided once per user per session with the script running, not for each new file deposit.
Fig. 2 Opening the Watch Folder CONGIG file to specify repository direction and user’s repository login
The watch folder ‘watches’ for changes to all folders in the directory. When a user adds a new file to a ‘watched’ folder, either a new or existing folder in the active directory, within a few seconds the script automatically adds two new files (Figure 3): METADATA, and VIEW_ITEM.
Fig.3 Adding a new file to a ‘watched’ folder generates a METADATA file and a VIEW_ITEM link file
Clicking on METADATA shows an XML copy of the metadata record for the object (content of folder and files) stored in the repository. The user can edit and save the XML record to update the metadata in the repository.
Clicking on VIEW_ITEM will link the user to the real repository record in a Web browser.
In this scheme, a folder in the active directory containing the watch folder represents a record in the repository, and a file in that folder represents an object linked from that record. Thus, folders can be used to organise collections in the repository, for example, adding two images to a folder will link both images to the same repository record. Hence, creating a new folder will correspond to a new record in the repository; an existing folder to a current record.
You can download the Watch Folder script (folder sync client) from our collected project resources. Note, this is not a formally packaged application for easy installation, unless you are comfortable working with perl scripts. For the brave a short ‘getting started’ guide can be found close to the download link for the script.
In principle, this was designed to be a simple way to deposit any file in a repository using basic drag-and-drop and copy commands, and add/update metadata, on the user desktop. Would it prove to be as simple in practice?
The Watch Folder and Word-Add-in are the two user-facing tools developed in DepositMO, but to work effectively these tools need to communicate interactively with repository servers, or repository ‘endpoints’ as they are known in the SWORD community. It is SWORDv2 that enables this communication between endpoints and user applications. The next three posts will consider SWORDv2 and how DepositMO has shaped and extended this standard for different repository softwares, DSpace and EPrints.