Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.SpecifiedCursorManager


    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor unitsForSelCursor = (CompoundCursor) cursorMngr.createCursor();

    // Display the results in a crosstab.
    getContext().printAsCrosstab(unitsForSelCursor);
   
    // For the printAsCrosstab method, see the CursorPrintWriter class.
    cursorMngr.close();
  }
View Full Code Here


      //isCalcSet(isSet, 3); // Added to verify that calculation is set.
    }
   
    // Create a Cursor and display the results to show the parent
    // starting and ending positions.
    SpecifiedCursorManager cursorManager =
                                       dp.createCursorManager(cursorMngrSpec);

    Cursor cursor = cursorManager.createCursor();
    println("\nThe values of the Cursor are:");
    getContext().displayCursor(cursor);
    cursorManager.close();
  }
View Full Code Here

    timeSelValCSpec.setParentEndCalculationSpecified(true);
    prodSelValCSpec.setParentStartCalculationSpecified(true);
    prodSelValCSpec.setParentEndCalculationSpecified(true);

    // Create the CursorManager and the Cursor.
    SpecifiedCursorManager cursorMngr = dp.createCursorManager(cursorMngrSpec);
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Get the child Cursor objects.
    ValueCursor baseValCursor = rootCursor.getValueCursor();
    List outputs = rootCursor.getOutputs();
    ValueCursor chanSelVals = (ValueCursor) outputs.get(0);
    ValueCursor timeSelVals = (ValueCursor) outputs.get(1);
    ValueCursor custSelVals = (ValueCursor) outputs.get(2);
    ValueCursor prodSelVals = (ValueCursor) outputs.get(3);
   
    // Set the position of the root CompoundCursor.
    rootCursor.setPosition(15);

    // Get the values at the current position and determine the span
    // of the values of the time and product outputs.
    print(chanSelVals.getCurrentValue() + ", ");
    print(timeSelVals.getCurrentValue() + ", ");
    print(custSelVals.getCurrentValue() + ", ");
    print(prodSelVals.getCurrentValue() + ", ");
    print(baseValCursor.getCurrentValue());
    println();

    // Determine the span of the values of the two fastest varying outputs.
    long span;
    span = ((prodSelVals.getParentEnd() - prodSelVals.getParentStart()) +1);
    println("The span of " + prodSelVals.getCurrentValue() +
            " at the current position is " + span + ".");
    span = ((timeSelVals.getParentEnd() - timeSelVals.getParentStart()) +1);
    println("The span of " + timeSelVals.getCurrentValue() +
            " at the current position is " + span + ".");

    cursorMngr.close();
  }
View Full Code Here

    println("\nCreating a Cursor");

    prepareAndCommit();
    CursorManagerSpecification cursorMngrSpec =
                 dp.createCursorManagerSpecification(querySource);
    SpecifiedCursorManager cursorMngr =
                 dp.createCursorManager(cursorMngrSpec);
    CompoundCursor queryCursor = (CompoundCursor)cursorMngr.createCursor();

    // Use the Cursor in some way, such as to display its values.
    getContext().displayCursor(queryCursor);

    getContext().printAsCrosstab(queryCursor);
   
//    getContext().printAsCrosstab(queryCursor);
    cursorMngr.close();
  }
View Full Code Here

    Source prodSource = mdmProdHier.getSource();
    // Because prodSource is a primary Source, you do not need to
    // prepare and commit the current Transaction.
    CursorManagerSpecification cursorMngrSpec =
                 dp.createCursorManagerSpecification(prodSource);
    SpecifiedCursorManager cursorMngr =
                 dp.createCursorManager(cursorMngrSpec);
    // Because the Source has no outputs, the Cursor for it
    // is a ValueCursor.
    ValueCursor prodValues = (ValueCursor) cursorMngr.createCursor();
    // Set the position to the fifth element of the ValueCursor.
    prodValues.setPosition(5);

    // Product values are strings. Get the String value at the
    // current position.
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
                   dp.createCursorManagerSpecification(querySource);
    SpecifiedCursorManager cursorMngr =
                   dp.createCursorManager(cursorMngrSpec);
    CompoundCursor unitsForSelCursor =
                   (CompoundCursor) cursorMngr.createCursor();

    // Get the base ValueCursor.
    ValueCursor specifiedUnitsVals = unitsForSelCursor.getValueCursor();

    // Get the outputs.
    List outputs = unitsForSelCursor.getOutputs();
    ValueCursor chanSelVals = (ValueCursor) outputs.get(0);
    ValueCursor timeSelVals = (ValueCursor) outputs.get(1);
    ValueCursor custSelVals = (ValueCursor) outputs.get(2);

    // You can now get the values from the ValueCursor objects.
    // When you have finished using the Cursor objects, close the
    // SpecifiedCursorManager.
    int i = 1;
    do
    {
      println(i + ": " +
              chanSelVals.getCurrentString() + ", " +
              timeSelVals.getCurrentString() + ", " +
              custSelVals.getCurrentString() + ", " +
              specifiedUnitsVals.getCurrentValue());
      i++;
    }
    while(unitsForSelCursor.next());

    cursorMngr.close();

    // Create an ArrayList of the Source objects for use by other examples.
    ArrayList sourcesFromExample4 = new ArrayList();
//    sourcesFromExample4.add(units);
//    sourcesFromExample4.add(prodSel);
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    Cursor unitsForSelCursor = cursorMngr.createCursor();

    // Send the Cursor to a method that does different operations.
    // depending on whether the Cursor is a CompoundCursor or a
    // ValueCursor.
    getContext().printCursor(unitsForSelCursor);
    cursorMngr.close();
    // ...the remaining code of someMethod...
   
    // For the code for the printCursor and _printTuple methods, see
    // the oracle.olapi.examples.CursorPrintWriter class.
  }
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
   
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Determine a starting position and the number of rows to display.
    int start = 7;
    int numRows = 12;
   
    println("Month     Product     Unit Price");
    println("-----     -------     ----------");

    // Iterate through the specified positions of the root CompoundCursor.
    // Assume that the Cursor contains at least (start + numRows) positions.
    for(int pos = start; pos < start + numRows; pos++)
    {
      // Set the position of the root CompoundCursor.
      rootCursor.setPosition(pos);

      // Print the local values of the output and base ValueCursors.
      // The getLocalValue method gets the local value from the unique
      // value of a dimension element.
      String timeValue = ((ValueCursor)rootCursor.getOutputs().get(0))
                          .getCurrentString();
      String timeLocVal = getContext().getLocalValue(timeValue);
      String prodValue = ((ValueCursor)rootCursor.getOutputs().get(1))
                          .getCurrentString();
      String prodLocVal = getContext().getLocalValue(prodValue);
      Object price = rootCursor.getValueCursor().getCurrentValue();
      println("  " + timeLocVal + sp9 + prodLocVal + sp9 +  price);
    }
    cursorMngr.close();

    return unitPriceByMonth;
  }
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitPriceByMonth);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor rootCursor = (CompoundCursor) cursorMngr.createCursor();

    // Get the outputs and the ValueCursor.
    List outputs = rootCursor.getOutputs();
    // The first output has the values of timeSel, the slower varying output.
    ValueCursor rowCursor = (ValueCursor) outputs.get(0);
    // The second output has the faster varying values of prodSel.
    ValueCursor columnCursor = (ValueCursor) outputs.get(1);
    // The base ValueCursor has the values from unitPrice.
    ValueCursor unitPriceValues = rootCursor.getValueCursor();

    // Display the values as a crosstab.
    println("\t        PRODUCT_AW");
    println("\t-----------------------");
    print("Month");
    do
    {
      String value = ((ValueCursor) columnCursor).getCurrentString();
      print("\t" + getContext().getLocalValue(value) + "  ");
    }
    while (columnCursor.next());
    println("\n-----\t-------\t-------\t-------");

    // Reset the column Cursor to its first element.
    columnCursor.setPosition(1);

    do
    {
      // Print the row dimension values.
      String value = ((ValueCursor) rowCursor).getCurrentString();
      print(getContext().getLocalValue(value) + "\t");
      // Loop over columns.
      do
      {
        // Print the data value.
        print(unitPriceValues.getCurrentValue() + "\t");
      }
      while (columnCursor.next());

      println();

      // Reset the column Cursor to its first element.
      columnCursor.setPosition(1);
    }
    while (rowCursor.next());

    cursorMngr.close();
  }
View Full Code Here

    prepareAndCommit();

    // Create a Cursor for unitsForSelections.
    CursorManagerSpecification cursorMngrSpec =
            dp.createCursorManagerSpecification(unitsForSelections);
    SpecifiedCursorManager cursorMngr =
            dp.createCursorManager(cursorMngrSpec);
    CompoundCursor unitsForSelCursor = (CompoundCursor) cursorMngr.createCursor();

    // Display the results in a crosstab.
    getContext().printAsCrosstab(unitsForSelCursor);
   
    // For the printAsCrosstab method, see the CursorPrintWriter class.
    cursorMngr.close();
  }
View Full Code Here

TOP

Related Classes of oracle.olapi.data.source.SpecifiedCursorManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.