Find-finder and friends

From CONTENTdm Users Wiki

Jump to: navigation, search

Tools for a flexible view of your metadata. Intended for the staff who create and administer your CONTENTdm collections. This tool is great for quality control on metadata and easy reference.

Written by Josh Kline

Contents

[edit] Terms of User

Permission to use is granted free of charge. I would appreciate it if you send me feedback, such as praise, blame, bug reports, or feature requests, about your use of these scripts. I would also appreciate, but by no means require, a copy of any modifications you make, especially if you think they will be useful to others.

[edit] Dependencies

More information is given in the README file.

There is no particular reason why you can't use these scripts on other environments. If you are successful installing them please add your environment, and any tricks you used, to this page.

  • Developed with
    • Linux
    • PHP 4
    • Apache httpd 2
    • CONTENTdm 4.2
    • Firefox
  • Third party dependencies. These are included in the distrobution, but you may use your own copy if you want. Just be careful because I haven't tested the code on other versions of these libraries. Also some of them are customized, as noted below.

[edit] Current Version

Version 1.0 Beta 2 is known to time-out on large collections. Unfortunately I don't yet have the infrastructure to repackage the entire find-finder. For now, please apply this patch to find-finder.php:

Index: find-finder.php
===================================================================
--- find-finder.php     (revision 2552)
+++ find-finder.php     (working copy)
@@ -26,7 +26,7 @@
                                         // ..be added to the height of the
                                         // ..preview to get the height of the
                                         // ..image tag.
-define('PAGESIZE', 25);                // Number of items to be displayed
+define('PAGESIZE', 250);                // Number of items to be displayed
                                         // ..per page of results.
 $defaultFields = array(
                                           'find' =>  array('name' => 'Display F
ile Name'),
@@ -883,12 +883,13 @@
        /*
         * Retrieve results
         */
-       if (stickyValue('itemsBy') == 'itemsByAll') {
+       if ($_GET['itemsBy'] == 'itemsByPrevResults') {
+        // Check $_GET because itemsByPrevResults isn't a sticky value.
+               // No new results to retrieve
+       } elseif (stickyValue('itemsBy') == 'itemsByAll') {
                getItemsBySearch(stickyValue('CISOROOT'),
                                                 array_keys(stickyValue('fields'
)));
                                                // Retreive results of the empty
 search
-       } elseif (stickyValue('itemsBy') == 'itemsByPrevResults') {
-               // No new results to retrieve
        } elseif (stickyValue('itemsBy') == 'itemsByPtr') {
                getItemsByPointer(stickyValue('CISOROOT'), stickyValue('ptrArray
'));
        } elseif (stickyValue('itemsBy') == 'itemsByCdmSearch' ) {
@@ -1158,8 +1159,9 @@
 function getItemsBySearch($alias, $fieldsToDisplay, $searchTerms = array())
 {
        $start = 1;                         // First item to retrieve
-    $maxrecs = 5;                       // Number of records to return from
-                                        // ..each call to dmQuery

-                                        // ..each call to dmQuery
+    $maxrecs = 1000;                    // Number of records to return from
+                                        // ..each call to dmQuery.
+                                        // ..An arbitrary large number.
     $total = 0;                         // Total number of records matching
                                         // ..the dmQuery. Not necessarily the
                                         // ..number of records returned. It

[edit] Support

I will do what I can to support these scripts in terms of future development and helping you install and use them. Keep in mind that you have all the code and can modify it if you want. If you do make changes I encourage you to let me know directly, or to post to this wiki (on this page or on a linked page) so that other people can benefit as well.

[edit] Suggestions and Requests

Put yours here...

Personal tools