Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

Table of Contents

Overview

Dynamic Configuration allows you to provide various authorization rules for different groups of Citations Helper users. This configuration method requires modifications to the default SiteOsidConfiguration API implementation, org.sakaiproject.citation.impl.SampleSiteOsidConfiguration.

Example Scenario

A simple scenario that suggests a dynamic configuration would be appropriate:

At my institution, users affiliated with West Campus use Sirsi SingleSearch, and users affiliated with East Campus use Ex Libris MetaLib.

To handle our example scenario, we'll need two sets of XML configuration files, one for SingleSearch and one for MetaLib, as well as a site-specific implementation of the SiteOsidConfiguration API interface. The custom SiteOsidConfiguration implementation selects the appropriate configuration files at runtime, when the Citations Helper is invoked.

API Interface

The Citations code provides a Java interface that defines methods used by the Citations Helper to find appropriate configuration information for a given user. See:

    org.sakaiproject.citation.api.SiteOsidConfiguration

Implementation

A SiteOsidConfiguration implementation picks the proper XML configuration files for the current user, based on that user's context: campus and course affiliations, guest status, etc.

Default Implementation

The default SiteOsidConfiguration API implementation provided with the Citations Helper is available here:

    org.sakaiproject.citation.impl.SampleSiteOsidConfiguration

This class needs to make three decisions:

  1. Which XML configuration file is appropriate for this user?

    The Java code returns the name of XML file that describes the proper configuration. See getConfigurationXml() in SampleSiteOsidConfiguration.

  2. Which databases are available to this user?

    The Java code returns the name of an XML file that describes the database hierarchy. See getDatabaseHierarchyXml() in SampleSiteOsidConfiguration.

  3. What groups (if any) does this user belong to?

    Groups allow the Citation Helper to decide which portions of the database hierarchy are available to the current user. In the Search Categories & Databases XML documentation, you will see that each defined database can have associated database-groups.

    See getGroupIds() in SampleSiteOsidConfiguration for a simple implementation.

Custom Implementation

A custom (or site specific) SiteOsidConfiguration implementation needs to make the same three decisions outlined above.

It may be easiest to modify the default implementation, SampleSiteOsidConfiguration, with any changes required to address the needs at your site. Your updated code can be compiled and deployed using the normal Citations build procedure.

If you prefer to build a separate class in another location, you can configure the Citations Helper to use this new class by setting the following Sakai property:

  osidConfig@org.sakaiproject.citation.api.ConfigurationService=<full-class-name>

The default value for this property is org.sakaiproject.citation.impl.SampleSiteOsidConfiguration

Configuration

To establish a dynamic configuration, changes are made to sakai.properties. In addition, you'll probably need to create multiple sets of XML configuration and search category files.

Property Values

In our example scenario, we'll need to provide the names of our configuration and search categories files in sakai.properties. One set is for East Campus, the other is for West Campus.

 
# 
# Cached configuration files (one for each campus) 
# 
configXmlCache@org.sakaiproject.citation.api.ConfigurationService=EAST-config.xml,WEST-config.xml 
databaseXmlCache@org.sakaiproject.citation.api.ConfigurationService=EAST-categories.xml,WEST-categories.xml 


XML Configuration Files

For the example scenario, each campus requires both a configuration file (EAST-config.xml, WEST-config.xml) and a database categories file (EAST-categories.xml, WEST-categories.xml). These files should be located in the Resources area of the Citations Admin site.

When setting up an XML configuration file, it's probably easiest to copy the sample configuration file, changing values to reflect your requirements.

To learn more on creating a search category file, refer to the Search Categories & Databases XML document and the example XML configuration file.

You may also want to review the editing overview for Citations configuration files.

  • No labels