DLXS IDRESOLVER

From DLXS Documentation

(Difference between revisions)
Jump to: navigation, search
(IDRESOLVER)
Line 9: Line 9:
     the Classes take this approach. </p>
     the Classes take this approach. </p>
     <p>The MySQL table in the DLXS database is named &quot;idresolver&quot;. It has
     <p>The MySQL table in the DLXS database is named &quot;idresolver&quot;. It has
-
     three fields: id, url, and modified. IDs must be unique. </p>
+
     three fields: id, url, and modified. IDs must be unique.</p>
     <p>The IDRESOLVER
     <p>The IDRESOLVER
         CGI ($DLXSROOT/cgi/i/idresolver/idresolver) will return a single URL
         CGI ($DLXSROOT/cgi/i/idresolver/idresolver) will return a single URL
Line 49: Line 49:
       the existing IDRESOLVER data.</p>
       the existing IDRESOLVER data.</p>
     <p>Here are the generic steps for loading or updating IDRESOLVER data.</p>
     <p>Here are the generic steps for loading or updating IDRESOLVER data.</p>
-
    <ol>
 
-
      <li>Load all ID/URL pairs in to an intermediate/short term table in MySQL.</li>
 
-
      <li>Create an empty copy of the current, production, &quot;idresolver&quot; table.</li>
+
* Load all ID/URL pairs in to an intermediate/short term table in MySQL.
-
      <li>Transfer all IDs/URLs from the intermediate table to the <strong>copy</strong> of the
+
* Create an empty copy of the current, production, &quot;idresolver&quot; table.
-
        production table. </li>
+
* Transfer all IDs/URLs from the intermediate table to the <strong>copy</strong> of the production table.  
-
      <li>Rename the current production table, essentially taking it
+
* Rename the current production table, essentially taking it out of service.  
-
        out of service. </li>
+
* Rename the copy of the production table as 'idresolver' so that it becomes the production table.
-
      <li>Rename the copy of the production table as 'idresolver' so that it
+
* Test the new production table. If all is well, drop/delete the intermediate table and the previous production table.
-
        becomes the production table.</li>
+
-
      <li>Test the new production table. If all is well, drop/delete the intermediate
+
     <p>Using the above method keeps the definition of the MySQL table in tact,including indexes. </p>
-
        table and the previous production table.</li>
+
     <p>Michigan has a more [http://www.umdl.umich.edu/docs/dlps/docs/id_resolver.html specific set of instructions] for internal use that might be helpful to you in creating your own set of steps and
-
    </ol>
+
instructions for updating idresolver.</p>
-
     <p>Using the above method keeps the definition of the MySQL table in tact,
+
-
  including indexes. </p>
+
-
     <p>Michigan has a more <a href="http://www.umdl.umich.edu/docs/dlps/docs/id_resolver.html" target="_blank">specific
+
-
        set of instructions</a> for internal use
+
-
      that might be helpful to you in creating your own set of steps and
+
-
      instructions for updating idresolver.</p>
+
     <p>It is worthwhile to come up with a well defined plan for creating IDs
     <p>It is worthwhile to come up with a well defined plan for creating IDs
       so that they are unambiguous and, in particular, unique.</p>
       so that they are unambiguous and, in particular, unique.</p>
Line 77: Line 68:
       Class. Plus, you want Image Class to link back to the page in the book.
       Class. Plus, you want Image Class to link back to the page in the book.
       This requires 3 ID/URL pairs. </p>
       This requires 3 ID/URL pairs. </p>
-
    <ol>
+
 
-
      <li>ID/URL for the thumbnail image</li>
+
* ID/URL for the thumbnail image
-
      <li>ID/URL for the full record in Image Class </li>
+
* ID/URL for the full record in Image Class
-
      <li>ID/URL for the book page in Text Class</li>
+
* ID/URL for the book page in Text Class
-
    </ol>
+
 
     <p>In order to disambiguate these related items, add to each ID a suffix
     <p>In order to disambiguate these related items, add to each ID a suffix
       such as &quot;rec&quot; for record and &quot;th&quot; for thumbnail. Also prefix each with
       such as &quot;rec&quot; for record and &quot;th&quot; for thumbnail. Also prefix each with

Revision as of 10:53, 29 July 2007

IDRESOLVER

IDRESOLVER is a simple mechanism for resolving a unique ID to a URL. The DLXS Classes can use it to, for example, link digital object identifiers in an Electronic Finding Aid to the actual digital object in another Class.

IDRESOLVER is the combination of a data table and a CGI. The table stores IDs and URLs, and the CGI responds to requests for ID resolution. It is also possible to skip the CGI and query the table directly, and some of the Classes take this approach.

The MySQL table in the DLXS database is named "idresolver". It has three fields: id, url, and modified. IDs must be unique.

The IDRESOLVER CGI ($DLXSROOT/cgi/i/idresolver/idresolver) will return a single URL (wrapped in XML) when given an ID that is in the database.

Below is an example from the [http://images.umdl.umich.edu/cgi/i/image/image-idx?c=bhl Bentley Image Bank], which links from a digital image record in Image Class to the Bentley Electronic Finding Aid (in FindAid Class) using IDRESOLVER. It is also possible to link in the other direction, but this way is easier to explain and understand.

The image record has a field named "Finding Aid" containing an ID. The field is configured (in Collmgr) so that Image Class uses IDRESOLVER to turn the ID into a link. The Image Class middleware takes the value of the field, "umich-bhl-02160", passes to IDRESOLVER in the form of an HTTP request, which returns the value from the URL field in IDRESOLVER.

ID URL
umich-bhl-02160 http://www.hti.umich.edu/cgi/f/findaid/findaid-idx?c=bhlead;idno=umich-bhl-02160

The above example links to the top level of the Finding Aid. Going the other direction, from the finding aid to the image record in Image Class is more specific. The list of objects in the finding aid has several links, each built by using IDRESOLVER to look up the URL by ID.

An ID may resolve to any type of URL, for instance, one that returns a result set (many items) rather than a single item. In all cases, it is up to you to create and maintain the IDs and URLs. The IDRESOLVER table and and CGI do nothing to help with this. The University of Michigan keeps a FileMaker database of IDRESOLVER IDs and URLs. Data is periodically added, removed, and updated in the FileMaker database. And then as needed, the data is dumped out of FileMaker as XML and loaded in to MySQL, replacing the existing IDRESOLVER data.

Here are the generic steps for loading or updating IDRESOLVER data.

  • Load all ID/URL pairs in to an intermediate/short term table in MySQL.
  • Create an empty copy of the current, production, "idresolver" table.
  • Transfer all IDs/URLs from the intermediate table to the copy of the production table.
  • Rename the current production table, essentially taking it out of service.
  • Rename the copy of the production table as 'idresolver' so that it becomes the production table.
  • Test the new production table. If all is well, drop/delete the intermediate table and the previous production table.

Using the above method keeps the definition of the MySQL table in tact,including indexes.

Michigan has a more specific set of instructions for internal use that might be helpful to you in creating your own set of steps and instructions for updating idresolver.

It is worthwhile to come up with a well defined plan for creating IDs so that they are unambiguous and, in particular, unique.

For example, let's say you have a book in Text Class that has full color figures in Image Class and you want to display thumbnails for the figures in Text Class and link them to the full record and large image in Image Class. Plus, you want Image Class to link back to the page in the book. This requires 3 ID/URL pairs.

  • ID/URL for the thumbnail image
  • ID/URL for the full record in Image Class
  • ID/URL for the book page in Text Class

In order to disambiguate these related items, add to each ID a suffix such as "rec" for record and "th" for thumbnail. Also prefix each with a DLXS Class abbreviation and the collection id. The following is an ID for linking from Text Class to Image Class. Let's break it down because it is slightly counter-intuitive how it is constructed.

Example ID: ic-micounty-2911266.0001.001-P0000063.TIF-rec

Assume the Text Class object (i.e., XML) contains a Text Class (not Image Class) collection ID, volume ID, and page ID. And the middleware has been configured/programmed to resolve IDs for this collection in order to link to Image Class. Text Class does not, however, know the Image Class collection ID that it needs to link to. Granted, this could be hardcoded into the middleware, but it is better to leave the Image Class collection ID out of the code and let IDRESOLVER take care of it. Again, we want the above Example ID to resolve to an Image Class URL. The counter-intuitive part is that the collection id is the Text Class collection ID, but we are linking to an Image Class collection.

Keep in mind that the DLXS classes do not require IDs to follow a particular convention, but you may have to make middleware changes/overrides if you choose your own convention.

Once you have your database of IDs and URLs, you need to know how to make the Classes do look-ups.

Image Class

To make Image Class look up the value of a field as an ID, use Collmgr to turn on the "idres" option in any list of display fields such as (dfltentryflds). The field value must match the ID in the IDRESOLVER table exactly. For more informatoin about enabling the idres option see <a href="../class/image/colldb.html" target="_blank">Image Class COLLDB (Collection Database) Configuration</a>.

FindAid Class

FindAid Class is coded to look up every DAO in idresolver and build a link if it finds the ID in the IDRESOLVER table. It uses the DAO as is. The method FilterAllDaos_XML in $DLXSROOT/cgi/f/findaid/FindAidClass.pm can be overridden per collection if different behavior is needed.

Text Class

Text Class attempts to resolve all FIGURE IDs. It uses IDRESOLVER if the FIGURE TYPE is INLINE or THUMBAIL. IDRESOLVER lookups assume image class. The method GenerateExternalId in $DLXSROOT/cgi/t/text/TextClass.pm can be overridden per collection if different behavior is needed.

More Information

More information about subclassing can be found in the document <a href="../program/subclassing.html" target="_blank">Subclassing in TextClass</a>.

The utility script $DLXSROOT/bin/data2db.pl is useful for loading data in to a MySQL table and it can be subclassed for different formats.

 











Personal tools