|
| Re: Fedrated Portel(wsrp)-----> page render of another jpf / url |
 |
Tue, 13 May 2008 01:31:49 -070 |
hi ,
Actually its a case of url rewriting from consumer to producer .
shared or nested page flow nothing to do with this problem .
actually when we are on one jpf we are tring to write url for another jpf
's action so that we can render page from that page flow . but that jpf is on
producer side and we are on consumer side so we need to write URL again .
i m sending you little code , so u can take a glimpse to better understand
problem .
here we are trying to write url for some other jpf by this code but we
are not able to do this .
public static String createPageURL(HttpServletRequest request,
HttpServletResponse response,
String pageDefinitionLabel, String
portletInstanceLabel, String action,
boolean loadState, Map parameters){
if(request==null || response==null){
return null;
}
if(!(pageDefinitionLabel!=null &&
pageDefinitionLabel.trim().length()>0)){
return null;
}
ResourceURL resourceURL = ResourceURL.createResourceURL(request,
response);
//resourceURL = checkIfValidURL(resourceURL, request, response);
resourceURL.removeParameter(ResourceURL.LOADSTATE_PARAM);
resourceURL.removeParameter(ResourceURL.WINDOW_LABEL_PARAM);
resourceURL.removeParameter(ResourceURL.PAGE_LABEL_PARAM);
if(resourceURL.getParameter(ResourceURL.POSTBACK_PARAM)==null){
resourceURL.addParameter(ResourceURL.POSTBACK_PARAM,
"true");
}
if(portletInstanceLabel!=null &&
portletInstanceLabel.trim().length()>0){
//resourceURL.setWindowLabel(portletInstanceLabel);
resourceURL.addParameter(ResourceURL.WINDOW_LABEL_PARAM,
portletInstanceLabel);
} else {
portletInstanceLabel = "";
}
if(loadState){
resourceURL.addParameter(ResourceURL.LOADSTATE_PARAM,
"false");
}
if(action!=null && action.trim().length()>0){
resourceURL.addParameter(portletInstanceLabel+"_actionOverride",
action, true);
}
if(parameters!=null && parameters.size()>0){
Iterator itr = parameters.keySet().iterator();
while(itr.hasNext()){
String name = (String)itr.next();
String value = (String)parameters.get(name);
resourceURL.addParameter(portletInstanceLabel+name, value, true);
}
}
resourceURL.addParameter(ResourceURL.PAGE_LABEL_PARAM,
pageDefinitionLabel);
return resourceURL.toString();
}
|
| Post Reply
|
|
|
|
|
|
|
|
|
|