New to ATG

I am new to ATG?


The Most awaited post is here. This post shall be explaining the step by step guidance for learning ATG (Oracle e-Commerce) for beginners.

Please watch out below Hyperlinks for detailed description on each topics. Hyperlinks will be enabled weekly basis.


Sl no Code Subject PPT Link VT Link
1 ECM01 Introduction to e-Commerce ECM01_PPT
2 ECM02 Introduction Oracle Commerce
3 LAB01 Installation of JDK, JBOSS
4 LAB02 Installation of Eclipse, SQL
5 LAB03 Installation of ATG10.2
6 LAB04 Running CIM
7 LAB05 DB Set up
8 LAB06 Building ATG Ear, Starting Server
9 DAF01 Understanding ATG Modules
10 LAB07 Creating myModule in Eclipse using ATG Plugin
11 DAF02 Understanding Nuclues
12 DAF03 Understanding Repository concepts
13 LAB08 Repository Lab
14 DAF04 Understanding Droplet concepts
15 LAB09 Droplet Lab
16 DAF05 Understanding Formhandler concepts
17 LAB10 Formhandler Lab
18 DAF06 Understanding Pipeline concepts
19 LAB11 Pipeline Lab

Coming Soon

Watch out for following Topics soon!!!!!

Links to following topics will be enabled periodically.

1. About ATG Framework
2. ATG Interview questions and answers
3. ATG's Droplet
4. ATG's FormHandler
5. Understanding Profile Repository
6. Understanding Order Repository
7. PriceList association to Product Catalog
8. Understanding Shopping Cart
9. Installing ATG10.x on Windows 7 (With JRE, ATG, JBOSS/Weblogic, MySQL/Oracle)
10. Installing CRS10.x on Windows 7

How to delete project from Front end of BCC

Deleting project from Front End of BCC

Note: This shall delete project along with project's associated process, assets, history.

To delete projects from front end of BCC, perform following steps.

1. Include the following jsp in custom BCC module's war.

File Name: delete-process.jsp

<%@ taglib uri="/dspTaglib" prefix="dsp" %>
<dsp:page>
<%@page import = "atg.epub.project.*" %>
<%@page import = "atg.dtm.*" %>
<%@page import = "atg.nucleus.*" %>
<%@page import = "javax.transaction.*" %>
<link href="style.css" type="text/css" rel="stylesheet"/>

<div style = "padding: 5px;">

<% boolean rollback = true;

TransactionManager tm=(TransactionManager)Nucleus.getGlobalNucleus().resolveName("/atg/dynamo/transaction/TransactionManager");
TransactionDemarcation td= new TransactionDemarcation();
        try {
            td.begin(tm);
            atg.deployment.server.SecurityManager.becomeTheSuperDood();
            ProcessHome processHome = ((ProcessHome) ProjectConstants.getPersistentHomes().getProcessHome());
            String processId = request.getParameter("process_id");
            if (processId == null) {
            out.println("TRYING HYPNOSIS TO GUESS PROCESS ID..... FAILED. Try explicitly specifying a process_id request parameter. ");
            return;
            }
            atg.epub.project.Process process =processHome.findById(processId);
            if (process == null) {
            out.println("wrong process_id parameter; not such process");
            return;
            }
            Project project = process.getProject();
            if (project == null) {
            process.delete();
            rollback = false;
            out.println("Process was found but there was no project associated with it. Process was deleted successfully.");
            return;
            }
            project.delete("publishing");
            out.println("Process with id " + processId + " was found and deleted successfully.");
            %>
            <br/> <input type = "button"
            onclick = "window.close()"
            value = "Cancel/Close"
            style = "font-size: 10px; background-color: #C3593C; color: white;"/> <% rollback = false;
        } catch (Throwable t) {
            t.printStackTrace(System.out);
            out.println(t);
        } finally {
            atg.deployment.server.SecurityManager.becomeNOTTheSuperDood();
        try {
        if (td != null) td.end(rollback);
        } catch (TransactionDemarcationException e) {
        e.printStackTrace();
        }
        }
%>
</div>
</dsp:page>


2. Identify the process id from DB using the following query.


select process_id from epub_process where display_name='name_of_project';



3. Hit the delete process URL, and pass the process id through request header.

<BCC_URL_Including_HTTP_PORT>/<context-root>/delete-process.jsp?process_id=<process_id>

ex: http://localhost:7005/mybcc/delete-process.jsp?process_id=prc162001




4. Following message confirms that the entire project is deleted.



Understang ATG Commerce Product Catalog

Catalog Elements

Catalogs- Catalog is a collection of repository items (categories, products, media, etc.) that provides the organizational framework for commerce site.
Properties of Catalog:
displayName: Name of catalog. It's required field.
rootCategories: Root categories of catalog.


Categories- Categories organize products into a hierarchy that provides a navigational framework for Websites. Categories can be parents to products or other categories.
Properties of Category:
displayName: Name of Category. It's required field.

childCategories: List of all categories that are children of this category.

childProducts: List of all products that are children of this category.

Products – A product is a navigational end-point in the catalog.
Properties of Product:
displayName: Name of Product. It's required field.
childSKUs: List of child SKUs of this product.


SKUs - A product is a navigational end-point in the catalog. However, customers do not actually purchase the product; they purchase a SKU (stock keeping unit). A product can have several different SKUs associated with it, representing varieties, sizes, and colors.
Properties of SKU:
displayName: Name of SKU. It's required field.



Example of Nested Categories                                               


Sample Catalog:

Block View of Catalog:

Unable to Create project in BCC(createProjectForProcess Exception)

ATG BCC Exception

Exception Details:
 

Logging Exception:

/atg/epub/workflow/process/WorkflowProcessManager       Error executing action createProjectForProcess[] on process instance 81200003; deleting the process instance   CONTAINER:atg.process.ProcessException; SOURCE:atg.epub.project.InvalidStateException: Process status is in a state where a new project cannot be created.

Why this error? 

BCC contains the workflows and process related to existing workflows in database, which are not in sync. So workflows and process needs to deleted and new workflows needs to loaded using server start up.

Solution:

Execute following scripts in versioning DB and restart BCC application. So when server starts up, it loads appropriate workflows into DB.

delete from EPUB_PR_HISTORY;
delete from EPUB_PROJECT;

delete from EPUB_PROC_TASKINFO;
delete from EPUB_WORKFLOW_STRS;

delete epub_workflow_info;
delete epub_coll_workflow;
delete from EPUB_IND_WORKFLOW;

delete from EPUB_PROC_HISTORY;
delete from EPUB_PROCESS;

delete from avm_asset_lock;

Its also good check to delete servers Ids.

Super Type and Sub Type in Repository

ATG Repository supports the inheritance of Objects through concepts of super-type and sub-type. Sub-type inherits all the properties of Super-type. Super-type can have multiple sub-types.

Following example shows "Library content" can be either "Book" or "Video CD". "Library content" is Super-type and "Book" and "Video CD" are sub-types.



Object Model

<!-- Library content-->
<item-descriptor name="libraryContent" sub-type-property="type">

  <table name="libraryContent" type="primary" id-column-names="id">
    <property name="type" data-type="enumerated">
      <option value="book"/>
      <option value="videoCD"/>
    </property>
    <property name="name"/>
    <property name="size"/>
    <property name="weight"/>
  </table>
</item-descriptor>

<!-- Book-->
<item-descriptor name="book" super-type="libraryContent" sub-type-value="book">
  <table name="book" type="auxiliary" id-column-names="id">
    <property name="pages"/>
  </table>
</item-descriptor>

<!-- Video CD-->
<item-descriptor name="videoCD" super-type="libraryContent" sub-type-value="videoCD">
  <table name="videoCD" type="auxiliary" id-column-names="id">
    <property name="duration"/>
  </table>
</item-descriptor>


Advantages
1. Most of properties from super-type can be reused in sub types.
2. This saves a lot of space in DB.




Resetting admin password for dyn/admin

Resetting "admin" password for dyn/admin

Password after resetting: "admin123"

update das_account set password='c1f59dd0bb1078b65a6c7f19f312e83ef6823716da2ba864507f1bb2eb393799' where account_name='admin';
commit;


OR

Delete the admin row and reinsert.

delete from  das_account where account_name='admin';
Insert into das_account (ACCOUNT_NAME,TYPE,FIRST_NAME,LAST_NAME,PASSWORD,DESCRIPTION,
LASTPWDUPDATE) values ('admin',1,'Andy','Administrator',
'c1f59dd0bb1078b65a6c7f19f312e83ef6823716da2ba864507f1bb2eb393799',null,to_date(
'07-NOV-12','DD-MON-RR'));
commit;

Clean up Profiles from DB

--Delete custom Profile tables from your Profile repository(Only if you have extended Profile Repository)
delete from dps_user_prevpwd;
delete from dps_user_org;
delete from dps_user_address;
delete from dps_user_roles;
delete from dps_user_org_anc;
delete from dps_user_mailing;
delete from dps_user_scenario;
delete from dps_scenario_value;
delete from dps_user_slot;
delete from dps_usr_markers;
delete from dss_user_bpmarkers;
delete from dcs_usr_actvpromo;
delete from dcs_usr_usedpromo;
delete from dcs_user;
delete from dcs_user_wishlist;
delete from dcs_user_giftlist;
delete from dcs_user_otherlist;
delete from dcs_user_catalog;
delete from dps_usr_creditcard;
delete from dps_other_addr;
delete from dps_mailing;
delete from dps_mail_trackdata;
delete from dps_user_mailing;
delete from dps_email_address;
delete from dps_user;
commit;

Clean up Orders from DB

--Delete custom Order tables from your order repository(Only if you have extended Order Repository)
delete from dcspp_schd_errmsg;
delete from dcspp_sched_error;
delete from dcspp_scherr_aux;
delete from dbcpp_sched_clone;
delete from dbcpp_sched_order;
delete from dcspp_manual_adj;
delete from dcspp_order_adj;
delete from dcspp_det_range;
delete from dcspp_det_price;
delete from dcspp_itmprice_det;
delete from dcspp_shipitem_tax;
delete from dcspp_ntaxshipitem;
delete from dcspp_taxshipitem;
delete from dcspp_shipitem_sub;
delete from dcspp_price_adjust;
delete from dcspp_amtinfo_adj;
delete from dcspp_ship_price;
delete from dcspp_tax_price;
delete from dcspp_item_price;
delete from dcspp_order_price;
delete from dcspp_amount_info;
delete from dcspp_payorder_rel;
delete from dcspp_payship_rel;
delete from dcspp_payitem_rel;
delete from dcspp_rel_range;
delete from dcspp_shipitem_rel;
delete from dcspp_cred_status;
delete from dcspp_debit_status;
delete from dcspp_auth_status;
delete from dcspp_sc_status;
delete from dcspp_gc_status;
delete from dcspp_cc_status;
delete from dcspp_pay_status;
delete from dcspp_bill_addr;
delete from dcspp_credit_card;
delete from dcspp_store_cred;
delete from dcspp_gift_cert;
delete from dcspp_item_ci;
delete from dcspp_subsku_item;
delete from dcspp_config_item;
delete from dcspp_pay_inst;
delete from dcspp_sg_hand_inst;
delete from dcspp_gift_inst;
delete from dcspp_hand_inst;
delete from dcspp_ship_addr;
delete from dcspp_ele_ship_grp;
delete from dcspp_hrd_ship_grp;
delete from dcspp_ship_inst;
delete from dcspp_order_rel;
delete from dcspp_order_item;
delete from dcspp_order_pg;
delete from dcspp_order_sg;
delete from dcspp_order_inst;
delete from dcspp_rel_orders;
delete from dcspp_relationship;
delete from dcspp_item;
delete from dcspp_pay_group;
delete from dcspp_ship_group;
delete from dcspp_order;
commit;

Secured Repository

Secured Repositories


The Oracle ATG Web Commerce secured repository system works in conjunction with the Oracle ATG Web Commerce Security System to provide fine-grained access control to repository item descriptors, individual repository items, and individual properties through Access Control List (ACL) settings.

Features:
•    Control access to repository item descriptors: Control who can create, add, remove, and query items defined by an item descriptor; similar to controlling access to a whole database table.
•    Control access to individual repository items: Control who can read, write, destroy, and query a repository item.; similar to controlling access to a single database row.
•    Control access to properties of all repository items in a repository item descriptor: Control who can read or write a property in any repository item defined by an item descriptor; similar to controlling access to a database table column.
•    Control access to properties of an individual repository item: Control who can read or write a particular property in a repository item; similar to controlling the field of a database table row.
•    Limit query results: Control who can receive repository items that are returned by a repository query.
•    Set ownership of a repository item: At creation time, the current user is assigned as the owner of the new repository item. The owner can query a repository item and modify its ACL; otherwise this is simply an association of an identity to an Item.
•    Automatically generate ACLs for new repository items: When a repository item is created, it is assigned an ACL that is constructed out of an ACL fragment and a template for the creator/owner (creator) and each group the owner belongs to.

Creating a Secured Repository
1.    Modify the Underlying Repository:
Add properties to the repository definition as follows

<item-descriptor name=”my”……………. >
….
<property name="item_owner" column-names="item_owner" data-type="string"/>
<property name="item_acl" column-names="item_acl" data-type="string"/>
<property name="secured_property_acl" column-names="secured_property_acl" data-type="string"/>
</item- descriptor>

2.    Configure the Secured Repository Adapter Component:

File name: SecuredMyRepository.properties
# SecuredMyRepository.properties
$class=atg.adapter.secure.GenericSecuredMutableRepository
$scope=global
name=My repository for the secured repository implementation
repositoryName=SecuredMyRepository
# the repository that we're wrapping
repository=MyRepository
# The template file that configures the repository
configurationFile=secured-My-repository.xml
# The security configuration component used by the repository
securityConfiguration=/atg/dynamo/security/SecuredRepositorySecurityConfiguration
# Various Dynamo services we need
XMLToolsFactory=/atg/dynamo/service/xml/XMLToolsFactory
transactionManager=/atg/dynamo/transaction/TransactionManager


3.    Register the Secured Repository Adapter Component:
/atg/registry/ContentRepositories

initialRepositories+=/MyRepository,/SecuredMyRepository

4.    Create the Secured Repository Definition File:
<!-- secured-my-repository.xml -->
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE secured-repository-template
 PUBLIC "-//Art Technology Group, Inc.//DTD Dynamo Security//EN"
 "http://www.atg.com/dtds/security/secured_repository_template_1.1.dtd">
<secured-repository-template>
 <item-descriptor name="my">

   <!-- The ACL that applies to the item view/descriptor -->
   <descriptor-acl value="Admin$role$administrators-group:
     read,write,create,delete;Admin$role$everyone-group:read"/>

   <!-- The property where the ownership is stored -->
   <owner-property name="item_owner"/>

   <!-- The property where ACL is stored in -->
   <acl-property name="item_acl"/>

   <!-- An ACL fragment that is assigned to all new items -->
   <creation-base-acl value="Admin$role$administrators-group:
      read,write,list,destroy,read_owner,write_owner,read_acl,write_acl;
      Admin$role$everyone-group:read,list"/>

   <!-- Access rights assigned to the owner when an item is created -->
   <creation-owner-acl-template value="$:read,write,list,destroy"/>

   <!-- Access rights assigned to all owner groups when an item is created. 
        WARNING: This feature can be dangerous. -->
   <creation-group-acl-template value="$:read,list"/>

   <property name="secured_property">
     <!-- The ACL that applies to this property across all repository items -->
     <descriptor-acl value="Admin$role$administrators-group:
        read,write;Admin$role$everyone-group:read"/>

     <!-- The name of the item property where this property's ACL is stored. -->
     <acl-property name="secured_property_acl"/>

     <!-- An ACL fragment assigned to this property when an item is created. -->
     <creation-base-acl value="Admin$role$administrators-group:read,write"/>

     <!-- Access rights assigned to the owner when an item is created -->
     <creation-owner-acl-template value="$:read,write"/>

     <!-- Access rights assigned to all owner groups when an item is created. 
          WARNING: This feature can be dangerous. -->
     <creation-group-acl-template value="$:read,write"/>

   </property>
 </item-descriptor>
</secured-repository-template>

5.    Modify the SQL for the Repository Data Store:
Add following columns to table.
item_owner varchar,
item_acl varchar,
secured_property_acl varchar

6.    Rebuild your EAR.

7.    Modify the Repository Mapping in Admin/Console to map SecuredMyRepository to both MyRepository_staging and MyRepository_production.