Provide the data access interface to the reporting service.

This package is responsible for data within the reporting engine. To make this part most generic, there are only interfaces, which define the needed functionallity to use the reporting engine. The main interface is the {@link com.top_logic.reporting.data.DataHandler}, which is the starting point of a report.

Depending on the kind of data handler the system provides different type of information provided by that handler (the so called {@link com.top_logic.reporting.data.Description}). This interface provides information to one type of data, which can be reported by the handler. Depending on that type this description provides a set of {@link com.top_logic.reporting.data.Operator operators}, which are processing data from the handler.

The set of {@link com.top_logic.reporting.data.Operator operators} can be retrieved by a special factory, which tries to find as much of operators as possible for the description. Therefore all known operators have to be named in the configuration file. The operator factory will inspect every operator and tries to find out, which types of data he is able to process.

The {@link com.top_logic.reporting.data.ValueHolder} is the class holding the real data. This class strongly interacts with the description, because that one knows the operators for the values within this holder. One value holder can have several {@link com.top_logic.reporting.data.Value values} within, which are located by a {@link com.top_logic.reporting.data.Range}.

This is a little bit complicated? No problem, here is an example for one value holder:

Expect a value holder for estimated costs and real costs for a project. The project lasts from 01.01.2002 to 31.12.2006. The value holder has then five ranges (2002, 2003, 2004, 2005, 2006), and the matching value for each of this ranges (100k, 230k, 50k, 94k, 42k). To get that values from the holder you will use the following code:

    ...
    private void printValues(ValueHolder aHolder) {
        Range   theRange;
        Range[] theRanges = aHolder.getRange();

        for (int thePos = 0; thePos < theRanges.length; thePos++) {
            theRange = theRanges[thePos];

            System.out.println(theRange.getDisplayName() + ": " + 
                               aHolder.getValue(theRange));
        }
    }
    ...

Simple, isn't it? When you want to use an operator on the whole range of values, you can use a code like this:

    ...
    private void printResult(ValueHolder aHolder, Operator anOp) {
        Range[] theRanges = aHolder.getRange();
        Value[] theValues = new Values[theRanges.length];

        for (int thePos = 0; thePos < theRanges.length; thePos++) {
            theValues[thePos] = aHolder.getValue(theRanges[thePos]);
        }

        System.out.println(anOp.getDisplayName() + " (on " + 
                           aHolder.getDisplayName() + "): " + 
                           anOp.process(theValues));
    }
    ...