212014Oct

Creating ATG Module From Scratch (without cim configuration)

Creating new atg project in eclipse is always a bummer for ATG beginners (was also for me). So here it is simply described how to create an ATG module from scratch.

Prerequiste

  • JDK7
  • ATG11.1
  • JBoss6+
  • Oracle 11G
  • Eclipse With Installed ATG Plugin

After getting all the required software installed open the eclispe and go with the screenshots listed below.

Click File -> New -> New ATG Module

atgm1

Make sure your project location is ATG root directory where ATG is installed.

atgm2

Click Next.

atgm3

By default DAS, DPS, DSS modules are included as they are base for any ATG module.

Configuration Directory is the folder where all your components reside.

Click Next.

atgm4

Click Next.

atgm5

Click Finish.

You have successfully created a new ATG module. You can check your new module in ATG root folder.

As we have seen there are three base modules DAS, DPS, DSS that are necessary for ATG application so we database configuration to get these modules running.

Database Configuration :-

  • Login Oracle
  • Create a new user
  • Grant permissions to that user
  • Login with new user
  • Run the following commands

SQL:>@<ATG_ROOT>\DAS\sql\install\oracle\das_ddl.sql

SQL:>@<ATG_ROOT>\DPS\sql\install\oracle\dps_ddl.sql

SQL:>@<ATG_ROOT>\DSS\sql\install\oracle\dss_ddl.sql

Configuring JBoss server :-

  • Go to <JBOSS_HOME>\standalone\configuration
  • make a copy of standalone.xml
  • name it MyStore.xml and open it in notepad++
  • find the string “urn:jboss:domain:datasources
  • remove the default datasource configuration and change as shown below
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
            <datasources>
                <xa-datasource enabled="true" jndi-name="java:/MyStoreDs" pool-name="MyStoreDs" use-java-context="true">
				<xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:XE</xa-datasource-property>
				<xa-datasource-property name="User">newusername</xa-datasource-property>
				<xa-datasource-property name="Password">password</xa-datasource-property>
				<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
				<driver>ojdbc6.jar</driver>
				</xa-datasource>
            </datasources>
</subsystem>

We have given MyStoreDs as datasource name in datasource cnfiguration so we have to configure this datasource in ATG. Follow following steps to configure MyStoreDs.

  • Go to:  <ATG_ROOT>\home\localconfig\atg\dynamo
  • Create following folder structure \service\jdbc
  • Create DirectJTDatasource.properties with the following properties
    JNDIName=java:/MyStoreDs
    $class=atg.nucleus.JNDIReference

    Now we are done with all configurations, so now we assemble the application and deploy it in JBoss.

  • Open command prompt and go to this location <ATG_ROOT>\home\bin
  • run the following command

runAssembler <JBOSS_HOME>\standalone\deployments\MyStore\Mystore.ear -m MyStore

Copy the ojdbc6.jar in the MyStore folder created in JBoss deployment folder.

Run the Jboss server with the configuration file we have created MyStore.xml. GGo to JBOSS_HOME>\bin and run the following command.b<JBOSS_HOME>\bin and run the following command.

standalone.bat –server-config=MyStore.xml -b 0.0.0.0

Go to browser and open http://localhost:8089/mystore and index.jsp will render on your browser. Here /mystore is the context root we have given while making module in eclipse.

Note :- Port no will vary so to verify go to Mystore.xml check http port there and you can also change it to desired port no.