Navigation Menu

Multisite

In Multisite Environment : 
  • SiteContextPipelineServlet in DAF pipeline/ Servlet Pipeline,determines the site. SiteContextPipelineServlet retrieve site id from request and check if site is enable. 
  • To disable Multisite feature : Set SiteContextPilelineServlet.enabled=false
  • If enable, Passes the site ID to the SiteContextManager (creates request scope thread to access site properties) and SiteSessionManager (associate session to site) components.


#/atg/dynamo/servlet/pipeline/SiteContextPipelineServlet 

        $class=atg.multisite.SiteContextPipelineServlet        
        siteSessionManagerPath=/atg/multisite/SiteSessionManager
        siteContextManager=/atg/multisite/SiteContextManager
        siteManager=/atg/multisite/SiteManager

        ruleFilters=\
                /atg/multisite/RequestParameterRuleFilter,\
                /atg/multisite/URLPatternMatchingRuleFilter
        defaultRuleFilter=/atg/multisite/DefaultSiteRuleFilter
        insertAfterServlet=/atg/dynamo/servlet/pipeline/DynamoHandler


On receiving a request, the SiteContextPipelineServlet examines each request URL in order to determine which site to associate it with. 
  • Iterate over an array of SiteContextRuleFilter components, or rule filters.
  • Call each rule filter’s filter() method until a site ID is returned for that request.
  • If none of these rule filters returns a site ID, call the rule filter that is set on the DefaultRuleFilter property, DefaultSiteRuleFilter.
  • If no rule filter returns a site ID, the SiteContextPipelineServlet stops processing and passes on the request to the next servlet in the request pipeline.
We can customize rule filter to add new rule filter. Below are the steps to create custom rules :
  • Modify SiteContextPipelineServlet property to append (+=) or overwrite custom filter.
  • CustomFilter class should implement SiteContextRuleFilter interface and overwrite its filter() method.
RequestParameterRuleFilter sets the site name in ‘pushSite‘ request parameter. Name has been configured to RequestParameterRuleFilter.pushSiteParamName.

URLPatternMatchingRuleFilter determines the site Id from the request URL, based on certain rules. checks the URLPatternMatchingRuleFilter.URLs map property. If not matchched, the filter asks SiteURLManager for a match. SiteURLManager builds cached map of URLs from the Site Repository. SiteURLManager.getSiteIdForURL() will return the site ID.

If none of these rule filters returns a site ID, call the rule filter that is set on the DefaultRuleFilter property, DefaultSiteRuleFilter. Site to the site configured in the property DefaultSiteContextRuleFilter.defaultSiteId. By default, defaultSiteId is null.

Based on the site ID returned by the rule filters, SiteContextPipelineServlet selects the site context. After the site context has been selected, the ProfilePropertyServlet uses it to set site-specific properties on the current profile.

Common Error :

If a site ID is determined, but the SiteContextPipelineServlet cannot find a site configuration that corresponds to the site ID, it logs a warning, stops processing, and passes on the request to the next servlet in the request pipeline.


Multisite for different website using same profile data :


Example, consider a clothing manufacturer that has two brands, a bargain brand and a luxury brand, and wants to run separate sites for the two brands.
In the simplest case, these sites may share only user profiles, so a customer registered on one site is also registered on the other. In more complex implementations, the sites may share shopping carts, so a customer can include items from both sites in a single order. The bargain-brand site might also include upsell recommendations for (and links to) items on the luxury brand site, or the sites might share gift lists.

This section provides an overview of multisite concepts and ATG’s implementation of multisite functionality. Its intended audience consists of business users, developers, and system administrators who are designing and developing multisite applications.


Multisite Approaches


  • Affiliated sites : Same type of site. Can share product, cart, profile
  • Microsites : Site within site. Created for special purpose. Share cart/ Profile with parent site.
  • Country sites : Specific to country. Diffrent catalog / Price Unit. Share profile, cart or catalog

ATG Multisite Support

Data sharing : can share commerce and personalization resources, such as catalog items, shopping carts, orders, search results, promotions, scenarios, and targeters.
Site Group : provide a way to logically group sites.
Example : If Site A and A1 share catalog - Site Group 1
If Site B and B1 share catalog - Site Group 2
If Site A and B share Profile - Site Group 3
By default, sharing of product comparisons is tied to sharing of shopping carts.

Administrative tools : creating and managing sites.
Site Repository : /atg/multisite/SiteRepository
Contains all the site details. like: site name, Default URL. (Only need to register if you have more than one site)
settings specified in Site Administration are stored in the Site Repository.

Site Administration : Managed through BCC.
Capable of creating,configure,Change settings,Disable site, site group

Site categories
To create a site category, the system administrator creates a site template item in the Site Repository.

The template makes it possible to:

  • Control the grouping of properties in Site Administration.
  • Specify non-default editors for properties. For example, the standard editor for a text property is a text box where a user can enter an arbitrary string. A site template can replace the editor for a specific text property with a drop-down menu that has a set of preconfigured options.
  • Suppress the display of certain properties, so that they cannot be set.
  • Hard-code the values of certain properties.

Site properties, site categories, and shared data are essential parts of the site definitions created in the Site Administration utility.

Site Repository has three item types :


  • Site Template : Contains name and description of site categories and Id of item mapping.
  • Site Group : contains site group Id , Reference of sites and sharable type
  • Site Configuration : Site properties of individual site


Oracle ATG Web Commerce adds these properties:

  • defaultListPriceList
  • defaultSalePriceList
  • defaultCatalog

Shared Item :

  • define a item or group of items shared within site groups.
  • ShareableType component is a globally scoped Nucleus component of class atg.multisite.ShareableType
  • ShareableType component must be registered with the /atg/multisite/SiteGroupManager

shareableTypes+=/atg/multisite/ShoppingCartShareableType

Site Administration utility has two main functions:

  • To create a new site, you select a site category, and fill in the values of the site configuration properties.
  • To create a site group, you specify the sites in the group, and the resources that the sites share.

Coding a multisite application differs from coding a non-multisite application in a number of ways.

Sharing resources : By default, all resources are shared across sites. Coding is to limits the sharing of resources.

  • Site context
  • URL management
  • Page development

No comments :