Sunday, July 24, 2016

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ATG Programming!!!!!!!!!!!!!!!!!!!!!!
1)    Nucleus
ATG Container for components
Provides hierarchal name space for components - each component has a unique full name so that pages and other components can reference it.
·         Create and initializes component instance
·         Manages component scope

$class=atg.nucleus.Nucleus
initialServiceName=/Initial

2)    Scope
Global Scope/ATG server running = one instance shared by all users of the application
and state is same for all users across atg servers
Users on different browser can manipulate the same object hence
Consider synchronizing the methods that sets values
Synchronize setAlpha(){
}
Session: every user gets copy of the component
exists for duration of the users session

/atg/dynamo/servlet/sessiontracking/SessionManager

Request: each request gets a different copy of the component
3)     What is the difference between formhandlers vs droplet.
Formhandlers - Push based / request scope
Droplets : Pull based de / global scope



4)    ACC - include DafEar.admin in assembled application
Jboss - 8080/HTTP port
Weblogic - 7001 or 9080/HTTP

Nested Modules
Service.Agent
Service.Search

5)    ATG Architectures

Component Centric  - web application are collected through java beans which are configured and linked though .properties files
MVC

Design pattern followed in ATG

MVC2 - pull based MVC - Dispatch view strategy
MVC2 - push based MVC - service to workers statergy
IOC - inversion of control(dependency injection)

ATG home directory / DYNAMO_HOME = ATG/ATG 10.0.1/home
ATG directory = ATG/ATG 10.0.1

6)    Module Dependencies

in ATG its often for a modules to dependent on another module using MANIFEST.MF file located in module/MANIFEST/MANIFEST.MF
if we include top level modules then all modules under this module are automatically included
7)    Manifest.MF
declares the purpose and location of the module's content
dependencies are declared  in file

Manifest-Version: 1.0
ATG-LiveConfig-Path: liveconfig
ATG-Config-Path: config/config.jar - ATG looks for component properties file in directories specified by CONFIGPATH environment variable
ATG-Required: SHARED.base SHARED.globalnav SHOP.shopcore SHOP.wireless SHOP.uverse SHOP.dsl SHOP.directv SHOP.accessline
ATG-Required-If-Present: SHARED.externalservices
ATG-Class-Path: lib/classes.jar lib/online-vending-1.1.jar
ATG-Client-Class-Path: lib/classes.jar lib/online-vending-1.1.jar

Name: lib/online-vending-1.1.jar
ATG-Client-Update-File: true

Name: lib/classes.jar
ATG-Client-Update-File: true

8)    Linking Property value
if a system containing many components, it is possible to have same component to be initialized with the same property value.

/ecom/base/crypto/IRUShopLandingEncryptorComponent.properties
key^= /ecom/shopcore/util/OnlineEncryptorComponent.key (component name whose value need to copy)

OnlineEncryptorComponent
key=hhDh5AWcZ7i2bbdQ96SVwcG3NgiweReDU2ecKOhnmss=

here we were taking the key from the base component across projects.

ATG nucleus can link the property of one component to the value of other component

9)    Application.xml
context url - /dynamusic
Deploying Application /startDynamoOnJBOSS -f -run-in-place - m Dynamusic
Assembling the application into EAR  /home/bin/runAssembler -standalone
placing that copy into JBoss server

10  ) ATG Core Components
DAS - Dynamo Application Server
DAF - Dynamo Application Framework
DPS - Dynamo Personalization Module
DSS - Dynamo Scenarios module

                DCS<<<< DSS <<< DPS<<< !DAS! <<< !!DAF!! <<< module/config <<<< module /liveconfig

                DPS<DSS

                       DAF
                          DPS                      
                         DSS
                    Nucleus
      Providing personalized content and scenario based personalization targeting



                 Repositories
                visitor profiling


                Tag Libraries
              content targeting


           Droplet & Form handlers




11)            Configuration layering
 if same property value is defined in two files, the last value overrides previous values
 listpropert += value to append(set,array etc)
         localconfig = site-wide, cluster-wide or server specific settings
         liveconfig  = production specific, located with in application
         installconfig -
        groupconfig

12)           Server - named servers

13)           Component name

 /atg/dynamo/services/SMTPEmail
                Component
$class=com. ecom.wireless.commerce.order.lob.WirelessLineOfBusinessInfoManager
$scope=global
orderTools=/atg/commerce/order/OrderTools


            14)      Session/user session/30 mins
/atg/dynamo/servlet/sessiontracking/SessionManager
sessionInvalidationTime=1800000

           15) weblogic-application.xml

<cookie-name>SHOPSESSIONID</cookie-name>
    <cookie-http-only>false</cookie-http-only>
    <timeout-secs>1800</timeout-secs>
         16)  Initial.properties

 /shop/config/src/main/resources/atg/Initial.properties

 initialServices+=\
                                /ecom/shop/service/TargeterRefreshService,\
                                /ecom/shopcore/servlet/pipeline/AuthorizationPipelineServlet,\

        17) InsertableServlet
$class=com.ecom.servlet.dafpipeline.VerifyUserAgent
$scope=global
insertAfterServlet= /ecom/base/servlet/pipeline/SSLRedirectServlet

public class VerifyUserAgent extends InsertableServletImpl {

public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws IOException,
            ServletException {

       18) Nucleus Configuration
atg_bootstrap.war in web.xml

Request processing nucleus based application
The Web application calls one of the following resources. Each of these resources starts a different request-handling pipeline:
DynamoProxyServlet, called when the request is for a JHTML page, starts the DAS servlet pipeline.

AppServer >> Custom Filter >> Dynamo Proxy Servlet >> DAS(Dynamo Handler/DAS servlet pipeline ) >> Page Compile Servlet >> App Server >> myresult.Jhtml

AppServer >> Page Filter >>  DAF( Tail pipeline ) >> Customer Filter >> App Server >> myresult.Jhtml
PageFilter, called when the request is for a JSP, starts the DAF servlet pipeline.

         19) Web.xml / .war

<servlet>
                                <servlet-name>NucleusServlet</servlet-name>
                                <servlet-class>
                                                atg.nucleus.servlet.NucleusServlet
                                </servlet-class>
                                <load-on-startup>1</load-on-startup>
                </servlet>

           20)  Form handler
Form handlers are components that you typically build from one of the form handler classes provided by the ATG Adaptive Scenario Engine. All provided form handler classes are subclasses of atg.repository.servlet.GenericFormHandle, and inherit its properties and methods:


SimpleSQLFormHandler - Works with form data that is stored in a SQL database.
RepositoryFormHandler - Saves repository data to a database.
ProfileFormHandler - Connects forms with user profiles stored in a profile repository.
SearchFormHandler - Specifies properties available to a search engine.

<dsp:input type="submit" value="button-label" bean="handler-component.cancel"/>
<dsp:input type="hidden" bean="MyFormHandler.cancelURL" value="../index.jsp"/>

<dsp:input bean="PersonalPaymentInfoFormHandler.successURL" type="hidden" value="/shoptest/checkout/shippingaddress.jsp"/>
<dsp:input bean="PersonalPaymentInfoFormHandler.billToAddress" id="billToAddress" value="submit" type="submit" />
                                               
           21) Form Error Handling

formError any error , boolean set to true
              formExceptions , vector of exception

           22)  Droplet
public class WirelessPricingDroplet extends DynamoServlet {

public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
            throws ServletException, IOException {
                                               
                                                Profile profile = (Profile) pRequest.getObjectParameter(DropletConstants.PROFILE_PARAM);
                               
                                                }

           23) Profile - live representation of user's information
/atg/userprofiling/Profile
ProfileRepository - stores information for registered users
PofileAdaptoryRepository
To use a composite profile repository instead of the standard SQL profile repository, override the default /atg/userprofiling/ProfileAdapterRepository so that it is an instance of a MutableCompositeRepository instead. To do this, create an instance of atg.adapter.composite.MutableCompositeRepository as described in Creating a Composite Profile Repository Component, but save it at the Nucleus address /atg/userprofiling/ProfileAdapterRepository.

$class=atg.adapter.composite.MutableCompositeRepository

repositoryName=UserProfiles
configurationFile=/atg/userprofiling/composite.xml
transactionManager=/atg/dynamo/transaction/TransactionManager
groupContainer=/atg/registry/RepositoryGroups
#loggingDebug=true
#debugLevel=20

24) Transient Property- corresponds to the state of anonymous user
1) when a new session is first created, transient = true and repositoryId= arbitrary number
2) user login in, transient = false and repositoryId=711

<item-descriptor>
<property name="testTransient" data-type="string" category="" />
<table name="" type=""

</item-descriptor>

No comments:

Post a Comment