public abstract class DomApplication extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DomApplication.ExceptionEntry
An entry in the exception table.
|
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
DomApplication()
The only constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<T> void |
addAsyncListener(IAsyncListener<T> l)
Add a new listener for asynchronous job events.
|
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(Class<? extends 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 |
addRequestHandler(IFilterRequestHandler fh,
int priority)
Add a toplevel request handler to the chain.
|
void |
addSessionListener(IAppSessionListener l) |
void |
addUIStateListener(IDomUIStateListener sl)
Register a listener for internal DomUI events.
|
void |
augmentThemeMap(IScriptScope ss)
This method can be overridden to add extra stuff to the theme map, after
it has been loaded from properties or whatnot.
|
int |
calculatePollInterval(boolean pollCallbackRequired) |
void |
clearListCache(ICachedListMaker<?> maker) |
void |
clearListCaches()
Discard all cached stuff in the list cache.
|
IResourceRef |
createClasspathReference(String name)
Create a resource ref to a class based resource.
|
<T> T |
createInstance(Class<T> clz,
Object... args)
FIXME Needs a proper, injected implementation instead of a quicky.
|
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(Exception x)
This locates the handler for the specfied exception type, if it has been registered.
|
String |
findLocalizedResourceName(String basename,
String suffix,
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)
Find a request handler by locating the highest-scoring request handler in the chain.
|
IResourceFactory |
findResourceFactory(String name)
Get the best factory to resolve the specified resource name.
|
String |
findRightsDescription(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.
|
<T extends UrlPage> |
getAccessDeniedPageClass()
Returns the class for UrlPage that is Access Denied page handler.
|
File |
getAppFile(String path)
Return a file from the webapp's root directory.
|
IResourceRef |
getAppFileOrResource(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.
|
List<IAsyncListener<?>> |
getAsyncListenerList() |
int |
getAutoRefreshPollInterval()
When
#isAutoRefreshPage() is enabled (T), this defines the poll interval that a client uses
to check for server-side changes. |
IBindingHandler |
getBindingHandler(NodeBase node) |
IBindingHandlerFactory |
getBindingHandlerFactory() |
<T> List<T> |
getCachedList(IListMaker<T> maker) |
ControlBuilder |
getControlBuilder()
Return the component that knows everything you ever wanted to know about controls - but were afraid to ask...
|
ControlCreatorRegistry |
getControlCreatorRegistry()
DOMUI2 Experimental
|
String |
getCurrentTheme()
Gets the current theme string.
|
int |
getDefaultExpiryTime()
Returns the default browser cache resource expiry time in seconds.
|
BasePageTitleBar |
getDefaultPageTitleBar(String title)
Deprecated.
|
int |
getDefaultPollInterval()
The default poll interval time for pages containing Async objects (see
DelayedActivitiesManager), defaulting
to 2500 (2.5 seconds). |
List<HeaderContributorEntry> |
getHeaderContributorList() |
IPageInjector |
getInjector()
Get the page injector.
|
List<IRequestInterceptor> |
getInterceptorList() |
List<String> |
getJQueryScripts() |
String |
getJQueryVersion() |
int |
getKeepAliveInterval() |
ILoginAuthenticator |
getLoginAuthenticator() |
ILoginDialogFactory |
getLoginDialogFactory() |
List<ILoginListener> |
getLoginListenerList() |
List<INewPageInstantiated> |
getNewPageInstantiatedListeners() |
PartRequestHandler |
getPartRequestHandler() |
static int |
getPlatformVarcharByteLimit()
When > 0, automatically created TextArea's will have their maxByteLength property
set to this value.
|
String |
getProblemFromAddress() |
String |
getProblemMailAddress() |
String |
getProblemMailSubject() |
List<String> |
getRegisteredRights()
Return a list of all currently registered right names.
|
Locale |
getRequestLocale(javax.servlet.http.HttpServletRequest request)
This returns the locale to use for the request passed.
|
IResourceRef |
getResource(String name,
IResourceDependencyList rdl)
Get an application resource.
|
List<IResourceFactory> |
getResourceFactories() |
ResourceInfoCache |
getResourceInfoCache()
Get the cache that keeps things like icon sizes for themes.
|
String |
getRightsDescription(String right)
Translates a right name to a description from the registered bundle, if registered.
|
abstract 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.
|
String |
getScriptVersion() |
ITheme |
getTheme()
Return the current theme itself.
|
ITheme |
getTheme(String themeName,
IResourceDependencyList rdl)
Get the theme store representing the specified theme name.
|
String |
getThemeProperty(String name) |
String |
getThemeReplacedString(IResourceDependencyList rdl,
String rurl)
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.
|
String |
getThemeReplacedString(IResourceDependencyList rdl,
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.
|
String |
getUrlExtension()
Returns the defined extension for DomUI pages.
|
WebActionRegistry |
getWebActionRegistry()
Get the action registry for
NodeBase.componentHandleWebAction(RequestContextImpl, String) requests. |
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.
|
String |
handleNotLoggedInException(RequestContextImpl ci,
Page page,
NotLoggedInException x)
Responsible for redirecting to the appropriate login page.
|
boolean |
hasApplicationResource(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.
|
protected void |
initializeWebActions()
Register all default web actions for
NodeBase.componentHandleWebAction(RequestContextImpl, String) requests. |
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) |
ThemeManager |
internalGetThemeManager() |
void |
internalInitialize(ConfigParameters pp,
boolean development) |
static int |
internalNextPageTag() |
boolean |
isShowProblemTemplate() |
boolean |
isUiTestMode() |
Class<? extends UrlPage> |
loadPageClass(String name) |
boolean |
logOutput() |
void |
register(ILookupControlFactory f)
Register a new LookupControl factory.
|
protected void |
registerControlFactories() |
void |
registerControlFactory(PropertyControlFactory cf)
Add a new control factory to the registry.
|
protected void |
registerPartFactories() |
void |
registerResourceFactory(IResourceFactory f) |
void |
registerRight(BundleRef bundle,
String... rights)
Registers a set of possible rights and their names/translation bundle.
|
void |
registerRights(BundleRef bundle,
Class<?> constantsclass)
Takes a class (or interface) and scans all static public final String fields therein.
|
void |
registerUrlPart(IUrlPart factory)
Add a part that reacts on some part of the input URL instead of [classname].part, with a priority of 10.
|
void |
registerUrlPart(IUrlPart factory,
int priority)
Add a part that reacts on some part of the input URL instead of [classname].part.
|
<T> void |
removeAsyncListener(IAsyncListener<T> l) |
void |
removeNewPageInstantiatedListener(INewPageInstantiated l) |
void |
removeSessionListener(IAppSessionListener l) |
void |
removeUIStateListener(IDomUIStateListener sl)
Remove a registered UI state listener.
|
void |
setAutoRefreshPollInterval(int autoRefreshPollInterval) |
void |
setBindingHandlerFactory(IBindingHandlerFactory bindingHandlerFactory) |
void |
setCurrentTheme(String currentTheme)
Sets the current theme string.
|
void |
setDefaultExpiryTime(int defaultExpiryTime)
Set the static resource browser cache expiry time, in seconds.
|
void |
setDefaultPollInterval(int defaultPollInterval) |
void |
setInjector(IPageInjector injector) |
void |
setKeepAliveInterval(int keepAliveInterval)
Set the keep-alive interval for DomUI screens, in milliseconds.
|
void |
setLoginAuthenticator(ILoginAuthenticator loginAuthenticator) |
void |
setLoginDialogFactory(ILoginDialogFactory loginDialogFactory) |
static void |
setPlatformVarcharByteLimit(int platformVarcharByteLimit) |
void |
setProblemMail(String toAddress,
String fromAddress,
String subject) |
void |
setShowProblemTemplate(boolean showProblemTemplate) |
void |
setThemeFactory(IThemeFactory themer)
Set the factory for handling the theme.
|
void |
setThemeProperty(String name,
String value)
Set a property for all themes.
|
void |
setUiTestMode() |
void |
setWindowSessionTimeout(int windowSessionTimeout)
Sets the windowSession timeout, in minutes.
|
@Nullable public abstract Class<? extends UrlPage> getRootPage()
protected void registerControlFactories()
protected void registerPartFactories()
@Nonnull public static DomApplication get()
public void addSessionListener(IAppSessionListener l)
public void removeSessionListener(IAppSessionListener l)
@Nonnull public String getUrlExtension()
public void addRequestHandler(@Nonnull IFilterRequestHandler fh, int priority)
fh - @Nullable public IFilterRequestHandler findRequestHandler(@Nonnull IRequestContext ctx) throws Exception
ctx - Exceptionpublic void registerUrlPart(@Nonnull IUrlPart factory, int priority)
factory - priority - The priority of handling. Keep it low for little-used factories.public void registerUrlPart(@Nonnull IUrlPart factory)
factory - @Nonnull public PartRequestHandler getPartRequestHandler()
@Nonnull public AppSession createSession()
protected void destroy()
protected void initialize(@Nonnull ConfigParameters pp) throws Exception
pp - Exceptionpublic final void internalInitialize(@Nonnull ConfigParameters pp, boolean development) throws Exception
Exceptionpublic static final int internalNextPageTag()
public String getJQueryVersion()
@Nonnull public WebActionRegistry getWebActionRegistry()
NodeBase.componentHandleWebAction(RequestContextImpl, String) requests.protected void initializeWebActions()
NodeBase.componentHandleWebAction(RequestContextImpl, String) requests.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 boolean isUiTestMode()
public void setAutoRefreshPollInterval(int autoRefreshPollInterval)
public int getAutoRefreshPollInterval()
#isAutoRefreshPage() is enabled (T), this defines the poll interval that a client uses
to check for server-side changes. It defaults to 2.5 seconds (in domui.js), and can be set to a faster update value
to have the update check faster for development. If the interval is not set this contains 0, else it contains the
refresh time in milliseconds.public int getDefaultPollInterval()
DelayedActivitiesManager), defaulting
to 2500 (2.5 seconds).public void setDefaultPollInterval(int defaultPollInterval)
public int calculatePollInterval(boolean pollCallbackRequired)
public int getWindowSessionTimeout()
public void setWindowSessionTimeout(int windowSessionTimeout)
windowSessionTimeout - public int getDefaultExpiryTime()
public void setDefaultExpiryTime(int defaultExpiryTime)
defaultExpiryTime - @Nonnull public Locale getRequestLocale(javax.servlet.http.HttpServletRequest request)
ServletRequest.getLocale(). You
can override this method to define the locale by yourself.request - public void setProblemMail(@Nonnull String toAddress, @Nonnull String fromAddress, @Nonnull String subject)
public boolean isShowProblemTemplate()
public void setShowProblemTemplate(boolean showProblemTemplate)
@Nonnull public IBindingHandlerFactory getBindingHandlerFactory()
public void setBindingHandlerFactory(@Nonnull IBindingHandlerFactory bindingHandlerFactory)
@Nonnull public IBindingHandler getBindingHandler(@Nonnull NodeBase node)
protected void initHeaderContributors()
public final void addHeaderContributor(HeaderContributor hc, int order)
hc - order - public List<HeaderContributorEntry> getHeaderContributorList()
public void addDefaultErrorComponent(NodeContainer page)
page - @Deprecated public BasePageTitleBar getDefaultPageTitleBar(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 - @Nonnull public final ControlBuilder getControlBuilder()
@Nonnull public ControlCreatorRegistry getControlCreatorRegistry()
public final void registerControlFactory(PropertyControlFactory cf)
cf - The new factorypublic void register(ILookupControlFactory f)
f - public <T> T createInstance(Class<T> clz, Object... args)
@Nonnull public File getAppFile(String path)
path - @Nonnull public IResourceRef getAppFileOrResource(String name)
IModifyableResource. This will not use any kind of resource
factory.name - public void registerResourceFactory(@Nonnull IResourceFactory f)
@Nonnull public List<IResourceFactory> getResourceFactories()
@Nullable public IResourceFactory findResourceFactory(String name)
name - @Nonnull public final File getWebAppFileRoot()
@Nonnull public IResourceRef createClasspathReference(String name)
name - @Nonnull public IResourceRef getResource(@Nonnull String name, @Nonnull IResourceDependencyList rdl) throws 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.Exceptionpublic boolean hasApplicationResource(String name) throws Exception
getAppFileOrResource(String).name - Exceptionpublic String findLocalizedResourceName(String basename, String suffix, Locale loc) throws 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.ExceptionBundleRef.loadBundleList(Locale)@Nonnull public <T> List<T> getCachedList(IListMaker<T> maker) throws Exception
T - key - maker - Exceptionpublic void clearListCaches()
public void clearListCache(ICachedListMaker<?> maker)
public boolean logOutput()
public void addInterceptor(IRequestInterceptor r)
public List<IRequestInterceptor> getInterceptorList()
public void addExceptionListener(Class<? extends Exception> xclass, IExceptionListener l)
l - public IExceptionListener findExceptionListenerFor(Exception x)
x - public void addNewPageInstantiatedListener(INewPageInstantiated l)
public void removeNewPageInstantiatedListener(INewPageInstantiated l)
public 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 List<ILoginListener> getLoginListenerList()
public <T> void addAsyncListener(@Nonnull IAsyncListener<T> l)
l - public <T> void removeAsyncListener(@Nonnull IAsyncListener<T> l)
@Nonnull public List<IAsyncListener<?>> getAsyncListenerList()
public String handleNotLoggedInException(RequestContextImpl ci, Page page, NotLoggedInException x)
ci - page - public IPageInjector getInjector()
public void setInjector(IPageInjector injector)
public void registerRight(BundleRef bundle, String... rights)
bundle - rights - public void registerRights(BundleRef bundle, Class<?> constantsclass)
bundle - constantsclass - public List<String> getRegisteredRights()
public String findRightsDescription(String right)
right - public String getRightsDescription(String right)
right - public static int getPlatformVarcharByteLimit()
public static void setPlatformVarcharByteLimit(int platformVarcharByteLimit)
@OverridingMethodsMustInvokeSuper public void augmentThemeMap(@Nonnull IScriptScope ss) throws Exception
Exceptionpublic final void setCurrentTheme(@Nonnull String currentTheme)
currentTheme - The theme name, valid for the current theme engine. Cannot be null nor the empty string.@Nonnull public final String getCurrentTheme()
public final void setThemeProperty(@Nonnull String name, @Nullable String value)
name - value - @Nonnull public ThemeManager internalGetThemeManager()
public final void setThemeFactory(@Nonnull IThemeFactory themer)
themer - public final ITheme getTheme(@Nonnull String themeName, @Nullable IResourceDependencyList rdl) throws Exception
rdl - Exceptionpublic final String getThemeReplacedString(IResourceDependencyList rdl, String rurl) throws Exception
rdl - rurl - Exceptionpublic final String getThemeReplacedString(IResourceDependencyList rdl, String rurl, BrowserVersion bv) throws Exception
rdl - key - Exception@Nonnull public ResourceInfoCache getResourceInfoCache()
public int getKeepAliveInterval()
public void setKeepAliveInterval(int keepAliveInterval)
keepAliveInterval - 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)
public void setUiTestMode()
@Nonnull public <T extends UrlPage> Class<T> getAccessDeniedPageClass()
AccessDeniedPage.Copyright © 2017 etc.to. All rights reserved.