Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.Source


   */
  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


    // Create the querySource object to use in the
    // Creating a Cursor example.

    MdmMeasure mdmAmount = getMdmMeasure("AMOUNT");
    MdmMeasure mdmSCC_Amount = getMdmMeasure("SCC_AMOUNT");
    Source amount = mdmAmount.getSource();
    Source scc_amount = mdmSCC_Amount.getSource();
   
    System.out.println(mdmAmount.getDescription());
   
    System.out.println(mdmSCC_Amount.getDescription());
   
//    oracle.olapi.data.source.NumberSource ss;
   
   
    MdmPrimaryDimension mdmDeptDim = getMdmPrimaryDimension("DEPARTMENT");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("MYTIME");
    MdmPrimaryDimension mdmMediaDim = getMdmPrimaryDimension("MEDIA");
   
    MdmValueHierarchy mdmDeptHier = (MdmValueHierarchy)
                                     mdmDeptDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
   
    MdmLevelHierarchy mdmMediaHier = (MdmLevelHierarchy)mdmMediaDim.getDefaultHierarchy();

    // 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"
            });
   
   
    Source depShortLabel = mdmDeptDim.getShortValueDescriptionAttribute().getSource();
    Source mediaShortLabel = mdmMediaDim.getShortValueDescriptionAttribute().getSource();
    Source timeShortLabel = mdmTimeDim.getShortValueDescriptionAttribute().getSource();
   
    Source deptShortDescr = depShortLabel.join(prodSel);
   
    Source mediaShortDescr = mediaShortLabel.join(mediaSel);
   
    Source timeShortDescr = timeShortLabel.join(timeSel);
//    Source prodSel = prodHier.value();
//
//    Source timeSel = timeHier.value();
//
//    Source mediaSel = mediaHier.value();
//    Source measDim = dp.createListSource(new Source[] {amount, scc_amount});
    Source measDim = dp.createListSource(new Source[] {scc_amount});
    Source querySource = measDim.extract().join(measDim).join(timeShortDescr).join(deptShortDescr).join(mediaShortDescr);
//    Source querySource = amount.join(scc_amount).join(deptShortDescr).join(timeShortDescr).join(mediaShortDescr);

    try
    {
      // The Creating a Cursor example.
View Full Code Here

  private ValueCursor gettingASingleValue(MdmHierarchy mdmProdHier)
  {
    println("\nGetting a Single Value from a ValueCursor");

    Source prodSource = mdmProdHier.getSource();
    // Because prodSource is a primary Source, you do not need to
    // prepare and commit the current Transaction.
    CursorManagerSpecification cursorMngrSpec =
                 dp.createCursorManagerSpecification(prodSource);
    SpecifiedCursorManager cursorMngr =
View Full Code Here

  private void getValsFormCompoundCursorWithNestedOutputs(List sourcesFromEx4)
    throws NotCommittableException
  {
    println("\nGetting Values from a CompoundCursor with Nested Outputs");

    Source units = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);

    // Code from the example.
    Source custByChanSel = custSel.join(chanSel);
    Source unitsForSelections = units.join(prodSel)
                                     .join(timeSel)
                                     .join(custByChanSel);

    // Prepare and commit the current Transaction.
    prepareAndCommit();
View Full Code Here

    println("\nNavigating For a Table View");
   
    String sp9 = "         ";
   
    // Select the first month of the timeHier quarters for 2001, 2002
    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",
                                           "CALENDAR_YEAR_AW::MONTH_AW::69",
                                           "CALENDAR_YEAR_AW::MONTH_AW::72",
                                           "CALENDAR_YEAR_AW::MONTH_AW::75",
                                           "CALENDAR_YEAR_AW::MONTH_AW::78"});
    Source unitPriceByMonth = unitPrice.join(prodSel)
                                       .join(timeSel);
    prepareAndCommit();

    // Create a Cursor for unitPriceByMonth.
    CursorManagerSpecification cursorMngrSpec =
View Full Code Here

  private void navigatingForACrosstabViewWPages(List sourcesFromEx4)
    throws NotCommittableException
  {
    println("\nNavigating For a Crosstab View With Pages");

    Source units = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);

    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);
   
    // Prepare and commit the current Transaction.
View Full Code Here

    println("Getting CursorSpecification Objects from a CursorManagerSpecification");

    println("This example has no text output. It returns a " +
            "CursorManagerSpecification \nused by other examples.");

    Source units  = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);

    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);

    // Prepare and commit the current Transaction.
View Full Code Here

  public void calculatingTheSpan(List sourcesFromEx4)
    throws NotCommittableException
  {
    println("\nCalculating the Span of the Positions in the Parent of a Value");

    Source units  = (Source) sourcesFromEx4.get(0);
    Source prodSel = (Source) sourcesFromEx4.get(1);
    Source custSel = (Source) sourcesFromEx4.get(2);
    Source timeSel = (Source) sourcesFromEx4.get(3);
    Source chanSel = (Source) sourcesFromEx4.get(4);
   
    Source unitsForSelections = units.join(prodSel)
                                     .join(custSel)
                                     .join(timeSel)
                                     .join(chanSel);

    // Prepare and commit the current Transaction.
View Full Code Here

    println("Creating a Cube and Pivoting Its Edges");
       
    // Get the MdmMeasure for units.
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
    // Get the Source for the measure.
    Source units = mdmUnits.getSource();
       
    // Get the dimensions of the measure and the default hierarchies of
    // the dimensions.
       
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("DEPARTMENT");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("MYTIME");
    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("MEDIA");
       
    MdmValueHierarchy mdmProdDefLvlHier = (MdmValueHierarchy)
                                           mdmProdDim.getDefaultHierarchy();
       
    MdmLevelHierarchy mdmTimeDefLvlHier = (MdmLevelHierarchy)
                                           mdmTimeDim.getDefaultHierarchy();
       
    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);
       
    // Select elements from the other dimensions of the measure
    Source timeSel = timeHier.selectValues(new String[]
                                            {"TIMEHIER::DAY::20110101",
                                             "TIMEHIER::DAY::20110102",
                                             "TIMEHIER::DAY::20110103"});
               
    Source chanSel = chanHier.selectValues(new String[]
                                       {"MEDIA::MEDIA::0",
                                        "MEDIA::MEDIA::1",
                                        "MEDIA::MEDIA::2"});
                        
    // Join the dimension selections to the short description attributes
    // for the dimensions.
    Source columnEdge = chanSel.join(chanShortDescr);
    Source rowEdge = timeSel.join(timeShortDescr);
    Source page1 = paramProdSel.join(prodShortDescr);
                        
    // Join the dimension selections to the measure.
    Source cube = units.join(columnEdge)
                       .join(rowEdge)
                       .join(page1);
                        
    // Prepare and commit the current Transaction.
    prepareAndCommit();
View Full Code Here

    MdmStandardDimension mdmProdStdDim =
                (MdmStandardDimension) getMdmPrimaryDimension("MEDIA");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("MYTIME");
       
    // 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 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
    // in the result.
    Source result = unitPrice.join(unitCost)
                             .join(prodSel)
                             .join(calendar, "TIMEHIER::DAY::20110101");
                       
    // Prepare and commit the current Transaction.
    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.