Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.Source


    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                        mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                        mdmTimeDim.getDefaultHierarchy();
       
    Source unitCost = mdmUnitCost.getSource();
    Source calendar = mdmCalendar.getSource();
    Source prodHier = mdmProdHier.getSource();
    Source timeSel = calendar.join(calendar.value(),
                                   getExpressDataProvider().createListSource(
                                     new String[]
                                         {"CALENDAR_YEAR_AW::MONTH_AW::47",
                                          "CALENDAR_YEAR_AW::MONTH_AW::59"}),
                                   Source.COMPARISON_RULE_SELECT,
                                   false);
    Source prodSel = prodHier.join(prodHier.value(),
                                   getExpressDataProvider().createListSource(
                                    new String[]
                                        {"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                         "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                         "PRODUCT_PRIMARY_AW::ITEM_AW::15"}),
                                    Source.COMPARISON_RULE_SELECT,
                                    false);
    Source unitCostSel = unitCost.join(timeSel,
                                       getEmptySource(),
                                       Source.COMPARISON_RULE_REMOVE,
                                       true)
                                  .join(prodSel,
                                      getExpressDataProvider().getEmptySource(),
View Full Code Here


    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
       
    Source unitCost = mdmUnitCost.getSource();
    StringSource calendar = (StringSource) mdmCalendar.getSource();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    Source timeSel = calendar.selectValues(new String[]
                                            {"CALENDAR_YEAR_AW::MONTH_AW::47",
                                             "CALENDAR_YEAR_AW::MONTH_AW::59"});
    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 unitCostSel = unitCost.join(timeSel)
                                 .join(prodSel);
                         
    println("The values of unitCostSel in are now:");
    prepareAndCommit();
    getContext().displayResult(unitCostSel);
View Full Code Here

       
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmHierarchy mdmProdHier = mdmProdDim.getDefaultHierarchy();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
       
    Source myList = getExpressDataProvider().createListSource(new String[]
                                          {"PRODUCT_PRIMARY_AW::FAMILY_AW::4",
                                           "PRODUCT_PRIMARY_AW::FAMILY_AW::5",
                                           "PRODUCT_PRIMARY_AW::FAMILY_AW::7",
                                           "PRODUCT_PRIMARY_AW::FAMILY_AW::8"});
                
    Source pos = getExpressDataProvider().createListSource(new int[] {2, 4});
    Source myListPos = myList.position();
    Source myListSel = myList.join(myListPos,
                                   pos,
                                   Source.COMPARISON_RULE_SELECT,
                                   false);
                
    println("The values of myListSel with visible false:");
View Full Code Here

       
    // Get the MdmMeasure for units
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
   
    // Get the Source for the measure
    Source units = mdmUnits.getSource();
       
    // Get the dimensions and their default hierarchies.      
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
       
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                        mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmShipHier = (MdmLevelHierarchy)
                                      mdmCustDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                       mdmChanDim.getDefaultHierarchy();
       
    // Get the short description attribute for the dimensions, and the
    // Source objects for the attributes.
    MdmAttribute mdmProdShortDescr =
                               mdmProdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescr.getSource();
    MdmAttribute mdmCustShortDescr =
                               mdmCustDim.getShortValueDescriptionAttribute();
    Source custShortDescr = mdmCustShortDescr.getSource();
    MdmAttribute mdmTimeShortDescr =
                               mdmTimeDim.getShortValueDescriptionAttribute();
    Source timeShortDescr = mdmTimeShortDescr.getSource();
   
    // Get the short description attribute for the channel dimension.
    MdmAttribute mdmChanShortDescr =
                               mdmChanDim.getShortValueDescriptionAttribute();
    Source chanShortDescr = mdmChanShortDescr.getSource();
       
    // Get the Source objects for the default hierarchies of the dimensions
    // of the measures
    Source prodHier = mdmProdHier.getSource();
    Source shipHier = mdmShipHier.getSource();
    Source calendar = mdmCalendar.getSource();
    Source chanHier = mdmChanHier.getSource();
       
    // Select values from the hierarchies
    Source prodSel = prodHier.join(prodHier.value(),
                                   getExpressDataProvider().createListSource(
                                      new String[]
                                        {"PRODUCT_PRIMARY_AW::FAMILY_AW::4",
                                         "PRODUCT_PRIMARY_AW::FAMILY_AW::5"}),
                                     Source.COMPARISON_RULE_SELECT,
                                     false);
    Source custSel = shipHier.join(shipHier.value(),
                                   getExpressDataProvider().createListSource(
                                      new String[]
                                        {"SHIPMENTS_AW::REGION_AW::9",
                                         "SHIPMENTS_AW::REGION_AW::10"}),
                                    Source.COMPARISON_RULE_SELECT,
                                    false);
    Source timeSel = calendar.join(calendar.value(),
                                  getExpressDataProvider().createConstantSource(
                                  "CALENDAR_YEAR_AW::YEAR_AW::4"),
                                  Source.COMPARISON_RULE_SELECT,
                                  false);
    Source chanSel = chanHier.join(chanHier.value(),
                                  getExpressDataProvider().createConstantSource(
                                    "CHANNEL_PRIMARY_AW::CHANNEL_AW::4"),
                                  Source.COMPARISON_RULE_SELECT,
                                  false);
                         
    Source custSelByTime = custSel.join(timeSel,
                                        getEmptySource(),
                                        Source.COMPARISON_RULE_REMOVE,
                                        true);
                         
    Source prodByCustByTime = prodSel.join(custSelByTime,
                                           getEmptySource(),
                                           Source.COMPARISON_RULE_REMOVE,
                                           true);
                         
    Source selectedUnits = units.join(prodByCustByTime,
                                      getEmptySource(),
                                      Source.COMPARISON_RULE_REMOVE,
                                      true)
                                .join(chanSel,
                                      getEmptySource(),
                                      Source.COMPARISON_RULE_REMOVE,
                                      true);
                         
    prepareAndCommit();
    getContext().displayResult(selectedUnits);
                         
    // Create Source objects that have the short description attributes
    // as the type values and the dimension selection Source objects
    // as outputs.
    Source prodSelDescr = prodShortDescr.join(prodSel);
    Source custSelDescr = custShortDescr.join(custSel);
    Source timeSelDescr = timeShortDescr.join(timeSel);
    Source chanSelDescr = chanShortDescr.join(chanSel);
                         
    // Recreate the query including the short descriptions
    custSelByTime = custSelDescr.join(timeSelDescr,
                                      getEmptySource(),
                                      Source.COMPARISON_RULE_REMOVE,
View Full Code Here

    // executes.

    println("\nMatching the Inputs of a Measure and Producing Outputs");
       
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
    Source units = mdmUnits.getSource();

    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
           
    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                     mdmChanDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmShipHier = (MdmLevelHierarchy)
                                     mdmCustDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
       
    Source chanHier = mdmChanHier.getSource();
    Source shipHier = mdmShipHier.getSource();
    Source prodHier = mdmProdHier.getSource();
    Source calendar = mdmCalendar.getSource();
       
    // Create a list of the default hierarchies.
    ArrayList defaultHiers = new ArrayList(4);
    defaultHiers.add(chanHier);
    defaultHiers.add(shipHier);
    defaultHiers.add(prodHier);
    defaultHiers.add(calendar);
       
    // Sort the inputs alphabetically by Source ID so that the display of the
    // ID values is consistent.
    SortedSet sortedInputsSet = new TreeSet(byID);
    sortedInputsSet.addAll(units.getInputs());
    Iterator inputsItr = sortedInputsSet.iterator();
    List outputs = units.getOutputs();
    Source input = null;
       
    int i = 1;
    println("The inputs of " + units.getID() + " are:");
    while(inputsItr.hasNext())
    {
      input = (Source) inputsItr.next();
      println(i + ": " + input.getID());
      i++;
    }
       
    println(" ");
    Set inputs = units.getInputs();
    int setSize = inputs.size();
   
    for(i = 0; i < (setSize + 1); i++)
    {
      println(units.getID() + " has " + inputs.size() +
              " inputs and " + outputs.size() + " outputs.");
      if (i < setSize)
      {
        input = (Source) defaultHiers.get(i);
        println("Joining " + input.getID() + " to " + units.getID());
        units = units.join(input);
        inputs = units.getInputs();
        outputs = units.getOutputs();
      }
    }
       
    println("The outputs of " + units.getID() + " are:");
    Iterator outputsItr = outputs.iterator();
    i = 1;
    while(outputsItr.hasNext())
    {
      Source output = (Source) outputsItr.next();
      println(i + ": " + output.getID());
      i++;
    }
  }
View Full Code Here

    MdmStandardDimension mdmProdStdDim = (MdmStandardDimension)
                                          getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
       
    // Get the Source for the Product dimension.
    Source prodStdDim = mdmProdStdDim.getSource();
       
    // Get the default hierarchies of the dimensions and the Source objects
    // for them.
    MdmLevelHierarchy mdmCalendar =
                        (MdmLevelHierarchy) mdmTimeDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmProdPrimary =
                     (MdmLevelHierarchy) mdmProdStdDim.getDefaultHierarchy();
    StringSource calendar = (StringSource) mdmCalendar.getSource();
    StringSource prodPrimary = (StringSource) mdmProdPrimary.getSource();
       
    // Get the Unit Cost and Unit Price measures and the Source objects for them.
    MdmMeasure mdmUnitCost = getMdmMeasure("UNIT_COST_AW");
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
       
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
       
    // Get the level to which the dimension members belong.
    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdPrimary,
                                                        "ITEM_AW");
       
    // Get the placeholder Source for the Number data type.
    Source ph = dp.getFundamentalMetadataProvider()
                  .getNumberPlaceholder()
                  .getSource();
       
    // Get a Source that specifies the value to assign for the custom member.
    Source calc = ((NumberSource)
                   (ph.join(prodPrimary, "PRODUCT_PRIMARY_AW::ITEM_AW::14")))
                   .plus(
                   (NumberSource)
                   (ph.join(prodPrimary, "PRODUCT_PRIMARY_AW::ITEM_AW::15")));
       
       
    // Create a custom member of the Item level of the Product dimension.
    MdmStandardMember mdmItem60 =
              mdmProdStdDim.createCustomMember("60"// member local value
                                                mdmItemLevel, // member level
                                                "4",   // parent local value
                                                calc, // calculation Source
                                                10);   // precedence value
       
    // Get a Source that specifies a value to assign for another custom member
    // that depends on the value to assign for the first custom member.
    Source dependentCalc = ((NumberSource)
                            (ph.join(prodPrimary,
                                     "PRODUCT_PRIMARY_AW::ITEM_AW::60")))
                            .plus(
                            (NumberSource)
                            (ph.join(prodPrimary,
                                     "PRODUCT_PRIMARY_AW::ITEM_AW::13")));
       
    // Create another custom member of the Item level of the Product dimension.
    MdmStandardMember mdmItem61 =
                          mdmProdStdDim.createCustomMember("61",
                                                           mdmItemLevel,
                                                           "4",
                                                           dependentCalc,
                                                           10);
       
    // Produce a selection of hierarchy members that includes the custom members.
    StringSource prodSel = prodPrimary.selectValues(
                                new String[]{"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::15",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::60",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::61"
                                             });
       
    // Produce a Source that specifies the Unit Cost and Unit Price values
    // for the selected Product and Time dimension members.
    Source result = unitPrice.join(unitCost)
                             .join(prodSel)
                             .join(calendar, "CALENDAR_YEAR_AW::MONTH_AW::47");
       
    // Prepare and commit the current Transaction.
    prepareAndCommit();
View Full Code Here

       
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
       
    FundamentalMetadataObject fmoStringDataType =
                     getFundamentalMetadataProvider().getStringDataType();
    Source stringDataTypeSource = fmoStringDataType.getSource();
    FundamentalMetadataObject fmoMdmProdDimDataType = mdmProdDim.getDataType();
    Source mdmProdDimDataTypeSource = fmoMdmProdDimDataType.getSource();
    Source prodDim = mdmProdDim.getSource();
    Source prodDimDataTypeSource = prodDim.getDataType();
    if(stringDataTypeSource == prodDimDataTypeSource &&
       mdmProdDimDataTypeSource == prodDimDataTypeSource)
    {
      println("The Source objects for the data types are the same.");
    }
View Full Code Here

   */
  public void getAllDecendents(MdmPrimaryDimension dim,MdmHierarchy hierarchy,String node,boolean decendentsOnly) throws Exception {
//      MdmHierarchy mdmMarketSegment =
//          getContext().getHierarchyByName(dim, "DEPT");   

      Source prodShortLabel = dim.getShortValueDescriptionAttribute().getSource();
      StringSource mktSegment = (StringSource)hierarchy.getSource();

//      mktSegment = (StringSource)mktSegment.join(prodShortLabel);
      // Get the ancestors attribute of the hierarchy and the Source for it.
      MdmAttribute mdmMarketSegmentAncestorsAttr =
        hierarchy.getAncestorsAttribute();
      Source mktSegmentAncestors = mdmMarketSegmentAncestorsAttr.getSource();

      // Reverse the ancestors relation to get the descendants relation.
      Source mktSegmentDescendants =
                mktSegment.join(mktSegmentAncestors, mktSegment.value());
     
      // Select an element of the hierarchy.
      Source selVal = mktSegment.selectValue(node);

      Source result = null;
      if(decendentsOnly){
        Source mktSegmentDescendantsOnly =
          mktSegmentDescendants.join(mktSegmentDescendants.getDataType().value(),
                                     mktSegment.value(),
                                     Source.COMPARISON_RULE_REMOVE);
     
        result = mktSegmentDescendantsOnly.join(mktSegment,
                selVal);
      }else{
      // Select the descendants of the specified element.
        Source selValDescendants = mktSegmentDescendants.join(mktSegment,
                                                            selVal);
      // Append the descedants to the selected element, using distinct
      // to remove any duplicate elements.
        result = selVal.appendValues(selValDescendants)
                                           .distinct();
View Full Code Here

    MdmPrimaryDimension mdmTimeDim = context.getMdmPrimaryDimension("MYTIME");
      MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)mdmTimeDim.getDefaultHierarchy();
//      StringSource prodHier =  (StringSource) mdmProdHier.getSource();

      MdmLevel mdmLevel = context.getLevelByName(mdmTimeHier, "YEAR");
      Source levelSrc = mdmLevel.getSource();
      StringSource timeHier = (StringSource) mdmTimeHier.getSource();
      // Get the Source for the short label attribute of the dimension.
      Source prodShortLabel = mdmTimeDim.getShortValueDescriptionAttribute()
                                        .getSource();
      Source levelSrcWithShortDescr = prodShortLabel.join(levelSrc);
      MdmAttribute mdmTimeHierParentAttr = mdmTimeHier.getParentAttribute();
      Source prodHierParentAttr = mdmTimeHierParentAttr.getSource();
      Source timeHierChildren = timeHier.join(prodHierParentAttr,
          timeHier.value());
      Cursor queryCursor = getCursor(context,levelSrcWithShortDescr);
      List<LazyDynaBean> result = convertDimensionShortDescCursor2List(queryCursor);
     
     
      for(int yeari=0;result!=null&&yeari<result.size();yeari++){
        LazyDynaBean yearbean = result.get(yeari);
        Object objectID = yearbean.get("id");
        if(objectID!=null){
          String id = objectID.toString();
            Source levelElement = timeHier.selectValue(id);
            Source levelElementChildren = timeHierChildren.join(timeHier, levelElement);
            Source levelElementChildrenWithShortDescr =
                                             prodShortLabel.join(levelElementChildren);
            queryCursor = getCursor(context,levelElementChildrenWithShortDescr);
            List<LazyDynaBean> quarterList = convertDimensionShortDescCursor2List(queryCursor);
            yearbean.set("children", quarterList);
          for(int quarteri=0;quarterList!=null&&quarteri<quarterList.size();quarteri++){
View Full Code Here

    MdmMeasure mdmMeasure = context.getMdmMeasure(measure);
    if(mdmMeasure==null){
      context.closeContext();
      return null;
    }
    Source measureSource = mdmMeasure.getSource();
   
    ArrayList<Source> HierarchySelectedList = new ArrayList<Source>();
    for(String dimensionName:dimensionNames){
      MdmPrimaryDimension mdmDim = context.getMdmPrimaryDimension(dimensionName);
      MdmHierarchy mdmHier = mdmDim.getDefaultHierarchy();
      StringSource hier = (StringSource)mdmHier.getSource();
      Source selected = hier.selectValues(dimensionList.get(dimensionName));
      Source depShortLabel = mdmDim.getShortValueDescriptionAttribute().getSource();
      Source deptShortDescr = depShortLabel.join(selected);
      HierarchySelectedList.add(deptShortDescr);
    }
    for(int i=HierarchySelectedList.size()-1;i>=0;i--){
      measureSource = measureSource.join(HierarchySelectedList.get(i));
    }
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.