Warning: This page has not been updated in over over a year and may be outdated or deprecated.
legacy:vufind_1.x_developer_manual:supporting_a_new_metadata_format
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
other_than_marc [2009/10/29 13:24] – Added getRDFXML method. demiankatz | legacy:vufind_1.x_developer_manual:supporting_a_new_metadata_format [2018/12/19 14:02] (current) – demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Support for other record formats | + | ====== Support for New Record Formats |
- | ===== Problem ===== | + | // This outdated page has been deleted |
- | + | ||
- | VuFind currently is tightly bound to MARCish record formats. The standard indexer ([[http://code.google.com/ | + | |
- | + | ||
- | ===== Solutions ===== | + | |
- | + | ||
- | + | ||
- | ==== Indexer ==== | + | |
- | Indexing is not an integrated part of VuFind. For indexing MARCish records, [[http:// | + | |
- | + | ||
- | Writing a custom indexer for other record formats may be done in almost any programming language. Steps to be done: | + | |
- | * parse record format | + | |
- | * map format entities to Solr index fields | + | |
- | * create XMLish document out of these fields | + | |
- | * POST document to Solr's update handler (FYI: it doesn' | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ==== Record display ==== | + | |
- | Currently full record display in VuFind is done by pulling a MARC record out of Solr index field fullrecord. The content to display is then taken out of MARC fields (e.g. 245$a as title...). | + | |
- | + | ||
- | There has been [[http:// | + | |
- | + | ||
- | So the idea is: | + | |
- | + | ||
- | when indexing: | + | |
- | * index whatever you want by mapping it to the index schema | + | |
- | * put the original record into the " | + | |
- | * put an " | + | |
- | + | ||
- | when displaying: | + | |
- | * when a record is retrieved for display, look at recordtype | + | |
- | * call a class appropriate for handling that format | + | |
- | * that class may fetch the full record and render it | + | |
- | * if no special class for a record format exists, take a fallback generic class, that renders a view out of the stored Solr index fields | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ===== Implementation ===== | + | |
- | Currently services/ | + | |
- | + | ||
- | One way to implement handling of other record formats would be by implementing a new family of " | + | |
- | + | ||
- | General "data enrichment services" | + | |
- | + | ||
- | ==== Integration with Templates ==== | + | |
- | + | ||
- | The current view.tpl used by the Record module includes basic record details along with export options, clickable tabs and other framing details. | + | |
- | + | ||
- | For greater flexibility, | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ==== Driver API Specification ==== | + | |
- | + | ||
- | This is the interface that must be implemented by all Record Driver classes: | + | |
- | + | ||
- | <code php> | + | |
- | /** | + | |
- | * Record Driver Class | + | |
- | * | + | |
- | * This interface class is the definition of the required methods for | + | |
- | * interacting with a particular metadata record format. | + | |
- | */ | + | |
- | interface RecordInterface | + | |
- | { | + | |
- | /** | + | |
- | * Constructor. | + | |
- | * from the (Solr) index (which also happens to include the | + | |
- | * ' | + | |
- | * make a search call to find out which record driver to construct, | + | |
- | * we will already have this data available, so we might as well | + | |
- | * just pass it into the constructor. | + | |
- | * | + | |
- | * @param | + | |
- | * @access | + | |
- | */ | + | |
- | public function __construct($indexFields); | + | |
- | + | ||
- | /** | + | |
- | * Get text that can be displayed to represent this record in | + | |
- | * breadcrumbs. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getBreadcrumb(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name | + | |
- | * to load in order to display the requested citation format. | + | |
- | * For legal values, see getCitationFormats(). | + | |
- | * format is not supported. | + | |
- | * | + | |
- | * @param | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getCitation($format); | + | |
- | + | ||
- | /** | + | |
- | * Get an array of strings representing citation formats supported | + | |
- | * by this record' | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getCitationFormats(); | + | |
- | + | ||
- | /** | + | |
- | * Get the value for the title attribute of a COinS span tag. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getCOinS(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name to | + | |
- | * load in order to display user comments on the current record. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getComments(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name to | + | |
- | * load in order to display core metadata (the details shown in the | + | |
- | * top portion of the record view pages, above the tabs). | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getCoreMetadata(); | + | |
- | + | ||
- | /** | + | |
- | * Get an array of search results for other editions of the title | + | |
- | * represented by this record (empty if unavailable). | + | |
- | * this will use the XISSN/XISBN logic to find matches. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getEditions(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name to | + | |
- | * load in order to export the record in the requested format. | + | |
- | * legal values, see getExportFormats(). | + | |
- | * not supported. | + | |
- | * | + | |
- | * @param | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getExport($format); | + | |
- | + | ||
- | /** | + | |
- | * Get an array of strings representing formats in which this record' | + | |
- | * data may be exported (empty if none). | + | |
- | * " | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getExportFormats(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name to | + | |
- | * load in order to display extended metadata (more details beyond | + | |
- | * what is found in getCoreMetadata() -- used as the contents of the | + | |
- | * Description tab of the record view). | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getExtendedMetadata(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name to | + | |
- | * load in order to display holdings extracted from the base record | + | |
- | * (i.e. URLs in MARC 856 fields). | + | |
- | * not replace, holdings information extracted through the ILS driver | + | |
- | * and displayed in the Holdings tab of the record view page. Returns | + | |
- | * null if no data is available. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getHoldings(); | + | |
- | + | ||
- | /** | + | |
- | * Get an array of User_list objects belonging to the current user in | + | |
- | * which this record is saved. | + | |
- | * exist. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getLists(); | + | |
- | + | ||
- | /** | + | |
- | * Get an array of search results for other items similar to this record | + | |
- | * (empty if none). | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getMoreLikeThis(); | + | |
- | + | ||
- | /** | + | |
- | * Get an XML RDF representation of the data in this record. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getRDFXML(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name to | + | |
- | * load in order to display the full record information on the Staff | + | |
- | * View tab of the record view page. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getStaffView(); | + | |
- | + | ||
- | /** | + | |
- | * Return an array of Tags objects associated with the current record. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getTags(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name to | + | |
- | * load in order to display the Table of Contents extracted from the | + | |
- | * record. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getTOC(); | + | |
- | + | ||
- | /** | + | |
- | * Does this record have audio content available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasAudio(); | + | |
- | + | ||
- | /** | + | |
- | * Does this record have an excerpt available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasExcerpt(); | + | |
- | + | ||
- | /** | + | |
- | * Does this record have searchable full text in the index? | + | |
- | * | + | |
- | * Note: As of this writing, searchable full text is not a VuFind feature, | + | |
- | | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasFullText(); | + | |
- | + | ||
- | /** | + | |
- | * Does this record have image content available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasImages(); | + | |
- | + | ||
- | /** | + | |
- | * Does this record have reviews available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasReviews(); | + | |
- | + | ||
- | /** | + | |
- | * Does this record have a Table of Contents available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasTOC(); | + | |
- | + | ||
- | /** | + | |
- | * Does this record have video content available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasVideo(); | + | |
- | + | ||
- | /** | + | |
- | * Is the current record saved in a list by the current user? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function isSaved(); | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | Record Driver naming conventions: | + | |
- | + | ||
- | * Filename: web/ | + | |
- | * Default Filename (if no match was found for [record type]Record.php): | + | |
- | * Class name: same as the filename -- [record type]Record (i.e. MarcRecord, DefaultRecord, | + | |
- | * Config file: web/ | + | |
- | + | ||
- | ==== Notes ==== | + | |
- | + | ||
- | * The public record driver interface is intentionally very abstract -- we want to be able to support records of all kinds, and we don't want to make any assumptions about the structure of the records. | + | |
- | * In spite of the generic interface, it is often useful to have very structured methods (getTitle, getAuthor, etc.). | + | |
- | * A lot of discussion has been deleted to reduce clutter on the page now that our ideas seem to be taking firmer shape. | + | |
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
legacy/vufind_1.x_developer_manual/supporting_a_new_metadata_format.1256822679.txt.gz · Last modified: 2014/06/13 13:13 (external edit)