Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-1600

Create a module that allows swapping out queries via hooks




      Currently, SPARQL queries are hard-coded into Islandora in several places throughout various modules to provide things like lists of objects. This hard-ties us to several things - most importantly driving a huge chunk of the site display through the triplestore.

      The work done as part of this ticket should accomplish two things:

      1. Create a module to provide a user interface and hooks to allow for swapping individual queries out. The module should provide a hook to register queries available for implementation and report them to the user interface; this hook should describe the registered query's required variables and return values. The module should also provide a hook to allow modules to implement registered queries; this second hook should accept anything necessary to trigger a query callback (e.g., file location, callable, etc). The api.php should also describe how a sample callback function may look.

      2. Wrap existing queries in a module_exists() call to check for this new module. If the module is enabled, default querying behaviour should be swapped out for results provided by callbacks defined by the query registry.

      Doing all of this will provide a simple, integrated interface for managing queries, which should be a marked improvement over the current query management style where query management is either handled in multiple places or is not handled at all due to hard-coding

      This ticket does not deal with actually implementing any of the new queries, only to provide the ability for them to be implemented. Once we have this ticket completed and have examples of the hooks in use, we can then set about implementing as many of the queries as we can so we can start to move away from driving the site display using Mulgara.

      This will require extensive testing; any queries that are affected by this should be checked to see if existing functionality remains when the module is not installed, and that query-swapping functions correctly if it is. Queries affected should be documented so that this testing can take place.




            • Assignee:
              daitken Daniel Aitken
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: