Package oracle.olapi.data.source

Examples of oracle.olapi.data.source.DataProvider


  protected void run() throws Exception
  {
    println("Implementing the extract Method as a CustomModel\n");
   
    // Get the DataProvider.
    DataProvider dp = getContext().getDataProvider();
   
    // Get the MdmMeasure objects and the Source objects for them.
    MdmMeasure mdmAmount = getMdmMeasure("AMOUNT");
    MdmMeasure mdmCOAL_EQUIVALENT = getMdmMeasure("COAL_EQUIVALENT");
       
View Full Code Here


    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)
View Full Code Here

  }
   
  protected void run() throws Exception
  {
    // Get the DataProvider.
    DataProvider dp = getContext().getDataProvider();
   
    // 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");
View Full Code Here

  protected void run() throws Exception
  {
    println("Creating a Custom Member That Assigns an Aggregated Value\n");
   
    // Get the DataProvider.
    DataProvider dp = getContext().getDataProvider();
   
    // Get the Sales measure and the Source for it.
     MdmMeasure mdmSales = getMdmMeasure("SALES_AW");
     NumberSource sales = (NumberSource) mdmSales.getSource();
   
    // Get the dimensions. Cast the Product dimension as an MdmStandardDimension
    // so that it has a createCustomMember method.
    MdmStandardDimension mdmProdStdDim = (MdmStandardDimension)
    getMdmPrimaryDimension("PRODUCT_AW");
    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,
View Full Code Here

  protected void run() throws Exception
  {
    println("Implementing the extract Method as a CustomModel\n");
   
    // Get the DataProvider.
    DataProvider dp = getContext().getDataProvider();
   
    // Get the MdmMeasure objects and the Source objects for them.
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
    MdmMeasure mdmUnitCost = getMdmMeasure("UNIT_COST_AW");
       
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
       
    // Get the MdmPrimaryDimension objects and the default hierarchies for them.
    MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
       
    MdmLevelHierarchy mdmProdRollup = (MdmLevelHierarchy)
                                       mdmProdDim.getDefaultHierarchy();
    MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
                                      mdmTimeDim.getDefaultHierarchy();
       
    // 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();
View Full Code Here

  protected void run() throws Exception
  {
    println("Creating an Assignment That Depends on Another Assignment\n");
       
    // Get the DataProvider.
    DataProvider dp = getContext().getDataProvider();
   
    // Get the dimensions. Cast the MdmPrimaryDimension for the Product dimension
    // as an MdmStandardDimension so it has a createCustomMember method.
    MdmStandardDimension mdmProdStdDim = (MdmStandardDimension)
                                          getMdmPrimaryDimension("PRODUCT_AW");
    MdmPrimaryDimension mdmTimeDim = getMdmPrimaryDimension("TIME_AW");
       
    // 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 prodPrimary = (StringSource) mdmProdPrimary.getSource();
       
    // Get the Unit Cost and Unit Price measures and the Source objects for them.
    MdmMeasure mdmUnitCost = getMdmMeasure("UNIT_COST_AW");
    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
       
    NumberSource unitCost = (NumberSource) mdmUnitCost.getSource();
    NumberSource unitPrice = (NumberSource) mdmUnitPrice.getSource();
       
    // Get the level to which the dimension members belong.
    MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdPrimary,
                                                        "ITEM_AW");
       
    // Get the placeholder Source for the Number data type.
    Source ph = dp.getFundamentalMetadataProvider()
                  .getNumberPlaceholder()
                  .getSource();
       
    // Get a Source that specifies the value to assign for the custom member.
    Source calc = ((NumberSource)
View Full Code Here

    MdmMeasure mdmUnitPrice = getMdmMeasure("UNIT_PRICE_AW");
       
    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)
View Full Code Here

  {
  }

  protected void run() throws Exception
  {
    DataProvider dp = getContext().getDataProvider();
    TransactionProvider tp = getContext().getTransactionProvider();

    // Create a SingleSelectionTemplate.
    // Get the MdmMeasure for the measure.
    MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
View Full Code Here

  }
 
  public UserSession openSession() throws Exception{
    //open a new Session
    if(connection == null)openConnection();
    data = new DataProvider();
    session = data.createSession(connection)
    logger.info(" Oracle Session opened");
   
    //if multidimensional option is true, than instantiate the multidimensional MetaData as well
    if(multiDimensional){
View Full Code Here

TOP

Related Classes of oracle.olapi.data.source.DataProvider

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.