[open-ils-commits] r10718 - in trunk/Open-ILS: examples
src/perlmods/OpenILS/Application/Search src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Sep 28 16:48:15 EDT 2008
Author: miker
Date: 2008-09-28 16:48:10 -0400 (Sun, 28 Sep 2008)
New Revision: 10718
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
Log:
expose the new in-db z39.50 config
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2008-09-28 19:24:46 UTC (rev 10717)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2008-09-28 20:48:10 UTC (rev 10718)
@@ -420,6 +420,44 @@
</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" />
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm 2008-09-28 19:24:46 UTC (rev 10717)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm 2008-09-28 20:48:10 UTC (rev 10718)
@@ -101,6 +101,8 @@
host => $s->host,
port => $s->port,
db => $s->db,
+ record_format => $s->record_format,
+ transmission_format => $s->transmission_format,
auth => $s->auth,
};
@@ -111,6 +113,7 @@
code => $a->code,
format => $a->format,
source => $a->source,
+ truncation => $a->truncation,
};
}
}
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2008-09-28 19:24:46 UTC (rev 10717)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2008-09-28 20:48:10 UTC (rev 10718)
@@ -444,6 +444,51 @@
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,
More information about the open-ils-commits
mailing list