|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.engine.ExternalService
public class ExternalService
The external service enables external applications to reference Tapestry pages via a URL. Pages
which can be referenced by the external service must implement the IExternalPage
interface. The external service enables the bookmarking of pages.
The external service may also be used by the Tapestry JSP taglibrary (
org.apache.tapestry.jsp.ExternalURLTag
and org.apache.tapestry.jsp.ExternalTag
).
You can try and second guess the URL format used by Tapestry. The default URL format for the external service is:
http://localhost/app?service=external/[Page Name]&sp=[Param 0]&sp=[Param 1]...For example to view the "ViewCustomer" page the service parameters 5056 (customer ID) and 309 (company ID) the external service URL would be:
http://localhost/myapp?service=external&context=ViewCustomer&sp=5056&sp=302In this example external service will get a "ViewCustomer" page and invoke the
IExternalPage.activateExternalPage(Object[], IRequestCycle)
method with the parameters:
Object[] { new Integer(5056), new Integer(302) }.
Note service parameters (sp) need to be prefixed by valid
DataSqueezerImpl
adaptor char. These adaptor chars are
automatically provided in URL's created by the buildGesture() method. However if you
hand coded an external service URL you will need to ensure valid prefix chars are present.
Prefix char(s) | Mapped Java Type | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
TF | boolean | |||||||||
b | byte | |||||||||
c | char | |||||||||
d | double | |||||||||
-0123456789 | integer | |||||||||
l | long | |||||||||
S | String | |||||||||
s | short | |||||||||
other chars | String without truncation of first char |
Constructor Summary | |
---|---|
ExternalService()
|
Method Summary | |
---|---|
ILink |
getLink(boolean post,
java.lang.Object parameter)
Builds a URL for a service. |
java.lang.String |
getName()
Returns the name of the service. |
void |
service(IRequestCycle cycle)
Perform the service, interpreting the URL (from the HttpServletRequest ) responding appropriately, and rendering a
result page. |
void |
setLinkFactory(LinkFactory linkFactory)
|
void |
setResponseRenderer(ResponseRenderer responseRenderer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExternalService()
Method Detail |
---|
public ILink getLink(boolean post, java.lang.Object parameter)
This method changed incompatibly between release 3.0 and release 4.0.
getLink
in interface IEngineService
post
- if true, then the link will be used for a post (not a get, i.e., for a HTML form);
this may affect what information is encoded into the linkparameter
- An object that provide any additional information needed by the service. Each
service implementation will expect that an object of the proper type be passed in.
In some cases, a simple String will do; in others, a specific object (possibly
implementing an interface) will be required.
public void service(IRequestCycle cycle) throws java.io.IOException
IEngineService
HttpServletRequest
) responding appropriately, and rendering a
result page.
service
in interface IEngineService
cycle
- the incoming request
java.io.IOException
org.apache.tapestry.IEngine#service(org.apache.tapestry.request.RequestContext)
public java.lang.String getName()
IEngineService
getName
in interface IEngineService
public void setResponseRenderer(ResponseRenderer responseRenderer)
public void setLinkFactory(LinkFactory linkFactory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |