The OSIDs (available from osid.org) are the service interface definitions. This wiki has information about the OSIDs and the Okapia open-source implementation.
Getting Okapia jars from the maven repository.
Clone a sample application and OSID Provider:
% git clone git://git.assembla.com/osid-sample.git % cd osid-sample % make run |
If you count nine planets, your OSID environment is working. Anything less then there was a serious problem.
net.okapia.osid.sample.Test illustrates the basics of consuming an OSID.
The Resource OSID Provider is net.okapia.osid.sample.providers.resource.solarsystem. It demonstrates:
net.okapia.osid.sample.Planets is the sample application. It performs the following:
The shaded rows indicate classes that directly implement an OSID. The others are supporting files.
file | purpose |
---|---|
net.okapia.osid.sample.providers.resource.solarsystem.ResourceManager | The entry point for OSID Providers. OsidManagers define what the OSID Provider supports and provides access to supported OsidSessions. |
net.okapia.osid.sample.providers.resource.solarsystem.ServiceProvider | Metadata for OsidManager implementations. |
net.okapia.osid.sample.providers.resource.solarsystem.ResourceLookupSession | The OsidSession for listing Resources. All the action happens in OsidSessions. |
net.okapia.osid.sample.providers.resource.solarsystem.Resource | An implementation of Resource. |
net.okapia.osid.sample.providers.resource.solarsystem.Planet | An enumeration of planets from which to create Resources. |
net.okapia.osid.sample.providers.resource.solarsystem.Bin | An OsidCatalog for collections of Resources. This provider defines only one. |
net.okapia.osid.sample.providers.resource.compliance.ResourceManager.xml | A configuration file for this provider. The OsidRuntimeManager feeds configuration data to OsidManager implementations via the initialize() method. |
The OSID Java Language Binding is in a jar OSID-<version>.jar. The other package dependencies are part of the Okapia OSID implementation framework.
Looking at the class files in the Resource OSID Provider, you can see that they extend classes in this framework and often make use of other Okapia tools in them.
Methods annotated with
@OSID @Override
directly implement an OSID method in an OSID.