Tuesday 3 December 2013 1 comments

Creating new ATG module with Merchandizing / ATG BCC setup for new module



Step 1:
Create two domains with two ports associated. Let’s take dshop, dbcc for example. And set protocol.jar file in “classpath” of startWeblogic.cmd file in both the domains. (Refer previous post for how to create a new domain)
Step 2:
Create Database Users. (Refer previous post for how to Create Database Users using Oracle and sql developer).
Creating users using MySQL:
i.                     create database dshop;

ii.                   CREATE USER 'PROD'@'localhost' IDENTIFIED BY 'PROD';
iii.                  grant all on *.* to 'PROD'@'localhost';

iv.                 CREATE USER 'PUB'@'localhost' IDENTIFIED BY 'PUB';
v.                   grant all on *.* to 'PUB'@'localhost';

vi.                 CREATE USER 'A'@'localhost' IDENTIFIED BY 'A';
vii.                grant all on *.* to 'A'@'localhost';

viii.              CREATE USER 'B'@'localhost' IDENTIFIED BY 'B';
ix.                 grant all on *.* to 'B'@'localhost';
Step 3:
i.                     Run “startWeblogic.cmd” file in both the domains.
ii.                   Run cim.bat which is located in <<ATG_DIR>>\home\bin\cim.bat
iii.                  Create schemas required.
Step 4:
i.                     In eclipse, create a new ATG module (say MyShop) under ATG installation path.
ii.                   Fill in all the details and proceed. (Refer previous post for creating new ATG module )
iii.                  Create Data Sources Properties files for shop.
As we are using switching data sources we have to give the bellow configurations.
iv.                 in /atg/dynamo/service/jdbc  folder
JTDataSource.properties must point to production (core) datasource,
DirectJTDataSourcemust point to production (core) datasource,
SwitchingDataSourceAmust point to DataSourceA,
SwitchingDataSourceBmust point to DataSourceB.

In ProductCatalog.properties, PriceLists.properties, SiteRepository.propertiesthe dataSource should be pointed to SwitchingDataSource(in case of switching data base otherwise no need of these properties files.)


v.                   Edit Manifest.MF with ATG-Required property.

Manifest-Version: 1.0
ATG-Config-Path: config/
ATG-Required: DAS DCS DPS PublishingAgent
ATG-J2EE: j2ee-apps/kshop
ATG-EAR-Module: j2ee-apps/kshop
ATG-Class-Path: bin


vi.                 Edit build.xml as required for application assembly.

vii.                Create a new folder “Versioned” inside your new module (MyShop/Versioned).
viii.              Create config folder inside (MyShop/Versioned).
Configurations must be as following:

ix.                 in /atg/dynamo/service/jdbc  folder
JTDataSource.properties must point to publishing datasource,
DirectJTDataSourcemust point to publishing datasource,
SwitchingDataSourceA must point to DataSourceA,
SwitchingDataSourceB must point to DataSourceB.


In ProductCatalog.properties, PriceLists.properties, SiteRepository.properties the dataSource should be pointed to publishing(in case of switching data base otherwise no need of these properties files.)


In DirectJTDataSource_production.properties, change JNDIname to core(prod) data source
In other xxxxxx_production.properties, change data source to switching datasource.

x.                   Create Manifest.MF file in (MyShop/Versioned). Edit it as shown below.
xi.                 Edit build.xml to include another target for versioned
(<arg line=" -m DafEar.Admin MyShop MyShop.Versioned" />)

xii.                After build, once BCC server is up with no errors, if we are not able to open bcc page, we need to do the below things:
a.       In <ATG-DIR>/home/localconfig/atg/dynamo/service/jdbc/ (create one if you don’t find it!) folder
create new files FakeXADataSource.properties and JTDataSource.properties.
In FakeXADataSource.properties, add below lines:
$class=atg.service.jdbc.FakeXADataSource
URL=jdbc:oracle:thin:@localhost:1521/xe
user=publishing_username
password=publishing_password
driver=oracle.jdbc.xa.client.OracleXADataSource(driver class)
In JTDataSource.properties, add below lines
$class=atg.service.jdbc.MonitoredDataSource
dataSource=/atg/dynamo/service/jdbc/FakeXADataSource

b.       Run <ATG-DIR>/BIZUI/install/importBizui.bat


NOTE: While running, if you get any SQLExceptions w.r.t drivers, we should add CLASSPATH with driver(ojdbc14.jar) path and add the path(path to ojdbc14.jar) to PATH variable.
 
;