votorola.a.web
Class VApplication

java.lang.Object
  extended by org.apache.wicket.Application
      extended by org.apache.wicket.protocol.http.WebApplication
          extended by VApplication

@ThreadSafe
public final class VApplication
extends WebApplication

Primary class of the Web-based voter interface.


Nested Class Summary
static class VApplication.ConfigurationContext
          A context for configuring the Web interface.
 
Field Summary
static String TEST_USER_EMAIL
          The email address of the test user to automatically login, according to system property "votorola.testUserEmail".
 
Fields inherited from class org.apache.wicket.Application
CONFIGURATION, CONTEXTPATH, DEPLOYMENT, DEVELOPMENT
 
Constructor Summary
VApplication()
           
 
Method Summary
 File cacheDirectory()
          Directory for storage of Web interface files that are generated at runtime, and persisted from run to run.
(package private)  File configurationFile()
          The scripted configuration file for this Web interface.
 ConsumerManager consumerManager()
          The OpenID consumer manager.
 String getCustomXHTML(String key)
          Retrieves the content for a customizeable page section.
 Class getHomePage()
           
protected  void init()
           
 Object mailLock()
          Lock object for mail facilities.
 MailSender mailSender()
          Access to the SMTP mail transfer service.
 Session mailSession()
          The mail session for this run of the Web interface.
 String name()
          The name that nominally identifies this Web interface.
static NavBar navBar()
          The top navigation bar, for navigating among the pages of the subserver.
 RequestCycle newRequestCycle(Request request, Response response)
           
 Session newSession(Request request, Response response)
           
protected  void onDestroy()
           
 Object openIDLock()
          Lock object for openID facilities.
 void putCustomXHTML(String key, String xhtml)
          Stores the content for a customizeable page section.
 WP_Meta.ApplicationScope scopeMeta()
          Returns the application scope for instances of WP_Meta.
 SecureRandom secureRandomizer()
          The secure random number generator.
 String serviceEmail()
          The email address that nominally identifies the Web interface.
(package private)  Spool spool()
          Spool unwound prior to destruction of this application.
 String styleSheet()
          The URL of the subserver's custom style sheet, for site-specific styling of pages.
 ElectoralSubserver.Run subserverRun()
          The subserver run, for which this Web responder is provided.
 
Methods inherited from class org.apache.wicket.protocol.http.WebApplication
getApplicationKey, getConfigurationType, getDefaultRequestCycleFactory, getInitParameter, getRequestCycleProcessor, getResourceFinder, getServletContext, getSessionAttributePrefix, getWicketFilter, internalDestroy, internalInit, logEventTarget, logResponseTarget, mount, mount, mountBookmarkablePage, mountBookmarkablePage, mountSharedResource, newAjaxRequestTarget, newRequestCycleProcessor, newSession, newSession, newSessionStore, newWebRequest, newWebResponse, outputDevelopmentModeWarning, sessionDestroyed, setApplicationKey, setWicketFilter, unmount
 
Methods inherited from class org.apache.wicket.Application
addComponentInstantiationListener, addComponentOnAfterRenderListener, addComponentOnBeforeRenderListener, addRenderHeadListener, configure, destroy, exists, get, get, getApplicationKeys, getApplicationSettings, getConverterLocator, getDebugSettings, getExceptionSettings, getFrameworkSettings, getMarkupCache, getMarkupSettings, getMetaData, getName, getPageSettings, getRequestCycleFactory, getRequestCycleSettings, getRequestLogger, getRequestLoggerSettings, getResourceSettings, getSecuritySettings, getSessionFactory, getSessionSettings, getSessionStore, getSharedResources, initializeComponents, newConverterLocator, newRequestCycle, newRequestLogger, notifyRenderHeadListener, removeComponentInstantiationListener, removeComponentOnAfterRenderListener, removeComponentOnBeforeRenderListener, removeRenderHeadListener, set, setMetaData, unset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_USER_EMAIL

public static final String TEST_USER_EMAIL
The email address of the test user to automatically login, according to system property "votorola.testUserEmail". May be null.

Constructor Detail

VApplication

public VApplication()
Method Detail

init

protected void init()
Overrides:
init in class WebApplication

cacheDirectory

public File cacheDirectory()
Directory for storage of Web interface files that are generated at runtime, and persisted from run to run. The directory is created at runtime if it did not already exist.

This is the same as the subserver cache directory, if that directory is writeable by the electoral services daemon of the Web interface (i.e. the servlet container); otherwise, it is some other, fallback directory.

See Also:
ElectoralSubserver.cacheDirectory()

configurationFile

File configurationFile()
The scripted configuration file for this Web interface. It is located at:
votorolaDirectory/web.js

The language is JavaScript. There are restrictions on the character encoding.


consumerManager

@ThreadRestricted(value="holds openIDLock")
public ConsumerManager consumerManager()
The OpenID consumer manager.


getCustomXHTML

public String getCustomXHTML(String key)
Retrieves the content for a customizeable page section.

See Also:
putCustomXHTML(String,String)

putCustomXHTML

@ThreadRestricted(value="init")
public void putCustomXHTML(String key,
                                                 String xhtml)
Stores the content for a customizeable page section. The content format is XHTML. If your script needs to read the content from a file, then consider making use of _voIncluder.fileToString.

The key format is CLASS/ID, where CLASS is the fully qualified class name of the page or panel, and ID is a class-specific identifier. Keys are * pre-defined as Java constants, with names beginning 'XHTML_'. See the javadoc * index for a complete list of valid keys.

This method is restricted to calls from the initWeb method of the configuration script, web.js.

Parameters:
key - the key under which to store the content
xhtml - the content in XHTML format
See Also:
getCustomXHTML(String)

mailLock

public Object mailLock()
Lock object for mail facilities. This object's monitor lock synchronizes all access to members that are annotated @ThreadRestricted("holds mailLock").


mailSender

@ThreadRestricted(value="holds mailLock")
public MailSender mailSender()
Access to the SMTP mail transfer service.


mailSession

@ThreadRestricted(value="holds mailLock")
public Session mailSession()
The mail session for this run of the Web interface.


name

public String name()
The name that nominally identifies this Web interface. It must be valid as the local part (before the '@') of an email address, per ElectoralService.name().

See Also:
serviceEmail()

navBar

public static NavBar navBar()
The top navigation bar, for navigating among the pages of the subserver.


openIDLock

public Object openIDLock()
Lock object for openID facilities. This object's monitor lock synchronizes all access to members that are annotated @ThreadRestricted("holds openIDLock").


scopeMeta

public WP_Meta.ApplicationScope scopeMeta()
Returns the application scope for instances of WP_Meta.


secureRandomizer

@ThreadRestricted(value="holds mailLock")
public SecureRandom secureRandomizer()
The secure random number generator.


serviceEmail

public String serviceEmail()
The email address that nominally identifies the Web interface. It is constructed from the interface and server names, as 'interface-name@server-name'. Email authentication messages to users will be sent from this address. Someone or something (such as the mail meta-service) ought to respond helpfully to any message that happens to be sent to this address.

See Also:
VApplication.ConfigurationContext.setName(String)

spool

Spool spool()
Spool unwound prior to destruction of this application.


styleSheet

public String styleSheet()
The URL of the subserver's custom style sheet, for site-specific styling of pages.

Returns:
URL of style sheet; or null, if there is none
See Also:
CustomStyleable, VApplication.ConfigurationContext.setStyleSheet(String)

subserverRun

public final ElectoralSubserver.Run subserverRun()
The subserver run, for which this Web responder is provided.


getHomePage

public Class getHomePage()
Specified by:
getHomePage in class Application

newSession

public Session newSession(Request request,
                          Response response)
Overrides:
newSession in class WebApplication

newRequestCycle

public RequestCycle newRequestCycle(Request request,
                                    Response response)
Overrides:
newRequestCycle in class WebApplication

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class Application