Fork me on GitHub

Tutorial 9

E09 Bundling multiple documents to a virtual projection

This tutorial introduces the concept of "external projections". You may specify a document origin per projection method. This way a projection may project data of multiple documents into one Java object. As example we take the XML interfaces of a Dreambox. A Dreambox is a hard disk video recorder with a web based interface that works with XML data exchange from multiple URLs. This example is provided to show a real life use case for integration of multiple external documents to one Java interface. You are surly not able to run this example without access to specific version of this hard disk recorder. Therefore there is no example code provided which uses this interface.

Projection interface

public interface Dreambox {
    // This is the root XBDocURL of my device.
    final static String BASE_URL = "";
    @XBDocURL(BASE_URL + "/movielist?dirname={0}")
    List<Movie> getMovies(String location);
    @XBDocURL(BASE_URL + "/getservices?")
    List<Service> getServices();
    @XBDocURL(BASE_URL + "/web/epgservice?sRef={0}")
    List<Event> getEvents(String serviceReference);
    @XBDocURL(BASE_URL + "/web/getlocations")
    List<String> getLocations();