<field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
<field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
<field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
+ <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
<field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
<field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
<field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
<class id="mde" controller="open-ils.cstore open-ils.pcrud"
oils_obj:fieldmapper="metabib::display_entry"
oils_persist:tablename="metabib.display_entry"
- reporter:label="Combined display Entry" oils_persist:readonly="true">
+ reporter:label="Display Field Entry" oils_persist:readonly="true">
<fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
<field name="id" reporter:datatype="id" />
<field name="field" reporter:datatype="link"/>
</class>
<class id="mfde" controller="open-ils.cstore open-ils.pcrud"
oils_obj:fieldmapper="metabib::flat_display_entry"
- reporter:label="Flat Display Entry View" oils_persist:readonly="true">
+ reporter:label="Flat Display Field Entry View" oils_persist:readonly="true">
<oils_persist:source_definition>
SELECT
mde.source,
browse_xpath TEXT,
browse_sort_xpath TEXT,
facet_xpath TEXT,
+ display_xpath TEXT,
authority_xpath TEXT,
joiner TEXT,
restrict BOOL DEFAULT FALSE NOT NULL,
CREATE INDEX metabib_display_entry_field_idx
ON metabib.display_entry (field);
-CREATE INDEX metabib_display_entry_value_idx
- ON metabib.display_entry (SUBSTRING(value,1,1024));
CREATE INDEX metabib_display_entry_source_idx
ON metabib.display_entry (source);
output_row.facet_field = FALSE;
END IF;
+ -- insert raw node text for display
+ IF idx.display_field THEN
+
+ IF idx.display_xpath IS NOT NULL AND idx.display_xpath <> '' THEN
+ display_text := oils_xpath_string( idx.display_xpath, xml_node, joiner, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]] );
+ ELSE
+ display_text := curr_text;
+ END IF;
+
+ output_row.field_class = idx.field_class;
+ output_row.field = -1 * idx.id;
+ output_row.source = rid;
+ output_row.value = BTRIM(REGEXP_REPLACE(display_text, E'\\s+', ' ', 'g'));
+
+ output_row.display_field = TRUE;
+ RETURN NEXT output_row;
+ output_row.display_field = FALSE;
+ END IF;
+
END LOOP;
CONTINUE WHEN raw_text IS NULL OR raw_text = '';
output_row.search_field = FALSE;
END IF;
- IF idx.display_field THEN
- output_row.field_class = idx.field_class;
- output_row.field = idx.id;
- output_row.source = rid;
- output_row.value = BTRIM(REGEXP_REPLACE(raw_text, E'\\s+', ' ', 'g'));
-
- output_row.display_field = TRUE;
- RETURN NEXT output_row;
- output_row.display_field = FALSE;
- END IF;
-
END LOOP;
END;
BEGIN;
+ALTER TABLE config.metabib_field ADD COLUMN display_xpath TEXT, display_field BOOL NOT NULL DEFAULT TRUE;
+UPDATE config.metabib_field SET display_field = FALSE WHERE field_class = 'keyword' OR name = 'complete';
+
CREATE TABLE metabib.display_entry (
id BIGSERIAL PRIMARY KEY,
source BIGINT NOT NULL,
CREATE INDEX metabib_display_entry_field_idx
ON metabib.display_entry (field);
-CREATE INDEX metabib_display_entry_value_idx
- ON metabib.display_entry (SUBSTRING(value,1,1024));
CREATE INDEX metabib_display_entry_source_idx
ON metabib.display_entry (source);
output_row.facet_field = FALSE;
END IF;
+ -- insert raw node text for display
+ IF idx.display_field THEN
+
+ IF idx.display_xpath IS NOT NULL AND idx.display_xpath <> '' THEN
+ display_text := oils_xpath_string( idx.display_xpath, xml_node, joiner, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]] );
+ ELSE
+ display_text := curr_text;
+ END IF;
+
+ output_row.field_class = idx.field_class;
+ output_row.field = -1 * idx.id;
+ output_row.source = rid;
+ output_row.value = BTRIM(REGEXP_REPLACE(display_text, E'\\s+', ' ', 'g'));
+
+ output_row.display_field = TRUE;
+ RETURN NEXT output_row;
+ output_row.display_field = FALSE;
+ END IF;
+
END LOOP;
CONTINUE WHEN raw_text IS NULL OR raw_text = '';
output_row.search_field = FALSE;
END IF;
- IF idx.display_field THEN
- output_row.field_class = idx.field_class;
- output_row.field = idx.id;
- output_row.source = rid;
- output_row.value = BTRIM(REGEXP_REPLACE(raw_text, E'\\s+', ' ', 'g'));
-
- output_row.display_field = TRUE;
- RETURN NEXT output_row;
- output_row.display_field = FALSE;
- END IF;
-
END LOOP;
END;