Package oracle.olapi.data.cursor

Examples of oracle.olapi.data.cursor.ValueCursor


    {
      // The Creating a Cursor example.
      creatingACursor(querySource);

      // The Getting a Single Value from a ValueCursor example.
      ValueCursor prodValues = gettingASingleValue(mdmProdHier);

      // The Getting All of the Values from a ValueCursor example.
      getAllValues(prodValues);

      // The Getting ValueCursor Objects from a CompoundCursor example.
View Full Code Here


                 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.
    String value = prodValues.getCurrentString();

    // Do something with the value, such as display it.
    println(value);
    // Close the SpecifiedCursorManager.
View Full Code Here

                   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);
    ValueCursor prodSelVals = (ValueCursor) outputs.get(3);

    // 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() + ", " +
              prodSelVals.getCurrentString() + ", " +
              specifiedUnitsVals.getCurrentValue());
      i++;
    }
    while(unitsForSelCursor.next());
View Full Code Here

    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();
View Full Code Here

    // 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 + ".");
View Full Code Here

  {
        CursorManagerSpecification cursorMngrSpec =
                dp.createCursorManagerSpecification(source);
        SpecifiedCursorManager cursorManager =
                dp.createCursorManager(cursorMngrSpec);
        ValueCursor valueCursor = (ValueCursor) cursorManager.createCursor();
       
        cpw.printTopBottomResult(valueCursor);
       
        // Close the CursorManager.
        cursorManager.close();
View Full Code Here

      }
   
      tp.commitCurrentTransaction();
           
      CursorManager cmngr = dp.createCursorManager(shortDescrForMember);
      ValueCursor valCursor = (ValueCursor) cmngr.createCursor();
           
      String shortDescrForMemberVal = valCursor.getCurrentString();
           
      if(firsttime)
      {
        shortDescrForMemberVals.append(shortDescrForMemberVal);
        firsttime = false;
View Full Code Here

    do
      {
      if(rootCursor instanceof CompoundCursor){
        CompoundCursor compoundCursor = (CompoundCursor)rootCursor;
        LazyDynaBean ldb = null;
        ValueCursor valueCursor = compoundCursor.getValueCursor();
        if (valueCursor.hasCurrentValue()) {
          ldb = new LazyDynaBean();
          ldb.set("text", valueCursor.getCurrentValue());
        }
        
        List<Cursor> oList = compoundCursor.getOutputs();
        for(int i=0;i<oList.size();i++){
          Cursor cursor = oList.get(i);
          if(cursor instanceof ValueCursor){
            valueCursor = (ValueCursor)cursor;
            if(valueCursor.hasCurrentValue()){
              ldb.set("id", valueCursor.getCurrentValue());
              result.add(ldb);
            }
          }
        }
      }
View Full Code Here

    do
      {
      if(rootCursor instanceof CompoundCursor){
        CompoundCursor compoundcursor = (CompoundCursor)rootCursor;
        LazyDynaBean ldb = null;
        ValueCursor valueCursor = compoundcursor.getValueCursor();
        if (valueCursor.hasCurrentValue()) {
          ldb = new LazyDynaBean();
          ldb.set("value", valueCursor.getCurrentValue());
          ldb.set("valueID", measureName);
        }else{
          ldb = new LazyDynaBean();
          ldb.set("value", 0);
          ldb.set("valueID", measureName);
//          continue;
        }
        
        List<Cursor> oList = compoundcursor.getOutputs();
        if(oList!=null&&dimNames!=null&&oList.size()==dimNames.size()){
          for(int i=0;i<oList.size();i++){
            Cursor cursor = oList.get(i);
            if(cursor instanceof CompoundCursor){
              CompoundCursor compoundCursor = (CompoundCursor)cursor;
              setBeanAttribute(ldb,dimNames.get(i),compoundCursor);
            }
          }
        }
        result.add(ldb);
      }else if(rootCursor instanceof ValueCursor){
        ValueCursor valueCursor = (ValueCursor)rootCursor;
        System.out.println(valueCursor);
      }
     
      }
      while(rootCursor.next());
View Full Code Here

  private static void setBeanAttribute(LazyDynaBean bean,String name,CompoundCursor compoundCursor){
    if(bean==null||compoundCursor==null){
      return;
    }
//    List<Cursor> outputs = compoundCursor.getOutputs();
    ValueCursor value = compoundCursor.getValueCursor();
    if(value.hasCurrentValue()){
      bean.set(name, value.getCurrentValue());
      List<Cursor> outputs = compoundCursor.getOutputs();
      if(outputs!=null&&outputs.size()==1){
        Cursor output = outputs.get(0);
        if(output instanceof ValueCursor){
          ValueCursor outputValue = (ValueCursor)output;
          bean.set(name+"ID", outputValue.getCurrentString());
        }
      }
    }else{
      List<Cursor> outputs = compoundCursor.getOutputs();
      if(outputs!=null&&outputs.size()==1){
        Cursor output = outputs.get(0);
        if(output instanceof ValueCursor){
          ValueCursor outputValue = (ValueCursor)output;
          String outString = outputValue.getCurrentString();
          Log.error(outString+" has no short description");
          if(outString.indexOf("::") > 0)
                {
                    int index = outString.lastIndexOf("::");
                    outString = outString.substring((index + 2),
                        outString.length());
                }
          bean.set(name, outString);
          bean.set(name+"ID", outputValue.getCurrentString());
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of oracle.olapi.data.cursor.ValueCursor

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.