|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.server.DomApplication
public abstract class DomApplication
Nested Class Summary | |
---|---|
static class |
DomApplication.ExceptionEntry
An entry in the exception table. |
Field Summary | |
---|---|
static org.slf4j.Logger |
LOG
|
Constructor Summary | |
---|---|
DomApplication()
The only constructor. |
Method Summary | ||
---|---|---|
void |
addDefaultErrorComponent(NodeContainer page)
When a page has no error handling components (no component has registered an error listener) then errors will not be visible. |
|
void |
addExceptionListener(java.lang.Class<? extends java.lang.Exception> xclass,
IExceptionListener l)
Adds an exception handler for a given exception type. |
|
void |
addHeaderContributor(HeaderContributor hc,
int order)
Call from within the onHeaderContributor call on a node to register any header contributors needed by a node. |
|
void |
addInterceptor(IRequestInterceptor r)
|
|
void |
addLoginListener(ILoginListener l)
|
|
void |
addNewPageInstantiatedListener(INewPageInstantiated l)
|
|
void |
addRenderFactory(IHtmlRenderFactory f)
|
|
void |
addSessionListener(IAppSessionListener l)
|
|
void |
addUIStateListener(IDomUIStateListener sl)
Register a listener for internal DomUI events. |
|
protected void |
augmentThemeMap(java.util.Map<java.lang.String,java.lang.Object> themeMap)
This method can be overridden to add extra stuff to the theme map, after it has been loaded from properties or whatnot. |
|
void |
clearListCache(ICachedListMaker<?> maker)
|
|
void |
clearListCaches()
Discard all cached stuff in the list cache. |
|
IResourceRef |
createClasspathReference(java.lang.String name)
Create a resource ref to a class based resource. |
|
|
createInstance(java.lang.Class<T> clz,
java.lang.Object... args)
FIXME Needs a proper, injected implementation instead of a quicky. |
|
protected AppSession |
createSession()
Can be overridden to create your own instance of a session. |
|
protected void |
destroy()
Override to destroy resources when the application terminates. |
|
IExceptionListener |
findExceptionListenerFor(java.lang.Exception x)
This locates the handler for the specfied exception type, if it has been registered. |
|
java.lang.String |
findLocalizedResourceName(java.lang.String basename,
java.lang.String suffix,
java.util.Locale loc)
This returns the name of an existing resource for the given name/suffix and locale. |
|
HtmlFullRenderer |
findRendererFor(BrowserVersion bv,
IBrowserOutput o)
Creates the appropriate full renderer for the specified browser version. |
|
IFilterRequestHandler |
findRequestHandler(IRequestContext ctx)
|
|
IResourceFactory |
findResourceFactory(java.lang.String name)
Get the best factory to resolve the specified resource name. |
|
java.lang.String |
findRightsDescription(java.lang.String right)
Translates a right name to a description from the registered bundle, if registered. |
|
HtmlTagRenderer |
findTagRendererFor(BrowserVersion bv,
IBrowserOutput o)
|
|
static DomApplication |
get()
Returns the single DomApplication instance in use for the webapp. |
|
AjaxRequestHandler |
getAjaxHandler()
|
|
java.io.File |
getAppFile(java.lang.String path)
Return a file from the webapp's root directory. |
|
IResourceRef |
getAppFileOrResource(java.lang.String name)
Primitive to return either a File-based resource from the web content files or a classpath resource (below /resources/) for the same path. |
|
java.lang.String |
getApplicationURL()
|
|
|
getCachedList(IListMaker<T> maker)
|
|
ControlBuilder |
getControlBuilder()
Return the component that knows everything you ever wanted to know about controls - but were afraid to ask... |
|
int |
getDefaultExpiryTime()
Returns the default browser cache resource expiry time in seconds. |
|
BasePageTitleBar |
getDefaultPageTitleBar(java.lang.String title)
Deprecated. |
|
java.util.List<HeaderContributorEntry> |
getHeaderContributorList()
|
|
IPageInjector |
getInjector()
Get the page injector. |
|
java.util.List<IRequestInterceptor> |
getInterceptorList()
|
|
ILoginAuthenticator |
getLoginAuthenticator()
|
|
ILoginDialogFactory |
getLoginDialogFactory()
|
|
java.util.List<ILoginListener> |
getLoginListenerList()
|
|
java.util.List<INewPageInstantiated> |
getNewPageInstantiatedListeners()
|
|
java.util.List<java.lang.String> |
getRegisteredRights()
Return a list of all currently registered right names. |
|
java.util.Locale |
getRequestLocale(javax.servlet.http.HttpServletRequest request)
This returns the locale to use for the request passed. |
|
IResourceRef |
getResource(java.lang.String name,
IResourceDependencyList rdl)
Get an application resource. |
|
java.util.List<IResourceFactory> |
getResourceFactories()
|
|
java.lang.String |
getRightsDescription(java.lang.String right)
Translates a right name to a description from the registered bundle, if registered. |
|
abstract java.lang.Class<? extends UrlPage> |
getRootPage()
Must return the "root" class of the application; the class rendered when the application's root URL is entered without a class name. |
|
java.lang.String |
getScriptVersion()
|
|
ITheme |
getTheme(IResourceDependencyList rdl)
Get the theme that is used for this application. |
|
java.lang.String |
getThemedResourceRURL(java.lang.String path)
|
|
java.util.Map<java.lang.String,java.lang.Object> |
getThemeMap(IResourceDependencyList rdlin)
Return the current theme map (a readonly map), cached from the last time. |
|
IThemeFactory |
getThemer()
|
|
java.lang.String |
getThemeReplacedString(IResourceDependencyList rdl,
java.lang.String rurl)
|
|
java.lang.String |
getThemeReplacedString(IResourceDependencyList rdl,
java.lang.String rurl,
BrowserVersion bv)
EXPENSIVE CALL - ONLY USE TO CREATE CACHED RESOURCES This loads a theme resource as an utf-8 encoded template, then does expansion using the current theme's variable map. |
|
java.lang.String |
getUrlExtension()
Returns the defined extension for DomUI pages. |
|
java.io.File |
getWebAppFileRoot()
Returns the root of the webapp's installation directory on the local file system. |
|
int |
getWindowSessionTimeout()
The #of minutes that a WindowSession remains valid; defaults to 15 minutes. |
|
java.lang.String |
handleNotLoggedInException(RequestContextImpl ci,
Page page,
NotLoggedInException x)
Responsible for redirecting to the appropriate login page. |
|
boolean |
hasApplicationResource(java.lang.String name)
Quickly determines if a given resource exists. |
|
boolean |
inDevelopmentMode()
Returns T when running in development mode; this is defined as a mode where web.xml contains reloadable classes. |
|
protected void |
initHeaderContributors()
|
|
protected void |
initialize(ConfigParameters pp)
Override to initialize the application, called as soon as the webabb starts by the filter's initialization code. |
|
void |
internalCallConversationCreated(ConversationContext ws)
|
|
void |
internalCallConversationDestroyed(ConversationContext ws)
|
|
void |
internalCallPageAction(RequestContextImpl ctx,
Page ws)
|
|
void |
internalCallPageComplete(IRequestContext ctx,
Page ws)
|
|
void |
internalCallPageFullRender(RequestContextImpl ctx,
Page ws)
|
|
void |
internalCallWindowSessionCreated(WindowSession ws)
|
|
void |
internalCallWindowSessionDestroyed(WindowSession ws)
|
|
void |
internalInitialize(ConfigParameters pp,
boolean development)
|
|
static int |
internalNextPageTag()
|
|
java.lang.Class<? extends UrlPage> |
loadPageClass(java.lang.String name)
|
|
boolean |
logOutput()
|
|
void |
register(ILookupControlFactory f)
Register a new LookupControl factory. |
|
protected void |
registerControlFactories()
|
|
void |
registerControlFactory(ControlFactory cf)
Add a new control factory to the registry. |
|
protected void |
registerPartFactories()
|
|
void |
registerResourceFactory(IResourceFactory f)
|
|
void |
registerRight(BundleRef bundle,
java.lang.String... rights)
Registers a set of possible rights and their names/translation bundle. |
|
void |
registerRights(BundleRef bundle,
java.lang.Class<?> constantsclass)
Takes a class (or interface) and scans all static public final String fields therein. |
|
void |
registerUrlPart(IUrlPart factory)
FIXME Mechanism is slow |
|
void |
removeNewPageInstantiatedListener(INewPageInstantiated l)
|
|
void |
removeSessionListener(IAppSessionListener l)
|
|
void |
removeUIStateListener(IDomUIStateListener sl)
Remove a registered UI state listener. |
|
void |
setDefaultExpiryTime(int defaultExpiryTime)
Set the static resource browser cache expiry time, in seconds. |
|
void |
setInjector(IPageInjector injector)
|
|
void |
setLoginAuthenticator(ILoginAuthenticator loginAuthenticator)
|
|
void |
setLoginDialogFactory(ILoginDialogFactory loginDialogFactory)
|
|
void |
setThemeFactory(IThemeFactory themer)
Set the factory for handling the theme. |
|
void |
setWindowSessionTimeout(int windowSessionTimeout)
Sets the windowSession timeout, in minutes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.slf4j.Logger LOG
Constructor Detail |
---|
public DomApplication()
Method Detail |
---|
public abstract java.lang.Class<? extends UrlPage> getRootPage()
protected void registerControlFactories()
protected void registerPartFactories()
public static DomApplication get()
public void addSessionListener(IAppSessionListener l)
public void removeSessionListener(IAppSessionListener l)
public java.lang.String getUrlExtension()
public IFilterRequestHandler findRequestHandler(IRequestContext ctx)
protected AppSession createSession()
protected void destroy()
protected void initialize(ConfigParameters pp) throws java.lang.Exception
pp
-
java.lang.Exception
public final void internalInitialize(ConfigParameters pp, boolean development) throws java.lang.Exception
java.lang.Exception
public static final int internalNextPageTag()
public java.lang.Class<? extends UrlPage> loadPageClass(java.lang.String name)
public java.lang.String getScriptVersion()
public HtmlFullRenderer findRendererFor(BrowserVersion bv, IBrowserOutput o)
bv
- o
-
public HtmlTagRenderer findTagRendererFor(BrowserVersion bv, IBrowserOutput o)
public void addRenderFactory(IHtmlRenderFactory f)
public boolean inDevelopmentMode()
public int getWindowSessionTimeout()
public void setWindowSessionTimeout(int windowSessionTimeout)
windowSessionTimeout
- public int getDefaultExpiryTime()
public void setDefaultExpiryTime(int defaultExpiryTime)
defaultExpiryTime
- @Nonnull public java.util.Locale getRequestLocale(javax.servlet.http.HttpServletRequest request)
ServletRequest.getLocale()
. You
can override this method to define the locale by yourself.
request
-
protected void initHeaderContributors()
public final void addHeaderContributor(HeaderContributor hc, int order)
hc
- order
- public java.util.List<HeaderContributorEntry> getHeaderContributorList()
public void addDefaultErrorComponent(NodeContainer page)
page
- @Deprecated public BasePageTitleBar getDefaultPageTitleBar(java.lang.String title)
AppPageTitleBar
is default one used by framework.
To set some custom page title component override this method in your application specific class.
title
-
public final ControlBuilder getControlBuilder()
public final void registerControlFactory(ControlFactory cf)
cf
- The new factorypublic void register(ILookupControlFactory f)
f
- public <T> T createInstance(java.lang.Class<T> clz, java.lang.Object... args)
public java.io.File getAppFile(java.lang.String path)
path
-
public IResourceRef getAppFileOrResource(java.lang.String name)
IModifyableResource
. This will not use any kind of resource
factory.
name
-
public void registerResourceFactory(IResourceFactory f)
public java.util.List<IResourceFactory> getResourceFactories()
public IResourceFactory findResourceFactory(java.lang.String name)
name
-
public final java.io.File getWebAppFileRoot()
public java.lang.String getApplicationURL()
public IResourceRef createClasspathReference(java.lang.String name)
name
-
@Nonnull public IResourceRef getResource(@Nonnull java.lang.String name, @Nonnull IResourceDependencyList rdl) throws java.lang.Exception
IResourceFactory
instances registered
with DomApplication can provide other means to locate resources.
name
- rdl
- The dependency list. Pass ResourceDependencyList.NULL
if you do not need the
dependencies.
java.lang.Exception
public boolean hasApplicationResource(java.lang.String name) throws java.lang.Exception
#getApplicationResourceByName(String)
.
name
-
java.lang.Exception
public java.lang.String findLocalizedResourceName(java.lang.String basename, java.lang.String suffix, java.util.Locale loc) throws java.lang.Exception
basename
- The base name: the part before the locale infosuffix
- The suffix: the part after the locale info. This usually includes a ., like .jsloc
- The locale to get the resource for.
java.lang.Exception
BundleRef.loadBundleList(Locale)
public <T> java.util.List<T> getCachedList(IListMaker<T> maker) throws java.lang.Exception
T
- key
- maker
-
java.lang.Exception
public void clearListCaches()
public void clearListCache(ICachedListMaker<?> maker)
public boolean logOutput()
public void addInterceptor(IRequestInterceptor r)
public java.util.List<IRequestInterceptor> getInterceptorList()
public void addExceptionListener(java.lang.Class<? extends java.lang.Exception> xclass, IExceptionListener l)
l
- public IExceptionListener findExceptionListenerFor(java.lang.Exception x)
x
-
public void addNewPageInstantiatedListener(INewPageInstantiated l)
public void removeNewPageInstantiatedListener(INewPageInstantiated l)
public java.util.List<INewPageInstantiated> getNewPageInstantiatedListeners()
public ILoginAuthenticator getLoginAuthenticator()
public void setLoginAuthenticator(ILoginAuthenticator loginAuthenticator)
public ILoginDialogFactory getLoginDialogFactory()
public void setLoginDialogFactory(ILoginDialogFactory loginDialogFactory)
public void addLoginListener(ILoginListener l)
public java.util.List<ILoginListener> getLoginListenerList()
public java.lang.String handleNotLoggedInException(RequestContextImpl ci, Page page, NotLoggedInException x)
ci
- page
- nlix
- public IPageInjector getInjector()
public void setInjector(IPageInjector injector)
public void registerRight(BundleRef bundle, java.lang.String... rights)
bundle
- rights
- public void registerRights(BundleRef bundle, java.lang.Class<?> constantsclass)
bundle
- constantsclass
- public java.util.List<java.lang.String> getRegisteredRights()
public java.lang.String findRightsDescription(java.lang.String right)
right
-
public java.lang.String getRightsDescription(java.lang.String right)
right
-
public AjaxRequestHandler getAjaxHandler()
public IThemeFactory getThemer()
public void setThemeFactory(IThemeFactory themer)
themer
- public void registerUrlPart(IUrlPart factory)
factory
- public java.lang.String getThemeReplacedString(@Nonnull IResourceDependencyList rdl, java.lang.String rurl) throws java.lang.Exception
java.lang.Exception
public java.lang.String getThemeReplacedString(@Nonnull IResourceDependencyList rdl, @Nonnull java.lang.String rurl, @Nullable BrowserVersion bv) throws java.lang.Exception
rdl
- key
-
java.lang.Exception
public ITheme getTheme(@Nullable IResourceDependencyList rdl) throws java.lang.Exception
rdl
-
java.lang.Exception
protected void augmentThemeMap(java.util.Map<java.lang.String,java.lang.Object> themeMap)
themeMap
- public java.util.Map<java.lang.String,java.lang.Object> getThemeMap(IResourceDependencyList rdlin) throws java.lang.Exception
rdl
-
java.lang.Exception
@Nullable public java.lang.String getThemedResourceRURL(java.lang.String path)
public void addUIStateListener(IDomUIStateListener sl)
sl
- public void removeUIStateListener(IDomUIStateListener sl)
sl
- public final void internalCallWindowSessionCreated(WindowSession ws)
public final void internalCallWindowSessionDestroyed(WindowSession ws)
public final void internalCallConversationCreated(ConversationContext ws)
public final void internalCallConversationDestroyed(ConversationContext ws)
public final void internalCallPageFullRender(RequestContextImpl ctx, Page ws)
public final void internalCallPageAction(RequestContextImpl ctx, Page ws)
public final void internalCallPageComplete(IRequestContext ctx, Page ws)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |