Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.Source


  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


                                     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[] {
                                           "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::43",
                                            "CALENDAR_YEAR_AW::MONTH_AW::44",
                                            "CALENDAR_YEAR_AW::MONTH_AW::45"});

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

    // Prepare and commit the current Transaction.
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

   
    // Get the MdmMeasure objects for unit cost and price.
    MdmMeasure mdmUnitCost = getMdmMeasure("UNIT_COST_AW");
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    // Get the Source for the measure
    Source unitCost = mdmUnitCost.getSource();
    Source unitPrice = mdmUnitPrice.getSource();
       
    // Create a measure dimension.
    Source measDim = dp.createListSource(new Source[] {unitCost, unitPrice});
               
    // Get the unique identifiers of the Source objects for the measures.
    String unitCostID = unitCost.getID();
    String unitPriceID = unitPrice.getID();
               
    // 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.
    MdmAttribute mdmProdShortDescr =
                               mdmProdDim.getShortValueDescriptionAttribute();
    MdmAttribute mdmTimeShortDescr =
                               mdmTimeDim.getShortValueDescriptionAttribute();
    Source prodShortDescr = mdmProdShortDescr.getSource();
    Source timeShortDescr = mdmTimeShortDescr.getSource();
                                 
    // Join the hierarchy selections to the short descriptions.
    Source prodSelShortDescr = prodShortDescr.join(prodSel);
    Source timeSelShortDescr = timeShortDescr.join(timeSel);
                                 
    // Extract the values from the measure dimension elements, and join
    // them to the specified measure and the dimension selections.
    Source result = measDim.extract().join(measDim, measParamSrc)
                                     .join(prodSelShortDescr)
                                     .join(timeSelShortDescr);
                                 
    // Prepare and commit the current transaction.
    prepareAndCommit();
View Full Code Here

     */
    public Source generateSource(MetadataState state)
    {
      SingleSelectionTemplateState castState =
                                        (SingleSelectionTemplateState) state;
      Source result = castState.measure;
           
      Iterator dimMemberInfosItr = castState.dimMemberInfos.iterator();
      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

    // Get the MdmMeasure for the measure.
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
    MdmMeasure mdmSales = getMdmMeasure("SALES_AW");
       
    // Get the Sources for the measures.
    Source units = mdmUnits.getSource();
    Source sales = mdmSales.getSource();
       
    // Get the MdmPrimaryDimension objects for the dimensions of the measure.
    MdmPrimaryDimension mdmCustDim = getMdmPrimaryDimension("CUSTOMER_AW");
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmChanDim = getMdmPrimaryDimension("CHANNEL_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
     
    // Get the default hierarchy of the Product dimension.
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
   
    // Get the detail level of the hierarchy.
    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdHier, "ITEM_AW");
   
    // Get the Source for the level.
    Source itemLevel = mdmItemLevel.getSource();
   
    // Get the short description attribute for the Product dimension and
    // the Source for the attribute.
    MdmAttribute mdmProdShortDescrAttr =
                           mdmProdDim.getShortValueDescriptionAttribute();
    Source prodShortDescrAttr = mdmProdShortDescrAttr.getSource();
   
    // Create a SingleSelectionTemplate to produce a Source that
    // represents the measure values specified by single members of each of
    // the dimensions of the measure other than the base dimension.
    SingleSelectionTemplate singleSelections =
                                       new SingleSelectionTemplate(units, dp);
       
    // Create MdmDimensionMemberInfo objects for single members of the
    // other dimensions of the measure.
    MdmDimensionMemberInfo timeMemInfo =
                new MdmDimensionMemberInfo(mdmTimeDim,
                                           "CALENDAR_YEAR_AW::YEAR_AW::4");
    MdmDimensionMemberInfo custMemInfo =
                new MdmDimensionMemberInfo(mdmCustDim,
                                           "SHIPMENTS_AW::REGION_AW::8");
    MdmDimensionMemberInfo chanMemInfo =
                new MdmDimensionMemberInfo(mdmChanDim,
                                          "CHANNEL_PRIMARY_AW::CHANNEL_AW::2");
       
    // Add the dimension member information objects to the
    // SingleSelectionTemplate.
    singleSelections.addDimMemberInfo(custMemInfo);
    singleSelections.addDimMemberInfo(chanMemInfo);
    singleSelections.addDimMemberInfo(timeMemInfo);
      
    // Create a TopBottomTemplate specifying, as the base, the Source for a
    // level of a hierarchy.
    TopBottomTemplate topNBottom = new TopBottomTemplate(itemLevel, dp);
    // Specify whether to retrieve the elements from the beginning (top) or the
    // end (bottom) of the selected elements of the base dimension.
    topNBottom.setTopBottomType(TopBottomTemplate.TOP_BOTTOM_TYPE_TOP);
    // Set the number of elements of the base dimension to retrieve.
    topNBottom.setN(10);
    // Get the Source produced by the SingleSelectionTemplate and specify it as
    // the criterion object.
    topNBottom.setCriterion(singleSelections.getSource());
       
    // Get the short value descriptions of the dimension members from the
    // SingleSelectionTemplate.
    StringBuffer shortDescrsForMemberVals =
                              singleSelections.getMemberShortDescrs(dp, tp);
    println("\nThe " + Math.round(topNBottom.getN()) +
            " products with the most units sold \nfor" +
            shortDescrsForMemberVals +" are:\n");
       
    // Get the Source produced by the TopBottomTemplate.
    Source topNBottomResult = topNBottom.getSource();
   
    // Join the Source produced by the TopBottomTemplate with the short
    // value descriptions. Use the joinHidden method so that the
    // dimension member values do not appear in the result.
    Source result = prodShortDescrAttr.joinHidden(topNBottomResult);
   
    // Prepare and commit the current Transaction.
    prepareAndCommit();   // Method of ContextExample.
   
    // Create a Cursor for the result and display the values of the Cursor.
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.