Monday, May 19, 2014

ATG 10.2 Customizing CRS

Using Customer User Accounts for CRS

This is the time to create user account for the freshly installed CRS.
First of all start following services one by one

0. Install two web browsers (Fireforx and Google Chrome).

This is to eliminate session expiration issue in ATG framework.
Use one browser to access CRS application and use other web browser to access ATG Business Control Center.

1. Start Production server.
     Open new terminal
     cd /common

2. Start Endeca services

     Open new terminal
     cd /common

3. Start Publishing server.

     Open new terminal
     cd /common

4. Brows Business Control Center (BCC) using one web browser.


Login as administrator

username - admin
password - Admin@123

5. Click on External Users

 6. Go to Users

 7. Go to Default Realm

7. Select any user.

There are many default users. These users can work as buyers of ecommerce products. In simply, They are customers of CRS application

 7. Click on the Change Password field.

 change the password. Ex. Testing@123

7. Save the changes.

7. Now open CRS home page using other web browser.


8. Click on Login Link

Enter Username and Password

username -
Password - Testing@123

8. See the beauty

Cheers you logged-in as given username ( email )

 9 . So far we have used given user account.
      This is the time create our own new user account.

     Follow above steps from 1 to 7.

10. Create new user by clicking + button in the upper left corner.

11. Add login name -
Add all mandatory fields by scroll down to bottom

And Scroll down and fill all required fields.

12. Save the new user.

13. Open other browser

Login as

Username -
Password - Testing@123

14. See the beauty again

Thanks for visting my blog. For the next lesson you will be able understand eCommerce data model. How to customize products, categories and many more things.

Happy Tux Time.

Friday, May 16, 2014

Artificial Intelligent - An approach to Nature Inspired Technologies

Artificial Intelligent (AI) is an approach to model natural intelligence of humans  in to machine level. Some of AI enabled machines need to be trained and some of AI enabled machines doesn't need specific training. They can work without special training.

AI enabled machines can work faster and better than humans for specific tasks. AI is not yet matured like humans but they can solve many real world problems very quickly with highest accuracy.

Lets see how different areas of Artificial Intelligent evolved as Nature Inspired Technologies.

1. Evolutionary Computing - Based on Charles Darwin Laws of Biological Evolution.

The biological evolution based on a key concepts. That is Survival of the fittest. It says, Most capable animals, plants and species to live and survive under natural conditions will reproduce their community for the next generation. 

The rest of animals, plants and species will be extincted ( towards no living family members ) step by step. This process of natural extinction will take hundreds of years to millions of years.

Lets see how this happened. At the time of reproduction a portions of parents genes are combined together and produce genes which are having features of both parents. Genes contain DNAs. DNA is a molecule that encodes unique biological information of given species.

It governed all biological activities such as  shape of the animal, growth of the animal, behaviors of the animal , inherited diseases of the animal , capabilities of the animal and many more.

2. Fuzzy Reasoning - Based on how Human Feelings emerged on Complex Situations.

3. Swarm Intelligence - Based on how Ant / Bee / Fish Colony worked on Uncertain Situations.


4. Artificial Neural Networks - Based on how Human Brain trained to accomplish different tasks under Unclear Situations.


Thursday, May 15, 2014

How to install ATG Plugin in Eclipse

Open the Eclipse

Then go to Help -> Install New Software

Then click button called Add

Then give a name to the plugin ATG Plugin

Then browse Archive and go to /common/ATG10.2/Eclipse.
Then you can find jar file.
Select that jar file.

Then click OK. Now we have pointed the ATG Plugin Jar file and now going install it in Eclipse.

Expand the installation components and select the root element.
Then click next to start the installation process. 

Then select next


Select the acceptance of agreement

Then select OK

Click YES to restart the Eclipse after plugin installation

Now it is the time to see the results. :D

Go to Window -> Open Perspective -> Other -> ATG

Now it will open all components related to ATG development

1. ATG Component Browser 

Located left upper corner along with package explorer
This represents ATG default components and components which are created by the developer.

2. ATG DSP Tag Libraries ( /common/ATG10.2/DAS/taglib/ )

These libraries are coming with default ATG framework.
As a best practice, Developers should try to use default ATG framework for their developments.
We have to use these tag libraries in our JSP pages.
Every JSP should begin with and End with
Then only that JSP will be enabled with ATG DSP ( Dynamo Servlet Pages ) features.

We can use these tag libraries in the following way.
For an example we will use ATG feature to print hello world.
Here we use ATG tag
This will print the content we passed.

Check all Tag libraries listed in Eclipse. 
Definitions of these tag libraries can be found under /common/ATG10.2/DAS/taglib/.

We can use these tag libraries along with HTML, JSTL Core Libraries, Expression Languages.
Ex : index.jsp


Output : Hello World

3. ATG Servlet Beans

These are pure Java Servlets enabled with ATG features.
Developers can extend and customized these default ATG servlet beans

Lets see how to use ForEach bean in ATG to iterate collection of bean called Person.

Each Person object has properties called id, name and address

Sample Data :
Person 1 ( 1212, saminda, matara )
Person 2 ( 3423, chathura, colombo )

Ex : index.jsp


Listing all persons begin


Listing all persons done.

There are two usages of

1. When we pass parameter then we have to use attribute param. 
   This can reads a bean value.

2. When we pass static value then we have to use attribute value

I am working on next tutorial, That is how to create and deploy ATG Project.

Happy Tux time...

Thursday, January 9, 2014

File compressions in Linux

1. tar command to make single archive file          
    tar -cvf testcontent.tar testcontent.txt          , tar -cvf  testcontent.tar yourFolder/

2. tar command to extract a tarball
    tar -xvf testcontent.tar

3. tar command to compress a file or folder with GZIP utility  
    tar -cvzf testcontent.tar.gz testcontent.txt    , tar -cvzf testcontent.tgz testcontent.txt

    Note : testcontent.tar.gz and testcontent.tgz are similar    

4. tar command to extract .tar.gz or .tgz file          
    tar -xvf testcontent.tar.gz                  , tar -xvf testcontent.tgz

5. tar command to compress a file or folder with BZ2 utility  
    tar -cvjf testcontent.tar.bz2 testcontent.txt  , tar -cvjf testcontent.tar.bz2 yourFolder/

6. tar command to extract .tar.bz2 file              
    tar -xvf testcontent.tar.gz

7. zip command to compress a file or folder          
    zip -r mybackupfile testfile.txt          , zip -r mybackupfile yourFolder/
    Note : Output file will be

8. zip command to uncompress a zip file            

Wednesday, January 8, 2014

How to run jar file in Linux

Goal :

 1. Most of production environments provides only terminal accesses. 
 2. Most of time there are no Graphical User Interfaces.
 3. So developers have to provide solutions  based on tiny console access. 
 4. Most of production environments are remotely located and support
     engineers  have to access them via slow network as well.


1. Install java and javac under Linux environment
2. Install Oracle under Linux environment
3. Download Oracle JDBC jar file from maven repository or oracle site.
    Ex - ojdbc14.jar


1. Create a simple project that connect to database and close the connection.
2. Export the project in to simple jar file.             
3. During this project we have to link Oracle JDBC driver jar file with the Project jar file.
4. Run the project jar file with making link to Oracle JDBC driver.

Step 1 : For the people who interested to write it from the scratch.
Navigate to Desktop by following command.
      cd ~/Desktop
Create folder called "testing" in your current location.
       mkdir testing
Change your directory to "testing"
       cd testing
Create folder called "javaunderlinux" inside folder called "testing"
       mkdir javaunderlinux
Step 2 : Create a class called "" inside folder called "javaunderlinux"
Use vi editor to create and save a java file.

Write your file as following manner.

package testing.javaunderlinux;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

class OracleTime{

     public static void main(String[] str){
        Connection dbConnection =  null;
       Statement statement = null;
       ResultSet rs = null;
          try {
        dbConnection =  DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","sys", "sys123");                                statement = dbConnection.createStatement();
                    rs=  statement.executeQuery("SELECT TO_CHAR(SYSDATE,'hh24:mi:ss') AS TIMENOW FROM DUAL");
                         System.out.println("Oracle Time : "+rs.getString("TIMENOW"));


           }catch ( Exception ex ){



Save and exit from

Step 3  : Time to compile
Go to the command prompt and change your directory to Desktop
      cd ~/Desktop
Then compile the code.
      javac testing/javaunderlinux/

Now it will create OracleTime.class inside folder called "javaunderlinux"

Step 4  : Creating jar file
Go to the command prompt and change your directory to Desktop
      cd ~/Desktop
Create jar file using following command.
      jar -cvf oracletime.jar testing/javaunderlinux/*
Step 5  : Time to run the jar file.

Check whether Oracle Database is up and running by following command.
      telnet localhost 1521

run the following command by linking both ojdbc14.jar and oracletime.jar
java -cp ojdbc14.jar:oracletime.jar testing.javaunderlinux.OracleTime

Step 6  : Time to see the result 

The result will similar to following one.
     Oracle Time : 16:45:22