Mario Valle Web

DescEditor

A file collection metadata editor

What is DescEditor?

DescEditor is a very simple database to keep track of the content of a directory tree. Each file has an attached description plus some other (user defined) metadata. The editor supports the manipulation of those descriptions.

The collection description is contained in a distributed database composed by a XML file (called .desc.xml) for each directory.

Why I started DescEditor?

I have a huge collection of chemistry files for demo, bug fixing, testing, etc. and I started loosing track of what each file is and why it is here.

Download DescEditor

The current DescEditor version is: 1.1.1 (14.02.2007) and is available as DescEditor.zip (Windows friendly) or DescEditor.tar.gz (Linux friendly).

The program requires Tcl/Tk and relies on TinyXML compiled as a Tcl extension. For now this library is provided as DLL (Windows) or Dynamic Library in the Linux kit. As soon as I have time, I will dig out the wrapper.

Setup

One environment variable should be defined before using DescEditor:

DESC_EDITOR_ROOT  directory where DescEditor is installed

To invoke DescEditor you can use run.bat or run.sh as an example, or run desc-editor.tcl under wish, the Tcl visual shell.

Invoke DescEditor a first time on a new collection to copy the necessary configuration file in the collection root directory. To do so invoke DescEditor with the collection root directory on the command line, or select the root directory from the menu with File → Set root… or define the environment variable DESC_EDITOR_DATA_ROOT pointing to the collection root directory before starting DescEditor.

Then select Tools → Edit configuration to edit the collection configuration file. This file lives in the collection root directory and is called .desc.cfg

The format of the file is described by the embedded comments. Remember that it is a Tcl source file, so the syntax should be strictly adhered.

For the Generate HTML functionality to work, you need the XSL processor XT. The XSL program to convert a .desc.xml file to .desc.html should be adapted to the file description you defined.

Usage

  1. Set the collection root directory on the command line or select the root directory from the menu with File → Set root… or define the environment variable DESC_EDITOR_DATA_ROOT pointing to the collection root before starting DescEditor.
  2. Navigate in the collection using the tree widget on the left.
  3. If a directory is selected (rendered in red) you can setup the general info related to this directory in the "Group" area on the right. Save the changes using this section’s Save button. If you move without saving the changes are silently lost.
  4. If a file is selected (rendered in green) you can set the information related to the selected file in the "File" are on the right. Save the changes using this section’s Save button. If you move without saving the changes are silently lost.
  5. To view the file content (the first megabyte only) double click on its tree entry or select View → View current file
  6. To copy the selected file use the "File manipulation" area selecting the destination directory. This area is useful also for copying the full path to the collection file.
  7. To move a file inside the collection, mark it with the "Mark" button, then navigate to desired directory and press "Copy". To remove the mark, simply press "UnMrk".
  8. To permanently delete a file, select it and press "Delete".

Create a HTML index

This functionality is launched by Tools → Generate HTML and creates an index page with a tree structured TOC to navigate the collection.

The tree navigation uses JavaScript. The code is from www.destroydrop.com/javascripts/tree and is authored by Geir Landrö.

Clean the collection

If fields are added or removed from the configuration or files are moved or deleted, the various XML files could start accumulating detritus. To clean them use the function Tools → Remove orphans.

This function saves the existing .desc.xml file to the backup copy called .desc.xml~ and creates a new .desc.xml file with only existing files data and fields described in .desc.cfg

Other operations

  1. Import a file into the collection: Use File → Load File… to import a file in the currently selected directory.
  2. Export a file: Use File → Export… to create a short XML file that contains all the info related to the selected file
  3. Import a file: Imports a metadata description previously exported with the Export function.
  4. Refresh view: Use View → Refresh view to synchronize the editor content with external changes made to the collection

Future and to do

I’m trying to “eat my own food” using DescEditor to describe my data collections. But always something is missing. You can contact me.

Anyway, here are the things to do: