org.zkoss.zk.au
Class AuRequest

java.lang.Object
  extended by org.zkoss.zk.au.AuRequest

public class AuRequest
extends java.lang.Object

A request sent from the client to UiEngine.

Notice that activate() must be called in the activated execution. Before calling this method, getPage(), getComponent() and getCommand() cannot be called.

Author:
tomyeh

Constructor Summary
AuRequest(Desktop desktop, Command cmd, java.lang.String[] data)
          Constructor for a general request sent from client.
AuRequest(Desktop desktop, java.lang.String uuid, Command cmd, java.lang.String[] data)
          Constructor for a request sent from a component.
AuRequest(Desktop desktop, java.lang.String uuid, java.lang.String cmdId, java.lang.String[] data)
          Constructor for a request sent from a component.
 
Method Summary
 void activate()
          Activates this request.
 boolean equals(java.lang.Object o)
           
 Command getCommand()
          Returns the command; never null.
static Command getCommand(java.lang.String name)
          Returns the command of the specified name.
 Component getComponent()
          Returns the component that this request is applied for, or null if it applies to the whole page or a general request.
 java.lang.String getComponentUuid()
          Deprecated. As of release 3.0.5, use getComponent() instead.
 java.lang.String[] getData()
          Returns the data of the command, might be null.
 Desktop getDesktop()
          Returns the desktop; never null.
 Page getPage()
          Returns the page that this request is applied for, or null if this reqeuest is a general request -- regardless any page or component.
static boolean hasRequest(java.lang.String cmdnm)
          Returns whether the specified request name is valid.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AuRequest

public AuRequest(Desktop desktop,
                 java.lang.String uuid,
                 java.lang.String cmdId,
                 java.lang.String[] data)
Constructor for a request sent from a component.

Parameters:
desktop - the desktop containing the component; never null.
uuid - the component ID (never null)
cmdId - the command ID; never null.
data - the data; might be null.
Since:
3.0.5

AuRequest

public AuRequest(Desktop desktop,
                 java.lang.String uuid,
                 Command cmd,
                 java.lang.String[] data)
Constructor for a request sent from a component.

Parameters:
desktop - the desktop containing the component; never null.
uuid - the component ID (never null)
cmd - the command; never null.
data - the data; might be null.

AuRequest

public AuRequest(Desktop desktop,
                 Command cmd,
                 java.lang.String[] data)
Constructor for a general request sent from client. This is usully used to ask server to log or report status.

Parameters:
cmd - the command; never null.
data - the data; might be null.
Method Detail

hasRequest

public static final boolean hasRequest(java.lang.String cmdnm)
Returns whether the specified request name is valid. A request is a event that are sent from the browser.

An request name is the ID of a command (Command.getId()) which starts with "on".


getCommand

public static final Command getCommand(java.lang.String name)
Returns the command of the specified name. It looks for the global commands only. For component-specific commands, use ComponentCtrl.getCommand(java.lang.String).

Throws:
CommandNotFoundException - if the command is not found

activate

public void activate()
              throws ComponentNotFoundException,
                     CommandNotFoundException
Activates this request.

It can be accessed only in the activated execution. Before calling this method, getPage(), getComponent() and getCommand(java.lang.String) cannot be called.

Throws:
ComponentNotFoundException
CommandNotFoundException
Since:
3.0.5

getDesktop

public Desktop getDesktop()
Returns the desktop; never null.


getPage

public Page getPage()
Returns the page that this request is applied for, or null if this reqeuest is a general request -- regardless any page or component.


getComponent

public Component getComponent()
Returns the component that this request is applied for, or null if it applies to the whole page or a general request.

Throws:
ComponentNotFoundException - if the component is not found

getComponentUuid

public java.lang.String getComponentUuid()
Deprecated. As of release 3.0.5, use getComponent() instead.


getCommand

public Command getCommand()
Returns the command; never null.


getData

public java.lang.String[] getData()
Returns the data of the command, might be null.


equals

public final boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo