|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.EventObject | +--com.sssw.srv.busobj.AgoBusinessObjectEvent | +--com.sssw.srv.busobj.AgoInvokedEvent
This is the event object passed into an invoked event of an InvokedListener business object.
AgiInvokedListener
, Serialized FormFields inherited from class java.util.EventObject |
source |
Constructor Summary | |
AgoInvokedEvent()
|
Method Summary | |
static Hashtable |
decodeURLEncodedForm(String s)
Parses a string which is encoded using application/x-www-form-urlencoded into a Hashtable of query terms. |
Serializable |
getParameter()
Return the parameter sent to the InvokedListener. |
void |
setResult(Serializable result)
Sets the return value of this invoked event. |
void |
setResult(Serializable result,
String mime)
Sets the return value of this invoked event. |
void |
setResultMimeType(String mime)
Assigns the MIME type of the return value of an InvokedAgent. |
Methods inherited from class com.sssw.srv.busobj.AgoBusinessObjectEvent |
getAgaData,
getDatabase,
getDatabaseURL,
getServer,
getSession,
getUser,
runAgData,
updateTransactionally,
userInGroup |
Methods inherited from class java.util.EventObject |
getSource,
toString |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public AgoInvokedEvent()
Method Detail |
public Serializable getParameter()
The invoker of the business object can pass in a parameter to the event.
E.g. a form calling agGeneral.invokeBusinessObject()
can
pass in a string parameter. The business object can get access to that
parameter via this method:
String param = (String)evt.getParameter();
public void setResult(Serializable result, String mime) throws AgoInvalidDataException
invokeAgent()
or invokeBusinessObject()
then
this sets what those methods will return.result
- the value to return to the caller of the invoked
business object. It must be Serializable since the caller could be on a
client machine.mime
- the MIME-Type of the return value. When business object returns a
String of HTML that the browser should display as HTML (if, for example,this object
is run via an HTML form's submit button) then the mime would be set to
("text/hmtl"). This must be a syntactically valid MIME type (type/subtype) or
AgoInvalidDataException is thrown.AgoInvalidDataException
public void setResult(Serializable result)
invokeAgent()
or invokeBusinessObject()
then
this method sets what those methods will return.result
- the value to return to the caller of the invoked
business object. It must be Serializable since the caller could be on a
client machine.
In version Silverstrem 1.X the result
parameter was defined as Object
but really needed to be some object that implemented
Serializable
. It has been changed to be explicitly
Serializable
. If 1.X code no longer compiles, it might
need to cast the parameter to Serializable.
public void setResultMimeType(String mime) throws AgoInvalidDataException
mime
- specifies the MIME type. This can be any valid MIME
Type. This must be a syntactically valid MIME type (type/subtype) or
AgoInvalidDataException is thrown.If the object returns a serialized java object this method does not need to be used. However, if the invoked object returns anything else, the MIME Type should correctly describe it.
For example, if the agent returns a String of HTML, intending that the browser display it as HTML (for example, if this agent is run via an HTML form's submit button) then setResultMIMEType("text/hmtl") should be called.
AgoInvalidDataException
,
AgoInvokedEvent.setResult( Serializable result )
public static Hashtable decodeURLEncodedForm(String s)
s
- the parameter to decode.
This routine could be used if the invoker of this business object were an
HTML form designed by hand and had the form POST directly to
the business object. In that case, all the fields in the form are
packaged up by the browser and URL encoded. Then getParameter()
would
be called to get arguments from the body of the POST
request as a string and then call this routine to parse those arguments.
This example gets the value of the Country parameter passed in from an HTML form. The parameter could have been set by the user via an HTML choice box (i.e., <SELECT> and <OPTION> tags).
String param = (String)evt.getParameter(); Hashtable params = decodeURLEncodedForm(param); String country = params.get("Country");
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |