public MarkupResponse getMarkup(MarkupRequest markupRequest,
String userID)
throws WSRPException {
checkInitCookie(userID);
MarkupResponse response = null;
try {
MarkupContext markupContext = null;
if ((markupContext = markupRequest.getCachedMarkup()) == null) {
// getMarkup request
GetMarkup request = new GetMarkup();
request.setPortletContext(getPortlet().getPortletContext());
request.setMarkupParams(getMarkupParams(markupRequest));
request.setRuntimeContext(getRuntimeContext(markupRequest));
RegistrationContext regCtx = producer.getRegistrationContext();
if (regCtx != null)
request.setRegistrationContext(regCtx);
UserContext userCtx = getUserContext(userID);
if (userCtx != null) {
request.setUserContext(getUserContext(userID));
}
response = markupPort.getMarkup(request);
parameterChecker.check(response);
} else {
response = new MarkupResponse();
response.setMarkupContext(markupContext);
}
Boolean requiresRewriting = response.getMarkupContext().getRequiresUrlRewriting();
requiresRewriting = requiresRewriting == null ? Boolean.FALSE : requiresRewriting;
if (requiresRewriting.booleanValue()) {
// rewrite url's
URLRewriter urlRewriter = consumerEnv.getURLRewriter();
String rewrittenMarkup = urlRewriter.rewriteURLs(response.getMarkupContext().getMarkupString());
if (rewrittenMarkup != null) {
response.getMarkupContext().setMarkupString(rewrittenMarkup);
}
}
} catch (InvalidCookieFault cookieFault) {