Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.Source


      TopBottomTemplateState castState = (TopBottomTemplateState) state;
           
      if (castState.criterion == null)
        throw new NullPointerException("CriterionParameterMissing");
           
      Source sortedBase = null;
           
      // Depending on the topBottomType value, select from the base Source
      // the elements specified by the criterion Source and sort the
      // elements in ascending or descending order.
      if (castState.topBottomType == TOP_BOTTOM_TYPE_TOP)
        sortedBase = castState.base.sortDescending(castState.criterion);
      else
        sortedBase = castState.base.sortAscending(castState.criterion);
           
      // Select the first N number of the sorted elements and return that
      // selection.
      return sortedBase.interval(1, Math.round(castState.N));
    }
View Full Code Here


      MdmDimensionMemberInfo mdmDimMemInfo = (MdmDimensionMemberInfo)
                                            mdmDimMemInfoListItr.next();
      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
      {
        tp.prepareCurrentTransaction();
View Full Code Here

    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
   
    // Get the Source for the product dimension.
    Source prodStdDim = mdmProdStdDim.getSource();
       
    // Get the marketing manager attribute and the Source for it.   
    MdmAttribute mdmMktMngrAttr = getContext().getAttributeByName(mdmProdStdDim,
                                                        "MARKETING_MANAGER_AW");
    Source mktMngrAttr = mdmMktMngrAttr.getSource();
       
    // Get the default hierarchies of the dimensions and the Source objects
    // for them.
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdStdDim.getDefaultHierarchy();
    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();
   
    // Get the level to which the dimension members belong.
    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdHier,
                                                        "ITEM_AW");

    // Get the Source for the ITEM level.
    Source itemLevel = mdmItemLevel.getSource();
   
    // Select the members of the level that are managed by a marketing manager.
    Source prodForManager = itemLevel.join(mktMngrAttr, "Jackson");
   
    // Get the short value description attribute for Product and the Source
    // for it.
    MdmAttribute mdmProdShortDescr =
                         mdmProdStdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescr.getSource();
   
    // Create the calculation Source, which specifies the aggregation of
    // the selected products.
    Source calc = ((NumberSource)
              (ph.join(prodHier,
                   new String[] {"PRODUCT_PRIMARY_AW::ITEM_AW::24",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::25",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::26",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::33",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::34",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::35",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::36",
                                "PRODUCT_PRIMARY_AW::ITEM_AW::37",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::38",
                                 "PRODUCT_PRIMARY_AW::ITEM_AW::39"}))).total();
                       
    // Create the custom dimension member.
    MdmStandardMember mdmMktMngrTotal =
            mdmProdStdDim.createCustomMember("65"// member local value
                                             mdmItemLevel, // member level
                                             "4",   // parent local value
                                             calc, // calculation Source
                                             10);   // precedence value
   
    // Set the short value description for the custom member.
    mdmMktMngrTotal.setShortDescription("Marketing Manager Total");
   
    // Append the custom member to the product selection.
    Source mktMngrWithTotal = prodForManager.appendValue(
                              prodHier.selectValue(
                                        "PRODUCT_PRIMARY_AW::ITEM_AW::65"));
   
    // Create a query that specifies the units sold of the selected products,
    // including a short description of the products, for the specified customer
    // through all sales channels in the specified year.
    Source result = sales.join(prodShortDescr.join(mktMngrWithTotal))
                         .join(shipHier, "SHIPMENTS_AW::SHIP_TO_AW::106")
                         .join(chanHier, "CHANNEL_PRIMARY_AW::TOTAL_CHANNEL_AW::1")
                         .join(calendar, "CALENDAR_YEAR_AW::YEAR_AW::3");
   
    // Prepare and commit the current Transaction.
View Full Code Here

    // 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",
                                             "PRODUCT_PRIMARY_AW::ITEM_AW::15"});
                
    // Create a Source that is the result of a calculation involving two measures.
    Source calculation = unitPrice.minus(unitCost);
                
    // Create a Source whose element values are the Source objects for the
    // measures and the calculation. The resulting Source is like a measure
    // dimension.
    Source sourceListSrc = dp.createListSource(new Source[] {unitPrice,
                                                             unitCost,
                                                             calculation});

    // Use the extract method and then join Source objects that match the
    // inputs of the Source objects in the list.
    Source resultUsingExtract =
                 sourceListSrc.extract()
                              .join(sourceListSrc)
                              .join(prodSel)
                              .join(calendar, "CALENDAR_YEAR_AW::MONTH_AW::47");
                            
    // Prepare and commit the current Transaction.
    prepareAndCommit();
                            
    // Create a Cursor for the query and display the values of the Cursor.
    println("The values using extract method are:");
    getContext().displayResult(resultUsingExtract);
                            
    // Produce the same result using a CustomModel directly.
    CustomModel customModel = dp.createModel(sourceListSrc);
    customModel.assign(unitPrice.getID(), unitPrice);
    customModel.assign(unitCost.getID(), unitCost);
    customModel.assign(calculation.getID(), calculation);
                            
    Source measValForSrc = customModel.createSolvedSource();
                            
    // Join Source objects that match the inputs of the solved Source produced by
    // the CustomModel.
    Source resultUsingCustomModel =
                measValForSrc.join(sourceListSrc)
                             .join(prodSel)
                             .join(calendar, "CALENDAR_YEAR_AW::MONTH_AW::47");
                            
    prepareAndCommit();
    println("The values of using a CustomModel directly, with the Source IDs");
    println("as the qualifications are:");
    getContext().displayResult(resultUsingCustomModel);
                            
    // Create a list Source that has String objects as its element values.
    Source stringListSrc = dp.createListSource(new String[] {"price",
                                                             "cost",
                                                             "markup"});
                                        
    // Create a CustomModel for the list Source.
    CustomModel  customModel2 = dp.createModel(stringListSrc);
    customModel2.assign("price", unitPrice);
    customModel2.assign("cost", unitCost);
    customModel2.assign("markup", calculation);
                                        
    Source measValForSrc2 = customModel2.createSolvedSource();
                                        
    Source resultUsingCustomModel2 =
               measValForSrc2.join(stringListSrc)
                             .join(prodSel)
                             .join(calendar, "CALENDAR_YEAR_AW::MONTH_AW::47");
                                        
    prepareAndCommit();
View Full Code Here

  }
   
  protected void run() throws Exception
  {
    // The Getting the Data Type of a Source example.
    Source prodDim = gettingTheDataTypeOfASource();
       
    // The Using the isSubtypeOf Method example.
    ArrayList sourcesList = usingTheisSubtypeOfMethod();
       
    // Informal examples.
    gettingTheIDofASource(prodDim);
    Source prodSel = fullJoinExample(sourcesList);
       
    // The Using the join Method To Produce a Source Without an Output example.
    Source custSel = producingASourceWithoutAnOutput();
       
    // The Using the join Method To Produce a Source With an Output example.
    producingASourceWithAnOutput(prodSel, custSel);
       
    // The Using the join Method To Match Source Objects To Inputs example.
View Full Code Here

    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
       
    FundamentalMetadataProvider fmp =
                    getExpressDataProvider().getFundamentalMetadataProvider();
    FundamentalMetadataObject fmoStringDataType = fmp.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 all the same.");
    }
View Full Code Here

  private ArrayList usingTheisSubtypeOfMethod()
      throws Exception
  {
    println("\nUsing the isSubtypeOf Method");
       
    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"});
                
                
    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.");
                
    println("The values of prodSel produced by the selectValues method");
View Full Code Here

  private Source fullJoinExample(ArrayList sourcesList)
           throws Exception
  {
    println("\nUsing the full join Method for the selectValues");
       
    Source prodHier = (Source) sourcesList.get(0);
    Source myList = (Source) sourcesList.get(1);
       
    // Selecting values using the full join method, from the Inputs of
    // a Source section.
    Source prodSel = prodHier.join(prodHier.value(), myList,
                                      Source.COMPARISON_RULE_SELECT, false);
       
    println("The values of prodSel produced by the full join method:");
    prepareAndCommit();
    getContext().displayResult(prodSel);
View Full Code Here

       
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmLevelHierarchy mdmShipHier = (MdmLevelHierarchy)
                                      mdmProdDim.getDefaultHierarchy();
       
    Source shipHier = mdmShipHier.getSource();
    Source custValuesToSelect =
     getExpressDataProvider().createListSource(new String[]
                                              {"SHIPMENTS_AW::REGION_AW::9",
                                               "SHIPMENTS_AW::REGION_AW::10"});
    Source shipHierValues = shipHier.value();
    Source custSel = shipHier.join(shipHierValues,
                                   custValuesToSelect,
                                   Source.COMPARISON_RULE_SELECT,
                                   false);
                
    println("The values of custSel:");
View Full Code Here

  private void producingASourceWithAnOutput(Source prodSel, Source custSel)
      throws Exception
  {
    println("\nUsing the join Method To Produce a Source with an Output");
       
    Source custSelByProdSel = custSel.join(prodSel,
                                           getEmptySource(),
                                           Source.COMPARISON_RULE_REMOVE,
                                           true);
    println("The values of custSelByProdSel:");
    prepareAndCommit();
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.