Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.StringSource


    mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendarYear = (MdmLevelHierarchy)
    mdmTimeDim.getDefaultHierarchy();
       
    // Get the Source objects for the hierarchies.
    StringSource prodHier = (StringSource) mdmProdPrimary.getSource();
    StringSource calendarYear = (StringSource) mdmCalendarYear.getSource();
       
    // Get the root MdmSchema.
    MdmSchema rootSchema = getMdmMetadataProvider().getRootSchema();
       
    // Get the MdmMeasureDimension of the root MdmSchema, and the Source for it.
    MdmMeasureDimension mdmMeasDim = rootSchema.getMeasureDimension();
    StringSource measDim = (StringSource) mdmMeasDim.getSource();
       
    // Specify a calculation for the custom measure.
    Source calculation = unitPrice.minus(unitCost);
       
    // Create custom measure as a custom member of the MdmMeasureDimension.
    MdmMeasure mdmMarkup = mdmMeasDim.createCustomMeasure("MARKUP_AW",
                                                           rootSchema,
                                                           calculation,
                                                           10);
    // Set the short and long value descriptions.
    mdmMarkup.setShortDescription("UNIT_PRICE_AW MINUS UNIT_COST_AW");
    mdmMarkup.setDescription("Unit price minus unit cost.");
       
    // Produce a Source that specifies the values of the members of the
    // measure dimension.
    Source measDimSel = measDim.selectValues(new String[]
                                            {mdmMarkup.getValue(),
                                             mdmUnitCost.getValue(),
                                             mdmUnitPrice.getValue()});
                
    // Get the Source objects for the short value description attributes
    // of the Product and Time dimensions.
    Source timeShortDesc =
                    mdmTimeDim.getShortValueDescriptionAttribute().getSource();
    Source prodShortDesc =
                    mdmProdDim.getShortValueDescriptionAttribute().getSource();
                
    // Select members of the product and time hierarchies.
    StringSource prodSel =
                    prodHier.selectValue("PRODUCT_PRIMARY_AW::ITEM_AW::13");
    StringSource timeSel = calendarYear.selectValues(new String[]
                                           {"CALENDAR_YEAR_AW::MONTH_AW::43",
                                            "CALENDAR_YEAR_AW::MONTH_AW::44",
                                            "CALENDAR_YEAR_AW::MONTH_AW::45"});
                         
    // Produce a query that specifies the values of the members of the measure
View Full Code Here


    // Get the default hierarchy of the Product dimension.
    MdmHierarchy mdmProdHier = mdmProdDim.getDefaultHierarchy();

    // Get the StringSource for the hierarchy.
    StringSource prodHier = (StringSource) mdmProdHier.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 =
View Full Code Here

       
    MdmLevelHierarchy mdmCustDefLvlHier = (MdmLevelHierarchy)
                                           mdmCustDim.getDefaultHierarchy();
       
    // Get the Source objects for the hierarchies.
    StringSource prodHier = (StringSource) mdmProdDefLvlHier.getSource();
    StringSource timeHier = (StringSource) mdmTimeDefLvlHier.getSource();
    StringSource chanHier = (StringSource) mdmChanDefLvlHier.getSource();
    StringSource custHier = (StringSource) mdmCustDefLvlHier.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 mdmCustShortDescr =
                              mdmCustDim.getShortValueDescriptionAttribute();
    Source custShortDescr = mdmCustShortDescr.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 custParam =
                      new StringParameter(dp, "SHIPMENTS_AW::REGION_AW::9");
    StringParameter prodParam =
                new StringParameter(dp, "PRODUCT_PRIMARY_AW::FAMILY_AW::4");
       
    // Create parameterized Source objects for the default hierarchies of
    // the CUSTOMER_AW and PRODUCT_AW dimensions.
    StringSource custParamSrc = dp.createParameterizedSource(custParam);
    StringSource prodParamSrc = dp.createParameterizedSource(prodParam);
       
    // Create derived Source objects from the hierarchies, using the
    // parameterized Source objects as the comparison Source objects.
    Source paramCustSel = custHier.join(custHier.value(), custParamSrc);
    Source paramProdSel = prodHier.join(prodHier.value(), prodParamSrc);
View Full Code Here

       
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
       
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    StringSource prodHier =  (StringSource) mdmProdHier.getSource();
       
    // Get one of the levels of the hierachy.
    MdmLevel mdmLevel = getContext().getLevelByName(mdmProdHier, "FAMILY_AW");
       
    Source levelSrc = mdmLevel.getSource();
       
    int pos = 5;
    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();
    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.
View Full Code Here

                                                                  "PACKAGE_AW");
    Source prodPkgAttr = mdmPackageAttr.getSource();
   

    // Get the Source objects for the metadata objects.
    StringSource prodDim = (StringSource) mdmProdDim.getSource();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    Source prodParent = mdmProdParentAttr.getSource();

    // Sort products hierarchically, parents first, in ascending order
    // without using the package attribute.
    Source result1 = prodHier.recursiveJoin(prodDim.value(),
                                            prodHier.getDataType(),
                                            prodParent,
                                            Source.COMPARISON_RULE_ASCENDING);

    // Sort products hierarchically, parents first, in ascending order
    // by package attribute value with null values first.
    // Nulls first is the default, so this should this should produce
    // the same results as COMPARISON_RULE_ASCENDING.
    Source sortedHierNullsFirst =
          prodHier.recursiveJoin(prodPkgAttr,
                                 prodPkgAttr.getDataType(),
                                 prodParent,
                                 Source.COMPARISON_RULE_ASCENDING_NULLS_FIRST);
    Source result2 = prodPkgAttr.join(sortedHierNullsFirst);

    // Sort all products hierarchically, parents first, in ascending order
    // by package attribute value with null values first.
    Source sortedHierNullsLast =
          prodHier.recursiveJoin(prodPkgAttr,
                                 prodPkgAttr.getDataType(),
                                 prodParent,
                                 Source.COMPARISON_RULE_DESCENDING_NULLS_FIRST);

    Source result3 = prodPkgAttr.join(sortedHierNullsLast);
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.selectValue("SHIPMENTS_AW::SHIP_TO_AW::61");

    // Create the query
    Source querySource2 = prodSel.join(chanSel)
                                 .join(custSel)
                                 .join(timeSel)
View Full Code Here

       
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                       mdmProdDim.getDefaultHierarchy();
   
    // Get the Source for the default product hierarchy.
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
       
    // Get the Source objects for the measure and for the default hierarchies
    // of the other dimensions.
    NumberSource units = (NumberSource) mdmUnits.getSource();
    StringSource custHier = (StringSource)
        getMdmPrimaryDimension("CUSTOMER_AW").getDefaultHierarchy().getSource();
    StringSource chanHier = (StringSource)
        getMdmPrimaryDimension("CHANNEL_AW").getDefaultHierarchy().getSource();
    StringSource timeHier = (StringSource)
        getMdmPrimaryDimension("TIME_AW").getDefaultHierarchy().getSource();
       
    Source totalProds =
           prodHier.selectValue("PRODUCT_PRIMARY_AW::TOTAL_PRODUCT_AW::1");
       
View Full Code Here

    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();

    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
                                     mdmProdDim.getDefaultHierarchy();
    StringSource prodHier = (StringSource) mdmProdHier.getSource();
    Source prodSel = prodHier.selectValue("PRODUCT_PRIMARY_AW::FAMILY_AW::5");

    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
    MdmLevelHierarchy mdmTimeHier = (MdmLevelHierarchy)
                                     mdmTimeDim.getDefaultHierarchy();
    StringSource timeHier = (StringSource) mdmTimeHier.getSource();

    MdmLevel mdmQuarterLevel = getContext().getLevelByName(mdmTimeHier,
                                                           "QUARTER_AW");
    Source quarterLevel = mdmQuarterLevel.getSource();
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.