Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.Source


//    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("MEDIA");
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    StringSource timeHier =  (StringSource) mdmTimeHier.getSource();
       
    Source levelElement = timeHier.selectValue("TIMEHIER::MONTH::MONTH_2011-M01");
       
    // Get the Source for the short label attribute of the dimension.
    Source prodShortLabel = mdmTimeDim.getShortValueDescriptionAttribute()
                                      .getSource();
       
    // Get the parent relation from the hierarchy.
    MdmAttribute mdmTimeHierParentAttr = mdmTimeHier.getParentAttribute();
   
    Source prodHierParentAttr = mdmTimeHierParentAttr.getSource();
       
    // Reverse the parent relation to get a children relation.
    Source timeHierChildren = timeHier.join(prodHierParentAttr,
        timeHier.value());
       
    // Select the children of the specified level element.
    Source levelElementChildren = timeHierChildren.join(timeHier, levelElement);
       
    //Join the children to the short description attribute.
    Source levelElementChildrenWithShortDescr =
                                     prodShortLabel.join(levelElementChildren);
       
    // Prepare and commit the current Transaction.
    prepareAndCommit();
       
View Full Code Here


    // Get the Source objects for the hierarchies.
    StringSource departmentRollup = (StringSource) mdmDepartmentRollup.getSource();
    StringSource calendar = (StringSource) mdmCalendar.getSource();
       
    // Create a Source that represents a selection of Product dimension members.
    Source prodSel = departmentRollup.selectValues(new String[]
                                            {"DEPARTMENT::0",
                                             "DEPARTMENT::1"});
   
    // Create a Source that is the result of a calculation involving two measures.
//    Source calculation = unitPrice.minus(unitCost);
View Full Code Here

    // The storedMdmDim object is an MdmPrimaryDimension that is assigned in
    // the getSchemaInfo method. The getSource method of the MdmPrimaryDimension
    // gets the Source object for the MdmPrimaryDimension.
    showOutput("\nGetting the primary Source object for dimension " +
                storedMdmDim.getName() + ".");
    Source dimSource = storedMdmDim.getSource();
    showInfo("The ID of the Source for " + storedMdmDim.getName() + " is " +
             dimSource.getID() + ".\n");
  }
View Full Code Here

    StringSource prodHier =  (StringSource) mdmProdHier.getSource();
       
    // Get one of the levels of the hierachy.
    MdmLevel mdmLevel = getContext().getLevelByName(mdmProdHier, "MEDIA");
       
    Source levelSrc = mdmLevel.getSource();
       
    int pos = 1;
    Source levelElement = levelSrc.at(pos);
       
    // Use levelElement as the comparison to select a level value.
    Source levelSel = prodHier.join(prodHier.value(), levelElement);
       
       
    // Get the Source for the short label attribute of the dimension.
    Source prodShortLabel = mdmProdDim.getShortValueDescriptionAttribute()
                                      .getSource();
       
    // Get the parent relation from the hierarchy.
    MdmAttribute mdmProdHierParentAttr = mdmProdHier.getParentAttribute();
   
    MdmAttribute mdmProdHierAncestAttr = mdmProdHier.getAncestorsAttribute();
   
   
    Source prodHierParentAttr = mdmProdHierParentAttr.getSource();
       
    // Get the ancestor relation from the hierarchy.
    MdmAttribute mdmProdHierAncsAttr = mdmProdHier.getAncestorsAttribute();
    Source prodHierAncsAttr = mdmProdHierAncsAttr.getSource();
       
    // Get ancestors of the level element.
    Source levelElementAncs = prodHierAncsAttr.join(prodHier, levelElement);
       
    // Get the parent of the level element.
    Source levelElementParent = prodHierParentAttr.join(prodHier, levelElement);
       
    // Reverse the parent relation to get a children relation.
    Source prodHierChildren = prodHier.join(prodHierParentAttr,
                                            prodHier.value());
       
    // Select the children of the specified level element.
    Source levelElementChildren = prodHierChildren.join(prodHier, levelElement);
       
    //Join the level to the short description attribute.
    Source levelSrcWithShortDescr = prodShortLabel.join(levelSrc);
       
    // Join the parent to the short description attribute.
    Source levelElementParentWithShortDescr =
                                      prodShortLabel.join(prodHier,
                                                          levelElementParent,
                                                          true);
       
    //Join the children to the short description attribute.
    Source levelElementChildrenWithShortDescr =
                                     prodShortLabel.join(levelElementChildren);
       
    //Join the ancestors to the short description attribute.
    Source levelElementAncsWithShortDescr =
                                     prodShortLabel.join(prodHier,
                                                         levelElementAncs,
                                                         true);
       
    // Prepare and commit the current Transaction.
View Full Code Here

    MdmValueHierarchy mdmDeptHier = (MdmValueHierarchy)
                                     mdmDeptDim.getDefaultHierarchy();
   
    StringSource valueSource = (StringSource)mdmDeptHier.getSource();
   
    Source depShortLabel = mdmDeptDim.getShortValueDescriptionAttribute().getSource();
   
    Source levelSrcWithShortDescr = depShortLabel.join(valueSource);
   
    prepareAndCommit();
 
    // Create Cursor objects and display their values.
   
    getContext().displayResult(levelSrcWithShortDescr);
  
    /**
     * 选择某个部门,以及他的直接下属部门
     */

   
   
   
    System.out.println("Media:");
    MdmPrimaryDimension mdmMediaDim = getMdmPrimaryDimension("MEDIA");
   
    MdmLevelHierarchy mdmMediaHier = (MdmLevelHierarchy)
                                     mdmMediaDim.getDefaultHierarchy();
   
    Source levelSource = mdmMediaHier.getSource();
   
    depShortLabel = mdmMediaDim.getShortValueDescriptionAttribute().getSource();
   
    Source mediaShortLabel = depShortLabel.join(levelSource);
   
    prepareAndCommit();
 
    // Create Cursor objects and display their values.
   
View Full Code Here

      StringSource mktSegment = (StringSource)hierarchy.getSource();

      // 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);

      // Select the descendants of the specified element.
      Source selValDescendants = mktSegmentDescendants.join(mktSegment,
                                                            selVal,Source.COMPARISON_RULE_DESCENDING,
                                                            false);
      // Append the descedants to the selected element, using distinct
      // to remove any duplicate elements.
      Source selValPlusDescendants = selVal.appendValues(selValDescendants)
                                           .distinct();

//      // Do the same append operation without using distinct.
//      Source selValPlusDescendantsWithoutDistinct =
//                                        selVal.appendValues(selValDescendants);
View Full Code Here

    dp = getContext().getDataProvider();
   
    // Get the MdmMeasure object for units sold.
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
    // Get the Source for the measure.
    Source units = mdmUnits.getSource();
   
    // Get the MdmPrimaryDimension objects for the dimensions of
    // the measures.
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
   
    // Get the default MdmLevelHierarchy for each dimension.
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCustHier = (MdmLevelHierarchy)
                                     mdmCustDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
                                     mdmChanDim.getDefaultHierarchy();
   
    // Get the Source objects for the hierarhies.
    StringSource prodHier = (StringSource) mdmProdDim.getSource();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();
    StringSource custHier = (StringSource) mdmCustDim.getSource();
    StringSource chanHier = (StringSource) mdmChanHier.getSource();
   
    // Get the MdmAttribute for the short description attribute of the
    // Product dimension, and get the Source for the attribute.
    MdmAttribute mdmProdShortDescr =
                         mdmProdDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescr.getSource();
   
    //StringSource shipmentsHier = (StringSource) mdmCustDim.getSource();
    //StringSource calendarHier = (StringSource) mdmTimeDim.getSource();
   
    // Add the Source objects to a List to pass to the examples.
View Full Code Here

   */
  private void createListSourceExample(List sources)
  {
    println("\nDataProvider.createListSource(Object[][] tuples) Example");
   
    Source units = (Source) sources.get(0);
    Source prodHier = (Source) sources.get(1);
    StringSource calendarHier = (StringSource) sources.get(2);
    StringSource shipmentsHier = (StringSource) sources.get(3);
    Source chanHier = (Source) sources.get(4);
   
    Source custSel = shipmentsHier.selectValue(
                                       "SHIPMENTS_AW::SHIP_TO_AW::104");
    
    Source edge = prodHier.join(calendarHier).join(chanHier);
    
    Source edgeSel = edge.selectValues(dp.createListSource(
                                       new Object [][] {
                                      {"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                       "CALENDAR_YEAR_AW::MONTH_AW::21",
                                       "CHANNEL_PRIMARY_AW::CHANNEL_AW::3"},
                                      {"PRODUCT_PRIMARY_AW::ITEM_AW::13",
                                       "CALENDAR_YEAR_AW::MONTH_AW::22",
                                       "CHANNEL_PRIMARY_AW::CHANNEL_AW::3"},
                                      {"PRODUCT_PRIMARY_AW::ITEM_AW::14",
                                       "CALENDAR_YEAR_AW::MONTH_AW::21",
                                       "CHANNEL_PRIMARY_AW::CHANNEL_AW::3"}}));
     
    Source results = units.join(custSel)
                          .join(edgeSel);
   
    // Call a ContextExample method that prepares and commits the current
    // transaction.
    try
View Full Code Here

   */
  private void likeExample(Source prodShortDescr, Source prodDim)
  {
    println("\nStringSource.like(String rhs) Example");
   
    Source shortDescrByProd = prodShortDescr.join(prodDim);
    Source prodSel = shortDescrByProd.select(
                                 ((StringSource) shortDescrByProd.value())
                                  .like("%External%"));
    
    Source prodSel2 = shortDescrByProd.select(
                                  ((StringSource) shortDescrByProd.value())
                                   .like("__tern%"));
   
    // Call a ContextExample method that prepares and commits the current
    // transaction.
View Full Code Here

    println("\nLiteralQualification Example");
   
    // Get the metadata and source objects for a measure and the dimensions
    // of the measure. 
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    Source unitPrice = mdmUnitPrice.getSource();
 
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    Source productDim = mdmProdDim.getSource();
   
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    StringSource prodHier = (StringSource) mdmProdDim.getSource();
   
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();
   
    // Select one member of each dimension.   
    Source timeSel = timeHier.selectValue("CALENDAR_YEAR_AW::YEAR_AW::4");   
    Source prodSel = prodHier.selectValue("PRODUCT_PRIMARY_AW::FAMILY_AW::7");
   
    // Join the dimension selections to the measure and display the result.
    Source result = unitPrice.join(prodSel)
                             .join(timeSel);
    getContext().commit();
    println("\nThe result without a Qualification is:");
    getContext().displayResult(result);
   
    // Get the MdmMeasureModel for the measure.
    MdmMeasureModel unitPriceModel =  (MdmMeasureModel) mdmUnitPrice.getModel();
   
    // Create the Qualification.
    // The code that appears in the LiteralQualification class description
    // has a non-existant dimension member and an incorrect assign method
    // signature.
    // The following code uses an existing dimension member and a correct
    // method signature.
    LiteralQualification prodQual = new LiteralQualification(
                                       productDim,
                                       "PRODUCT_PRIMARY_AW::FAMILY_AW::7");
                                       //"PRODUCT_PRIMARY_AW::FAMILY_AW::50");
    // unitPriceModel.assign(prodQual, dp.createConstantSource(75));
    Qualification[] qualArray = new Qualification[]{prodQual};
    unitPriceModel.assign(qualArray, dp.createConstantSource(75));
   
    Source result2 = unitPrice.join(prodSel)
                              .join(timeSel);
    getContext().commit();
    println("\nThe result with the Qualification is:");
    getContext().displayResult(result2)
  }
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.