Sometimes you need to ingest product catalog versioned data (or any other data) into BCC and be able to publish as a project, for that, startSQLImport has been added to ATG to ease your life, this post is based on a previous one about startSQLRepository approach , feel free to look for any additional questions you may have or in case you want to explore that option.
Information for configuring it is out there on Oracle docs, however, there are some tricks you might be missing, I'm going to detail steps for getting it up.First of all, make sure you read through Oracle's documentation:
https://docs.oracle.com/cd/F25148_01/Platform.11-3-2/ATGContentAdminProgGuide/html/s0513startsqlimport01.html
Configure your datasources for database access
In order to get started with the utility you need to configure the FakeXADataSource component to allow the utility to connect to your database, you can see documentation from Oracle in here . Let's get into detail:Create a new server on your ATG installation along with the necessary folders for datasource configuration:
mkdir -p $ATG_ROOT/home/servers/startSQL-import/localconfig/atg/dynamo/service/jdbc
The default datasource is JTDataSource, so we will create an override for it with the values as suggested by Oracle's documentation:
vi $ATG_ROOT/home/servers/startSQL-import/localconfig/atg/dynamo/service/jdbc/JTDataSource.properties
And paste these values:
$class=atg.service.jdbc.MonitoredDataSource min=10 max=20 blocking=false maxFree=-1 loggingSQLWarning=false loggingSQLDebug=false loggingSQLInfo=false dataSource=/atg/dynamo/service/jdbc/DirectJTDataSourceFakeXA loggingSQLError=true
As you can see in the dataSource property, it points to a FakeXA component which specifies the database connection, so create a file like:
vi $ATG_ROOT/home/servers/ startSQL-import/localconfig/atg/dynamo/service/jdbc/DirectJTDataSourceFakeXA.properties
And paste these values, notice I have ojdbc driver in this example:
$class=atg.service.jdbc.FakeXADataSource server=localhost:1521:orcl user=<the_pub_user> needsSeparateUserInfo=false URL=jdbc:oracle:thin:@localhost:1521:orcl readOnly=true password=<the_pub_user_password> database= driver=oracle.jdbc.xa.client.OracleXADataSource
Note: If you happen to have any problems related to missing driver, you can add it to the CLASSPATH in $ATG_ROOT/home/localconfig/postEnvironment.sh
Run the utility
$ATG_ROOT/home/bin/startSQLRepository.sh -m DCS.Versioned -s startSQL-import -import import.xml -project startSQLImportTest -user admin -repository "/atg/commerce/catalog/ProductCatalog"
A very brief explanation on what the above does:
- -m DCS.Versioned -> This is for loading the DCS.Versioned module, which contains the catalog related components required for versioned items.
- -s startSQL-import -> This is for using a server name startSQL-import for components override
- -import import.xml -> The file with the xml operations to be processed, check here for more details on the format of the file
- -project startSQLImportTest -> The name of the project to be created in BCC
- -user admin -> The user with which the project will be created
- -repository "/atg/commerce/catalog/ProductCatalog" -> This is optional if you define your repository definition in the -import file, however, if you define it it will be used as the default repo if no definition is found
Note: If you have custom or extended repositories that you're going to make use of, make sure to add the corresponding repository definitions in your "startSQL-import" server, or within the -import xml file
Have a nice day!
Comments
Post a Comment