CRS#009 - How to import Commerce Reference Store (CRS) Code in Eclipse?

ATG Commerce Reference Store (CRS) code can be easily imported to eclipse in a few simple steps.
If you wish to change and deploy the existing CRS code, it is not recommended to do so. For this purpose, you can create a new custom module on top of CRS and deploy it. You can see the steps for this HERE.

1. Create a new Java Project

a. Go to File -> New -> Java Project, an eclipse window will open.
b. Name the new project as TempProject. Notice the location of the project, where it is being created. (Disabled textbox, below project name)

c. Click Finish.
d. Browse to the location where this new project is present.
e. Now, copy the files .classpath and .project

2. Copy files to ATG's CRS Folders

a. Open your ATG directory (e.g. D:/ATG/ATG11.0)
b. Inside this folder, you will find a folder CommerceReferenceStore
c. Open this folder and and paste the .classpath and .project files you copied before
d. Edit the .project with a text editor (e.g. notepad)
e. Change the name of the project from TempProject to CommerceReferenceStore
Your .project file should look somewhat like:
<?xml version="1.0" encoding="UTF-8"?>

f. Now, the project CommerceReferenceStore, also has some nested projects. Therefore, you need to repeat the above steps (copying .project and .classpath) for those subfolders too, and change the project name.

For example, CommerceReferenceStore project has a sub-project called store. Therefore, these files have to be copied there too, and in this case, the project name will be changed to CommerceReferenceStore.Store.

Similarly, this Store folder also contains sub-projects like EStore, Mobile etc. In this case, the project name will become CommerceReferenceStore.Store.Estore and CommerceReferenceStore.Store.Mobile. These steps can be repeated, for whichever sub-projects you want to import.

3. Import in Eclipse

a. Open eclipse (you can use same or old workspace, whichever you like)
b. Go to File -> Import
c. Type "Existing Projects"

d. Select "Existing Projects into Workspace". Press Next.
e. Browse the path to your CommerceReferenceStore directory in ATG folder.
(Your sample path should look like: D:/ATG/ATG11.0/CommerceReferenceStore)
f. Tick the checkbox "Search for nested projects". 
g. Eclipse will show a list of all the projects where you have copied .project and .classpath files (should look like below)

h. Press Finish. Your projects will be displayed in Package Explorer on the left.

Again, it is not recommended to customize existing CRS Code. This code should only be used a reference. You can build a module on top of CRS and write your custom code. Details for which have been provided HERE.

1 comment:


Get All The Latest Updates Delivered Straight Into Your Inbox For Free!