Oracle recommends that you create record stores by writing and executing a custom script that calls CAS utilities, following the examples in this section. For detailed information about these CAS utilities, refer to the Oracle Commerce Content Acquisition System Developer's Guide.
The easiest and simplest
way to create a custom script is to base your calls to CAS utilities on
examples provided in
/Endeca/apps/Discover/control/initialize_services.bat|sh
.
Place your custom script in
your application's
/control
folder. Give your custom script file a
descriptive name such as "initialize_rs_feeds.bat
".
The remainder of this section lists the calls to CAS utilities in
initialize_services.bat
that can form the basis for your
custom script.
Note
Define the local variables that will be used in your custom script; for example:
setlocal set DATA_RS_NAME=data_rs1 set DIMVALS_RS_NAME=dimvals_rs1 set RECORD_STORE_MERGER_NAME=Discover-record-store-merger set DVAL_ID_MGR_NAME=Discover-dimension-value-id-manager set CAS_ROOT=C:\Endeca\CAS\11.2.0 set CAS_HOST=localhost set CAS_PORT=8500
You will need to reference record store names in the following contexts:
Delete the Dimension Value ID Manager provided with the Discover Electronic reference application:
echo Removing Dimension Value Id Manager %DVAL_ID_MGR_NAME% call %CAS_ROOT%\bin\cas-cmd.bat deleteDimensionValueIdManager -h %CAS_HOST% -p %CAS_PORT% -m %DVAL_ID_MGR_NAME%
Create an instance of the Dimension Value ID Manager , which will create and store the dimension values created for automatically generated dimensions; for example:
echo Creating Dimension Value Id Manager %DVAL_ID_MGR_NAME% call %CAS_ROOT%\bin\cas-cmd.bat createDimensionValueIdManager -h %CAS_HOST% -p %CAS_PORT% -m %DVAL_ID_MGR_NAME% if not %ERRORLEVEL%==0 ( echo Failure to create Dimension Value Id Manager. exit /B 1 )
Note
The instance of the Dimension Value ID Manager created in this step does not require configuration, and it will create and store the dimension values for flat dimensions automatically.
Copy these commands from
initialize_services.bat
to your custom script:set LAST_MILE_CRAWL_NAME=Discover-last-mile-crawl set CAS_ROOT=C:\endeca\CAS\11.2.0
Create a record store for product data records; for example:
echo Creating Record Store %DATA_RS_NAME% call %CAS_ROOT%\bin\component-manager-cmd.bat create-component -h %CAS_HOST% -p %CAS_PORT% -t RecordStore -n %DATA_RS_NAME% if not %ERRORLEVEL%==0 ( echo Failure to create Record Store. exit /B 1 )
Note
Any record store can be used to store either product data records or dimension value records. For this reason, it is important to give each record store a name that is clearly descriptive of its intended use, and to make note of that name for future reference.
Modify the version of
data-recordstore-config.xml
provided with the Discover reference application to specify a property whose value in each record will be unique in the record store. For more information, see Configuring record stores.Specify that the configuration in
data-recordstore-config.xml
is to be applied to the record store named by the variable DATA_RS_NAME; for example:REM Set the record store configuration call %CAS_ROOT%\bin\recordstore-cmd.bat set-configuration -h %CAS_HOST% -p %CAS_PORT% -a %DATA_RS_NAME% -f %~dp0..\config\cas\data-recordstore-config.xml if not %ERRORLEVEL%==0 ( echo Failure to set Record Store configuration. exit /B 1 )
Create a record store for dimension value records (for hierarchical dimensions or range dimensions such as "Price"); for example:
echo Creating Record Store %DIMVALS_RS_NAME% call %CAS_ROOT%\bin\component-manager-cmd.bat create-component -h %CAS_HOST% -p %CAS_PORT% -t RecordStore -n %DIMVALS_RS_NAME% if not %ERRORLEVEL%==0 ( echo Failure to create Record Store. exit /B 1 )
Note
You do not need to create record stores for automatically generated dimension values. The Dimension Value ID Manager generates and stores these dimension values (names and IDs).