Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Summary

OSID Runtime manages configuration for OSID Providers.

...

Code Block
titleGetting the Logging OSID Provider via Configuration in Jamocha
 public class MyCalendarManager
    extends net.okapia.osid.jamocha.calendaring.spi.AbstractCalendaringManager
    implements org.osid.calendaring.CalendaringManager {
  
    private org.osid.logging.LoggingManager logger;
    private static final org.osid.id.Id LOGGING_IMPL_PARAMETER_ID = new net.okapia.primordium.id.BasicId("myCalendar", "configuration", "logging_osid");
 
 
    @OSID @Override
    public void initialize(org.osid.OsidRuntimeManager runtime)
        throws org.osid.ConfigurationErrorException,
               org.osid.OperationFailedException {
            
        super.initialize(runtime);
        this.logger = (org.osid.logging.LoggingManager) loadOsidManager(OSID.LOGGING, 
                                                                        getConfigurationValue(LOGGING_IMPL_PARAMETER_ID).getStringValue());
          
        return;
    }
 
    ....
}

Single Vs. Multiple Values

 There are two variants of value retrieval operations:

...

Kilimanjaro's Configuration Files

...

Base Configuration

Code Block
titleExample Configuration
<?xml version="1.0" encoding="utf-8" standalone="no"?>

<configuration xmlns="urn:inet:osid.org:schemas:configuration"
               lastmod="2010-01-29T16:25:00Z">

    <displayName>Example Configuration</displayName>
    <description>
        <div>An eample configuration to demonstrate the Base Configuration
        OSID Provider. This implementation is not quite as flexible as
	    the Configuration OSID allows, but does handle parameter
	    metadata and multiple values.</div>
    </description>

    <parameter id="shouldThisWork" syntax="boolean">
    	<displayName>Wor</displayName>
	    <description>
            <div class="description">A parameter to specify whether or not this
            code should work. If set to false, <em>random bugs</em> may occur.</div> 
	    </description>
	    <value>
            <boolean>true</boolean>
	    </value>
    </parameter>

    <parameter id="favoriteNumber" syntax="cardinal">
	    <displayName>Favorite Number</displayName>
	    <description>
            Our favorite number between 1 and 10.
	    </description>
	    <value>
            <cardinal>3</cardinal>
	    </value>
    </parameter>

    <parameter id="birthdate" syntax="datetime">
	    <displayName>Birthday</displayName>
	    <description>
            A date on which someone was born specified in ISO format.
	    </description>
	    <value>
            <datetime>1979-08-20</datetime>
    	</value>
    </parameter>
 
    <parameter id="serverName" syntax="string">
        <displayName>Server Name</displayName>
        <description>
            The name of our database server that contains the projects
            plans for the product we wish we could build.
        </description>
        <value priority="1">
            <string>www1.company.com</string>
        </value>
        <value priority="1">
            <string>www2.company.com</string>
        </value>
        <value priority="10">
            <string>backup.company.com</string>
        </value>
    </parameter>
</configuration>

The above is an example of a base configuration file that defines Parameters and Values for the Configuration OSID.