Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.StringSource


    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                     mdmChanDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmShipHier = (MdmLevelHierarchy)
                                     mdmCustDim.getDefaultHierarchy();
   
    StringSource calendar = (StringSource) mdmCalendar.getSource();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    StringSource chanHier = (StringSource) mdmChanHier.getSource();
    StringSource shipHier = (StringSource) mdmShipHier.getSource();
   
    // Get the placeholder Source for the Number data type.
    Source ph = dp.getFundamentalMetadataProvider()
                  .getNumberPlaceholder()
                  .getSource();
View Full Code Here


                                       mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                      mdmTimeDim.getDefaultHierarchy();
       
    // Get the Source objects for the hierarchies.
    StringSource prodRollup = (StringSource) mdmProdRollup.getSource();
    StringSource calendar = (StringSource) mdmCalendar.getSource();
       
    // Create a Source that represents a selection of Product dimension members.
    Source prodSel = prodRollup.selectValues(new String[]
                                            {"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::14",
View Full Code Here

                                           "PRODUCT_PRIMARY_AW::FAMILY_AW::8"});
                
                
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmHierarchy mdmProdHier = mdmProdDim.getDefaultHierarchy();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
                
    // Selecting values using the selectValues shortcut.
    Source prodSel = prodHier.selectValues(myList);
    if (prodSel.isSubtypeOf(prodHier))
      println("prodSel is a subtype of prodHier.");
    else
      println("prodSel is not a subtype of prodHier.");
                
View Full Code Here

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

  {
    println("\nMatching the base Source to an input of the joined Source");
       
    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",
View Full Code Here

    // 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"
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{
View Full Code Here

      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++){
            LazyDynaBean quarterbean = quarterList.get(quarteri);
            objectID = quarterbean.get("id");
            if(objectID!=null){
              id = objectID.toString();
                  levelElement = timeHier.selectValue(id);
                  levelElementChildren = timeHierChildren.join(timeHier, levelElement);
                  levelElementChildrenWithShortDescr =
                                                   prodShortLabel.join(levelElementChildren);
                  queryCursor = getCursor(context,levelElementChildrenWithShortDescr);
                  List<LazyDynaBean> monthList = convertDimensionShortDescCursor2List(queryCursor);
                  quarterbean.set("children", monthList);
                for(int monthi=0;monthList!=null&&monthi<monthList.size();monthi++){
                  LazyDynaBean monthbean = monthList.get(monthi);
                  objectID = monthbean.get("id");
                  if(objectID!=null){
                    id = objectID.toString();
                        levelElement = timeHier.selectValue(id);
                        levelElementChildren = timeHierChildren.join(timeHier, levelElement);
                        levelElementChildrenWithShortDescr =
                                                         prodShortLabel.join(levelElementChildren);
                        queryCursor = getCursor(context,levelElementChildrenWithShortDescr);
                        List<LazyDynaBean> dayList = convertDimensionShortDescCursor2List(queryCursor);
View Full Code Here

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

    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");

    // Get the MdmPrimaryDimension and the default MdmLevelHiearchy for the
    // PRODUCT dimension.
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    StringSource custHier = (StringSource)
      getMdmPrimaryDimension("CUSTOMER_AW").getDefaultHierarchy().getSource();
    StringSource chanHier = (StringSource)
      getMdmPrimaryDimension("CHANNEL_AW").getDefaultHierarchy().getSource();
    StringSource timeHier = (StringSource)
      getMdmPrimaryDimension("TIME_AW").getDefaultHierarchy().getSource();

    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    // Get the Source for the default product hierarchy                                   .
    StringSource prodHier = (StringSource) mdmProdHier.getSource();

    // Get the Source objects for the measure and for the default hierarchies
    // of the other dimensions.
    NumberSource units = (NumberSource) mdmUnits.getSource();

    // Get the parent attribute of the PRODUCT dimension and the Source for it
    // to use in the recursiveJoin method.
    MdmAttribute mdmProdParentAttr = mdmProdHier.getParentAttribute();
    Source prodParent = mdmProdParentAttr.getSource();

    // Get the short value description attribute and its Source.
    MdmAttribute mdmProdShortDescrAttr =
                                mdmProdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescrAttr.getSource();

    // Select the Direct Sales channel, the year 2001, and all customers.
    Source chanSel = chanHier.selectValue("CHANNEL_PRIMARY_AW::CHANNEL_AW::2");
    Source timeSel = timeHier.selectValue("CALENDAR_YEAR_AW::YEAR_AW::4");
    Source custSel = custHier.selectValue("SHIPMENTS_AW::TOTAL_CUSTOMER_AW::1");

    // Sort all products hierarchically in ascending order of units sold,
    // with parents first.
    Source sortedProduct =
                      prodHier.recursiveJoin(units,
                                             units.getDataType(),
                                             prodParent,
                                             Source.COMPARISON_RULE_ASCENDING,
                                             true,  // Parents first
                                             true); // Restrict parents to base
View Full Code Here

TOP

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

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.