Navigation API – EPCM.doNavigate usage for GET and POST
[API] [epc epcm] [EPCM] [EPCM.doNavigate] [GET] [laurel navigation] [navigation] [navigation builder] [POST] [postBody]
Symptom
This is a guide how to use Navigation API EPCM.doNavigate to control the request method for requests to launch applications that are referred from the Portal Content Area.
The EPCM.doNavigate method is defined with the following arguments:
function(target, mode, winfeatures, winname, history,targetTitle, context,postBody)
We will focus on the postBody argument and will see how we can use this argument to control the request method for launching application from the content area.
When performing any navigation in the portal, EPCM.doNavigate is triggered and it sends a request to the Portal Content Area with the Navigation Target which presents the content (iView\Page\Workset) we would like to launch.
When the content area builds the request to this target it checks whether we have any parameters that we want to forward to the application – here comes the role of the postBody argument.
If there are no parameters (means that postBody is null or undefined) the request method of the request reffered from the content area will be GET, but if there are parameters the request will be POST.
Assume that we want to force a POST request we must send parameters in the postBody argument – this argument accepts a list of javascript objects that each object contains name and value pairs.
We can use this mechanism to force POST request in case we don’t have any parameter to forward to the target application by just simply adding a fictive parameter e.g. method=POST. Here is a short example:
var parameters = [{name: 'method', value: 'POST'}];
function(target, mode, winfeatures, winname, history,targetTitle, context,parameters); //here I sent the variable parameters as the postBody – when the content area recognizes this parameters it will launch a POST request to the target content and forward this fictive parameter which will not be used.
Other terms
Navigation API, EPCM, EPCM.doNavigate, postBody, POST, GET
Reason and Prerequisites
You want to use the Navigation API to launch a target application and force POST request
Solution
Use this guide to learn about Navigation API and force POST request for launching target application from the content area.
For more information, please refer to:
http://help.sap.com/saphelp_nw70/helpdata/en/26/71c74030308431e10000000a1550b0/frameset.htm