This SIMExporter utility can perform a onetime export of Commerce Reference Store (CRS) data, such as products, SKUs, stores, and inventory levels, to the Oracle Store Inventory Manager (SIM) application. This utility is intended to support the limited integration between the ASA and Oracle SIM products. As part of this integration we will provide a method for synchronizing the SIM application’s database schema with relevant data from the CRS application so that the SIM application has knowledge of CRS catalog and store assets. Specifically, so that SIM returns and allows updates of inventory information for SKUs, returns SKU inventory information for “buddy stores” (stores that share inventory) of a given store, etc.

Note: This feature is intended purely for testing and demonstration purposes, and only for use with the CRS sample data. It is not intended to be used as a general purpose method for synchronization of data between the ATG and SIM applications, nor does it provide a means to maintain a constant synchronization between CRS and SIM data once the initial export has completed.

Features

This functionality exports catalog, store and inventory data from ATG to the SIM database schema and is intended to be used by anyone who wants to run ASA with the sample CRS data integrated with the SIM product.

The feature is implemented as a Nucleus component in the ASA (Mobile/DCS-CSR) module and requires that the ATG application has been installed correctly and that the SIM Integration option has either been selected during CIM installation or that the SIM DataSource has been created manually.

Architecture and Implementation

The SIMExporter component is implemented as a single class, atg.projects.store.mobile.catalog.export.SIMExporter. It reads catalog, store, and inventory data through the standard ATG repository APIs and copies that data to the SIM schema via direct JDBC calls.

SIMExporter operates on the following subset of SIM tables:

    STORE_SEQUENCE_AREA
    ADDRESS
    STORE_ITEM_STOCK
    STORE_ITEM
    STORE_GROUP
    STORE
    SUPPLIER_ITEM_COUNTRY
    SUPPLIER_ITEM
    ITEM_PRICE
    ITEM
    SUPPLIER
    ITEM_HIERARCHY
Forcing Upper Case SKU IDs

SIMExporter.java and SIMInventoryManager.java forces SKU IDs into uppercase when communicating with SIM, as shown in the following code:

SIMExporter
 // Should SKU Ids always be exported as uppercase?
  private boolean mForcingUppercaseIds = false;

  /**
   * Returns true if SKU Ids should be forced into uppercase when being exported.
   * @return true if forcing uppercase Ids
   */
  public boolean isForcingUppercaseIds() {
    return mForcingUppercaseIds;
  }

  /**
   * If set to true, SKU ids exported to SIM will be upper-cased, even if they are not upper case in the repository.  This
   * may be necessary if integrating with another system that can't handle lowercase Ids.
   * @param pForcingUppercaseIds if SKU ids should be converted to uppercase.
   */
  public void setForcingUppercaseIds(boolean pForcingUppercaseIds) {
    mForcingUppercaseIds = pForcingUppercaseIds;
  }
SIMInventoryManager
 // Should SIM queries always use uppercase SKU Ids?
  private boolean mForcingUppercaseIds = false;

  /**
   * Returns true if SIM queries should always use uppercase SKU Ids.
   * @return true if forcing uppercase Ids
   */
  public boolean isForcingUppercaseIds() {
    return mForcingUppercaseIds;
  }

  /**
   * If set to true, SKU ids sent to SIM will be upper-cased, even if they are not upper case in the repository.  This
   * may be necessary if integrating with another system that can't handle lowercase.
   * @param pForcingUppercaseIds if SKU ids should be converted to uppercase.

   */
  public void setForcingUppercaseIds(boolean pForcingUppercaseIds) {
    mForcingUppercaseIds = pForcingUppercaseIds;
  }
Component Properties

SIMExporter exposes the following properties:

Property

Default Value

Description

productCatalogRepository

/atg/commerce/catalog/ProductCatalog

The product catalog

locationRepository

/atg/commerce/locations/LocationRepository

Store location information

simDataSource

/atg/dynamo/service/jdbc/JTDataSource_sim

Reference to the SIM application’s schema

countryNamesToLocales

USA=US

Deutschland=GR

Maps CRS store.country values to appropriate values for the SIM STORE.LOCALE_COUNTRY column.

fakeStoreItemStockLevel

-1

Determines source, and possibly value, for SKU inventory information populated in the STORE_ITEM_STOCK.QUANTITY_TOTAL column of the SIM schema. Default value (-1) means use CRS SKU/Store inventory information.

The fakeStoreItemStockLevel Property

The fakeStoreItemStockLevel property controls whether the SIMExporter component exports actual CRS store-specific SKU inventory stock level data or whether it exports a single fake stock level value for all SKUs. Setting the value to a negative value causes the component to use the CRS SKU store-specific inventory data. A non-negative value causes all SKU inventory stock levels at all stores to be set to that single value.

One reason to specify a value for SKU inventory stock levels is to reduce the time required for the export process. Reading and exporting stock values for each SKU, for each store, can be a time consuming process. If you specify a fakeStoreItemStockLevel, a single SQL statement will execute in a few seconds.

Public Component Methods

The following methods are available and intended to be invoked on the component from the Dynamo Admin UI:

Method

Description

executeExport

Copies CRS data from the ATG Production repository to the configured SIM schema.

deleteExportedData

Attempts to delete from the SIM schema only that data which has been exported via executeExport. This may be useful if the SIM schema contains non-CRS data.

truncateTables

Truncates the tables populated via the executeExport method. This method deletes data in the tables listed above without regard for whether that data originated from CRS data export.


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices