use of javax.portlet.MimeResponse in project core by wicketstuff.
the class PortletRequestMapper method encodeActionUrl.
private Url encodeActionUrl(Url url, boolean forceActionUrl) {
if ((!forceActionUrl) && (ThreadPortletContext.isResourceRequest())) {
return encodeResourceUrl(url);
}
if (url != null) {
String qualifiedPath = getQualifiedPath(url.toString());
PortletResponse portletResponse = ThreadPortletContext.getPortletResponse();
if ((portletResponse != null) && (portletResponse instanceof MimeResponse)) {
try {
ActionURL portletUrl = ((MimeResponse) portletResponse).createActionURL();
portletUrl.getActionParameters().setValue(WicketPortlet.WICKET_URL_PORTLET_PARAMETER, qualifiedPath);
qualifiedPath = portletUrl.toString();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
url = parseUrl(qualifiedPath);
}
return markAsPortletUrl(url);
}
use of javax.portlet.MimeResponse in project liferay-faces-bridge-impl by liferay.
the class ExternalContextImpl method getResponseCharacterEncoding.
@Override
public String getResponseCharacterEncoding() {
if (portletResponse instanceof MimeResponse) {
MimeResponse mimeResponse = (MimeResponse) portletResponse;
String characterEncoding = mimeResponse.getCharacterEncoding();
if (manageIncongruities) {
incongruityContext.setResponseCharacterEncoding(characterEncoding);
}
return characterEncoding;
} else {
if (manageIncongruities) {
return incongruityContext.getResponseCharacterEncoding();
} else {
if (portletResponse instanceof StateAwareResponse) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
String characterEncoding = (String) externalContext.getRequestMap().get(BridgeExt.RESPONSE_CHARACTER_ENCODING);
if (characterEncoding != null) {
// Workaround for patch applied to Mojarra in JAVASERVERFACES-3023
return characterEncoding;
} else {
// TCK: getResponseCharacterEncodingEventTest
throw new IllegalStateException();
}
} else {
return null;
}
}
}
}
use of javax.portlet.MimeResponse in project liferay-faces-bridge-impl by liferay.
the class ExternalContextCompat_2_0_Impl method getResponseBufferSize.
/**
* @see ExternalContext#getResponseBufferSize()
* @since JSF 2.0
*/
@Override
public int getResponseBufferSize() {
if (portletResponse instanceof MimeResponse) {
MimeResponse mimeResponse = (MimeResponse) portletResponse;
int responseBufferSize = mimeResponse.getBufferSize();
if (manageIncongruities) {
incongruityContext.setResponseBufferSize(responseBufferSize);
}
return responseBufferSize;
} else {
if (manageIncongruities) {
return incongruityContext.getResponseBufferSize();
} else {
throw new IllegalStateException();
}
}
}
use of javax.portlet.MimeResponse in project liferay-faces-bridge-impl by liferay.
the class ExternalContextCompat_2_0_Impl method responseReset.
/**
* @see ExternalContext#responseReset()
* @since JSF 2.0
*/
@Override
public void responseReset() {
if (portletResponse instanceof MimeResponse) {
MimeResponse mimeResponse = (MimeResponse) portletResponse;
mimeResponse.reset();
} else {
if (manageIncongruities) {
incongruityContext.responseReset();
} else {
throw new IllegalStateException();
}
}
}
use of javax.portlet.MimeResponse in project liferay-faces-bridge-impl by liferay.
the class ExternalContextCompat_2_0_Impl method isResponseCommitted.
/**
* @see ExternalContext#isResponseCommitted()
* @since JSF 2.0
*/
@Override
public boolean isResponseCommitted() {
if (portletResponse instanceof MimeResponse) {
MimeResponse mimeResponse = (MimeResponse) portletResponse;
boolean responseCommitted = mimeResponse.isCommitted();
if (manageIncongruities) {
incongruityContext.setResponseCommitted(responseCommitted);
}
return responseCommitted;
} else {
if (manageIncongruities) {
return incongruityContext.isResponseCommitted();
} else {
throw new IllegalStateException();
}
}
}
Aggregations