banner

How to use the ALOA Web Service API

  1. Download this jar file. This jar contains the ALOA Web Service API.
  2. Download the jar files "axis-1.4.jar, axis-jaxrpc-1.4.jar, axis-saaj-1.4.jar, axis-wsdl4j-1.5.1.jar, commons-logging-1.1.jar, commons-discovery-0.2.jar" from the Apache Axis page.
  3. Download the jar file "castor-1.1-M2.jar" from the Castor project page.
  4. The API is very straightforward, this is an example of what you can do:
    
    // sets the learning object source
    
    // We assume here that we want to generate metadata from
    // "http://www-i5.informatik.rwth-aachen.de"
    // ALOA can also generate metadata from other file types
    // e.g. pdf, ppt, word, simple text files
    // The ALOA Framework was designed to be extended with
    // other file type extractors
    URLMetadatasourceId metadatasourceId =
        new URLMetadatasourceId();
    // An id for the metadata source should be defined,
    // here we use "test" as id
    metadatasourceId.setMetadatasourceIdName("test");
    metadatasourceId.setLoURLLocation(
        "http://www-i5.informatik.rwth-aachen.de");
    
    // creates the proxy
    
    SamgIPortProxy sampleSamgIPortProxyid = new SamgIPortProxy();
    
    sampleSamgIPortProxyid.setEndpoint
    ("http://eiche.informatik.rwth-aachen.de:3333/ALOA/services/SamgIPort");
    
    // sets the target languages
    
    // ALOA supports the following languages:
    // English, German, French, Spanish, Arabic, Korean
    // If no language is defined, the default language
    // of the learning object will be used.
    // A session id for the target languages should be defined
    String[] targets = new String[] {"english", "german"};
    sampleSamgIPortProxyid.setLanguages("1234", targets);
    
    // gets the metadata
    
    // The ALOA result will be a string containing
    // the learning object metadata in XML format
    // If the whole metadata has to be generated
    String[] types = null;
    String res = sampleSamgIPortProxyid.getMetadata(
        "1234", new MetadatasourceId[] {
         metadatasourceId }, types);
    // If only a part of the metadata has to be generated
    // (in this example only Title, Author, and Keywords)
    String[] types = new String[] {"TITLE", "AUTHOR", "KEYWORD"};
    String res = sampleSamgIPortProxyid.getMetadata(
        "1234", new MetadatasourceId[] {
         metadatasourceId }, types);
    		
Copyright © 2007
Informatik 5
RWTH Aachen
ALOA Team
Home
More information about the ALOA Framework