Saturday, 27 February 2016

Frequently used Out of box Components ( droplets and formhandlers)



SOME OOB FORMHANDLERS:

Here are some of the commonly used FormHandlers, although ATG provides many out of the box FormHandlers and even we can write our own custom FormHandlers by extending GenericFormHandler class provided by ATG.

CartModifierFormHandler -- This formhandler is used to modify a ShoppingCart by adding items to it, deleting items from it, modifying the quantities of items in it, and preparing it for the checkout process.

ExpressCheckoutFormHandler -- The ExpressCheckoutFormHAndler is used to expedite the checking out of an Order. This supports creating a maximum of one Profile derived HardgoodShippingGroup and one Profile derived CreditCard, followed by committing the Order.

SaveOrderFormHandler -- The SaveOrderFormHandler is used to save the user's current Order based on a descriptive name that the user specifies. A new empty Order is then made the user's current shopping cart. If a descriptive name for the Order is not specified, then one is created based on the user's Locale and date and time.

ShippingGroupFormHandler -- The ShippingGroupFormHandler is used to associate ShippingGroups with the various Order pieces. This component is used during the Order checkout process, and any Order successfully processed by the ShippingGroupFormHandler is ready for the next checkout phase, which may be Payment.

PaymentGroupFormHandler -- The PaymentGroupFormHandler is used to associate PaymentGroups with the various Order pieces. This component is used during the Order checkout process, and any Order successfully processed by the PaymentGroupFormHandler is ready for the next checkout phase, which may be confirmation.

CommitOderFormHandler -- The CommitOrderFormHandler is used to submit the Order for final confirmation. This calls the OrderManager's processOrder method. If there are no errors with processing the Order, then the current Order in the user's ShoppingCart will be set to null and the submitted Order will become the ShoppingCart's last Order. 

CancelOderFormHandler -- The CancelOrderFormHandler is used to cancel the user's current Order, which deletes the Order from the ShoppingCart.

RepositoryFromHandler -- Saves repository data to a database.

ProfileFormHandler -- Connects forms with user profiles stored in a profile repository.

SearchFormHandler -- Specifies properties available to a search engine.

SimpleSQLFormHandler -- Works with form data that is stored in a SQL database.

SOME OOB DROPLETS:

Compare (/atg/dynamo/droplet/Compare) -- The Compare servlet bean takes two objects as input parameters and conditionally renders one of its open parameters, based on the relative values of the input parameters. For all non-number properties, the comparison is accomplished by casting the two objects to java.lang.Comparable and calling Comparable.compareTo(). A comparison must involve properties that share the same data type, unless those properties are instances of java.lang.Number

CurrencyFormatter (/atg/dynamo/droplet/CurrencyFormatter) -- The CurrencyFormatter servlet bean takes a numeric value and displays that value as a currency amount, formatting it based on the locale. The formatting includes the currency symbol, the placement of the symbol, and the delimiters used. For example, if the value passed in is 20000, and the locale is en_US, the servlet bean formats the value as $20,000.00; if the locale is de_DE, the servlet bean formats the value as 20.000,00 DM.

ErrorMessageForEach(/atg/dynamo/droplet/ErrorMessageForEach) -- The ErrorMessageForEach servlet bean takes a vector of form exceptions and, for each exception, displays an appropriate error message. The exceptions are of class atg.droplet.DropletException, or a subclass of this class. The vector of exceptions can either be passed automatically by the request that produces the exceptions, or specified explicitly using the exception’s input parameter. For example, any form handler of class atg.droplet.GenericFormHandler (or a subclass of this class) has a property named formExceptions which is a vector of the exceptions that occurred while processing the form. To pass these exceptions to the ErrorMessageForEach servlet bean, you can use a tag like this:
<dsp:param name="exceptions" bean="MyFormHandler.formExceptions"/>

For (/atg/dynamo/droplet/For) -- The For servlet bean implements a simple loop. Given an integer parameter howMany, the For servlet bean renders its output parameter that many times. The howMany parameter must be a String representation of an int. Each iteration sets the index parameter to the current loop count, starting at 0, and sets the count parameter to index + 1, starting at 1.

ForEach (/atg/dynamo/droplet/ForEach) -- The ForEach servlet bean renders a listing of elements specified by the array parameter in the order you specify. The array parameter can be a Collection (Vector, List, or Set), Enumeration, Iterator, Map, Dictionary, or array.
There are three input parameters that are not described below because there is a more favorable method for accomplishing their tasks:
  • elementName and indexName let you provide a parameter name other than element and index, respectively.
  • reverseOrder permits you to decide whether items should be counted in their natural order or the reverse. Use the sortProperties input parameter instead.

IsEmpty (/atg/dynamo/droplet/IsEmpty) -- The IsEmpty servlet bean conditionally renders one of its open parameters based on the value of its value input parameter. If value is null or if the object is empty, then the output parameter true is rendered. Otherwise, the output parameter false is rendered.

IsNull (/atg/dynamo/droplet/IsNull) -- The IsNull servlet bean conditionally renders one of its open parameters based on the value of its value input parameter. If value is null, then the output parameter true is rendered. Otherwise, the output parameter false is rendered.

Range (/atg/dynamo/droplet/Range) -- The Range servlet bean is similar to the ForEach servlet bean, except that it enables you to render a subset of the output array, rather than the entire array. Range renders its output parameter for each element in its array parameter, beginning with the array element that corresponds to the start parameter and continuing until it has rendered a number of elements equal to the howMany parameter. The array parameter can be a Collection (Vector, List, or Set), Iterator, Enumeration, Map, Dictionary, or array.

Redirect (/atg/dynamo/droplet/Redirect) -- The Redirect servlet bean takes a full or relative URL and redirects the user to the specified page. When the Redirect servlet bean is invoked, the second page displays in response

RQLQueryForEach (/atg/dynamo/droplet/RQLQueryForEach) -- The RQLQueryForEach servlet bean executes a RQL query and renders its output open parameter once for each element returned by the query. The query can be a simple query or can include parameters. Note that the syntax for specifying a parameter is different from the syntax normally used in RQL.

 Switch (/atg/dynamo/droplet/Switch) -- The Switch servlet bean conditionally renders one of its open parameters based on the value of its value input parameter. This value is turned into a string and used as the name of the parameter to render for this case. You can use Switch to compare two dynamically defined values by setting the name of one of your open parameters to one value and the Switch servlet bean’s value parameter to the other.

0 comments:

Post a Comment

 
;