8. ProfileRequestServlet
creates an instance of
the atg/userprofiling/Profile
create a cookie containing the Profile ID of the
current guest user
Auto-logs in
maintain persistent
information: persistentAnonymousProfiles=tr
ue
11. Steps to create pipeline servlet
Add the
servlet to /atg/dynamo/servlet/Initial.initialServices
Set the new servlet’s nextServlet property
Reset the previous servlet’s nextServlet property
Define global scope component
Extend atg.servlet.pipeline.PipelineableServletImpl
20. UpdateOrder Pipeline Chain:
O OrderManager.updateOrder(
O updateOrderObject
O updateCommerceItemObjects
O updateShippingGroupObjects
O updatePaymentGroupObjects
O updateRelationshipObjects
O updatePriceInfoObjects
O saveManualAdjustments
21. ProcessOrder Pipeline Chain
O OrderManager.processOrder()
O checkForExpiredPromotions
O removeEmptyShippingGroups
O removeEmptyPaymentGroups
O moveUsedPromotionsauthorizePayment
O addOrderToRepository
O sendPromotionUsedMessage
O sendFulfillmentMessage
When a user performs an action that prompts a response, the application server creates an instance of theHttpServletRequest and HttpServletResponse. Based on the directories and file extension of therequestURI, the application server uses servlet and filter mappings defined in web.xml to determine the nextresource to call.By default, PageFilter is mapped to handle JSP requests. When the application server invokes PageFilter,it checks the request and response for a reference to a Dynamo request and response pair. The pair doesnot exist, so PageFilter starts the DAF servlet pipeline by calling DynamoHandler, the first servlet in thepipeline. The DAF servlet pipeline processes through a series of servlets that modify the request and responseby extracting path information and providing session, user, and security information. The last servlet in thepipeline is TailPipelineServlet. It is responsible for calling FilterChain.doFilter(), which invokes thenext filter defined in web.xml. The web application, unless it uses Oracle ATG Web Commerce Portal, does notinclude other servlet filters.
http://localhost:8180/dyn/admin/nucleus//atg/dynamo/servlet/dafpipeline/DynamoHandler/http://localhost:8180/dyn/admin/nucleus//atg/dynamo/servlet/adminpipeline/Resolves and starts processing from “atg.servlet.startRequestServletName” filter configuration parameterIn some cases can invoke only /atg/dynamo/servlet/dafpipeline/TailPipelineServlet
The BasicAuthenticationPipelineServlet class provides authentication using the Basic HTTP authentication mechanism. A component for this servlet is not included in the standard servlet pipelines, but the class is available for use in servlet pipelines you might create in your own applications.
CachePreventionServlet modifies the response headers for certain requests to indicate that the returned content should not be cached.
Extend atg.servlet.pipeline.PipelineableServletImpl.Define the servlet as a globally scoped Nucleus component.Reset the previous servlet’s nextServlet property to point to the new servlet.Set the new servlet’s nextServlet property to point to the next servlet in the pipeline.Add the servlet’s path to the initialServices property of /atg/dynamo/servlet/Initial.
The DispatcherPipelineableServlet interface provides a mechanism for conditionally branching the pipeline. This interface includes adispatcherServiceMap property that is a Map of possible servlets to invoke next, depending on some condition. For example, the MimeTypeDispatcherservlet determines which servlet to invoke depending on the MIME type of the request. ATG provides the implementation classDispatcherPipelineableServletImpl.
http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGPlatformProgGuide/html/s0807insertingservletsinthepipeline01.htmlThe InsertableServlet interface lets a servlet insert itself into the pipeline when the service starts, without requiring changes to servlets already in the pipeline, through the insertAfterServlet property, which points back to the preceding servlet. The inserted servlet reads the preceding servlet’s nextServletproperty and points to it as the next servlet to execute after itself.For example, a servlet pipeline might contain Servlet1, whose nextServlet property points to Servlet2. You can insert MyNewServlet, which implementsInsertableServlet, between the two by setting its insertAfterServlet property so it points to Servlet1. This configuration splices ServletNew between Servlet1 and Servlet2 as follows:- MyNewServlet sets its own nextServlet property to the value of Servlet1’s nextServlet property.MyNewServlet reads Servlet1’s nextServlet property and links to Servlet2 as the next servlet to execute after itself.If an insertable servlet inserts only itself into a pipeline, it uses the nextServlet property of its insertAfterServlet servlet to resume pipeline execution. However, if the inserted servlet starts a secondary pipeline, it sets its own nextServlet property to the next servlet in that pipeline. After the last secondary pipeline servlet executes, it passes control to the nextServlet servlet originally specified by the insertAfterServlet servlet, and the original pipeline resumes execution.The ATG installation provides an implementation of the InsertableServlet interface, atg.servlet.pipeline.InsertableServletImpl. This class implements all Servlet methods, so you only need to override the service method.To add an InsertableServlet to the servlet pipeline:Write your servlet by extending atg.servlet.pipeline.InsertableServletImpl.Define the servlet as a globally scoped Nucleus component.Set the insertAfterServlet property of your servlet to point to the path of the pipeline servlet you want your servlet to follow. For example, you can insert a servlet after DynamoServlet as follows:insertAfterServlet=/atg/dynamo/servlet/dafpipeline/DynamoServletAdd the servlet’s path to the initialServices property of /atg/dynamo/servlet/Initial:initialServices+=/myServletWhen the inserted servlet finishes processing, it calls the method passRequest() (defined in InsertableServletImpl), which automatically passes the request and response objects to the next servlet in the pipeline.
1. The processing of an Order begins with a call from FormHandlers (CartModifierFormHandler) toOrderManager.processOrder().2. OrderManager.processOrder calls the PipelineManager to execute the processOrder pipelinewhich is configured in commercepipeline.xml3.The processOrder pipeline first validates the Order and then processes it by calling the sequenceof processors.4.Each processor is responsible to handle a task or can call another pipeline.5.Each processor after execution returns a status code and determines which processor in thechain to execute next.6.The Pipeline Manager enables us to dynamically add and remove processors and chains of processors.
From OrderManager.java public PipelineManagergetPipelineManager() { return getOrderTools().getPipelineManager(); } public void updateOrder(Order pOrder) throws CommerceException {…HashMap map = new HashMap(13);map.put("OrderManager", this);map.put("Order", pOrder);map.put("Changed", Boolean.FALSE); try {map.put("OrderRepository",getOrderTools().getOrderRepository());getOrderTools().registerSynchronization(pOrder);getPipelineManager().runProcess("updateOrder", map); } catch (RunProcessException e) { throw new CommerceException(e); } finally { if (pOrderinstanceofOrderImpl && isTransactionMarkedAsRollBack()) ((OrderImpl) pOrder).invalidateOrder(); } if (pOrderinstanceofOrderImpl) ((OrderImpl) pOrder).updateVersion();…
The processOrder pipeline chain submits the given Order for checkout. The processOrder pipeline chain is executed by the processOrder() method in the OrderManager. The processOrder() method adds the given Order, Profile, Request, Locale, and OrderManager to its parameter list, which is supplied to the executing chain. The pipeline chain’s transaction mode is TX_REQUIRED.