expose the new in-db z39.50 config
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 28 Sep 2008 20:48:10 +0000 (20:48 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 28 Sep 2008 20:48:10 +0000 (20:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10718 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
Open-ILS/src/sql/Pg/002.schema.config.sql

index fd7274b..49419dd 100644 (file)
@@ -420,6 +420,44 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                </links>
        </class>
 
                </links>
        </class>
 
+    <class id="czs" controller="open-ils.cstore" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
+        <fields oils_persist:primary="name">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="Z39.50 Source" name="name" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+            <field reporter:label="Label" name="label" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+            <field reporter:label="Host" name="host" oils_obj:array_position="5" oils_persist:virtual="false"  reporter:datatype="text"/>
+            <field reporter:label="Port" name="port" oils_obj:array_position="6" oils_persist:virtual="false"  reporter:datatype="int"/>
+            <field reporter:label="DB" name="db" oils_obj:array_position="7" oils_persist:virtual="false"  reporter:datatype="text"/>
+            <field reporter:label="Record Format" name="record_format" oils_obj:array_position="8" oils_persist:virtual="false"  reporter:datatype="text"/>
+            <field reporter:label="Transmission Format" name="transmission_format" oils_obj:array_position="9" oils_persist:virtual="false"  reporter:datatype="text"/>
+            <field reporter:label="Auth" name="auth" oils_obj:array_position="10" oils_persist:virtual="false"  reporter:datatype="bool"/>
+            <field reporter:label="Attrs" name="attrs" oils_obj:array_position="11" oils_persist:virtual="true"  reporter:datatype="link"/>
+        </fields>
+        <links>
+            <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
+        </links>
+    </class>
+
+    <class id="cza" controller="open-ils.cstore" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
+        <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
+            <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
+            <field name="ischanged" oils_obj:array_position="1" oils_persist:virtual="true" />
+            <field name="isdeleted" oils_obj:array_position="2" oils_persist:virtual="true" />
+            <field reporter:label="Z39.50 Attr ID" name="id" oils_obj:array_position="3" oils_persist:virtual="false" reporter:datatype="id"/>
+            <field reporter:label="Z39.50 Source" name="source" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
+            <field reporter:label="Name" name="name" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="text"/>
+            <field reporter:label="Label" name="label" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="text" oils_persist:i18n="true"/>
+            <field reporter:label="Code" name="code" oils_obj:array_position="7" oils_persist:virtual="false"  reporter:datatype="int"/>
+            <field reporter:label="Format" name="format" oils_obj:array_position="8" oils_persist:virtual="false"  reporter:datatype="int"/>
+            <field reporter:label="Truncation" name="truncation" oils_obj:array_position="9" oils_persist:virtual="false"  reporter:datatype="int"/>
+        </fields>
+        <links>
+            <link field="source" reltype="has_a" key="name" map="" class="czs"/>
+        </links>
+    </class>
+
        <class id="aws" controller="open-ils.cstore" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
                <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
        <class id="aws" controller="open-ils.cstore" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
                <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
                        <field name="isnew" oils_obj:array_position="0" oils_persist:virtual="true" />
index fc2f672..97cf08b 100755 (executable)
@@ -101,6 +101,8 @@ sub query_services {
                 host => $s->host, 
                 port => $s->port, 
                 db => $s->db, 
                 host => $s->host, 
                 port => $s->port, 
                 db => $s->db, 
+                record_format => $s->record_format, 
+                transmission_format => $s->transmission_format, 
                 auth => $s->auth, 
             }; 
 
                 auth => $s->auth, 
             }; 
 
@@ -111,6 +113,7 @@ sub query_services {
                     code => $a->code, 
                     format => $a->format, 
                     source => $a->source, 
                     code => $a->code, 
                     format => $a->format, 
                     source => $a->source, 
+                    truncation => $a->truncation, 
                 }; 
             } 
         } 
                 }; 
             } 
         } 
index 57f2c78..fbe5b0d 100644 (file)
@@ -444,6 +444,51 @@ CREATE TABLE config.bib_level_map (
        value   TEXT    NOT NULL
 );
 
        value   TEXT    NOT NULL
 );
 
+CREATE TABLE config.z3950_source (
+    name                TEXT    PRIMARY KEY,
+    label               TEXT    NOT NULL UNIQUE,
+    host                TEXT    NOT NULL,
+    port                INT     NOT NULL,
+    db                  TEXT    NOT NULL,
+    record_format       TEXT    NOT NULL DEFAULT 'FI',
+    transmission_format TEXT    NOT NULL DEFAULT 'usmarc',
+    auth                BOOL    NOT NULL DEFAULT TRUE
+);
+
+INSERT INTO config.z3950_source (name,label,host,port,db,auth) VALUES ('loc','Library of Congress','z3950.loc.gov',7090,'Voyager',FALSE);
+INSERT INTO config.z3950_source (name,label,host,port,db) VALUES ('oclc','OCLC','zcat.oclc.org',210,'OLUCWorldCat');
+
+CREATE TABLE config.z3950_attr (
+    id          SERIAL  PRIMARY KEY,
+    source      TEXT    NOT NULL REFERENCES config.z3950_source (name),
+    name        TEXT    NOT NULL,
+    label       TEXT    NOT NULL,
+    code        INT     NOT NULL,
+    format      INT     NOT NULL,
+    truncation  INT     NOT NULL DEFAULT 0,
+    CONSTRAINT z_code_format_once_per_source UNIQUE (code,format,source)
+);
+
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','tcn','Title Control Number',12,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','isbn','ISBN',7,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','lccn','LCCN',9,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','author','Author',1003,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','title','Title',4,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','issn','ISSN',8,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','publisher','Publisher',1018,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','pubdate','Publication Date',31,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('loc','item_type','Item Type',1001,1);
+
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','tcn','Title Control Number',12,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','isbn','ISBN',7,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','lccn','LCCN',9,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','author','Author',1003,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','title','Title',4,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','issn','ISSN',8,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','publisher','Publisher',1018,6);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','pubdate','Publication Date',31,1);
+INSERT INTO config.z3950_attr (source,name,label,code,format) VALUES ('oclc','item_type','Item Type',1001,1);
+
 CREATE TABLE config.i18n_locale (
     code        TEXT    PRIMARY KEY,
     marc_code   TEXT    NOT NULL REFERENCES config.language_map (code) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
 CREATE TABLE config.i18n_locale (
     code        TEXT    PRIMARY KEY,
     marc_code   TEXT    NOT NULL REFERENCES config.language_map (code) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,