Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.StringSource


  private void numberParameterExample(List sourceList)
  {
    println("\nNumberParameter Example");
   
    Source units = (Source) sourceList.get(0);
    StringSource prodHier = (StringSource) sourceList.get(1);
    Source timeHier = (Source) sourceList.get(2);
    Source custHier = (Source) sourceList.get(3);
    Source chanHier = (Source) sourceList.get(4);
    Source prodShortDescr = (Source) sourceList.get(5);
   
    // Example from NumberParameter.
    NumberParameter numParam = new NumberParameter(dp, 1000);
    NumberSource numParamSrc = dp.createParameterizedSource(numParam);
   
    NumberSource qualifiedUnits = (NumberSource)
                     units.join(timeHier, "CALENDAR_YEAR_AW::YEAR_AW::4")
                          .join(custHier, "SHIPMENTS_AW::REGION_AW::9")
                          .join(chanHier,"CHANNEL_PRIMARY_AW::CHANNEL_AW::4");
   
    Source paramProdSel = prodHier.select(qualifiedUnits.gt(numParamSrc));
    Source results = prodShortDescr.join(paramProdSel);
   
    try
    {
      prepareAndCommit();
View Full Code Here


    // Get the Source for the hierarchy.

//    Source valueSource = mdmDeptHier.getSource();
   
   
    StringSource prodHier = (StringSource) mdmDeptHier.getSource();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();
    StringSource mediaHier = (StringSource) mdmMediaHier.getSource();
   
   
//    MdmAttribute mdmDeptAttr = getContext().getAttributeByName(mdmDeptDim,"SHORT_DESCRIPTION");
//    Source mktMngrAttr = mdmDeptAttr.getSource();
//    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmDeptHier, "ITEM_AW");
//    Source prodForManager = mdmDeptHier.join(mdmDeptAttr, "一炼");
   
    Source prodSel = prodHier.selectValues(new String[] {
                                           "DEPT::0"
                        ,
                                           "DEPT::1",
                                           "DEPT::2"
                                           });

    Source timeSel = timeHier.selectValues(new String[] {
                                           "TIMEHIER::MONTH::MONTH_2011-M01"
                        ,
                                           "TIMEHIER::DAY::DAY_20110102",
                                           "TIMEHIER::DAY::DAY_20110103"
                                           });

    Source mediaSel = mediaHier.selectValues(new String[] {
            "MEDIAHIER::MEDIA::MEDIA_0"
        ,
            "MEDIAHIER::MEDIA::MEDIA_1",
            "MEDIAHIER::MEDIA::MEDIA_2"
            });
View Full Code Here

       
    MdmLevelHierarchy mdmChanDefLvlHier = (MdmLevelHierarchy)
                                            mdmChanDim.getDefaultHierarchy();
       
    // Get the Source objects for the hierarchies.
    StringSource prodHier = (StringSource) mdmProdDefLvlHier.getSource();
    StringSource timeHier = (StringSource) mdmTimeDefLvlHier.getSource();
    StringSource chanHier = (StringSource) mdmChanDefLvlHier.getSource();
       
    // Get the DataProvider.
    ExpressDataProvider dp = getExpressDataProvider();
       
    // Get the short description attribute for the dimensions and the
    // Source objects for the attributes.
    MdmAttribute mdmProdShortDescr =
                              mdmProdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescr.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();
       
    // Create Parameter objects with values from the CUSTOMER_AW and
    // PRODUCT_AW dimensions.
    StringParameter prodParam =
                new StringParameter(dp, "DEPT::DEPT::0");
       
    // Create parameterized Source objects for the default hierarchies of
    // the CUSTOMER_AW and PRODUCT_AW dimensions.
    StringSource prodParamSrc = dp.createParameterizedSource(prodParam);
       
    // Create derived Source objects from the hierarchies, using the
    // parameterized Source objects as the comparison Source objects.
    Source paramProdSel = prodHier.join(prodHier.value(), prodParamSrc);
       
View Full Code Here

    // them.
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmProdPrimary = (MdmLevelHierarchy)
                                     mdmProdStdDim.getDefaultHierarchy();
    StringSource calendar = (StringSource) mdmCalendar.getSource();
    StringSource prodHier = (StringSource) mdmProdPrimary.getSource();
       
    // Get the measures and the Source objects for them.
    MdmMeasure mdmUnitCost = getMdmMeasure("AMOUNT");
    MdmMeasure mdmUnitPrice = getMdmMeasure("SCC_AMOUNT");
       
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
   
    DataProvider dp = getContext().getDataProvider();
       
    // Get the placeholder Source for the Number data type.
    Source ph = dp.getFundamentalMetadataProvider().getNumberPlaceholder()
                                                   .getSource();
       
    // Create a Source that specifies the value to assign as the
    // value of a measure for the custom dimension member.
//    Source calc = ((NumberSource)
//                   (ph.join(prodHier, "DEPT::0")))
//                  .plus(
//                  (NumberSource)
//                  (ph.join(prodHier, "DEPT::1")));
       
    // Get the level to which the dimension members belong.
//    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdPrimary,
//                                                        "DEPT");
//       
//    // Create the custom dimension member.
//    MdmStandardMember mdmItem60 = mdmProdStdDim.createCustomMember(
//                                                "60",  // member local value
//                                                 mdmItemLevel, // member level
//                                                 "4",   // parent local value
//                                                 calc, // calculation Source
//                                                 10);   // precedence value
       
    // Select a set of Product member values.
    StringSource prodSel = prodHier.selectValues(
                               new String[]{"MEDIA::MEDIA::0",
                                            "MEDIA::MEDIA::1"});
                       
    // Produce a query that specifies the unit price and the unit cost for the
    // selected products and the specified month. The month does not appear
View Full Code Here

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

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

    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                     mdmChanDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCustHier = (MdmLevelHierarchy)
                                     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[] {
View Full Code Here

               
    // Create a StringParameter using one of the IDs.
    StringParameter measParam = new StringParameter(dp, unitCostID);
               
    // Create a parameterized Source.
    StringSource measParamSrc = dp.createParameterizedSource(measParam);
               
    // Get the metadata objects and the Source objects for the dimensions of
    // the measures.
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    StringSource prodHier = (StringSource) mdmProdDim.getSource();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();
               
    // Select elements from the hierarchies.
    Source prodSel = prodHier.selectValues(new String[]
                                        {"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                         "PRODUCT_PRIMARY_AW::ITEM_AW::14"});
                        
    Source timeSel = timeHier.selectValues(new String[]
                                           {"CALENDAR_YEAR_AW::MONTH_AW::58",
                                            "CALENDAR_YEAR_AW::MONTH_AW::59"});
                                 
    // Get the short description attributes for the dimensions and
    // get the Source objects for the attributes.
View Full Code Here

      while (dimMemberInfosItr.hasNext())
      {
        MdmDimensionMemberInfo mdmDimMemInfo = (MdmDimensionMemberInfo)
                                                dimMemberInfosItr.next();
        MdmHierarchy mdmHier = mdmDimMemInfo.getHierarchy();
        StringSource hierSrc = (StringSource) mdmHier.getSource();
        Source memberSel = hierSrc.selectValue(mdmDimMemInfo.getUniqueValue());
       
        // Join the Source objects for the selected dimension members
        // to the measure.
        result = result.joinHidden(memberSel);
      }
View Full Code Here

      MdmPrimaryDimension mdmPrimDim = mdmDimMemInfo.getPrimaryDimension();
      MdmAttribute mdmShortDescrAttr =
                          mdmPrimDim.getShortValueDescriptionAttribute();
      Source shortDescrAttr = mdmShortDescrAttr.getSource();
      MdmHierarchy mdmHier = mdmDimMemInfo.getHierarchy();
      StringSource hierSrc = (StringSource) mdmHier.getSource();
      Source memberSel = hierSrc.selectValue(mdmDimMemInfo.getUniqueValue());
      Source shortDescrForMember = shortDescrAttr.joinHidden(memberSel);
           
      // Prepare and commit the current transaction.
      try
      {
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.