Showing posts with label ATG. Show all posts
Showing posts with label ATG. Show all posts

Wednesday, October 7, 2015

RMI Over SSL in ATG Platform Configuration

RMI Over SSL


Component:

Use this component for RMI over SSL configuration /atg/dynamo/service/socket/SSLRMISocketFactory


Enable RMI Over SSL:


set the RMISocketFactory property of the /atg/dynamo/server/RmiInitialization component to point to the SSLRMISocketFactory component

eg: RMISocketFactory=/atg/dynamo/service/socket/SSLRMISocketFactory



Configuring Keys and Certificates:



1. Go to your ATGDir\home directory.

2. Use the keytool utility to export the Oracle ATG Web Commerce certificate:

keytool -export -alias atgkey –keystore ..\DAS\keystore\atg-ssl.jks
-rfc –file ..\DAS\keystore\atg-ssl.cer

3. Enter atgkey when prompted for the key store password:

Enter password name: atgkey
Certificate stored in file <..\das\keystore\atg-ssl.cer>

4. Now import the Oracle ATG Web Commerce certificate:

keytool -import -alias atgcert -file ..\DAS\keystore\atg-ssl.cer -keystore
..\DAS\keystore\cacerts.jks

The key tool utility displays information about the certificate:

5. Owner: CN=Snorthog, OU=Dynamo, O=Art Techonology Group, L=Cambridge,
ST=MA, C=US
Issuer: CN=Snorthog, OU=Dynamo, O=Art Techonology Group, L=Cambridge,
ST=MA, C=US
Serial number: 3eef2fc2
Valid from: Tue Jun 17 11:12:02 EDT 2003 until: Thu May 04 14:50:08
EDT 2006
Certificate fingerprints:
         MD5:  95:0E:9A:3A:D7:C9:A6:CA:73:B5:CA:C0:44:DB:E0:1E
         SHA1: 32:38:3C:AD:57:BB:59:B7:9C:91:A3:79:03:56:9E:96:44:37:20:4C

6. Answer yes when prompted whether to trust the certificate:

Trust this certificate? [no]: yes
Certificate was added to keystore



Generating a New Certificate on Production Environment:



We can use the keytool utility to generate a new private key and public key, and wrap the public key into a new self-signed certificate.

1. Configure the /atg/dynamo/security/BasicSSLConfiguration component on each server.

2. You must set the keyStore and trustStore properties to point to your new key store and trust store file locations. You must also set the keyStorePassword and trustStorePassword properties to the values that you used when creating the key store and trust store.


Note: Use the JDK keytool utility with the –genkey flag to generate a new self-signed certificate that wraps the public key.



Saturday, February 28, 2015

How to Configure/Integrate Spring Framework with ATG

Introduction:


Spring is a framework (open source). More important thing here is ATG accepts spring based application which can be integrate along with ATG modules. Spring framework providing the way to establish its mechanism to ATG with the help of nucleus based approach. Spring is based on JavaBeans as like as Nucleus.


Steps to start with:



1. Create a spring framework entry in web.xml which is available in our ATG projects, 
<servlet>
   <servlet-name>spring</servlet-name>
   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
   <servlet-name>spring</servlet-name>
   <url-pattern>/spring/*</url-pattern>
</servlet-mapping>

a) DispatcherServlet act as controller and it is a bridge between ATG and Spring components


2. Make sure our pageFilter has a entry for spring under <filter-mapping>




<filter-mapping>
    <filter-name>PageFilter</filter-name>
    <url-pattern>/spring/*</url-pattern>
</filter-mapping>

a) DAF pipeline will take care of rest of the process.
 










3. We should use Two OOTB ATG Classes for this spring integration






a) NucleusResolverUtil:




It contains a single static resolveName method. which attempts to resolve the specified Nucleus path. Since Spring is unaware of Nucleus component scope. 
It will check resolve name on current request, if it is fails then in next attempt it will resolve the name in the global Nucleus scope.

eg:
To make a Nucleus component available in Spring, you declare it in your Spring configuration XML file. For example, to resolve the current user profile as a Spring component:
<bean name="/Profile" class="atg.nucleus.spring.NucleusResolverUtil"
    factory-method="resolveName" singleton="false">
  <constructor-arg value="/atg/userprofiling/Profile"/>
</bean>
a) singleton="false" : Profile is a session based component. only global scope component will be specified as singleton="true", request and session component should be specified as  
singleton="false"


b) NucleusPublisher:



The NucleusPublisher class publishing a Spring configuration to nucleus path.

<bean name="/NucleusPublisher" class="atg.nucleus.spring.NucleusPublisher"
    singleton="true">
  <property name="nucleusPath">
    <value>/atg/spring/MyspringBeanClass</value>
  </property>
</bean>







4. We have to add springtonucleus.jar


Path: <ATGDir>/DAF/spring/lib/springtonucleus.jar. 

a) NucleusPublisher requires access to the Spring classes, so the springtonucleus.jar must be added to the WEB-INF/lib




5. Now you can check your application






Monday, December 23, 2013

Session Management in ATG Applications : ATG



Note: This is about session management in ATG applications running on third-party application servers

The J2EE specification defines that each web application has its own session object and any attributes added to the session are only accessible from within that web application. The application server is entirely responsible for managing session life cycles; it generates a unique session ID, creates the session, invalidates it, fails it over, etc. An “ATG session” refers to session-scoped components Also, keep in mind that Nucleus components have a tree structure, and can include multiple scopes, with each scope being rooted at a particular component. The root for session-scoped components is /atg/dynamo/servlet/sessiontracking/GenericSessionManager/sessionid/ where sessionid is generated by the application server.


Sharing Session Information Among ATG Applications


You can run multiple ATG applications in the form of WAR files within a single EAR. In this case, you should share session-scoped Nucleus components so that your application will always have access to the same instance of session scoped components. By default, J2EE servers hand out different session objects in each web application visited, even if all requests came from the same browser. Sharing sessions across ATG applications ensures that you can build a J2EE application consisting of multiple WAR files in a single EAR, and each WAR has access to the same session-scoped components. Note that you should never run more than a single ATG EAR per application server instance.

When multiple web applications exist in the ATG EAR file, one of them must be designated as the parent application. Being the parent means that that application’s session ID is used as the basis for creating the ATG session scope root.

By default, ATG makes the <ATG10.2dir>\DafEar\base\j2ee-components\atg_bootstrap.war file the parent web application. The parent context path is /dyn. No additional configuration is required to use this, but your web applications should define the atg.session.parentContextName and atg.dafear.bootstrapContextName parameters in their web.xml to point to the parent web-application as shown:


<context-param>
   <param-name>atg.session.parentContextName</param-name>
   <param-value>/dyn</param-value>
</context-param>
<context-param>
   <param-name>atg.dafear.bootstrapContextName</param-name>
   <param-value>/dyn</param-value>
   <description>The name of the DAF bootstrap WAR context.</description>
</context-param>

The context path the context-param points to must be for a WAR file with the SessionNameContextServlet defined in its web.xml:

<servlet>
   <servlet-name>SessionNameContextServlet</servlet-name>
   <servlet-class>atg.nucleus.servlet.SessionNameContextServlet
   </servlet-class>
</servlet>

Note that there can be only one parent web application specified per EAR file. Therefore, if you change the parent application, be sure to set the context-param to the same values in all web.xml files within your EAR file:

<context-param>
   <param-name>atg.session.parentContextName</param-name>
   <param-value>/portal</param-value>
</context-param>

Note: This information applies only to session-scoped Nucleus components, and does not affect HTTP sessions obtained using atg.servlet.ServletUtil.getDynamoRequest(request).getSession(), which retain a context particular to the current web application.


Managing User Sessions


You can manage user sessions from the Dynamo Component Browser for debugging or administrative purposes. To access the Session Manager, click through the hierarchy:

/atg/dynamo/servlet/sessiontracking/

Click GenericSessionManager to view sessions. Choose the selection criteria, then click the View button. Click an individual session to see its properties.



Switching Databases : ATG


In many database-dependent applications, you may want to make changes in an offline database and then switch over your live application so that the inactive database becomes the live database. ATG’s switching facility is based on a class named atg.service.jdbc.SwitchingDataSource. You can use a SwitchingDataSource in place of a regular data source (such as atg.service.jdbc.MonitoredDataSource)

The SwitchingDataSource can be switched between two or more underlying DataSources. All DataSource method calls are passed through to the DataSource specified by the currentDataSource property of the SwitchingDataSource. Note that each DataSource that the SwitchingDataSource points to must be of class atg.nucleus.JNDIReference, with a JNDIName property that points to an application server data source.


Configuring a SwitchingDataSource


$class=atg.service.jdbc.SwitchingDataSource
#
# A map from data source names to data sources
#
dataSources=\
     DataSourceA=/atg/commerce/jdbc/ProductCatalogDataSourceA,\
     DataSourceB=/atg/commerce/jdbc/ProductCatalogDataSourceB

#
# The name of the data source that should be used on startup
#
initialDataSourceName=DataSourceA

repository=/atg/dynamo/service/jdbc/SDSRepository


initialDataSourceName:


The short name for the DataSource that should be used for the currentDataSource on the very first run. On subsequent runs, the initial currentDataSource is obtained from the state recorded in the SDSRepository.


dataSources:


Set to a ServiceMap of DataSources. This property maps short names of DataSources to their Nucleus component path. The following example shows how you might set the dataSources property:

dataSources=FirstDataSource=\
/atg/dynamo/service/jdbc/FirstDataSource,\
  SecondDataSource=\
/atg/dynamo/service/jdbc/SecondDataSource


repository:


Set with a reference to /atg/dynamo/service/jdbc/SDSRepository


Database Switching and Query Caching


If you are using a GSA repository and set the cacheSwitchLoadQueries property of the GSAItemDescriptor to true, the query cache is loaded for a cache switch. If false, the query cache starts out empty after a cache switch.


Database Switching and Repository Caches


If you set the cacheSwitchHot property of the repository component to true, when the repository receives a SwitchingDataSourceEvent of type PREPARE from the SwitchingDataSource, it prepopulates off-line caches with data from the next DataSource. Then, when the switch occurs and the repository receives a SwitchingDataSourceEvent of type SWITCH from the SwitchingDataSource, the caches are not flushed; instead, the off-line caches go live. This can improve performance during and immediately after a database switchover.


Friday, October 18, 2013

Reset the Dyn/Admin Password in simple ways : ATG

Reset the Dyn/Admin Password:


Step 1 : Add the Admin.Reset to your Build ear, When adding this module to your build arguments, It will allow us to prompt to the Change password template

 









Step 2 :  And if you not sure what is your password . Use this below query and execute it in the query browser

update das_account set password = 'e64b78fc3bc91bcbc7dc232ba8ec59e0'
where account_name = 'admin';


your Password will be : Admin123

If you want to use some other MD5 hash words also

Different Admin password Are Given Below Along With MD5 Hash Words:

Admin1234  =  2da753c46e58b26de9a6c25acae32d6df6fde06adb8ef2cde66aad7436d235dd
admin =  21232f297a57a5a743894a0e4a801fc3




Thats it. so simple.



Popular Posts