Broadcast on Broadcast off
The Documentation for Project Zero has moved. Please update your bookmarks to: http://www.projectzero.org/documentation/
Table of
Contents...
Hide

Project Zero Developer’s Guide

Concepts and components
Basic concepts overview
Event processing
Writing Java handlers
Writing Groovy handlers
Firing events
Global Context
Global Context reference
Application directory layout
Virtualized directories
Assemble
PHP
Features and configuration
Configuration
Debugging
Dependencies
Packaging
Application classpath
Logging and tracing
RESTful resources
RESTful documentation
File serving
Response rendering
Validators and validation
HTTP error handling
Calling a remote resource
Using the Connection API
Sending an email using EmailConnection
Configuring destinations
Configuring protocols
Configuring connection handlers
Creating a connection handler
Creating a custom protocol transport
Simple logging connection handlers
Protocol reference
Client programming with Dojo
Runtime options
Deployment modifications
HTTP configuration
SSL configuration
Proxy configuration
Extending the CLI
Security considerations
Authentication
OpenID authentication
Extending security
Security tokens
CSRF prevention support
Extending token support
Leveraging TAI
User service
File based user service
LDAP user service
Extending user service
Security Utilities
Leveraging XOREncoder
Extensions
Atom support
RSS support
JSON support
XMLEncoder
REST to SOAP extension
URIUtils
Developer Web tools
Database setup tools
Configuring data access
Common query patterns
Advanced query patterns
Update patterns
Local database transactions
Extending data access
Configuration vendor differences
PHP data access
Resource model
Configuring ZRM
Resource model declaration
Programmatic model API
HTTP REST API
A ZRM mini tutorial
Active content filtering support
Default filters
Custom filters
Runtime management
Management commands
Zero socket opener
Other extension modules
Amazon E-commerce service
Flickr service
WeatherZero forecast service
Wikipedia service
Reference
Zero command line interface
JavaDoc - Public API
JavaDoc - Public SPI
JavaDoc - All Classes

 

Global context reference

The tables in this article show the default attributes available in each of the global context zones.

Config zone

Key Type Description Read/Write
/config/accessLogging boolean Enables/Disables access logging Read/write
/config/connection/defaults/ {protocol_name} / {property_name} Object Default protocol configuration for the Connection API. Read-only
/config/connection/destinations List<Map<String, Object>> Configured destinations for the Connection API. Read-only
/config/connection/https List<Map<String, Object>> Outbound HTTPS configurations for the Connection API. Read-only
/config/contextRoot String The optional application context root uniquely identifies the application. An empty string indicates no context root; otherwise, it starts with a slash. The context root must only contain legal URI characters. Read-only
/config/defaultContentType String The default response content type. The default is text/html. Read-only
/config/dependencies Map Map of root directories for dependencies. Key=dependency name; value=root directory. Read-only
/config/exitCode Integer Optional The termination status code set by config event handlers. If set, then the application exits. Read/write for "config" handlers.
/config/externalUriPrefix String The optional external URI prefix. If defined, it replaces the scheme, host and port when calculating absolute URIs. Read-only
/config/fileserver/defaultExtensions List<String> The list of file extensions for default file serving, in search order. The default is [.groovy, .gt, .html]. Read/write
/config/fileserver/directoryBrowsing Boolean Indicates whether directory browsing is enabled. The default is false. Read/write
/config/fileserver/directoryView String Reference to view template/script file (relative to app/views).  
/config/fileserver/expires Integer The time, in seconds, that a client should cache files with this extension. It is set in a Cache-Control header. By default, files are sent with a max-age of 0. Always prepended to a file extension like the following: /config/fileserver/expires/.extension Read/write
/config/fileserver/setEtag Boolean Indicates whether the Etag header is set on outgoing static file headers. The default is true. Read/write
/config/http/port Integer The HTTP port associated with this application. Read-only
/config/https/keyStore String The location of the key store. Read-only
/config/https/keyStorePassword String The password for the key store. Read-only
/config/https/keyStoreType String The key store type. Read-only
/config/https/port Integer The HTTPS port associated with this application. Read-only
/config/https/trustStore String The location of the trust store. Read-only
/config/https/trustStorePassword String The password for the trust store. Read-only
/config/https/trustStoreType String The trust store type. Read-only
/config/json/prettyPrint   Type: Boolean  
/config/name String The name of this application. Read-only
/config/requestLogging boolean Enables/Disables request logging Read/write
/config/requestLoggingLimit Integer The per request logging limit for the input/output streams. If the limits are reached the log is truncated. Read/write
/config/resources/defaultExtensions List<String> A list of file extensions for resource handlers, in search order. The default is [.groovy]. Read/write
/config/root String The root directory of the application. Read-only
/config/tmpDir String The location of a directory for temporary files to be stored. The default is the Java system property java.io.tmpdir. Read-only

Connection zone

Key Type Description Read/Write
/connection/configuration# {property_name}   Connection handler configuration. Only accessbile within a connection Handler implementation. Read-only
/connection/request/body   Connection request body. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/request/headers/ {header_name} List<Object> Connection request headers. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/request/operation String Connection request operation name. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/request/outputStream String Request OutputStream. Only applicable to OutputStream aware protocol Transport implementations. Read/write
/connection/request/protocol/_name String Connection protocol name. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/request/target String Connection request target resource name or URL. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/response/body   Connection response body. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/response/defaultCharset String Default response character encoding suggested by the protocol Transport. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/response/headers/ {header_name} List<Object> Connection response headers. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write
/connection/response/status String Connection response status. Only accessbile within transmit or getTransport handler, a connection Handler or a protocol Transport implementation. Read/write

Event zone

Key Type Description Read/Write
/event/_name String The event name. Read-only
/event/matchedPath String The URI to the current handler.
App.contextRoot + Event.matchedPath + Event.pathInfo = decode(Request.uri)
Read-only
/event/parentPath String The URI to the parent directory containing the current handler. Read-only
/event/pathInfo String The segment of the URI after /event/matchedPath. Decoded. Read-only
/event/remoteGroup   The value of the selector expression variable {remoteGroup}, if applicable to the request URI.  
/event/remoteUser   The value of the selector expression variable {remoteUser}, if applicable to the request URI.  

Request zone

Key Type Description Read/Write
/request/authType String The type of authentication used. Read-only
/request/cookies/in Map<String, List<Cookie>> The cookies that a client sent. Read-only
/request/cookies/out List<Cookie> The outgoing cookies. To avoid erasing any other cookies, you must get the list and add to it rather than setting this variable.
Example:
Cookie newCookie = new Cookie(name, value);
GlobalContext.get("/request/cookies/out").add(newCookie);
Read/write
/request/files Map<String, Map<String, String>[]> Information regarding uploaded files. The map contains 2 keys, filename and path. The filename is the name of the files as defined by the client. The path is the location of the file on disk. Read-only
/request/headers/in/ {header_name} FirstElementList <String> Values of request header header_name
You can walk all the request headers with zlist:

for (String key : GC.zlist("/request/headers/in")) {
Object value = GC.zget(key);
// manipulate value ...
}
Read-only
/request/headers/out/ {header_name} FirstElementList <String> Values of response header header_name Read/write
/request/headers/sent Boolean Indicates whether the HTTP response headers have been sent. If this value is true, then any changes to /request/headers/out are not sent to the client. Read-only
/request/input InputStream The input stream associated with the HTTP request. Form-encoded parameters are available using /request/params, not on the input stream. Read-only
/request/locales   The languages and countries sent by the client in the accept-language header  
/request/method String The HTTP request method (GET, POST, PUT, DELETE). Read-only
/request/outputStream OutputStream The binary output stream. This is available only to render handlers. Write for render handlers
/request/params Map<String, String[]> Includes parameters from query string and form-encoded parameters (POST). Read-only
/request/path String The request URI path beyond the context root (see /app/contextRoot). URI decoded. Read-only
/request/protocol String The request protocol (for example HTTP/1.1). Read-only
/request/queryString String The query string associated with the request URI. Read-only
/request/remoteAddress String The IP address of the remote host. Read-only
/request/remoteHost String The name of the remote host. Read-only
/request/remotePort Integer The remote port number. Read-only
/request/scheme String The URL scheme (<scheme>://host/path). Read-only
/request/serverName String The host name of the server to which the request was sent. Read-only
/request/serverPort Integer The server port on which the request was received. Read-only
/request/status Integer Status of the response. Read/write
/request/subject/groups List<String> The groups an authenticated user belongs to. Read-only
/request/subject/remoteUser String The authenticated remote user name. Read-only
/request/uri String The fully qualified request URI, including context-root and query string. URI encoded. Includes (proxy) context root, path, and query string Read-only
/request/view String A path to view script/template (relative to app/views). This is a required field for the ViewHandler renderer. Read/write
/request/writer PrintWriter The text output stream. Write

r33 - 05 Feb 2008 - 20:15:36 - zerodocgen
Syndicate this site RSS ATOM
Copyright 2007 © IBM Corporation | Privacy | Terms of Use | About this site