Portal applications are custom handlers which require additional setup in the corresponding CMS project, but are only called
for pages, which explicitly specify that they need them.
When the loaded page has a comma separated list of portal application IDs in its fields.portalapp
field, the injected
PortalApplicationRegistry
is queried if it has a portal application with that ID, and executes the handle()
methods
of the found application.
By default a PortalApplicationRegistry
which does not contain any applications is used by the portal, but this can
be overridden by changing the BindModule accordingly:
Using a custom PortalApplicationRegistry
@Module
public abstract BindModule {
// ...
@Binds
abstract PortalApplicationRegistry bindApplicationRegistry(CustomApplicationRegistry e);
}
The handle()
method of an PortalApplication
implementation must either:
-
call the next handler with rc.next()
-
end the response by calling rc.response().end()
(or any of its variants), or
-
fail the request with rc.fail()
(passing either an Exception or an error status code)