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 revisionLast revisionBoth sides next revision | ||
other_than_marc [2009/08/25 18:30] – Clarified tag return value; adjusted case of method names. demiankatz | legacy:vufind_1.x_developer_manual:supporting_a_new_metadata_format [2015/12/14 16:52] – ↷ Links adapted because of a move operation demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Support for other record formats | + | ====== Support for New Record Formats |
- | ===== Problem ===== | + | //This page refers to VuFind 1.x; for documentation on newer versions, see the [[development: |
- | VuFind currently is tightly bound to MARCish record formats. The standard indexer ([[http://code.google.com/ | + | //Note: This feature was introduced in VuFind 1.0. If you are using VuFind 1.0RC2 or earlier, please upgrade |
- | ===== Solutions | + | ===== Introduction |
+ | VuFind is currently bundled with a standard indexer ([[indexing: | ||
+ | * write an indexer to get the data into VuFind' | ||
+ | * write a " | ||
- | ==== Indexer ==== | + | ===== Indexer |
- | Indexing is not an integrated part of VuFind. For indexing | + | Indexing is not an integrated part of VuFind. For indexing |
Writing a custom indexer for other record formats may be done in almost any programming language. Steps to be done: | Writing a custom indexer for other record formats may be done in almost any programming language. Steps to be done: | ||
* parse record format | * parse record format | ||
- | * map format entities to Solr index fields | + | * map format entities to Solr index fields |
- | * create XMLish document out of these fields | + | * create XMLish document out of these fields |
* POST document to Solr's update handler (FYI: it doesn' | * POST document to Solr's update handler (FYI: it doesn' | ||
+ | Note that for any metadata format available as XML, you can save yourself some steps by using the [[: | ||
+ | ===== Record Display ===== | ||
- | + | Record display is handled | |
- | ==== Record display | + | |
- | Currently full record display in VuFind | + | |
- | + | ||
- | 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 | + | |
- | + | ||
- | 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 ==== | ==== Driver API Specification ==== | ||
- | This is the interface that must be implemented by all Record Driver classes: | + | The interface that must be implemented by all Record Driver classes can be viewed |
- | + | ||
- | <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 | + | |
- | * breadcrumbs. | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function getBreadcrumb(); | + | |
- | + | ||
- | /** | + | |
- | * Assign necessary Smarty variables and return a template name | + | |
- | * to load in order to display | + | |
- | * 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(); | + | |
- | + | ||
- | | + | |
- | * 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). Legal values: " | + | |
- | * " | + | |
- | * | + | |
- | * @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 the IDs of lists 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(); | + | |
- | + | ||
- | /** | + | |
- | * 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 function have audio content available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasAudio(); | + | |
- | + | ||
- | /** | + | |
- | * Does this function have an excerpt available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasExcerpt(); | + | |
- | + | ||
- | /** | + | |
- | * Does this function have image content available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasImages(); | + | |
- | + | ||
- | /** | + | |
- | * Does this function have reviews available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasReviews(); | + | |
- | + | ||
- | /** | + | |
- | * Does this function have a Table of Contents available? | + | |
- | * | + | |
- | * @access | + | |
- | * @return | + | |
- | */ | + | |
- | public function hasTOC(); | + | |
- | + | ||
- | /** | + | |
- | * Does this function 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: | Record Driver naming conventions: | ||
* Filename: web/ | * Filename: web/ | ||
- | | + | * Class name: same as the filename -- [record type]Record (i.e. MarcRecord, |
- | | + | |
- | * Config file: web/ | + | |
==== Notes ==== | ==== Notes ==== | ||
- | * The public | + | * The public |
- | * In spite of the generic interface, it is often useful to have very structured methods (getTitle, getAuthor, etc.). | + | * 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 summarize the previous two points: if your data format represents bibliographic data in a way roughly similar |
---- struct data ---- | ---- struct data ---- | ||
---- | ---- | ||
legacy/vufind_1.x_developer_manual/supporting_a_new_metadata_format.txt · Last modified: 2018/12/19 14:02 by demiankatz