org.activemath.content.mediator.kbimpl
Class ExerciseRepositoryCaller

java.lang.Object
  extended by org.activemath.content.mediator.KBCaller
      extended by org.activemath.content.mediator.kbimpl.ExerciseRepositoryCaller

public class ExerciseRepositoryCaller
extends KBCaller

Connects the ExerciseRepository to the Mediator. A URL of the Ex.Rep. looks like: mathdox://workplace/klett/Sippel/uebung_01. This class does only work with xml-rpc 2! And the class AuthenticationManager uses a method, which is only in xml-rpx 1 and not in 2.


Field Summary
protected static boolean DEBUG
           
 
Constructor Summary
ExerciseRepositoryCaller(String url, String user, String password)
           
 
Method Summary
 String getContent(String uri)
          Returns the whole content of the learning object corresponding to the given uri.
 String getMappingURL()
          Returns the URL of the mapping file.
 String getName()
          Each KBCaller has name, which can be returned by this method.
 String getOntologyURL()
          Returns the URL of the owl-file which specifies the metadata structure of the kb.
 String getUniqueURIPrefix()
          Returns a unique prefix of the URIs belonging to this repository.
 Set queryClass(String item)
          We return a set with the single String "exercise" in it because we only have exercises in the exercise repository
 Set queryProperty(String item)
          Returns a Set of lists, where each list comprises two elements: [attribute,value].
 Set queryRelation(String rel, String item)
          Currently, this method returns the set of all exercises there are in the repository iff the incoming item is a definition of the derivative.
 Set queryRelation(String rel, String item, String c)
          Returns the set of all items x for which holds: x rel item.
 
Methods inherited from class org.activemath.content.mediator.KBCaller
getOIOMapping, getOntologyModel, optimizeKBQuery, setOIOMapping, setOntologyModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

protected static final boolean DEBUG
Constructor Detail

ExerciseRepositoryCaller

public ExerciseRepositoryCaller(String url,
                                String user,
                                String password)
                         throws KBCallerException
Parameters:
url -
Throws:
KBCallerException
Method Detail

queryClass

public Set queryClass(String item)
We return a set with the single String "exercise" in it because we only have exercises in the exercise repository

Specified by:
queryClass in class KBCaller
Returns:
a set of Strings
See Also:
KBCaller.queryClass(java.lang.String)

queryRelation

public Set queryRelation(String rel,
                         String item)
Currently, this method returns the set of all exercises there are in the repository iff the incoming item is a definition of the derivative. If it is not, an empty set is returned.

Specified by:
queryRelation in class KBCaller
Returns:
a set of Strings
See Also:
KBCaller.queryRelation(java.lang.String, java.lang.String)

queryProperty

public Set queryProperty(String item)
Description copied from class: KBCaller
Returns a Set of lists, where each list comprises two elements: [attribute,value]. The set contains the metadata specification of the given item.

Specified by:
queryProperty in class KBCaller
Returns:
a Set of Lists

getName

public String getName()
Description copied from class: KBCaller
Each KBCaller has name, which can be returned by this method.

Specified by:
getName in class KBCaller
Returns:
The Name of the KBCaller.

getOntologyURL

public String getOntologyURL()
Description copied from class: KBCaller
Returns the URL of the owl-file which specifies the metadata structure of the kb.

Specified by:
getOntologyURL in class KBCaller
Returns:
a Sting determining URL.

getMappingURL

public String getMappingURL()
Description copied from class: KBCaller
Returns the URL of the mapping file. A mapping file specifies the correspondence of metadata concepts between the Ontology of Instructional Objects and the metadata ontology describing the metadata structure of a KBCaller.

Specified by:
getMappingURL in class KBCaller
Returns:
a String determining the mapping's URL.

getUniqueURIPrefix

public String getUniqueURIPrefix()
Description copied from class: KBCaller
Returns a unique prefix of the URIs belonging to this repository. E.g. returning "mbase://" will let the mediator access this KBCaller in order to retrieve the metadata or the content of a certain Learning object.

Specified by:
getUniqueURIPrefix in class KBCaller
Returns:
a String denoting the unique string each URI of a learning object belonging to this repository caller starts with.

getContent

public String getContent(String uri)
Description copied from class: KBCaller
Returns the whole content of the learning object corresponding to the given uri. Use this method to fetch a whole learning object from a foreign repository.

Specified by:
getContent in class KBCaller
Returns:
the whole body of a learning object as String.

queryRelation

public Set queryRelation(String rel,
                         String item,
                         String c)
Description copied from class: KBCaller
Returns the set of all items x for which holds: x rel item. E.g. queryRelation(function, is_a, en) will return the set {even function, odd function, ...}. Additionally, when a symbol has several definitions with different coverages, then the definition with the coverage c is selected.

Specified by:
queryRelation in class KBCaller
Returns:
a set of Strings