Você está na página 1de 139

ATG Relationship Management Platform (formely Dynamo eBusiness Platform)

R.Srinivasan Vamsoft

ATG Platform
The ATG Platform and its suite of products is a flexible, Java-based development environment for building personalized applications for the Web and other communication channels (email messaging, wireless devices, etc.). The platform and its related products, include Dynamo Application Server, ATG Portal, ATG Commerce, ATG Content Administration, and the ATG Control Center.
2

ATG Platform
ATG
Merchandising

ATG Recommendations

ATG CSC

OutReach Campaign Optimizer

Knowledge Response
Management

ATG Search

ATG Portal

ATG ATG Commerce Publishing

ACI

ATG Personalization + ATG Scenarios Dynamo Application Framework Application Server

ATG Platform
The ATG Platform includes the following core components: DAF - Dynamo Application Framework DPS - ATG Personalization Module DSS ATG Scenarios Module

ATG Platform
The Dynamo Application Framework (DAF) runs on top of our application server and supplies essential facilities for application development and deployment viz.,
Nucleus Repositories Tag libraries Droplets & FormHandlers

This portable framework is designed to run on the industrys leading J2EE application servers, like JBoss, IBM WebSphere and Oracle WebLogic.
5

ATG Platform
The Personalization module (DPS) provides tools for visitor profiling and content targeting, enabling to deliver personalized content to customers according to their characteristics and preferences. The Scenarios module (DSS) adds advanced scenario-based personalization features to the ATG Platform. Using the scenario editor, business managers can design, test, and fine-tune customer management scenarios that track and respond to customer behavior. Business processes can be exposed as workflows. Data analysis and reporting tools, including ready-made business chart templates, are available for charting scenario data.
6

ATG Portal provides a customizable framework for building personalized Web portals for specific user communities. A manufacturing company, for example, might create separate portals for employees, customers, and partners, each providing access to different content and services. The Portal Application Framework (PAF) is the infrastructure developers use to create and administer portals and the individual gears that render content and features (a stock ticker or discussion forum, for example) within portal pages. ATG Portal comes with a set of page template and baseline gears that you can use for your own portals.

Add-on Products

Add-on Products
ATG Commerce includes everything we need to build and manage personalized ecommerce Web sites. ATG Consumer Commerce provides business-to-consumer (B2C) storefront development features -- product catalog management, pricing, inventory, customer service, etc. ATG Business Commerce adds support for business-to-business (B2B) transactions, including B2B payment methods (purchase orders, requisitions), account-specific product catalogs and price lists, multiple shipping/billing addresses, etc.

Add-on Products
ATG Content Administration (earlier known as ATG Publishing) provides a streamlined system for modifying and deploying content on your site. The system keeps track of multiple versions of publishable assets (scenarios or catalog items, for example) within specific publishing projects. Using the workflow editor, you can define how each project moves through the various stages of the publishing process: content creation, editing, check-in, approval, QA and deployment on the live site.
9

Additional Applications
ATG Merchandising application runs on top of ATG Publishing and ATG Commerce and give the Commerce Business users a way of creating and maintaining versioned content of various items like ProductCatalog, Personalization targeters etc., ATG CSC (Commere Service Center) is a web based application that also integrates a ticketing system, which can be used by the Commerce Call center agents to manage customers, Orders etc., ATG Knowledge and Response Management accumulates and provides CRM related information. ATG Outreach and Campaign Optimizer are used by the marketing people to create promotions, scenarios etc., to track visitor behaviour and tune the commerce system.
10

Finally, the ATG Control Center (ACC) is the integrated user interface for the ATG Relationship Management Platform and its supported products. The ACC provides application developers, page designers, site administrators, business managers, and other members of your project team with point-and-click access to the tools they need for building and maintaining ATG applications

11

Facilities Supplied by DAF


The ATG Platform is supported by a foundation layer called the Dynamo Application Framework (DAF), which runs on top of our application server. Our application server handles tasks such as session management, load balancing, clustering, and SNMP monitoring. DAF supplies additional facilities for application development and deployment, including:

12

Facilities Supplied by DAF


Nucleus Nucleus is the central registry for the JavaBeans that contain our application-level logic. It creates and configures Dynamo components and organizes them into a hierarchical namespace so they can be referenced by other components. By reading the various configuration files associated with each component, Nucleus figures out what components to use in an application, what their initial properties are, and how they connect to each other. Nucleus, thus allows developers to build applications in a component-oriented manner.
13

Nucleus is the mechanism that creates and configures new components, then gives those components a place to "live" so they can be found by other components. In Nucleus, every component has a unique name, allowing components to refer to each other. Components are organized into a hierarchy, similar to a file system. This results in component names such as /atg/dynamo/service/Scheduler and gives Nucleus the ability to resolve relative names, such as ../service/Scheduler. Furthermore, Nucleus components are JavaBeans, affording all the advantages of the JavaBean standard.
14

The Pages and Components task area in the ATG Control Center shows all of the components currently registered in Nucleus (by module or by path) and provides templates to help we create new ones, either from existing Dynamo classes or our own Java classes. When it comes to configuring components for our application, we can use the built-in Component Editor to specify initialization parameters and the way the components link together. The ACC creates the necessary configuration files automatically. DAF also provides a Web-based component browser, as part of the Dynamo Administration interface, that we can use to examine and modify components in a running Nucleus application.
15

Facilities Supplied by DAF


Tag libraries Originally the presentation language used by the framework was JHTML. There are lots of custom tags provided in JHTML to access the dynamo components. With JSP becoming the defacto presentation language for java, the framework provides the DSP tag library to access Nucleus components and render dynamic content from our JavaServer Pages (JSPs). Earlier DAF also contained a Core tag library for tags for flow control, manipulating data and handling transactions which has been now deprecated in favour of the JSTL core tag library.

16

Facilities Supplied by DAF


Dynamo Servlet Beans Dynamo Servlet Beans are specialized Nucleus components that can be embedded in our JSPs to display dynamic content. Using Dynamo Servlet Beans minimizes the amount of Java code that has to appear in HTML and the amount of HTML that has to be hard-coded into Java classes and also enables the developer to take a Dispatcher View approach of MVC2 Design pattern. As a result, Java programmers and page designers can work independently and applications are easier to maintain. DAF comes with a set of ready-made Dynamo Servlet Beans that you can use in your pages.
17

Facilities Supplied by DAF


Form Handlers Form handlers are specialized Nucleus components that can be embedded in our JSPs to do form validation and based on the results do certain actions like inserting into database, forwarding the user to some other JSP page etc., Using Form Handlers is the way to achieve Service To Workers approach of MVC2 design pattern. DAF comes with a set of ready-made Form handlers like ProfileFormHandler, ShoppingCartModifier etc., that we can use in your pages either directly or customize them using the extension points given.
18

Facilities Supplied by DAF


Repository API The Repository API (atg.repository.*) is a data access layer that defines a generic representation of a data store. Whenever ATG applications needs to load, store, or query a data store, they make the appropriate calls through this API. The API then accesses the underlying data storage device, translating the API calls into whatever calls are needed to access that particular data store.
19

Implementations of the Repository API exist to access data stores such as relational databases, LDAP systems, and content management systems. In addition, the Composite Repository feature enables us to consolidate multiple data sources and make them available to our application as a single, queryable repository. The Secured Repository Adapter provides finegrained access control to repository item descriptors, individual repository items, and even individual properties through the use of Access Control Lists (ACLs).

20

Component-centric Development Model

21

This Framework is totally a component-centric development platform. The Dynamo Web applications you create are assembled out of individual JavaBean components, which are configured and linked together by .properties files within Nucleus, Dynamos open object framework. Nucleus is the core of the entire Dynamo system. It creates and configures Dynamo components (also called beans and JavaBeans) and organizes them into a hierarchical namespace, essentially giving them a place to live so they can be referenced by other components. By reading the .properties files associated with each component, Nucleus figures out which components to use in an application, what their initial properties are, and how they connect to each other. This model makes it possible for us to build Dynamo applications by configuring pre-built components instead of writing a lot of Java code from scratch.
22

WHAT IS A COMPONENT?
Components are pre-developed pieces of application code that can be assembled into working application systems. In Short, A Building Block. A Component Can Be Designed To Manage Simple Functionality Or Even A Very Big Module.. Components Will Be Put Inside A Construct Called As Container To Make Them Work. The Container Provides the Application Context(or The Environment) And Provides Management And Control Services For These Components. Client Components Will Normally Be A Web Form Or An Applet Whereas Server Components Are Non-visual And Will Be Executed Inside Web Servers ,TP Monitors Etc., A Component Has To Strictly Adhere To The Standard Component Model. 23

COMPONENT MODEL
Component Model: defines the basic architecture of a component, specifying the structure of its interfaces and the mechanisms by which it interacts with the container and other components. Provides guidelines to create & implement components that can work together to form a larger application. GUIDELINES Granularity : a component can be very small or even complex. Standard Interface : the component must provide a standard interface that will enable other components to access its properties and methods. Customization without much refactoring : Application developer must be able to change the properties & behaviour of a component without going thro its source code.
24

COMPONENT ARCHITECTURE
Practice of delivering solutions by building/buying interoperable components. Components need not necessarily be objects. They can be any program functionality. Components can be used for managing GUI functionality or even serverside functionality.
25

COMPONENT ARCHITECTURE
EXAMPLES OF COMPONENT ARCHITECTURE COM/DCOM JAVA BEANS CORBA COMPONENTS

26

ADVANTAGES
Code reusability Reduced development time Container independent Entire application behaviour can be changed by modifying one/some of the components (applicable to J2EE)

27

ADVANTAGES
Makes application development more cost effective by reducing the time to market. Reusing components improves the quality of the application since the components would have been exhaustively tested and debugged before being released in the market. Also reusing components means the developers can concentrate on newer areas than doing the same chores.
28

ADVANTAGES
Components will allow you to adapt and reconfigure your work processes and deliverables without requiring wholesale replacement and restructuring of your IT environment. The use of components enables the continuous, incremental and successful improvements, which quite often yield revolutionary results.

29

What is a component in ATG?


A public java class with appropriate properties with set/get methods. A acompanying .properties file specifying the class name and the scope and also any default values. The properties file will also contain any dependency injections of other components. The .properties file must be under the CONFIGPATH of the ATG. The name of the component is the full path name of the .properties file under the configpath starting with a /. For example, /com/vam/firstbean. CONFIGPATH variable is computed dynamically during startup based on the modules started, their order of startup and based on the entry in the MANIFEST.MF file of every module started.
30

Dynamo Model Vs. J2EE


Original Dynamo Model of Development J2EE Model of development

JHTML with Custom Tags

JSP Pages

Nucleus (Containing Components,repositories etc)

Web Container(Contains Java beans, Tag handlers etc)

JVM (DAS)

JVM (J2EE Application Server)

Operating System

Operating System

31

DAF Model Today


Web Application (JSP)
DSP Tag Library

Nucleus (Containing Components,repositories etc)

Web Container JVM (J2EE Application Server) Operating System

32

Design Patterns followed in DAF


MVC2 in a Dispatcher View Strategy MVC2 in a Service To Workers Strategy Dependency Injection or IoC (Inversion Of Control

More details about this available in Appendix


33

Separation between page Development and Application Development - the ATG way

34

MAKING JSP EXTENSIBLE


Use Java Beans to separate the Business content from the presentation content and reuse the code. Define custom tags and a tag library for the oft-used functionalities.

35

JSP Design Basics


Aim in web application design must be to separate logic and presentation. Based on this, there are two approaches to JSP design: Page-Centric or client-server : in this type, requests are made directly to the JSP page that produces response. Dispatcher or n-tier : Request is initially made to a JSP or a servlet that acts as a mediator or controller, dispatching requests to a JSP pages and JavaBeans as appropriate.
36

Page-Centric or Client-Server
Browser Request/ response
JSP or servlets client requests are intercepted here

Browser

EJB java beans


37

dB

Characteristics of page-centric design JSP/servlets access enterprise resources like EJBs directly and generate responses by themselves. Simple to program and allows the page author to generate the dynamic content easily and based upon the request and state of resources. But scalability is not there and manageability is difficult because it ends up bundling too much of java code within a JSP page especially if the JSP pages are maintained by the designers. There are two variants of this model. Page view page-view with bean
38

Page view
request JSP response Business processing

this approach is easy to get started. All java code will be embedded within HTML. Trade-off is as the business logic grows the pages go out of control and also there is very little reusability.
39

Page view with Bean


request JSP response Worker Bean Business processing

this architecture is used when page view becomes too much cluttered with Business logic. The java code is relegated to a worker bean leaving the JSP clean and maintainable by the designers. JSP can be modified without affecting the 40 Business logic

Consequences of the single-page approach


Heavy HTML and Java coupling The coder of the JSP file must be both a page designer and a Java developer. The result is often either terrible Java code or an ugly page, or sometimes both. Java and JavaScript blur As the pages become larger, there can be a tendency to implement some JavaScript. When the JavaScript appears in a page, the script can get confused with the Java code. An example of a possible point of confusion is using client-side JavaScript to validate the email field.

Embedded flow logic


To understand the entire flow of the application, you have to navigate all of the pages. Imagine the spaghetti logic on a 100-page Web site.
41

Debugging difficulties
In addition to being ugly to look at, HTML tags, Java code, and JavaScript code all in one page makes it difficult to debug problems. Tight coupling Changes to business logic or data means possibly touching every page involved.

Aesthetics
Visually, in large pages, this type of coding looks messy. When doing Microsoft ASP development, you would commonly see 1000-line pages. Even with syntax coloring, it is still difficult to read and understand.
42

A JSP tag is simply a way of abstracting out code from a JSP file. Some people think of JSP tags as macros for JSP files, where the code for the tag is contained in the servlet. (The macro perspective is almost true.) we do not want to see HTML tags in Java code, and also Java code in a JSP file. The entire point of JSP technology is to allow the page designer to create servlets without being distracted with Java code. Tags allow Java programmers to extend JSP files by making Java code look like HTML.

43

JSP tags require a container that runs JSP 1.1 or later. JSP tags run on the server and are not interpreted by the client like HTML tags are. JSP tags provide proper code re-use.

44

MVC Architecture
MODEL
Encapsulates application state Responds to state queries Exposes application functionality Notifies views of the changes

5. Query the state

1. Register as an observer

3. State change

4. Change notification

VIEW

View

Renders the models selection Defines application behaviuor Requests update from models Maps user actions to model updates Sends user gestures to controller Selects view for response 2. User Allow controller to select view

CONTROLLER

gestures
45

Method calls Events

Model-View-Controller (MVC)
Model
The model encapsulates the state of the application. It knows nothing about the view or controller.

View
The view provides the presentation of the model. It is the look of the application. The view can access the model getters, but it has no knowledge of the setters. The view should be notified when changes to the model occur.

Controller
The controller reacts to the user input. It creates and sets the model.
46

MVC2 / Model2
For the Web, the classical form of MVC cannot be applied. So a Web adaptation of MVC, also commonly known as Model 2 or MVC2 has been brought in. The Web brought some unique challenges to software developers, most notably the stateless connection between the client and the server. This stateless behavior made it difficult for the model to notify the view of changes. On the Web, the browser has to re-query the server to discover modification to the state of the application.
47

MVC2 / Model2
A JSP or a Servlet will act as a mediator or controller, delegating the requests to other components like JSP or Java Beans. The View will be another JSP. There are two design patterns that can be followed to apply MVC2 : Mediator-View/Dispatcher-View (a pull based MVC) service to workers (a push based MVC)
48

Dispatcher-View
2. Forward the control

Renders response

request

Controller

Presentation JSP

Worker bean

Business Layer (may Be EJBs)

3. Uses/re-populates 1. populates
Simple value Java Beans

49

Dispatcher-View
Mediator works with a presentation JSP page and a worker bean to fulfil a service request. The mediator initially handles the request and delegates it to a JSP/bean combination. The presentation JSP populates the bean properties from the request parameters and then uses the bean to prepare the data for presentation.

50

Service To Workers
1.request

Controller Servlet
6.forward

5. Returns the presentation JSP name

delegate

4.Business call

7. response

JSP

2.populate Java bean

3.execute

EJBs
Business

3. Uses/re-populates

workers

Layer

51

db

Service To Workers
The mediating Servlet handles the request from the client. Initial delegation point is a worker bean that processes our business data and data access code. After the worker bean has completed its responsibility of populating the intermediate model for the JSP, the mediating component dispatches to the JSP to generate the presentation. This architecture provides a cleaner separation between the view and the controller
52

IoC or Dependency Injection


Another important benefit of the dynamo framework is that it uses the Dependency Injection or the Inversion of Control design pattern. This facilitates the developers to concentrate on the business logic coding rather than the infrastructure coding. The Container is responsible for tying up the necessary components and make it available as and when our application required the same. Every component will have a dedicated .propeties file to enable the developer to specify the necessary dependencacies.

53

IoC or Dependency Injection


What is it? A way of sorting out dependencies between objects and automatically injecting references to collaborating objects on demand Who determines how the objects should be injected? The IoC framework, usually via configuration files Benefits Removes the responsibility of finding or creating dependent objects and moves it into configuration Reduces coupling between implementation objects and encourages interface based design Allows an application to be reconfigured outside of code Can encourage writing testable components
54

Inversion of Control (IoC) is a design pattern that addresses a component's dependency resolution, configuration and lifecycle. IoC is also relevant to simple classes, not just components. The most significant aspect to IoC is dependency resolution and most of the discussion surrounding IoC dwells solely on that. Simply put, a component designed according to IoC does not go off and get other components that it needs in order to do its job. It instead declares these dependencies, and the container supplies them. Thus the name IoC/DIP/Hollywood Principle. The control of the dependencies for a given component is inverted. It is no longer the component itself that establishes its own dependencies, but something on the outside. That something could be a container like dynamo, but could easily be normal code instantiating the component in an embedded sense.
55

Traditional way of obtaining references

public void service( ) throws .. { DataSource ds=new InitialContext().lookup(dynamo:/atg/dyna mo/service/jdbc/MyDS); Connection conn=ds.getConnection(); ..

56

Dynamo way of obtaining references


private DataSource dataSource; public void setDataSource(DataSource ds) { dataSource=ds; //setter Injection } public void service( ) throws .. { Connection conn=dataSource.getConnection(); .. The .properties file will look like
$class=somepkg.someclass

57

dataSource=/atg/dynamo/service/jdbc/sql PoolFakeXA

Linking Property Values In a system containing many components, it is not usual for several components to be initialized with the same property values. If we configure the values independently, this can lead to confusion for the administrator if the value is changed in one component, but not changed in the other components. So we want the Nucleus to link one property value to the value of another property in another service. To do this, append a ^ to the name of the property you want to set. For the value, enter the component name and property name whose value is to be copied into this property. For example if there is a second bean whose age property is dependent on firstbean age property, then the properties file of second bean will look like this,where firstbean is a nucleus name relative to secondbean. $class=vam.secondbean age^=firstbean.age Note : The ^ character must come right after the age name without any intervening white space, otherwise it will not be set.
58

Questions to Ponder?
What is the role of META-INF\MANIFEST.MF in setting up the module dependencies? What are the steps in creating a component in ATG? What is the effect of layering the .properties file in ATG? What is the default location of our java classes in ATG? What care must be taken when layering .properties file that contain multi-value properties? What are the various attributes that <dsp:valueof can take? When changes will get reflected when the .properties file of a global component is changed? Can one java class me made into multiple components?
59

Droplets

60

Steps in writing a Droplet


Write a java class extending the atg.servlet.DynamoServlet class. Override the service() method and provide the logic there. Identify the appropriate Input parameters that can be passed to droplet and the OPARAMS the droplet will render and also the various output parameters the droplet will set in the request. Write the BeanInfo class and define all the necessary parameters in that. Make the droplet into a component using the ATG Component Browser. Embed the droplet in a JSP page using the <dsp:droplet ..> tag and pass the necessary parameters. Us the OPARAM tags to mix the HTML content and the dynamic values returned by the droplet.
61

Form Handlers

62

Form Handling Many Web applications obtain information from users by having them fill out forms. A form may need to handle user input in a variety of formats, check input for validity, handle errors, and pass input to a servlet for processing or to a database for storage. Through the use of special attributes, we can use JSP pages to associate HTML form tags to the properties of Nucleus components:
63

A page can automatically display the current value of a Nucleus components property as the default value in a form element. When a form is submitted, the values that the user enters can be used to set the values of component properties. A single form can set any number of properties in any number of Nucleus components. Forms can be made to interact directly with a SQL database. Information a user submits can be stored in a database, or used to query a database for information to display. When a form is submitted, the form input

elements can trigger actions in the application.


64

Form Handlers
We can create forms in JSP Pages that set values of properties of Nucleus components directly when the form is submitted. For more complex form handling operations, setting the values of properties directly is not always desirable. It is generally preferable to first submit the form to a form handler. The form handler can evaluate the validity of the data, check for errors, and determine what action to take (e.g., submit the data, direct the user to a different page, display an error message, etc.) Often when you use a form handler, the form input fields are associated with properties of the form handler rather than the component you ultimately want to modify.
65

A form handler class must include one or more handler methods. A handler method is typically invoked when the user clicks the submit button, and handles the processing of the form. Depending on the purpose of the form handler, it can have several different handler methods that each perform a different operation. For example, a form handler that works with user profiles might have separate handler methods for creating the profile, modifying the profile, and logging the user in.
66

If the form uses FormHandler, the exceptions that occurred while processing the form are stored in the following properties. formError : A boolean that is true if any errors occurred when the form was processed. formExceptions : A vector of the exceptions that occurred when the form is processed. propertyExceptions : A read-only property that returns a Dictionary of subproperties, one for each property set by the form. For any property that generated an exception, the corresponding subproperty in the propertyExceptions Dictionary contains that exception. For any property that did not generate an exception, the corresponding subproperty in the propertyExceptions Dictionary is unset.
67

ATG Relationship Management Platform includes the following form handler classes: SimpleSQLFormHandler for working with form data that is stored in a SQL database. RepositoryFormHandler for saving repository data to a database. ProfileFormHandler class to connect forms with user profiles stored in a profile repository. SearchFormHandler for specifying properties available to a search engine. You can also extend these and other form handler classes to handle the specific needs of your application.
68

Steps in writing a FormHandler


Create a java class extending the atg.droplet.GenericFormHandler base class. Provide the appropriate handleXXX methods. Each Handler method will be triggered by a corresponding dsp:input submit button from the JSP page. Provide either a Map data structure to hold the form data or provide individual fields with appropriate set/get methods. Write the validation logic inside the handler methods and return appropriate boolean codes. Populate validation errors, if any, into the formExceptions Vector or proceed to do the business logic. Forward the user to the appropriate success URL.
69

CORE DYNAMO SERVICES

70

Dynamo comes with a host of Dynamo Foundation Classes that can be used as Nucleus components. Because these classes provide functionality that is generally useful across many applications, these classes are often called services. services Like all Dynamo components, these Dynamo Foundation Classes are created and configured through configuration files (properties files, most often) in the Nucleus configuration tree. Some services are meant to be used by multiple applications, and are thus instantiated once in a well-known place. For example, the Scheduler service is used by many applications, and is instantiated as part of the standard Dynamo configuration. Other services are instantiated and configured differently for different applications, sometimes creating many instances for the same application. And finally, other services are not instantiated at all, but instead are extended by subclasses, which should then be instantiated. 71

Scheduler Service
Most server-side applications have tasks that need to be performed on a periodic or recurring basis. For example, a component in the application may need to clear a cache every 10 minutes, or send out email at 2AM every morning, or rotate a set of log files on the first of every month. Dynamo includes a Scheduler service, atg.service.scheduler.Scheduler, which keeps track of scheduled tasks and executes the appropriate services at specified times. Administrators can see a list of all scheduled tasks by looking up /atg/dynamo/service/Scheduler in the Dynamo Component Browser (http://localhost:8830/nucleus/)
72

Scheduling a Task
In order for a component to schedule a task, the component needs a pointer to the Scheduler, which is usually set as a property. The component then schedules a new task by calling addScheduledJob on the Scheduler. The Scheduler handles things from there, waiting until the time comes to execute the job. When the Scheduler executes a job, it calls performScheduledTask on the object that is supposed to perform the task, which must implement atg.service.scheduler.Schedulable. Most often the component that scheduled the task will also be the Schedulable that will handle the task, but this is not strictly required. When a component schedules a task, it must specify enough information for the Scheduler to handle the scheduling:
73

A name for the scheduled job, which is not used except when it is displayed to the administrator. The name of the component scheduling the job. Once again, this is not used except for purposes of displaying to the administrator. The Schedulable object that will handle the job. Most often this is the same as the component scheduling the job, but need not be the case. A flag indicating whether the job should run in a separate thread when its time comes, run in the same thread that all other scheduled services run in, or run in a dedicated, reusable thread. If it runs in the same thread, then no other scheduled services can run until that job finishes. If the job is long and expensive, it should run in a separate thread. If the job is short, then it should run in the same thread. The Schedule that indicates when the job should run. This is specified as an object that implements atg.service.scheduler.Schedule. atg.service.scheduler.Schedule
74

The scheduler package provides a set of useful Schedule types, including schedules that represent an event at a specific time, schedules that represent periodic events, and schedules that represent events based on the calendar (e.g., on the 1st and 15th of every month). Usually the Schedule is passed in as a property. All of this information is encapsulated in a ScheduledJob object, which is passed to the addScheduledJob method of the Scheduler. When a job is added to the Scheduler, the Scheduler returns a job ID for the job, which is an integer that can later refer to that job. For example, to stop a scheduled job, you can call removeScheduledJob on the Scheduler, passing in the ID of the job to be stopped. When the Schedulable object is called to perform a task, it is passed the ScheduledJob object that was used to schedule that task. This is useful in the case where a single service is supposed to perform several kinds of scheduled tasks, and needs the properties of the ScheduledJob to determine which task it is supposed to perform.
75

SCHEDULER_THREAD: The Job runs in the SCHEDULER_THREAD Schedulers own thread. This is the most efficient mechanism but it blocks the scheduler from performing any other job till this is complete. Use this if the jobs started are not long running. Not suitable for jobs involving I/O operations. SEPARATE_THREAD: Each time the job is SEPARATE_THREAD triggered, a new thread is created to run the job and the thread is destroyed once the job completes. REUSED_THREAD: A pool of threads is created REUSED_THREAD for that job and the threads are re-used. Will not block the Scheduler.
76

The different types of Schedules can also be created programmatically by creating new instances of RelativeSchedule, PeriodicSchedule, or CalendarSchedule. RelativeSchedule A RelativeSchedule specifies a time relative to the current time. For example, the following specifies a task that will occur in 30 seconds: schedule=in 30 seconds PeriodicSchedule A PeriodicSchedule specifies a task that will occur at regular intervals. There are three parameters for this Schedule. The first is the period between jobs. For example: schedule=every 20 minutes A second parameter lets you specify a period to wait before starting the schedule: schedule=every 10 seconds in 20 minutes This will wait 20 minutes before starting the periodic task. 77 Once it starts, it executes every 10 seconds.

The third parameter determines whether or not the PeriodicSchedule should attempt to catch up if it misses jobs. For example, suppose that the period is 2 seconds. Now assume that the job occurs at time A. Another job should occur at time A+2. But suppose that the Scheduler doesn't get around to handling the job until time A+5. This might happen if the polling interval is greater than the job's period (technically, this will occur if the polling interval is greater than half the period). The next time it will schedule for the job is A+6, which means that the job at A+4 is missed. If the PeriodicSchedule is instructed to catch up, then at time A+5, the job will occur twice, once for A+2, and once for A+4. The next job will occur at A+6. If the PeriodicSchedule is instructed not to catch up, then the job that would have occurred at A+4 will be discarded. The following example sets a PeriodicSchedule not to catch up missed jobs: 78 schedule=every 10 seconds in 20 minutes without catchup

CalendarSchedule A CalendarSchedule specifies a task that will occur according to units of the calendar and clock. For example, you can schedule a task to occur at 2:30am on the 1st and 15th of every month. The format looks like this: schedule=calendar <months> <dates> <days of week> <occurrences in month> <hours> <minutes>
79

Dynamo Initial Services


startDynamo
Nucleus
initialServiceName

/Initial
initialServices

/atg/Initial
initialServices

/atg/dynamo/startServers

/VMSystem

Other Services

/atg/dynamo/Initial /atg/modules/Initial /atg/commerce/Initial Other Services

80

Starting our components Automatically


The way to start multiple components during ATG startup is to define a single component that refers to all of the components that must be started, then start that single component. Nucleus includes a component called InitialService that exists specifically for this purpose. The Nucleus.properties file includes this line:
initialServiceName=/Initial

This refers to the Initial service, which is defined by the Initial.properties configuration file as follows:
$class=atg.nucleus.InitialService initialServices=\ /atg/Initial,\ VMSystem,\ /atg/dynamo/StartServers
81

Sampler
Once an application has been deployed, monitoring the state of that application becomes an important task. In the JavaBeans model, the current state of the application is usually exposed through properties. These properties are often read-only, meaning that they expose only the getX method. Dynamo provides a Sampler service that you can configure to monitor a set of component properties. The Sampler can be instructed to generate periodic samples of the specified components, or to generate samples of the component on demand.

82

SecureRandomGenerator
Dynamo includes a component you can use to generate secure random numbers. This component, with a Nucleus address of /atg/dynamo/service/random/SecureRandom, can generate random numbers more efficiently than the Java class, java.security.SecureRandom, since it provides the random number generator with a random seed, rather than using the slower process of Java's SeedGenerator.

83

IdGenerator
In many circumstances, a Dynamo application may need to generate unique identifiers. For example, each repository item in a repository needs a unique repository ID, so that the item can be retrieved by its ID. The atg.service.idgen package provides an interface and implementations that you can use to generate unique IDs in a variety of ways. SQLIdGenerator TransientIdGenerator ObfuscatedSQLIdGenerator
84

ResourcePool
atg.service.resourcepool.ResourcePool A Base class for creating our components that can be pooled.

EmailSender
Dynamo includes a facility for sending e-mail, and a JavaMail-based implementation for sending Internet e-mail through SMTP. The email interface is called atg.service.email.EmailListener, and the SMTP implementation is called atg.service.email.SMTPEmailSender. Internally, SMTPEmailSender uses JavaMail's SMTP implementation to send the e-mail.
85

Servlet Pipeline

86

One of Dynamo's most important tasks is handling HTTP requests. In handling these requests, Dynamo uses session tracking, page compilation, Dynamo Server Pages, and other powerful extensions to the basic Web server model. Request handling can usually be broken down into a series of independent steps. Each step may depend on additional information being available about the request, so order does matter. However, the individual steps are separable. For example, a typical request might go through these steps:
Examine the incoming cookies to match the request to a session. Compare the request URI against a list of restricted directories, to make sure that the user has permission to access the specified directory. Translate the request URI into a real file name, taking "index" files into account when the file name refers to a directory.

87

Given the file name's extension, determine the MIME type of the file. From the MIME type, dispatch the request to the appropriate handler. For "text/html" MIME types, handle the request by looking in a cache to see if the file is already in the cache. If so, serve the data from the cache. If the file is not in the cache, read the file from disk and serve it.

This is only one of many possible request-handling configurations. Other configurations might dispatch based on a beginning path such as /cgi-bin. Other configurations might move the session-tracking step to be performed only for files with the MIME type "text/sessiontracked." In Dynamo, each of these steps is represented by a single Nucleus service that also implements the Servlet interface. Every request sent to the Dynamo server is dispatched to the servlet pipeline. The request is delivered to the servlet at the head of the pipeline. Each servlet in turn performs its specific function on the request. Each servlet is also given a pointer to the next servlet in the pipeline.
88

When a servlet is done acting on the request, it can pass the request to the next servlet. This linked-list of servlets is called the servlet pipeline. Treating the request-handling process as a pipeline of independent elements allows requesthandling to be treated in a component-oriented manner. This allows you to use Nucleus to customize the request-handling process through configurable components, thereby giving you the flexibility that is often required by large applications.
89

There are two request-handling pipelines used by Dynamo: the DAS servlet pipeline (for JHTML requests) and the DAF servlet pipeline (for JSP requests). When a JHTML page is requested, the DAS servlet pipeline runs through the set of servlets appropriate for conditions of the request as would the DAF servlet pipeline for JSP requests. Because JHTML is a proprietary language, it relies on the page compiler provided in the DAS servlet pipeline to generate JHTML into a servlet thats rendered as HTML by the application server. Other minor differences exist between the requesthandling pipelines, but many of the classes invoked for each are the same. 90

How a request is processed?


A request processed by an application server will follow this path. The process described here assumes that youve configured your Web application to use PageFilter and DynamoProxyServlet just as demonstrated in atg_bootstrap.war. When a user performs an action that prompts a response, the application server creates an instance of the HttpServletRequest and HttpServletResponse. Based on the directories and file extension of the requestURI, the application server uses servlet and filter mappings defined in web.xml to determine the next resource 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 91 request and response pair.

The pair wont exist so PageFilter will start the DAF servlet pipeline by calling DynamoHandler, the first servlet in the pipeline. The DAF servlet pipeline will process through a series of servlets that modify the request and response by extracting path information and providing session, user, and security information. The last servlet in the pipeline is TailPipelineServlet. It is responsible for calling FilterChain.doFilter(), which invokes the next filter defined in web.xml. The web application, unless it uses ATG Portal, wont include other servlet filters by default.
92

As specified in web.xml, a call for a page in the dyn directory, which holds all JHTML pages, causes the application server to invoke DynamoProxyServlet, the resource responsible for starting the DAS servlet pipeline by calling DynamoHandler. The DAS servlet pipeline performs the same request and response handling tasks as the DAF servlet pipeline. One task common to both pipelines is the compiling of JHTML pages by PageCompileServlet, one of the servlets in the pipeline. By default, no filters are involved in requesthandling process; if you create custom servlet filters, they will be invoked before DynamoProxyServlet.
93

DynamoHttpServletRequest & DynamoHttpServletResponse


One of the functions of the servlet pipeline is to modify a request as it runs through various processing elements. For example, one pipeline element might find the file associated with a given pathInfo, and use that file name to set the pathTranslated property of the request. ATG provides a class called atg.servlet.DynamoHttpServletRequest. This class implements HttpServletRequest, but also provides methods that allow you to change the properties of the request, such as setPathInfo or setPathTranslated. There is also a corresponding atg.servlet.DynamoHttpServletResponse that allows you to change properties of the HttpServletResponse, such as the output stream, and access its values, such as statusCode.
94

95

The very first element of the servlet pipeline converts an incoming HttpServletRequest/Response pair into a DynamoHttpServletRequest /Response pair and allows subsequent elements of the servlet pipeline to use the additional functions provided by DynamoHttpServletRequest /Response. To access information contained in the request and response in your page, do so by making direct calls to HttpServletRequest and HttpServletResponse. When you need Dynamo-specific information held only by the Dynamo request and response, you should import the request or response using the atg.servlet.ServletUtil class. For example, to access the state object parameter, your JSP might use this code: <%= atg.servlet.ServletUtil.getDynamoRequest(request).g etObjectParameter("state") %> Any references to the Dynamo request and response will be interpreted as calls to the generic HttpServletRequest or HttpServletResponse.

96

Components added by B2C

97

98

CommerceCommandServlet
Class atg.commerce.order.CommerceCommandServlet Component /atg/commerce/order/CommerceCommandServlet CommerceCommandServlet has an actionMap property that matches actions to the servlets that process those actions. When a request includes a dcs_action parameter, CommerceCommandServlet checks the value of the dcs_action, locates the actions corresponding servlet using actionMap, and calls that servlet. For example, if a request attempts to add an item to a users cart by URL, the dcs_action will be addItemToCart and the AddItemToCartServlet will be called.
99

PromotionServlet
Class atg.commerce.promotion.PromotionServlet Component /atg/commerce/promotion/PromotionServlet When PromotionServlet is enabled (enabled property set to true), PromotionServlet scans the requestURI for the PROMO parameter, and when it is present, matches the promotion ID associated to it against the promotion IDs in the promotionItemDescriptorNames property to ensure that the promotion is active. When a match is found, PromotionServlet checks to see if the user qualifies for the promotion by examining the Profile RepositoryItem for persistency and the Promotion giveToAnonmousProfiles property for a value of true. If either condition is met, PromotionServletadds the promotion ID to the Profile activePromotions property.
100

Components added by B2B

101

102

The standard DAS servlet pipeline is invoked every time Dynamo handles a request. An additional servlet pipeline is used by the Dynamo Administration interface. This pipeline starts at /atg/dynamo/servlet/adminpipeline/AdminHandler. We can customize the existing pipelines in Dynamo by adding servlets. The components in a servlet pipeline should be globally scoped. The atg.servlet.pipeline package provides interfaces that provide various mechanisms for linking servlets to create a pipeline. The heart of the servlet pipeline is the PipelineableServlet interface. All servlets in a pipeline must implement this interface. Servlets that implement PipelineableServlet have a nextServlet property that points to the next component to invoke.
103

Customizing Servlet Pipeline

This is the primary pipelining mechanism used by the standard DAS servlet pipeline. Dynamo also provides an implementation class, PipelineableServletImpl, that implements this interface; our classes can implement PipelineableServlet by subclassing PipelineableServletImpl. The PipelineableServlet interface has two subinterfaces that provide additional mechanisms for determining the next component to invoke: InsertableServlet and DispatcherPipelineableServlet. Servlets that implement the InsertableServlet interface have an insertAfterServlet property that enables the servlet to insert itself in a specific spot in the pipeline. The key advantage of this mechanism is that it does not require modifying any existing servlets in the pipeline.
104

For example, suppose you have a servlet pipeline in which a servlet called Servlet1 invokes a servlet called Servlet2. Now suppose you want to insert another servlet, Servlet1a, between these two servlets in the pipeline. If Servlet1a implements PipelineableServlet, you can reroute the pipeline by changing the value of the Servlet1.nextServlet property so it points to Servlet1a rather than Servlet2, and set Servlet1a.nextServlet to point to Servlet2. But if Servlet1a implements InsertableServlet, all you have to do is set Servlet1a.insertAfterServlet to point to Servlet1, and Servlet1a will automatically be spliced into the pipeline right after Servlet1 and before Servlet2. Servlet1a is able to do this because it effectively sets its own nextServlet property to the value of Servlet1s nextServlet property and rewrites Servlet1s nextServlet property to point to Servlet1a.
105

A Sample Pipeline Servlet import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import atg.servlet.*; import atg.servlet.pipeline.*; public class URIPrinter extends PipelineableServletImpl { public URIPrinter () {} public void service (DynamoHttpServletRequest request, DynamoHttpServletResponse response) throws IOException, ServletException { System.out.println ("Handling request for " + request.getRequestURI ()); passRequest (request, response); 106 }}

1.

2. 3.

4. 5.
107

Compile your servlet as URIPrinter.java.Create a new component as an instance of the URIPrinter class. For convenience, put this component in the configuration tree at /atg/dynamo/servlet/dafpipeline/URIPrinter. Modify the DAF servlet pipeline to insert your URIPrinter between,say,DynamoHandler and TransactionServlet components. The head of the DAF servlet pipeline is the service called / atg/dynamo/servlet/dafpipeline/DynamoHandler. The default value of DynamoHandlers nextServlet property is TransactionServlet, meaning that the DynamoHandler will pass its requests to the TransactionServlet. Change the DynamoHandlers nextServlet property to point to your URIPrinter and then Set your URIPrinters nextServlet property to the TransactionServlet. Now when you run Dynamo, it prints out a message for each request before the request is handled by the remaining servlets.

You can also modify a pipeline by inserting servlets that subclass atg.servlet.pipeline.InsertableServletImpl. InsertableServletImpl is an implementation of InsertableServlet that inserts itself into an existing servlet pipeline at startup. This capability is required because it is difficult to use Nucleus configuration files to splice into a pipeline whose configuration cannot be determined when the configuration files are written. A servlet that implements InsertableServlet explicitly adds itself to a pipeline when the service starts, and uses the insertAfterServlet property to determine its location. Such a servlet may be the first servlet in its own secondary servlet pipeline, in which case it will have a nextServlet property.
108

If so, it inserts itself into the primary pipeline after the insertAfterServlet servlet by changing that servlets nextServlet property to the InsertableServlet servlet. Then, the InsertableServlet servlet changes the nextServlet property of the last servlet in the secondary pipeline to point to the next servlet in the primary pipeline.

109

To add an InsertableServlet to the servlet pipeline: 1. Write your servlet, extending InsertableServletImpl. 2. Define it as a component in the Nucleus hierarchy. It does not really matter where you put your servlet in the component hierarchy (though the location will affect references to other components if you use relative path names). 3. Set the insertAfterServlet property of your servlet to point to the path of the pipeline servlet you want your servlet to follow. 4. For example, if you want your servlet to follow the DynamoServlet in the pipeline, use: insertAfterServlet=/atg/dynamo/servlet/pipeline/DynamoS ervlet 1. Add the path to your servlet to the initialServices property of /atg/dynamo/servlet/Initial: initialServices+=/myServlet 110

import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import atg.servlet.*; import atg.servlet.pipeline.*; public class URIPrinter extends InsertableServletImpl { public URIPrinter () {} public void service (DynamoHttpServletRequest request, DynamoHttpServletResponse response) throws IOException, ServletException{ System.out.println ("Handling request for " + request.getRequestURI ()); passRequest (request, response); }}

111

LiveConfig Layer
To enable liveconfig, add the following line to the WEB-INF/ATGINF/dynamo.env file in the atg_bootstrap.war module of our EAR file: atg.dynamo.liveconfig=on The application assembler automatically includes this line in dynamo.env if we specify the liveconfig flag when you invoke the runAssembler command. The following settings are enabled by default in liveconfig mode:
112 disable checking for changed .properties files Turn off checkFileNameCase property Set the java compiler Setup web server error pages Shuts of serverina and internal https server Disable performance monitor Adjust pageCheckSeconds property from 1 to 60 Adjust fileCacheSize to 2 million entries Enable Repository Cache lock Managers Adjust SessionManager properties

The following settings are not enabled by default:


Set logging levels in global.properties Disable screen log Turn off Repository Database verification Configure Repository cache modes Pre-populate Caches on startup

113

Enabling checkFileNameCase on Windows


During development, we can configure ATG to check the case of file names by setting the checkFileNameCase property of the Nucleus component to true. Doing so prevents Nucleus from creating new components unnecessarily if, for example, we create a component named Person and then mistakenly refer to it as person. The checkFileNameCase property has no effect on UNIX platforms. It imposes a small performance cost on Windows. Therefore, once our application is no longer in active development and we are not creating new components often, you should set the checkFileNameCase property back to false (the default). The recommended deployment configuration (false) is set in the liveconfig configuration layer.
114

Sharing Session Information Between Applications

115

If we run multiple ATG applications on the same site, we may want to share session-scoped Nucleus components between WAR files included in the same EAR file. By default, ATG makes the atg_bootstrap.war file the parent web application. It ships with the following information in the web.xml file:
<servlet> <servlet-name>SessionNameContextServlet</servlet-name> <servlet-class>atg.nucleus.servlet.SessionNameContextServlet </servlet-class> </servlet>

There can be only one parent web app specified per EAR file. In all other web applcations, the web.xml must contain the following entry.
<context-param> <param-name>atg.session.parentContextName</paramname> <param-value>/dyn</param-value> 116 </context-param>

SUNDRY

117

Creating New Components


ATG Control Center includes templates to help you create new Dynamo components quickly and easily. There are the standard templates youll see when you select [all modules]: Empty Targeter helps you create an iterator component that lets you specify the order in which content is rendered to a subset of users. Generic Component helps you create new components from any existing Dynamo classes or your own Java classes. HTML File Repository helps you define an HTML repository by specifying the files it will contain and the attributes that describe them. Slot helps you set up a slot by letting you determine the repository items it will manage and how it will manage them. SQL Form Handler helps you create a component for inserting, updating, and deleting objects in a specified SQL table. SQL Query helps you create a component that performs queries against a SQL database. XML File Repository helps you define an XML repository by specifying the files it will contain and the attributes that describe them.
118

Dynamo Application Server


Dynamo Application Server (DAS) is the highperformance, Java-based engine that drives our Dynamo and J2EE applications. DAS runs continuously behind the scenes to handle HTTP requests and manage other essential tasks (database connectivity, session management, messaging, transactions, etc.). Nucleus, Dynamo's open object framework, serves as the central registry for the JavaBeans, Servlets, and Enterprise JavaBeans (EJBs) that contain our application-level logic.
119

120

JSP Vs. JHTML

121

Differences Between JHTML and JSP Coming from the same origins, JHTML and JSP share many of the same features. Both allow simple embedding of Java code directly into the page. In JHTML, this is accomplished with the <java> tag: <java> out.println("Hello, world!"); </java> In JSP, this is accomplished by using the scriptlet syntax: <% out.println("Hello, world!"); %> Displaying the values of scripting variables is similar as well. In JHTML, <valueof param="foo.bar"/> And in JSP, <%= foo.getBar() %>
122

<importbean bean="/atg/dynamo/droplet/ForEach"> <droplet bean="ForEach"> <param name="array" value="param:people"> <oparam name="output"> <valueof param="element.firstName"/><br> </oparam> </droplet> In JSP, this can be expressed with a tag library: <%@ taglib uri=http://java.sun.com/jstl/core prefix="core" %> <core:forEach items='<%=request.getParameter("people")%>' var="element"> <%= element.getFirstName() %><br> 123 </core:forEach>

The DSP Tag Library In order to reduce the amount of time and effort required to move an application from JHTML to JSP, ATG has written the DSP Tag Library, which provides the JHTML syntax to JSP developers. Nearly all of the JHTML tags are available, as well as the standard HTML tags that are extended by JHTML. There are some minor differences due to the subtleties of each environment. The tags that support URLs, including <dsp:a> <dsp:frame> <dsp:iframe> <dsp:img> <dsp:include> <dsp:link> include a page attribute that can optionally be used instead of their href or src attributes. The page attribute differs from the href or src attributes in that the absolute URL values are resolved to the Web application's root, not the Web server's root. This means a tag <dsp:a href="/test.jsp"/>Test</a> will create a link to http://server:port/test.jsp,
124

while <dsp:a page="/test.jsp"/>Test</a> will create a link to http://server:port/WebAppContextRoot/test.jsp. This allows a DSP Web application to be moved from URL to URL within the application server without having to change the JSP source. Two new tags, <dsp:page> and <dsp:getvalueof> are utility tags for working with JSP. The <dsp:page> tag is used to "wrap" all pages which use the DSP tag library: it is responsible for retrieving the Dynamo HttpServletRequest and Response objects, as well as calling the Dynamo servlet pipeline. <dsp:getvalueof> retrieves a parameter or bean value, and makes the value available as a JSP scripting variable.
125

126

127

<dsp:importbean bean="/atg/dynamo/droplet/Switch"/> <dsp:importbean bean="/atg/dynamo/servlet/RequestLocale"/> <dsp:importbean bean="/atg/dynamo/droplet/Redirect/> <dsp:setvalue bean="RequestLocale.refresh" value=" "/> <dsp:droplet name="Switch"> <dsp:param bean="RequestLocale.locale.language" name="value"/> <dsp:oparam name="fr"> <dsp:droplet name="Redirect"> <dsp:param name="url" value="fr/index.jsp"/></dsp:droplet> </dsp:oparam> <dsp:oparam name="de"> <dsp:droplet name="Redirect"> <dsp:param name="url" value="de/index.jsp"/> </dsp:droplet> </dsp:oparam> <dsp:oparam name="default"> <dsp:droplet name="/atg/dynamo/droplet/Redirect"> <dsp:param name="url" value="en/index.jsp"/> </dsp:droplet> </dsp:oparam></dsp:droplet>
128

129

130

131

132

133

SimpleSQLFormHandler
Dynamo defines a class, atg.droplet.sql.SimpleSQLFormHandler, which implements a form handler for querying, inserting, updating, and deleting rows from a database table. This form handler requires that each row to be edited can be uniquely identified by a set of key columns. In other words, it cannot be used for queries, updates, or deletes that operate on more than one row at a time. When we create a form handler component, we set properties that specify the URL of a JDBC driver to connect to, the name of a table to edit, and identifiers for the rows and columns to edit.
134

We can then embed this component in forms in JSP Pages. The form fields are used to set the form handlers value property. The value property is a Dictionary whose subproperties store values that identify the current row in the form, indexed by the name of the column. The value subproperties can either be keys used to look up an item, or new values for an update or insert operation. After the lookup operation occurs, these subproperties are set to the row that was returned.
135

After a form operation (lookup, update, delete, or insert) has been completed, you may want to redirect the user to a new page. As in standard HTML, you can use the action attribute of the form tag to specify a page to display when the form is submitted. The action attribute allows you to specify only a single page. You may want to specify several different pages, with the page the user is directed to dependent on the nature of the form operation and whether or not it succeeds. The SimpleSQLFormHandler has a set of properties you can use to control navigation after a form operation. These properties specify the URLs to which the user is redirected on certain error and success conditions. Each submit handler method (except for handleReset) has a corresponding SuccessURL and ErrorURL property. Thus, the following properties are available:
lookupSuccessURL and lookupErrorURL updateSuccessURL and updateErrorURL insertSuccessURL and insertErrorURL deleteSuccessURL and deleteErrorURL

An additional property specifies the URL to use if a database error occurs when submitting the form: 136
dbErrorURL

The default value of each of these properties is null, so you must set these properties explicitly (either in the form handler component or on the page). If the values of these properties are not set, the page specified by the action attribute of the form is displayed when the form is submitted. For example, suppose you include these two lines: <dsp:form action="index.jsp" method="post"> <dsp:input bean="MyFormHandler.lookupErrorURL" type="hidden" value="notFound.jsp"/> </dsp:form> If a lookup operation fails, the user is redirected to the page notFound.jsp. But if a lookup operation succeeds, and the value of lookupSuccessURL is not set, the user is taken to index.jsp (the page specified by the action attribute).
137

$class=atg.droplet.sql.SimpleSQLFormHandler $scope=session connectionURL^=TableManager.connectionURL keyColumns=NAME tableName=SKIER DBErrorURL=sqlError.jsp

138

Repository Form Handler


$class=atg.repository.servlet.RepositoryForm Handler $scope=request repository=/srini/repositories/emp requireIdOnCreate=false

139

Você também pode gostar