Purpose
uPortal provides a set of abstractions for modular processing of the URL syntax and request parameters. By moving handling of URL syntax details into specialized classes, framework makes it possible to alter or extend URL syntax without having to modify multitude of java classes and/or XSLT stylesheets.
Request parameter controller
Processing of URL syntax and request parameters for a specific CompoundContext is described by IRequestProcessorController interface. A default implementation (RequestParameterProcessorListController) serves as a point of integration for two types of components: those responsible for processing some subset of request parameters; and those used for constructing URLs. See diagram below (pdf version)
Request parameter processors
IRequestParameterProcessor defines an interface for the elementary unit that may process incoming request information in RequestParameterProcessorListController. It allows for iterative processing. RequestParameterProcessorListController will satisfy all variable-evaluating processors (in iterative loops) before processing all other processors.
URL constructors
Each URL constructor is responsible for encoding URL structure (path elements, file portion of the URL and, of course, parameters) for a particular functionality. Constructors are defined by IUrlConstructor interface. URL constructors are delivered by IUrlConstructorProvider implementations (which is a factory interface that also providers constructor name). Some of the more important URL constructor providers:
- Portlet URL constructor (PortletUrlConstructorProviderImpl) - implementation of the portlet URL syntax performing functions required for JSR168 PortletURL interface implementation (org.jasig.portal.portlet.url.impl.PortletUrlImpl)
- Legacy constructors implementing uPortal2 syntax support
- User layout URL constructor (LegacyLayoutSourceCommandsUrlConstructorProvider) - implementation of the uPortal2 URL syntax for layout management actions
- Transient layout URL constructor (LegacyTransientUserLayoutUrlConstructorProvider) - constructs uPortal2 syntax for calling portlets by functional name
- Transformation filter ULR constructor (TransformationFilterLegacyCommandsUrlConstructorProvider) - constructs uPortal2 URL syntax for managing params/attributes of structure and theme transformations
- Portlet error handling URL constructor (ErrorPortletParameterProcessor) - responsible for URLs for restarting, resetting or retrying rendering of the portlets that have been replaced by the error portlet
Within portlet code, URL constructors are acquired by casting PortletURL (render or action) to uPortal-specific interface org.jasig.portal.url.IPortalUrl, and calling getUrlConstructor() method with the name of the desired constructor (by convention, it is a name of the command interface for that functionality, see "URL syntax loop pattern" section below).
URL decorators
Decorators are special constructors that are invoked automatically upon constructing any URL. For example, RenderUrlConstructorProvider appends .uP to the end of each URL.
URL syntax loop pattern
Typical pattern for uPortal3 syntax abstraction consists of a command interface that describes all basic functionality. Command interface is then implemented by both URL constructor and parameter processor (or the underlying business bean).
Constructor/processor example: LegacyLayoutSource
The UML diagram above includes an example of how legacy layut management URL syntax is implemented. ILegacyLayoutSourceCommands is the command interface, implemented by both URL constructor and processor. The processor relates commands to the legacy layout source itself.