|Home >> All >> org >> infohazard|
|||org.infohazard.maverick.* (65)||||org.infohazard.maverick.ctl.* (6)|
|||org.infohazard.maverick.flow.* (36)||||org.infohazard.maverick.shunt.* (1)|
|||org.infohazard.maverick.transform.* (7)||||org.infohazard.maverick.util.* (7)|
Dispatcher: Dispatcher is the central command processor of the Maverick framework. All commands are routed to this servlet by way of extension mapping (say, *.m). From here requests are routed through the "workflow" tree of org.infohazard.maverick.flow.Command , View , and Transform (or "Pipeline") objects built from the Maverick configuration file. Commands can be gracefully chained together; if a view references another Maverick Command, the same org.infohazard.maverick.flow.MaverickContext object is used. The Dispatcher object is made available to Controllers (or anyone else) as an object in the application-scope ...
DocumentViewFactory: Factory for building JSP, Velocity, and other resource-based views which place the model bean in one of the servlet attribute collections and use the RequestDispatcher to forward to the actual content. This is also used for static documents. This factory has certain options which can be defined when declaring the factory. The defaults are shown here: <view-factory type="document" provider="org.infohazard.maverick.view.DocumentViewFactory"> <default-bean-name value="model"/> </view-factory> default-bean-name - If no "bean" attribute is specified for individual views, this is the ...
LanguageShuntFactory: LanguageShuntFactory produces Shunts which determine mode based on the Accept-Language header submitted by the user agent. Modes can be specified as "en", "fr", "zh-hk", and the like. Multiple modes can be assigned to the same view by comma-delimiting them ("en,fr"). In addition, a view can leave its mode unspecified to be a "default" view which will apply when no other mode is appropriate. Choosing mode from the Accept-Language header follows the way browsers actually work rather than the HTTP spec. Go figure. There is no support for quality levels and preference is determined by simple order ...
DocumentView: DocumentView is the base class for the default Maverick "document" view type. A DocumentView is a org.infohazard.maverick.flow.View that sets up a "model" object in request or session scope and forwards to another resource to render the final response. The "model" object exposes dynamic data so that it can be rendered as part of the response. This class is used by the Maverick DocumentViewFactory . The DocumentViewFactory defines the abstract SetAttribute method for each instance according to the parameters passed through the View XML element. By default, a DocumentView will be associated with ...
CommandBase: Base class for implementing a Maverick Command . Implementors must define getView(java.lang.String) 55 . CommandBase obtains a View name by calling its Controller's go 55 method, and then invokes the View's go 55 method. The ModelLifetime interface is honored. After invoking View.go, if the model object is an instance of ModelLifetime, its discard 55 method is called.
DocumentTransformFactory: Factory for creating transformation pipelines based on executing successive documents which are aware of servlet attribute collections. The output of the preceeding step is stored as a String in the request attributes, available to be included anywhere in the successive document. This factory has certain options which can be defined when declaring the factory. The defaults are shown here: <transform-factory type="document" provider="org.infohazard.maverick.transform.DocumentTransformFactory"> <default-bean-name value="wrapped"/> </transform-factory> default-bean-name - If no "bean" ...
Shunt: The Shunt interface allows Maverick to automagically determine which of a set of views should be executed based on some arbitrary characteristic of the request. Views are associated with modes in the Maverick configuration, and the Shunt is responsible for identifying the proper mode based on the request. The canonical example of a Shunt is the LanguageShunt, which uses the Accept-Language header to choose among views with modes like "en", "fr", etc. More complicated Shunts might allow regexes or other sophisticated expressions in the mode string. Individual Shunt instances are associated with ...
RedirectViewFactory: Creates views which result in HTTP redirects. Views will handle the model in the following way: If the model is a String, that is used as the base URL and the path attribute is ignored. If the model is a Map, the key/value pairs are converted into parameters for the target URL. This behavior is deprecated; you should use ControllerContext.setParam() instead. Params set on the ControllerContext will become query parameters. Redirect views cannot have transforms and have no attributes other than "path".
ThrowawayBean2: ThrowawayBean2 is a throwaway controller which populates its bean properties using the Apache BeanUtils. Note that unless you set the model yourself, the default will be "this". This is the typical use case of html form processing; the controller itself will have setters and getters for the various fields. See the FriendBook sample for several examples of this idiom. It's certainly not necessary to use the controller-as-model pattern. You can set specific objects to custom-tailor the "shape" of the model.
AbstractControllerFactory: Base class for controller factories. Creates (what appears to be) a singleton controller object appropriate for the type of controller specified in the XML, including single-use controllers. If no controller is specified, a special do-nothing controller is returned. If you want to use a custom controller factory, it is advisable to extend from this class and override either the interface method (createController) or override one or more of the template methods (getControllerClass, getControllerInstance and initializeController).
TrivialViewFactory: Creates simple views which expect the model itself to be the source of content. Controllers which use a trivial view should provide a model which is one of: java.lang.String java.io.Reader javax.xml.transform.Source org.w3c.dom.Node The model will be rendered to the output stream (or transform) unmolested. Trivial views can have transforms. Neither the view elements nor the factory elements have any additional parameters.
Transform: The Transform interface allows some sort of arbitrary transformation on a set of input data. It is the relatively static object in the Maverick configuration object graph which represents a specific transform node in the config file. The actual work of performing a transformation step during actual request procesing is done by an instance of TransformationStep, which Maverick asks the Transform object to create.
AbstractTransformStep: Helper class for all transform steps. When extending this class, remember that you are providing the TransformStep interface, so the getResponse(), etc methods are for a *client* to call. You should be sending your output to the methods on getNext(), which is safe to call multiple times. Remember, the goal is to take data written to you and send it on to the next step!
RedirectView: This view causes a client redirect. If the model is a String, that overrides the path. ControllerContext params become query parameters. If the model is a Map, the key/value pairs are converted into parameters for the target URL, but this behavior is deprecated. The key "#" in context params (or Map model) is appended to the end of the redirect URL as a named anchor.
ControllerSingleton: ControllerSingleton serves two purposes: First, the presence of this interface on a Controller class indicates to the framework that the controller should be defined as a singleton rather than instantiating a fresh instance for every request. Second, it provides a method to initialize the singleton controller with the relevant XML data from the configuration file.
Throwaway: Note: While not formally deprecated, use of this class is discouraged. You should use Throwaway2 instead. Throwaway is a base class for simple controllers which implements the single-use controller pattern (a fresh controller instance is created to service each request). No population of properties is performed by this class.
Command: The Command is the highest entry point of workflow outside of the Dispatcher . For a base implementation, see CommandBase .
TransformStep: The TransformStep defines a transformation step in a single request. It is used and then disposed of. It provides convenient facades for most of the usual output mechanisms that views and previous transforms might want. Unlike a Transform, a TransformStep is used in a single request and then thrown away.
ThrowawayBean: Note: While not formally deprecated, use of this class is discouraged. You should use ThrowawayBean2 instead. ThrowawayBean is a throwaway controller which populates its bean properties using the Apache BeanUtils. Note that the default implementation of model() returns "this".
FormBeanUser: FormBeanUser is a base class for singleton controllers which use external FormBeans rather than populating themselves. Since only one of these will exist for each command definition, it must be thread-safe. This Controller pattern is very similar to Struts Actions.
NullViewFactory: Creates a view which does absolutely nothing. The Controller is assumed to have manually written all data to the response. The model is ignored. Null views have no extra attributes and cannot have transforms.
Throwaway2: Throwaway2 is a base class for simple controllers which implements the single-use controller pattern (a fresh controller instance is created to service each request). No population of properties is performed by this class.
Controller: Controller is the interface that all command controllers must implement. A controller which implements this interface (and not ControllerSingleton) will have a new instance instantiated for every request.
ShuntFactory: Pluggable modules which build Shunts must implement this interface and then be defined in the <modules> section of the Maverick config file. One factory is created to build all Shunts.
DispatchedViewFactory: This factory creates Views which use the RequestDispatcher to obtain content. It is used by the DocumentViewFactory and not intended to be designated as a normal Maverick view type.