// Create Level objects for the SHIPMENTS_AW Hierarchy.
// Create the detail level, SHIP_TO_AW.
// This level is in both of the hierarchies of the Customer Dimension.
Level customerShip_ToLevel = customerDim.createLevel();
customerShip_ToLevel.setName("SHIP_TO_AW");
customerShip_ToLevel.setShortName("SHIP_TO_AW");
customerShip_ToLevel.setLongName("SHIP_TO_AW level");
// Create the Long and Short Description AttributeProjection objects for
// SHIP_TO_AW Level.
this.setupAttributeProjection(customerShip_ToLevel, "Long Description",
customerLDAttr);
this.setupAttributeProjection(customerShip_ToLevel, "Short Description",
customerSDAttr);
this.clearLevelMapVectors();
_keys.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_ID");
_cols.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_DSC"); // Long description
_cols.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_DSC"); // Short description
this.createLevelMap(customerShip_ToLevel, _keys, _cols);
// Create the WAREHOUSE_AW level.
Level customerWarehouseLevel = customerDim.createLevel();
customerWarehouseLevel.setName("WAREHOUSE_AW");
customerWarehouseLevel.setShortName("WAREHOUSE_AW");
customerWarehouseLevel.setLongName("WAREHOUSE_AW level");
// Create the Long and Short Description AttributeProjection objects for
// WAREHOUSE_AW Level.
this.setupAttributeProjection(customerWarehouseLevel, "Long Description",
customerLDAttr);
this.setupAttributeProjection(customerWarehouseLevel, "Short Description",
customerSDAttr);
this.clearLevelMapVectors();
_keys.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_ID");
_cols.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_DSC"); // Long description
_cols.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_DSC"); // Short description
this.createLevelMap(customerWarehouseLevel, _keys, _cols);
// Create the REGION_AW Level.
Level custRegionLevel = customerDim.createLevel();
custRegionLevel.setName("REGION_AW");
custRegionLevel.setShortName("REGION_AW");
custRegionLevel.setLongName("REGION_AW level");
// Create the Long and Short Description AttributeProjection objects for
// the REGION_AW Level.
this.setupAttributeProjection(custRegionLevel, "Long Description",
customerLDAttr);
this.setupAttributeProjection(custRegionLevel, "Short Description",
customerSDAttr);
this.clearLevelMapVectors();
_keys.add("GLOBAL.CUSTOMER_DIM.REGION_ID");
_cols.add("GLOBAL.CUSTOMER_DIM.REGION_DSC"); // Long description
_cols.add("GLOBAL.CUSTOMER_DIM.REGION_DSC"); // Short description
this.createLevelMap(custRegionLevel, _keys, _cols);
// Create the top level, TOTAL_CUSTOMER_AW.
Level allCustomersLevel = customerDim.createLevel();
allCustomersLevel.setName("TOTAL_CUSTOMER_AW");
allCustomersLevel.setShortName("TOTAL_CUSTOMER_AW");
allCustomersLevel.setLongName("TOTAL_CUSTOMER_AW level");
// Create the Long and Short Description AttributeProjection objects for
// the ALL_CUSTOMERS_AW Level.
this.setupAttributeProjection(allCustomersLevel, "Long Description",
customerLDAttr);
this.setupAttributeProjection(allCustomersLevel, "Short Description",
customerSDAttr);
this.clearLevelMapVectors();
_keys.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_ID");
_cols.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_DSC"); // Long description
_cols.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_DSC"); // Short description
this.createLevelMap(allCustomersLevel, _keys, _cols);
// Create the SHIPMENTS_AW Hierarchy.
Hierarchy shipmentsHier = customerDim.createHierarchy();
shipmentsHier.setName("SHIPMENTS_AW");
shipmentsHier.setShortName("SHIPMENTS_AW");
shipmentsHier.setLongName("SHIPMENTS_AW hierarchy");
// Add the Level objects for the Hierarchy, and the columns for them,
// to Vector objects in the hierarcharchical order of the levels,
// with the top level first.
this.clearHierarchyMapVectors();
_levels.add(allCustomersLevel);
_levColumns.add("GLOBAL.CUSTOMER_DIM.TOTAL_CUSTOMER_ID");
_levels.add(custRegionLevel);
_levColumns.add("GLOBAL.CUSTOMER_DIM.REGION_ID");
_levels.add(customerWarehouseLevel);
_levColumns.add("GLOBAL.CUSTOMER_DIM.WAREHOUSE_ID");
_levels.add(customerShip_ToLevel);
_levColumns.add("GLOBAL.CUSTOMER_DIM.SHIP_TO_ID");
// Specify the levels for the hierarchy and map them to relational columns.
this.createHierarchyMap(shipmentsHier, _levels, _levColumns);
// Create Level objects for the MARKET_SEGMENT_AW Hierarchy.
// Create the ACCOUNT_AW Level.
Level customerAccountLevel = customerDim.createLevel();
customerAccountLevel.setName("ACCOUNT_AW");
customerAccountLevel.setShortName("ACCOUNT_AW");
customerAccountLevel.setLongName("ACCOUNT_AW level");
// Create the Long and Short Description AttributeProjection objects for
// the ACCOUNT_AW Level.
this.setupAttributeProjection(customerAccountLevel, "Long Description",
customerLDAttr);
this.setupAttributeProjection(customerAccountLevel, "Short Description",
customerSDAttr);
this.clearLevelMapVectors();
_keys.add("GLOBAL.CUSTOMER_DIM.ACCOUNT_ID");
_cols.add("GLOBAL.CUSTOMER_DIM.ACCOUNT_DSC"); // Long description
_cols.add("GLOBAL.CUSTOMER_DIM.ACCOUNT_DSC"); // Short description
this.createLevelMap(customerAccountLevel, _keys, _cols);
// Create the MARKET_SEGMENT_AW Level.
Level customerMktSegmentLevel = customerDim.createLevel();
customerMktSegmentLevel.setName("MARKET_SEGMENT_AW");
customerMktSegmentLevel.setShortName("MARKET_SEGMENT_AW");
customerMktSegmentLevel.setLongName("MARKET_SEGMENT_AW level");
// Create the Long and Short Description AttributeProjection objects for
// the MARKET_SEGMENT_AW Level.
this.setupAttributeProjection(customerMktSegmentLevel, "Long Description",
customerLDAttr);
this.setupAttributeProjection(customerMktSegmentLevel, "Short Description",
customerSDAttr);
this.clearLevelMapVectors();
_keys.add("GLOBAL.CUSTOMER_DIM.MARKET_SEGMENT_ID");
_cols.add("GLOBAL.CUSTOMER_DIM.MARKET_SEGMENT_DSC"); // Long description
_cols.add("GLOBAL.CUSTOMER_DIM.MARKET_SEGMENT_DSC"); // Short description
this.createLevelMap(customerMktSegmentLevel, _keys, _cols);
// Create the top level, TOTAL_MARKET_AW.
Level customerTotalMktLevel = customerDim.createLevel();
customerTotalMktLevel.setName("TOTAL_MARKET_AW");
customerTotalMktLevel.setShortName("TOTAL_MARKET_AW");
customerTotalMktLevel.setLongName("TOTAL_MARKET_AW level");
// Create AttributeProjection objects for the long and short description
// attributes for the TOTAL_MARKET_AW Level.
this.setupAttributeProjection(customerTotalMktLevel, "Long Description",
customerLDAttr);