DLXS IDRESOLVER
From DLXS Documentation
(→Loading Data) |
|||
(9 intermediate revisions not shown.) | |||
Line 4: | Line 4: | ||
==IDRESOLVER== | ==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 ofthe 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 [http://images.umdl.umich.edu/cgi/i/image/image-idx?rgn1=bhl_href;med=1;c=bhl2ic;q1=awm00096;back=back1183735019;size=20;subview=detail;resnum=1;view=entry;lastview=thumbnail;cc=bhl2ic;entryid=x-awm00096;viewid=AWM00096 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. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | <p>The [http://images.umdl.umich.edu/cgi/i/image/image-idx?rgn1=bhl_href;med=1;c=bhl2ic;q1=awm00096;back=back1183735019;size=20;subview=detail;resnum=1;view=entry;lastview=thumbnail;cc=bhl2ic;entryid=x-awm00096;viewid=AWM00096 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.</p> | ||
<table width="644" height="44" border="1"> | <table width="644" height="44" border="1"> | ||
<tr> | <tr> | ||
<td>ID</td> | <td>ID</td> | ||
- | |||
<td>URL</td> | <td>URL</td> | ||
</tr> | </tr> | ||
Line 38: | Line 27: | ||
</table> | </table> | ||
- | + | 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 [http://quod.lib.umich.edu/cgi/f/findaid/findaid-idx?c=bhlead;cc=bhlead;idno=umich-bhl-02160;type=simple;rgn=Entire%20Finding%20Aid;q1=NYDA.1986.004.00096;view=text;didno=umich-bhl-02160;focusrgn=C04;byte=224462 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. | * Load all ID/URL pairs in to an intermediate/short term table in MySQL. | ||
- | * Create an empty copy of the current, production, | + | * Create an empty copy of the current, production, "idresolver" table. |
* Transfer all IDs/URLs from the intermediate table to the <strong>copy</strong> of the production table. | * Transfer all IDs/URLs from the intermediate table to the <strong>copy</strong> of the production table. | ||
* Rename the current production table, essentially taking it out of service. | * Rename the current production table, essentially taking it out of service. | ||
Line 59: | Line 40: | ||
* Test the new production table. If all is well, drop/delete the intermediate table and the previous 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 [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 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.</p> | |
- | + | ||
+ | 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 thumbnail image | ||
Line 75: | Line 53: | ||
* ID/URL for the book page in Text 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 information about enabling the idres option see <a href="../class/image/colldb.html" target="_blank">Image Class COLLDB (Collection Database) Configuration</a>. (''fix link'') | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | </ | + | |
- | === | + | ===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> (''fix link''). |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | The utility script $DLXSROOT/bin/data2db.pl is useful for loading data into a MySQL table and it can be subclassed for different formats. | |
- | + | ||
- | + | ||
- | + | ||
[[#top|Top]] | [[#top|Top]] |
Current revision
Main Page > Ancillary Resources > DLXS IDRESOLVER
Contents |
[edit] 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 ofthe 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 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.</p>
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.
[edit] 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 information about enabling the idres option see <a href="../class/image/colldb.html" target="_blank">Image Class COLLDB (Collection Database) Configuration</a>. (fix link)
[edit] 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.
[edit] 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.
[edit] More Information
More information about subclassing can be found in the document <a href="../program/subclassing.html" target="_blank">Subclassing in TextClass</a> (fix link).
The utility script $DLXSROOT/bin/data2db.pl is useful for loading data into a MySQL table and it can be subclassed for different formats.