...
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
An simple scenario that suggests the use of a dynamic configuration:
At my institution, users affiliated with West Campus use Sirsi SingleSearch, and users affiliated with East Campus use Ex Libris MetaLib.
API Interface
The org.sakaiproject.citation.api.SiteOsidConfiguration
interface defines several methods that allow the Citations Helper to use different sets of locate the appropriate configuration information for a given user, based on the current that user's context - – campus and course affiliations, guest status, etc.
For To handle our example , at my institution users affiliated with West Campus use Sirsi SingleSearch, and users affiliated with East Campus use Ex Libris MetaLib. To handle this there will need to be scenario, we'll need two sets of configuration information, one for SingleSearch and one for MetaLib, as well as a mechanism to determine which configuration to use for a any given user. That mechanism is a site-specific implementation of the SiteOsidConfiguration
API interface. Different sets of configuration information are maintained in separate XML files, and the SiteOsidConfiguration
implementation selects the appropriate configuration files dynamically, when the Citations Helper is invoked.
...
- Which Sakai properties need to be overridden for this user?
- The Java code returns a path to an XML file that describes the parameter values to override. Return null to use the file specified by the following property:
configXmlCache@org.sakaiproject.citation.api.ConfigurationService
=<XML file>- The default value for this property is
config.xml
- The default value for this property is
- XML configuration files are discussed below.
- See
getConfigurationXml()
inSampleSiteOsidConfiguration
.
- The Java code returns a path to an XML file that describes the parameter values to override. Return null to use the file specified by the following property:
- Which databases are available to this user?
- The Java code returns the path to an XML file that describes the database hierarchy to the Citations Helper. Return null to use the file specified by the following property:
databaseXmlCache@org.sakaiproject.citation.api.ConfigurationService
=<XML file>- The default value for this property is
categories.xml
- The default value for this property is
- The Search Categories & Databases XML page has documentation on how to build this XML file.
- See
getDatabaseHierarchyXml()
inSampleSiteOsidConfiguration
.
- The Java code returns the path to an XML file that describes the database hierarchy to the Citations Helper. Return null to use the file specified by the following property:
- What groups (if any) does this user belong to?
- Groups can come into play when the Citation Helper decides 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()
inSampleSiteOsidConfiguration
.
...
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
- The default value for this property is
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="utf-8"?> <config> <!-- Metasearch engine parameters (URL, username and password) --> <metasearch-baseurl>http://my-institution.edu/web2/servlet/MuseWeb2</metasearch-baseurl> <metasearch-username>my-username</metasearch-username> <metasearch-password>my-password</metasearch-password> <!-- Repository OSID implementation to use --> <!-- edu.indiana.lib.osid.base.repository.http (Sirsi SingleSearch) --> <!-- org.sakaibrary.osid.repository.xserver (Ex Libris MetaLib) --> <osid-impl>org.sakaibrary.osid.repository.xserver</osid-impl> <!-- Google Scholar URL and Sakai server --> <google-baseurl>http://scholar.google.com/schhp</google-baseurl> <sakai-serverkey>my-institution.sakai-instance.edu</sakai-serverkey> <!-- OpenUrl Resolver --> <!-- Use your local resolver URL (if you're running a resolver) --> <!-- http://worldcatlibraries.org/registry/gateway (if you've registered) --> <openurl-resolveraddress>http://my-institution.edu/openurl-resolver</openurl-resolveraddress> </config> |
Note: Property names in the XML above are not syntactically the same as the property names used for sakai.properties
. See the Configuration Properties page for a listing of all properties used in sakai.properties
. You will find the property names to be the same, just not written in the same way, as the XML document above.
Note: If there is a conflict between a static and a dynamically set configuration parameter, the dynamic value takes precedence.