Skip to content

Smithsonian/islandora_viewers

 
 

Repository files navigation

@author William Panting

This module is meant to describe the interface 
for modules implementing the Islandora viewer hooks.
It also creates an admin interface/DB entry to record settings regarding 
what theme function to use under what conditions.
It provides a way to detect wich viewer is selected through the admin interface.
This functionality may be extended in the future.
A source of possible bugs is the deactivation of viewers: 
A function should be created that viewers call on deactivation to remove any DB entry
regarding their module.

DECISION DIMENSIONS FOR CHOSING A VIEWER:
DSID (do not suggest supporting)
PID (do not suggest supporting)
SOLUTION_PACK_DEFAULT (would be hardcoded, or configurable in solution pack admin)
    Solution pack dependent.
    If the code falls through to this and it doesn't exist we should 
MIME_TYPE (for aggregate content models this would be a unique string. 
            Is there a convention for mime-types of distributed media?
            multipart/vnd.islandora.content_model) 
    implemented 
    this is the most basic way to make the decision
CONTENT_MODEL (can override MIME_TYPE)
    The first dev who needs this needs to implement it.
    This is the prefered way to make the decision in Islandora.
COLLECTION (can override CONTENT_MODEL)
    The first dev who needs this needs to implement it.

HOOK:
islandora_viewers(mimetype)
    ON NULL: return an array(mime_type=>theme function)
    ON MIMETYPE MATCH: return the theme function
    OTHERWISE: return nothing

DETECT VIEWER SETTINGS:
islandora_viewers.inc: islandora_viewers_get_viewer_theme($mime_type)

EXPECTED VIEWER/THEME INTERFACE:
theme(PID, DSID) @TODO: exameine; Xhould this be the URI of datastream?
    CONTENTS IN VIEWER

EXAMPLES:

VIEWERS:
https://github.com/willtp87/islandora_flexpaper_viewer

This approach is extendible to the object level: we can use it to overide an object level theme (display) such as 'Object Details'.
It is also extendible to metadata display, though the details of a well performing implementation need to be ironed out:
Maybe a relation on datstreams describing their schema. So the datastream would not need to be accessed more than once and not need to be passed around.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published