Java Doc for Execution.java in  » Ajax » zk » org » zkoss » zk » ui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » zk » org.zkoss.zk.ui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.zkoss.zk.ui.Execution

All known Subclasses:   org.zkoss.zk.ui.impl.AbstractExecution,
Execution
public interface Execution (Code)
An execution of a client request (e.g., ServletRequest). When a request sent from a client, the server constructs a Execution object to hold execution relevant info, and then serves the request thru this execution.

A client request, e.g., HttpServletRequest, might consist of multiple ZK request ( org.zkoss.zk.au.AuRequest ). However, these ZK requests must target the same desktop of pages ( Page ).

Because a request might come from HTTP or other protocol, Execution also serves as an isolation layer.
author:
   tomyeh
See Also:   Page



Field Summary
final public static  intAPPEND_PARAM
     Whether to append params if both uri and params contain the same parameter.
final public static  intIGNORE_PARAM
     Whether to ignore params if both uri and params contain the same parameter.
final public static  intOVERWRITE_URI
     Whether to overwrite uri if both uri and params contain the same parameter.
final public static  intPASS_THRU_ATTR
     Whether the specified parameters shall be passed thru the request's attribute called arg.


Method Summary
public  voidaddAuResponse(String key, AuResponse resposne)
     Adds an asynchronous response ( AuResponse ) which will be sent to client at the end of the execution.

If AuResponse.getDepends is not null, the response depends on the returned componet.

public  ComponentcreateComponents(PageDefinition pagedef, Component parent, Map arg)
     Creates components from the specified page definition. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.
Parameters:
  pagedef - the page definition to use.
public  ComponentcreateComponents(String uri, Component parent, Map arg)
     Creates components from a page file specified by an URI. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

It loads the page definition from the specified URI (by use Execution.getPageDefinition ), and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  parent - the parent component, or null if you want it to bea root component.

public  Component[]createComponents(PageDefinition pagedef, Map arg)
     Creates components that don't belong to any page from the specified page definition.
Parameters:
  pagedef - the page definition to use.
public  Component[]createComponents(String uri, Map arg)
     Creates components that don't belong to any page from a page file specified by an URI.
public  ComponentcreateComponentsDirectly(String content, String extension, Component parent, Map arg)
     Creates components from the raw content specified by a string. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(String,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content of the page.

public  ComponentcreateComponentsDirectly(Document content, String extension, Component parent, Map arg)
     Creates components from the raw content specified by a DOM tree. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Document,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content in DOM.
Parameters:
  extension - the default extension if the content doesn't specifyan language.

public  ComponentcreateComponentsDirectly(Reader reader, String extension, Component parent, Map arg)
     Creates components from the raw content read from the specified reader. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

The raw content is loaded and parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Reader,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  reader - the reader to retrieve the raw content in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language.

public  Component[]createComponentsDirectly(String content, String extension, Map arg)
     Creates components that don't belong to any page from the raw content specified by a string.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(String,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content of the page.

public  Component[]createComponentsDirectly(Document content, String extension, Map arg)
     Creates components that don't belong to any page from the raw content specified by a DOM tree.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Document,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content in DOM.
Parameters:
  extension - the default extension if the content doesn't specifyan language.

public  Component[]createComponentsDirectly(Reader reader, String extension, Map arg)
     Creates components that don't belong to any page from the raw content read from the specified reader.

The raw content is loaded and parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Reader,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  reader - the reader to retrieve the raw content in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language.

public  StringencodeURL(String uri)
     Encodes an URL.

It resolves "*" contained in URI, if any, to the proper Locale, and the browser code. Refer to Servlets.locate(ServletContextServletRequestStringLocator) for details.

public  Objectevaluate(Component comp, String expr, Class expectedType)
     Evluates the specified expression with ${link #getVariableResolver} and Page.getFunctionMapper of the page of the specified component.

The function mapper is retrieved from component's page's function mapper ( Page.getFunctionMapper ). If null, the current page, if any, is used to retrieve the mapper.

For better performance, you can use the instance returned by Execution.getEvaluator to parse and cached the parsed expression. org.zkoss.zk.xel.ExValue is a utility class to simply the task.
Parameters:
  comp - used as the self variable and to retrieve the functionmapper.

public  Objectevaluate(Page page, String expr, Class expectedType)
     Evluates the specified expression with ${link #getVariableResolver} and Page.getFunctionMapper of the specified page.

The function mapper is retrieved from component's page's function mapper ( Page.getFunctionMapper ). If null, the current page, if any, is used to retrieve the mapper.

For better performance, you can use the instance returned by Execution.getEvaluator to parse and cached the parsed expression. org.zkoss.zk.xel.ExValue is a utility class to simply the task.
Parameters:
  page - used as the self variable and to retrieve the functionmapper.

public  voidforward(Writer writer, String page, Map params, int mode)
     Forwards to another page.

Note: this method can be called only when loading a page. Use Execution.sendRedirect(String) instead if you want to change to another desktop when processing a request from the client.
Parameters:
  writer - the output to write.

public  voidforward(String page)
     A shortcut of forward(null, page, null, 0).
public  MapgetArg()
     Returns the parameters (aka., arg) if Execution.pushArg is called recently, or an empty map if not available.

The use of parameters is application dependent. ZK only provides the way to store ( Execution.pushArg and to restore Execution.popArg .

public  ObjectgetAttribute(String name)
     Returns the value of the specified request attribute.
public  MapgetAttributes()
     Returns a map of request attributes associated with this session.
public  StringgetContextPath()
     Returns the portion of the request URI that indicates the context of the current execution.
public  DesktopgetDesktop()
     Returns the desktop for this execution.
public  EvaluatorgetEvaluator(Page page, Class expfcls)
     Returns the evaluator (never null).
public  EvaluatorgetEvaluator(Component comp, Class expfcls)
     Returns the evaluator of the current execution.
public  StringgetLocalAddr()
     Returns the Internet Protocol (IP) address of the interface on which the request was received.
public  StringgetLocalName()
     Returns the host name of the Internet Protocol (IP) interface on which the request was received.

Note: it is the host name defined in the server.

public  intgetLocalPort()
     Returns the Internet Protocol (IP) port number of the interface on which the request was received.
public  ObjectgetNativeRequest()
     Returns the native request, or null if not available.
public  ObjectgetNativeResponse()
     Returns the native response, or null if not available.
public  PageDefinitiongetPageDefinition(String uri)
     Returns the page definition from the page file specified by an URI.
public  PageDefinitiongetPageDefinitionDirectly(String content, String extension)
     Converts the specified page content to a page definition.

Implemetation Notes: this method must invoke org.zkoss.zk.ui.sys.UiFactory.getPageDefinitionDirectly(org.zkoss.zk.ui.sys.RequestInfoStringString)
Parameters:
  content - the raw content of the page.

public  PageDefinitiongetPageDefinitionDirectly(Document content, String extension)
     Converts the specified page content, in DOM, to a page definition.
Parameters:
  content - the raw content of the page in DOM.
Parameters:
  extension - the default extension if the content doesn't specifyan language.
public  PageDefinitiongetPageDefinitionDirectly(Reader reader, String extension)
     Reads the raw content from a reader and converts it into a page definition.
Parameters:
  reader - used to input the raw content of the page.
public  StringgetParameter(String name)
    
public  MapgetParameterMap()
     Returns a Map of the parameters of this request.
public  String[]getParameterValues(String name)
     Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
public  StringgetRemoteAddr()
     Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
public  StringgetRemoteHost()
     Returns the fully qualified name of the client or the last proxy that sent the request.
public  StringgetRemoteName()
    
public  StringgetRemoteUser()
     Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated.
public  StringgetServerName()
     Returns the host name of the server to which the request was sent.
public  intgetServerPort()
     Returns the port number to which the request was sent.
public  StringgetUserAgent()
     Returns the user-agent header, which indicates what the client is, or an empty string if not available.
public  PrincipalgetUserPrincipal()
     Returns a java.security.Principal object containing the name of the current authenticated user.
public  VariableResolvergetVariableResolver()
     Returns the variable resolver for this execution, or null if not available.
public  voidinclude(Writer writer, String page, Map params, int mode)
     Includes a page.
Parameters:
  writer - the output to write.
public  voidinclude(String page)
     A shortcut of include(null, page, null, 0).
public  booleanisAsyncUpdate(Page page)
     Returns whether this execution is asynchronous updating the specified page (thru ZK Update Engine).
public  booleanisBrowser()
     Returns whether the client is a browser.
public  booleanisExplorer()
     Returns whether the client is Internet Explorer.
public  booleanisExplorer7()
     Returns whether the client is Internet Explorer 7 or later.
public  booleanisForwarded()
     Returns whether the execution is forwarded from other pages.
public  booleanisGecko()
     Returns whether the client is Gecko based, such as Mozilla, Firefox and Camino.
public  booleanisHilDevice()
     Returns whether the client is a mobile device supporting HIL (Handset Interactive Language).
public  booleanisIncluded()
     Returns whether this execution is included by some other pages.
public  booleanisMilDevice()
     Returns whether the client is a mobile device supporting MIL (Mobile Interactive Language).
public  booleanisRobot()
     Returns whether the client is a robot (such as Web crawlers).
public  booleanisSafari()
     Returns whether the client is Safari.
public  booleanisUserInRole(String role)
     Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
public  booleanisVoided()
     Returns whether the execution is voided. By void we mean the request is taken charged by other servlet. The execution shall not do anything more.
public  voidpopArg()
     Pops the parameters (aka., arg) that is pushed by Execution.pushArg .
public  voidpostEvent(Event evt)
     Queues an event to the current execution.
public  voidpushArg(Map arg)
     Pushes the parameters (aka., arg) that EL could refer it by the arg variable.
public  voidremoveAttribute(String name)
     Removes the specified request attribute.
public  voidsendRedirect(String uri)
     Sends a temporary redirect response to the client using the specified redirect location URL.

It is the same as sendRedirect(url, null).

After calling this method, the caller shall end the processing immediately (by returning).

public  voidsendRedirect(String uri, String target)
     Sends a temporary redirect response to the client using the specified redirect location URL and redirect to the specified browser window.

After calling this method, the caller shall end the processing immediately (by returning).

public  voidsetAttribute(String name, Object value)
     Sets the value of the specified request attribute.
Parameters:
  value - the value.
public  voidsetVoided(boolean voided)
     Sets whether the execution is voided. By void we mean the request is taken charged by other servlet.

If you invoke Execution.forward , this method is called automatically with true.

public  StringtoAbsoluteURI(String uri, boolean skipInclude)
     Converts the specified URI to an absolute URI, if uri is related and the current execution is not included ( Execution.isIncluded ).

Field Detail
APPEND_PARAM
final public static int APPEND_PARAM(Code)
Whether to append params if both uri and params contain the same parameter. In other words, they both appear as the final query string.



IGNORE_PARAM
final public static int IGNORE_PARAM(Code)
Whether to ignore params if both uri and params contain the same parameter.



OVERWRITE_URI
final public static int OVERWRITE_URI(Code)
Whether to overwrite uri if both uri and params contain the same parameter.



PASS_THRU_ATTR
final public static int PASS_THRU_ATTR(Code)
Whether the specified parameters shall be passed thru the request's attribute called arg.





Method Detail
addAuResponse
public void addAuResponse(String key, AuResponse resposne)(Code)
Adds an asynchronous response ( AuResponse ) which will be sent to client at the end of the execution.

If AuResponse.getDepends is not null, the response depends on the returned componet. In other words, the response is removed if the component is removed. If it is null, the response is component-independent.
Parameters:
  key - could be anything. The second invocation of this methodin the same execution with the same key will override the previous one.




createComponents
public Component createComponents(PageDefinition pagedef, Component parent, Map arg)(Code)
Creates components from the specified page definition. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.
Parameters:
  pagedef - the page definition to use. It cannot be null.
Parameters:
  parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. the first component being created.
See Also:   Execution.createComponents(String,Component,Map)



createComponents
public Component createComponents(String uri, Component parent, Map arg)(Code)
Creates components from a page file specified by an URI. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

It loads the page definition from the specified URI (by use Execution.getPageDefinition ), and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Component,Map)
See Also:   Execution.createComponentsDirectly(String,String,Component,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Component,Map)
See Also:   Execution.createComponentsDirectly(Reader,String,Component,Map)




createComponents
public Component[] createComponents(PageDefinition pagedef, Map arg)(Code)
Creates components that don't belong to any page from the specified page definition.
Parameters:
  pagedef - the page definition to use. It cannot be null.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. the first component being created.
See Also:   Execution.createComponents(String,Map)
since:
   2.4.0



createComponents
public Component[] createComponents(String uri, Map arg)(Code)
Creates components that don't belong to any page from a page file specified by an URI.

It loads the page definition from the specified URI (by use Execution.getPageDefinition ), and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Map)
See Also:   Execution.createComponentsDirectly(String,String,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Map)
See Also:   Execution.createComponentsDirectly(Reader,String,Map)
since:
   2.4.0




createComponentsDirectly
public Component createComponentsDirectly(String content, String extension, Component parent, Map arg)(Code)
Creates components from the raw content specified by a string. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(String,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content of the page. It must be in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
Parameters:
  parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Component,Map)
See Also:   Execution.createComponents(String,Component,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Component,Map)
See Also:   Execution.createComponentsDirectly(Reader,String,Component,Map)




createComponentsDirectly
public Component createComponentsDirectly(Document content, String extension, Component parent, Map arg)(Code)
Creates components from the raw content specified by a DOM tree. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Document,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content in DOM.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
Parameters:
  parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Component,Map)
See Also:   Execution.createComponents(String,Component,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Component,Map)
See Also:   Execution.createComponentsDirectly(Reader,String,Component,Map)




createComponentsDirectly
public Component createComponentsDirectly(Reader reader, String extension, Component parent, Map arg) throws IOException(Code)
Creates components from the raw content read from the specified reader. The created components become the child of the specified parent, or become the root components of the current page if parent is specified as null.

The raw content is loaded and parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Reader,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  reader - the reader to retrieve the raw content in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
Parameters:
  parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Component,Map)
See Also:   Execution.createComponents(String,Component,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Component,Map)
See Also:   Execution.createComponentsDirectly(String,String,Component,Map)




createComponentsDirectly
public Component[] createComponentsDirectly(String content, String extension, Map arg)(Code)
Creates components that don't belong to any page from the raw content specified by a string.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(String,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content of the page. It must be in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Map)
See Also:   Execution.createComponents(String,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Map)
See Also:   Execution.createComponentsDirectly(Reader,String,Map)
since:
   2.4.0




createComponentsDirectly
public Component[] createComponentsDirectly(Document content, String extension, Map arg)(Code)
Creates components that don't belong to any page from the raw content specified by a DOM tree.

The raw content is parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Document,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  content - the raw content in DOM.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Map)
See Also:   Execution.createComponents(String,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Map)
See Also:   Execution.createComponentsDirectly(Reader,String,Map)
since:
   2.4.0




createComponentsDirectly
public Component[] createComponentsDirectly(Reader reader, String extension, Map arg) throws IOException(Code)
Creates components that don't belong to any page from the raw content read from the specified reader.

The raw content is loaded and parsed to a page defintion by use of Execution.getPageDefinitionDirectly(Reader,String) , and then invokes Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters:
  reader - the reader to retrieve the raw content in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
Parameters:
  arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null.
See Also:   Execution.createComponents(PageDefinition,Map)
See Also:   Execution.createComponents(String,Map)
See Also:   Execution.createComponentsDirectly(Document,String,Map)
See Also:   Execution.createComponentsDirectly(String,String,Map)
since:
   2.4.0




encodeURL
public String encodeURL(String uri)(Code)
Encodes an URL.

It resolves "*" contained in URI, if any, to the proper Locale, and the browser code. Refer to Servlets.locate(ServletContextServletRequestStringLocator) for details.




evaluate
public Object evaluate(Component comp, String expr, Class expectedType)(Code)
Evluates the specified expression with ${link #getVariableResolver} and Page.getFunctionMapper of the page of the specified component.

The function mapper is retrieved from component's page's function mapper ( Page.getFunctionMapper ). If null, the current page, if any, is used to retrieve the mapper.

For better performance, you can use the instance returned by Execution.getEvaluator to parse and cached the parsed expression. org.zkoss.zk.xel.ExValue is a utility class to simply the task.
Parameters:
  comp - used as the self variable and to retrieve the functionmapper. Ignored if null.
See Also:   Execution.getVariableResolver
See Also:   Execution.getEvaluator




evaluate
public Object evaluate(Page page, String expr, Class expectedType)(Code)
Evluates the specified expression with ${link #getVariableResolver} and Page.getFunctionMapper of the specified page.

The function mapper is retrieved from component's page's function mapper ( Page.getFunctionMapper ). If null, the current page, if any, is used to retrieve the mapper.

For better performance, you can use the instance returned by Execution.getEvaluator to parse and cached the parsed expression. org.zkoss.zk.xel.ExValue is a utility class to simply the task.
Parameters:
  page - used as the self variable and to retrieve the functionmapper. Ignored if null.
See Also:   Execution.getVariableResolver
See Also:   Execution.getEvaluator




forward
public void forward(Writer writer, String page, Map params, int mode) throws IOException(Code)
Forwards to another page.

Note: this method can be called only when loading a page. Use Execution.sendRedirect(String) instead if you want to change to another desktop when processing a request from the client.
Parameters:
  writer - the output to write. If null, the response's defaultwriter is used.
Parameters:
  page - the page's uri; null to denote the same request
Parameters:
  mode - one of Execution.OVERWRITE_URI, Execution.IGNORE_PARAM,Execution.APPEND_PARAM and Execution.PASS_THRU_ATTR.It defines how to handle if both uri and params containsthe same parameter.mode is used only if both uri contains query string and params isnot empty.




forward
public void forward(String page) throws IOException(Code)
A shortcut of forward(null, page, null, 0).



getArg
public Map getArg()(Code)
Returns the parameters (aka., arg) if Execution.pushArg is called recently, or an empty map if not available.

The use of parameters is application dependent. ZK only provides the way to store ( Execution.pushArg and to restore Execution.popArg . And, let the parameters being accessible in EL by referring it as the arg variable.

Currently, Execution.createComponents(String,Component,Map) and similar methods use this mechanism to let caller customize a page definition.

Notice that Execution.createComponents(String,Component,Map) pops arg after creating components, and before processing any event. In other words, it is not aviable for event listener, including onCreate. However, org.zkoss.zk.ui.event.CreateEvent.getArg preserves the map for its event listeners.




getAttribute
public Object getAttribute(String name)(Code)
Returns the value of the specified request attribute.



getAttributes
public Map getAttributes()(Code)
Returns a map of request attributes associated with this session.



getContextPath
public String getContextPath()(Code)
Returns the portion of the request URI that indicates the context of the current execution. The path starts with a "/" character but does not end with a "/" character. For servlets in the default (root) context, this method returns "".

If the client is not using HTTP to access, this method return "";
See Also:   Page.getRequestPath




getDesktop
public Desktop getDesktop()(Code)
Returns the desktop for this execution. Each execution is against exactly one desktop.



getEvaluator
public Evaluator getEvaluator(Page page, Class expfcls)(Code)
Returns the evaluator (never null). It is usually used to parse the expression into org.zkoss.xel.Expression or used with org.zkoss.zk.xel.ExValue . for performance improvement.
Parameters:
  page - the page that this evaluator is associated.If null, the current page and then the first page is assumed.
Parameters:
  expfcls - the implementation of org.zkoss.xel.ExpressionFactory,or null to use the default (org.zkoss.zk.ui.util.Configuration.getExpressionFactoryClass.
since:
   3.0.0



getEvaluator
public Evaluator getEvaluator(Component comp, Class expfcls)(Code)
Returns the evaluator of the current execution. It is a shortcut of getEvaluator(comp != null ? comp.getPage(): null)
Parameters:
  comp - the component to retrieve the page for the evaluator
Parameters:
  expfcls - the implementation of org.zkoss.xel.ExpressionFactory,or null to use the default (org.zkoss.zk.ui.util.Configuration.getExpressionFactoryClass.
since:
   3.0.0



getLocalAddr
public String getLocalAddr()(Code)
Returns the Internet Protocol (IP) address of the interface on which the request was received.



getLocalName
public String getLocalName()(Code)
Returns the host name of the Internet Protocol (IP) interface on which the request was received.

Note: it is the host name defined in the server. To retrieve the name in URL, use Execution.getServerName .
See Also:   Execution.getServerName




getLocalPort
public int getLocalPort()(Code)
Returns the Internet Protocol (IP) port number of the interface on which the request was received.
See Also:   Execution.getServerPort



getNativeRequest
public Object getNativeRequest()(Code)
Returns the native request, or null if not available.

The returned object depends on the Web container. If it is based Java servlet container, an instance of javax.servlet.ServletRequest is returned.




getNativeResponse
public Object getNativeResponse()(Code)
Returns the native response, or null if not available.

The returned object depends on the Web container. If it is based Java servlet container, an instance of javax.servlet.ServletResponse is returned.




getPageDefinition
public PageDefinition getPageDefinition(String uri)(Code)
Returns the page definition from the page file specified by an URI.

Implemetation Notes: this method must invoke org.zkoss.zk.ui.sys.UiFactory.getPageDefinition(org.zkoss.zk.ui.sys.RequestInfoString)
Parameters:
  uri - the URI of the page file.
See Also:   Execution.getPageDefinitionDirectly(String,String)
See Also:   Execution.getPageDefinitionDirectly(Document,String)
See Also:   Execution.getPageDefinitionDirectly(Reader,String)




getPageDefinitionDirectly
public PageDefinition getPageDefinitionDirectly(String content, String extension)(Code)
Converts the specified page content to a page definition.

Implemetation Notes: this method must invoke org.zkoss.zk.ui.sys.UiFactory.getPageDefinitionDirectly(org.zkoss.zk.ui.sys.RequestInfoStringString)
Parameters:
  content - the raw content of the page. It must be in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
See Also:   Execution.getPageDefinitionDirectly(Document,String)
See Also:   Execution.getPageDefinitionDirectly(Reader,String)
See Also:   Execution.getPageDefinition




getPageDefinitionDirectly
public PageDefinition getPageDefinitionDirectly(Document content, String extension)(Code)
Converts the specified page content, in DOM, to a page definition.
Parameters:
  content - the raw content of the page in DOM.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
See Also:   Execution.getPageDefinitionDirectly(String,String)
See Also:   Execution.getPageDefinitionDirectly(Reader,String)
See Also:   Execution.getPageDefinition



getPageDefinitionDirectly
public PageDefinition getPageDefinitionDirectly(Reader reader, String extension) throws IOException(Code)
Reads the raw content from a reader and converts it into a page definition.
Parameters:
  reader - used to input the raw content of the page. It must be in ZUML.
Parameters:
  extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed.
See Also:   Execution.getPageDefinitionDirectly(String,String)
See Also:   Execution.getPageDefinitionDirectly(Document,String)
See Also:   Execution.getPageDefinition



getParameter
public String getParameter(String name)(Code)
Returns the value of a request parameter as a String, or null if the parameter does not exist



getParameterMap
public Map getParameterMap()(Code)
Returns a Map of the parameters of this request. Request parameters are extra information sent with the request.



getParameterValues
public String[] getParameterValues(String name)(Code)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.



getRemoteAddr
public String getRemoteAddr()(Code)
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.



getRemoteHost
public String getRemoteHost()(Code)
Returns the fully qualified name of the client or the last proxy that sent the request. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address.



getRemoteName
public String getRemoteName()(Code)
Execution.getRemoteHost



getRemoteUser
public String getRemoteUser()(Code)
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication.



getServerName
public String getServerName()(Code)
Returns the host name of the server to which the request was sent. It is the value of the part before ":" in the Host header value, if any, or the resolved server name, or the server IP address.
See Also:   Execution.getLocalName



getServerPort
public int getServerPort()(Code)
Returns the port number to which the request was sent. It is the value of the part after ":" in the Host header value, if any, or the server port where the client connection was accepted on.
See Also:   Execution.getLocalPort



getUserAgent
public String getUserAgent()(Code)
Returns the user-agent header, which indicates what the client is, or an empty string if not available.

Note: it doesn't return null, so it is easy to test what the client is with String.indexOf .
since:
   3.0.2




getUserPrincipal
public Principal getUserPrincipal()(Code)
Returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null.



getVariableResolver
public VariableResolver getVariableResolver()(Code)
Returns the variable resolver for this execution, or null if not available.

Note: the resolver is similar to PageContext's if this execution is caused by a HTTP request.
See Also:   Execution.evaluate(Component,String,Class)




include
public void include(Writer writer, String page, Map params, int mode) throws IOException(Code)
Includes a page.
Parameters:
  writer - the output to write. If null, the response's defaultwriter is used.
Parameters:
  page - the page's uri; null to denote the same request
Parameters:
  mode - one of Execution.OVERWRITE_URI, Execution.IGNORE_PARAM,Execution.APPEND_PARAM and Execution.PASS_THRU_ATTR.It defines how to handle if both uri and params containsthe same parameter.mode is used only if both uri contains query string and params isnot empty.



include
public void include(String page) throws IOException(Code)
A shortcut of include(null, page, null, 0).



isAsyncUpdate
public boolean isAsyncUpdate(Page page)(Code)
Returns whether this execution is asynchronous updating the specified page (thru ZK Update Engine). whether the specified page is being asynchronous updatedby this execution.If the specified page is null, this method returnswhether this execution is asynchronous updating a page(rather than creating/loading a new page).Each execution remembers the page being creating.All other pages are consided as being asynchronous updated.



isBrowser
public boolean isBrowser()(Code)
Returns whether the client is a browser.



isExplorer
public boolean isExplorer()(Code)
Returns whether the client is Internet Explorer. If true, it also implies Execution.isExplorer7 is true.



isExplorer7
public boolean isExplorer7()(Code)
Returns whether the client is Internet Explorer 7 or later.



isForwarded
public boolean isForwarded()(Code)
Returns whether the execution is forwarded from other pages.
since:
   2.4.0



isGecko
public boolean isGecko()(Code)
Returns whether the client is Gecko based, such as Mozilla, Firefox and Camino.



isHilDevice
public boolean isHilDevice()(Code)
Returns whether the client is a mobile device supporting HIL (Handset Interactive Language).

Note: ZK Mobile for Android supports both MIL and HIL. That is, both Execution.isHilDevice and Execution.isMilDevice return true.
since:
   3.0.2




isIncluded
public boolean isIncluded()(Code)
Returns whether this execution is included by some other pages.



isMilDevice
public boolean isMilDevice()(Code)
Returns whether the client is a mobile device supporting MIL (Mobile Interactive Language).
since:
   2.4.1



isRobot
public boolean isRobot()(Code)
Returns whether the client is a robot (such as Web crawlers).

Because there are too many robots, it returns true if the user-agent is not recognized.




isSafari
public boolean isSafari()(Code)
Returns whether the client is Safari.



isUserInRole
public boolean isUserInRole(String role)(Code)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returns false.
Parameters:
  role - a String specifying the name of the role



isVoided
public boolean isVoided()(Code)
Returns whether the execution is voided. By void we mean the request is taken charged by other servlet. The execution shall not do anything more. In other words, the execution is avoided and won't generate any ouput.

The common cause of being voided is the invocation of Execution.forward .
since:
   2.4.0




popArg
public void popArg()(Code)
Pops the parameters (aka., arg) that is pushed by Execution.pushArg .

It never throws an exception.
See Also:   Execution.getArg




postEvent
public void postEvent(Event evt)(Code)
Queues an event to the current execution. The event is placed at the end of the event queue. It will be processed after all other events are processed.



pushArg
public void pushArg(Map arg)(Code)
Pushes the parameters (aka., arg) that EL could refer it by the arg variable. Remember to call Execution.popArg in the finally clause.
See Also:   Execution.getArg



removeAttribute
public void removeAttribute(String name)(Code)
Removes the specified request attribute.



sendRedirect
public void sendRedirect(String uri)(Code)
Sends a temporary redirect response to the client using the specified redirect location URL.

It is the same as sendRedirect(url, null).

After calling this method, the caller shall end the processing immediately (by returning). All pending requests and events will be dropped.
Parameters:
  uri - the URI to redirect to, or null to reload the same page




sendRedirect
public void sendRedirect(String uri, String target)(Code)
Sends a temporary redirect response to the client using the specified redirect location URL and redirect to the specified browser window.

After calling this method, the caller shall end the processing immediately (by returning). All pending requests and events will be dropped.

Note: if you specify target other than null and "_self", it'll fail if the browser prevent the server to popup a window.
Parameters:
  uri - the URI to redirect to, or null to reload the same page
Parameters:
  target - the name of the browser window that send-redirect willload the sepcified URI, or null if the current browser windowis used.




setAttribute
public void setAttribute(String name, Object value)(Code)
Sets the value of the specified request attribute.
Parameters:
  value - the value. If null, the attribute is removed.



setVoided
public void setVoided(boolean voided)(Code)
Sets whether the execution is voided. By void we mean the request is taken charged by other servlet.

If you invoke Execution.forward , this method is called automatically with true. Thus, you rarely need to invoke this method, unless you forward to other servlet by use javax.servlet.RequestDispatcher directly.
since:
   2.4.1




toAbsoluteURI
public String toAbsoluteURI(String uri, boolean skipInclude)(Code)
Converts the specified URI to an absolute URI, if uri is related and the current execution is not included ( Execution.isIncluded ).

Note: an asynchrous update is processed by the update servlet. It is different from the servlet for rendering the ZUML page. In other words, a relative URI won't be interpreted correctly, so you have to invoke this method to convert them if necessary.

In addtions, RequestDispatcher.include doesn't handle related URI well.
Parameters:
  skipInclude - whether not to convert to an absolute URI ifthe current page is included by another page.If you are not sure, you might specify false.




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.