Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.Source


    // the MdmLevelHierarchy for the SHIPMENTS hierarchy of that
    // dimension, and the Source objects for them.
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmLevelHierarchy mdmShipmentsHIer = (MdmLevelHierarchy)
    getContext().getHierarchyByName(mdmCustDim, "SHIPMENTS_AW");
    Source custDim = mdmCustDim.getSource();
    StringSource shipments = (StringSource) mdmShipmentsHIer.getSource();
       
    // Get the parent attribute for the hierarchy and the value description
    // attribute for the dimension, and the Source objects for them.
    MdmAttribute mdmParentAttr = mdmShipmentsHIer.getParentAttribute();
    MdmAttribute mdmCustValDescAttr = mdmCustDim.getValueDescriptionAttribute();
    Source shipmentsParentAttr = mdmParentAttr.getSource();
    Source custValDescAttr = mdmCustValDescAttr.getSource();
   
    // Specify a parent value from the hierarchy.
    Source parentValue =
            shipments.selectValue("SHIPMENTS_AW::WAREHOUSE_AW::17");
   
    // Example 1: Using the full recursiveJoin method signature.
    // Create a Source that specifies the parent value and its children.
    Source parentAndChildren =
            shipments.recursiveJoin(custDim.value(),
                                    parentValue,
                                    shipmentsParentAttr,
                                    Source.COMPARISON_RULE_SELECT,
                                    true,
                                    true,
                                    5,
                                    false);
    // Create a Source that has the value descriptions for the parent and
    // child values.
    Source parentAndChildrenWithDescr = custValDescAttr.join(parentAndChildren);
    // Prepare and commit the Transaction.
    prepareAndCommit();
    // Create a Cursor for parentAndChildrenWithDescr and display its values.
    println("\nUsing the full recursiveJoin method signature.");
    getContext().displayResult(parentAndChildrenWithDescr);
              
    // Example 2: recursiveJoin(Source joined, String comparison,
    //                          Source parent, int comparisonRule)
    // Using a single String as the comparison, select the parent values and
    // their children.
    Source parentAndChildrenShortcut =
            shipments.recursiveJoin(custDim.value(),
                                    "SHIPMENTS_AW::WAREHOUSE_AW::17",
                                    shipmentsParentAttr,
                                    Source.COMPARISON_RULE_SELECT);
    // Add the value descriptions to the selections.
    Source parentAndChildrenShortcutWithDescr =
            custValDescAttr.join(parentAndChildrenShortcut);
    prepareAndCommit();
    println("\nUsing the recursiveJoin(Source joined, " +
            "String comparison,\n" +
            "Source parent, int comparisonRule) method.");
    getContext().displayResult(parentAndChildrenShortcutWithDescr);
       
    // Example 3: recursiveJoin(Source joined, String[] comparison,
    //                          Source parent, int comparisonRule)
    // Using a String array as the comparison, select the parent values and
    // their children.
    Source parentsAndChildrenShortcut =
            shipments.recursiveJoin(custDim.value(),
                                    new String[]
                                      {"SHIPMENTS_AW::WAREHOUSE_AW::17",
                                       "SHIPMENTS_AW::WAREHOUSE_AW::18"},
                                    shipmentsParentAttr,
                                    Source.COMPARISON_RULE_SELECT);
     // Add the value descriptions to the selections.
     Source parentsAndChildrenShortcutWithDescr =
             custValDescAttr.join(parentsAndChildrenShortcut);
     prepareAndCommit();
     println("\nUsing the recursiveJoin(Source joined, " +
             "String[] comparison,\n" +
             "Source parent, int comparisonRule) method.");
     getContext().displayResult(parentsAndChildrenShortcutWithDescr);   
    
     // Example 4: selectDescendants(Source comparison, Source parent)
     // Select the parent value and its descendants.
     Source parentAndChildrenShortcut2 =
             shipments.selectDescendants(
                      getExpressDataProvider()
                      .createConstantSource("SHIPMENTS_AW::WAREHOUSE_AW::17"),
                      shipmentsParentAttr);
     // Add the value descriptions to the selections.
     Source parentAndChildrenShortcut2WithDescr =
             custValDescAttr.join(parentAndChildrenShortcut2);
     prepareAndCommit();
     println("\nUsing the selectDescendants(Source comparison, " +
             "Source parent) method.");
     getContext().displayResult(parentAndChildrenShortcut2WithDescr);
         
     // Example 5: sortDescendingHierarchically(Source joined, Source parent,
     //                                         boolean parentsFirst,
     //                                         boolean parentsRestrictedToBase)
     // Select the descendants of a REGION value, which is the level above the
     // WAREHOUSE level.
     Source custSel = shipments.selectDescendants(
                        getExpressDataProvider()
                        .createConstantSource("SHIPMENTS_AW::REGION_AW::8"),
                        shipmentsParentAttr);
     // Sort the selection hierarchically in descending order, with the parent
     // values appearing after their children.
     Source custSelSortedDescending =
        custSel.sortDescendingHierarchically(custDim.value(),
                                             shipmentsParentAttr,
                                             false, // parents after children
                                             true);
     // Add the value descriptions to the sorted selections.
     Source custSelSortedDescendingWithDescr =
             custValDescAttr.join(custSelSortedDescending);
     prepareAndCommit();
     println("\nUsing the sortDescendingHierarchically(Source joined, " +
             "Source parent,\nboolean parentsFirst, " +
             "boolean parentsRestrictedToBase) method.");
View Full Code Here


   
    // Create the querySource object to use in the
    // Creating a Cursor example.

    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    Source unitPrice = mdmUnitPrice.getSource();

    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();

    // Get the Source for the hierarchy.
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();

    Source prodSel = prodHier.selectValues(new String[] {
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::15"});

    Source timeSel = timeHier.selectValues(new String[] {
                                           "CALENDAR_YEAR_AW::MONTH_AW::55",
                                           "CALENDAR_YEAR_AW::MONTH_AW::58",
                                           "CALENDAR_YEAR_AW::MONTH_AW::61",
                                           "CALENDAR_YEAR_AW::MONTH_AW::64"});

    Source querySource = unitPrice.join(prodSel).join(timeSel);

    // Call the methods that run the examples.
    try
    {
      // 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.
      List sourcesFromEx4 = getValCursorsFromCompoundCursor(prodHier, timeHier);

      // The Getting Values from a CompoundCursor with Nested Outputs example.
      getValsFormCompoundCursorWithNestedOutputs(sourcesFromEx4);

      // The Navigating for a Table View example.
      Source unitPriceByMonth = navigatingForATableView(unitPrice,
                                                        timeHier,
                                                        prodSel);

      // The Navigating for a Crosstab View without Pages example.
      navigatingForACrossTabViewWOPages(unitPriceByMonth);
View Full Code Here

  private ValueCursor gettingASingleValue(MdmHierarchy mdmProdHier)
  {
    println("\nGetting a Single Value from a ValueCursor");

    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 =
View Full Code Here

                                     mdmCustDim.getDefaultHierarchy();

    StringSource chanHier = (StringSource) mdmChanHier.getSource();
    StringSource custHier = (StringSource) mdmCustHier.getSource();

    Source chanSel = chanHier.selectValue("CHANNEL_PRIMARY_AW::CHANNEL_AW::2");

    Source custSel = custHier.selectValues(new String[] {
                                            "SHIPMENTS_AW::SHIP_TO_AW::58",
                                            "SHIPMENTS_AW::SHIP_TO_AW::61",
                                            "SHIPMENTS_AW::SHIP_TO_AW::65"});

    Source prodSel = prodHier.selectValues(new String[] {
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::15"});

    Source timeSel = timeHier.selectValues(new String[] {
                                            "CALENDAR_YEAR_AW::MONTH_AW::43",
                                            "CALENDAR_YEAR_AW::MONTH_AW::44",
                                            "CALENDAR_YEAR_AW::MONTH_AW::45"});

    // Code from the example.
    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);

    // Prepare and commit the current Transaction.
View Full Code Here

  private void getValsFormCompoundCursorWithNestedOutputs(List sourcesFromEx4)
    throws NotCommittableException
  {
    println("\nGetting Values from a CompoundCursor with Nested Outputs");

    Source units = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);

    // Code from the example.
    Source custByChanSel = custSel.join(chanSel);
    Source unitsForSelections = units.join(prodSel)
                                     .join(timeSel)
                                     .join(custByChanSel);

    // Prepare and commit the current Transaction.
    prepareAndCommit();
View Full Code Here

    println("\nNavigating For a Table View");
   
    String sp9 = "         ";
   
    // Select the first month of the timeHier quarters for 2001, 2002
    Source timeSel = timeHier.selectValues(new String[] {
                                           "CALENDAR_YEAR_AW::MONTH_AW::55",
                                           "CALENDAR_YEAR_AW::MONTH_AW::58",
                                           "CALENDAR_YEAR_AW::MONTH_AW::61",
                                           "CALENDAR_YEAR_AW::MONTH_AW::64",
                                           "CALENDAR_YEAR_AW::MONTH_AW::69",
                                           "CALENDAR_YEAR_AW::MONTH_AW::72",
                                           "CALENDAR_YEAR_AW::MONTH_AW::75",
                                           "CALENDAR_YEAR_AW::MONTH_AW::78"});
    Source unitPriceByMonth = unitPrice.join(prodSel)
                                       .join(timeSel);
    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
View Full Code Here

  private void navigatingForACrosstabViewWPages(List sourcesFromEx4)
    throws NotCommittableException
  {
    println("\nNavigating For a Crosstab View With Pages");

    Source units = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);

    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);
   
    // Prepare and commit the current Transaction.
View Full Code Here

    println("Getting CursorSpecification Objects from a CursorManagerSpecification");

    println("This example has no text output. It returns a " +
            "CursorManagerSpecification \nused by other examples.");

    Source units  = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);

    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);

    // Prepare and commit the current Transaction.
View Full Code Here

  public void calculatingTheSpan(List sourcesFromEx4)
    throws NotCommittableException
  {
    println("\nCalculating the Span of the Positions in the Parent of a Value");

    Source units  = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);
   
    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);

    // Prepare and commit the current Transaction.
View Full Code Here

   
    // Create the querySource object to use in the
    // Creating a Cursor example.

    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    Source unitPrice = mdmUnitPrice.getSource();

    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();

    // Get the Source for the hierarchy.
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();

    Source prodSel = prodHier.selectValues(new String[] {
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                           "PRODUCT_PRIMARY_AW::ITEM_AW::15"});

    Source timeSel = timeHier.selectValues(new String[] {
                                           "CALENDAR_YEAR_AW::MONTH_AW::55",
                                           "CALENDAR_YEAR_AW::MONTH_AW::58",
                                           "CALENDAR_YEAR_AW::MONTH_AW::61",
                                           "CALENDAR_YEAR_AW::MONTH_AW::64"});

    Source querySource = unitPrice.join(prodSel).join(timeSel);

    // Call the methods that run the examples.
    try
    {
      // 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.
      List sourcesFromEx4 = getValCursorsFromCompoundCursor(prodHier, timeHier);

      // The Getting Values from a CompoundCursor with Nested Outputs example.
      getValsFormCompoundCursorWithNestedOutputs(sourcesFromEx4);

      // The Navigating for a Table View example.
      Source unitPriceByMonth = navigatingForATableView(unitPrice,
                                                        timeHier,
                                                        prodSel);

      // The Navigating for a Crosstab View without Pages example.
      navigatingForACrossTabViewWOPages(unitPriceByMonth);
View Full Code Here

TOP

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

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.