Search in sources :

Example 1 with QueryStringHttpServletRequestWrapper

use of com.pogeyan.cmis.browser.shared.QueryStringHttpServletRequestWrapper in project copper-cms by PogeyanOSS.

the class AkkaCmisBrowserBindingServlet method gettingBaseMessage.

private BaseMessage gettingBaseMessage(String method, String[] pathFragments, IUserObject loginSession, HttpServletRequest request, HttpServletResponse response) {
    BaseMessage bm = null;
    try {
        // check HTTP method
        if (METHOD_GET.equals(method)) {
            QueryStringHttpServletRequestWrapper qRequest = new QueryStringHttpServletRequestWrapper(request);
            bm = ServletHelpers.queryHttpToBaseMessage((QueryStringHttpServletRequestWrapper) qRequest, pathFragments, loginSession);
        } else if (METHOD_POST.equals(method)) {
            POSTHttpServletRequestWrapper pRequest = new POSTHttpServletRequestWrapper(request);
            bm = ServletHelpers.postToBaseMessage((POSTHttpServletRequestWrapper) pRequest, pathFragments, loginSession);
        } else {
            throw new CmisNotSupportedException("Unsupported method");
        }
    } catch (Exception e1) {
        LOG.error("Service execution exception: {}, stack: {}", e1.getMessage(), ExceptionUtils.getStackTrace(e1));
        ServletHelpers.printError(e1, request, response);
    }
    return bm;
}
Also used : CmisNotSupportedException(org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException) QueryStringHttpServletRequestWrapper(com.pogeyan.cmis.browser.shared.QueryStringHttpServletRequestWrapper) BaseMessage(com.pogeyan.cmis.api.BaseMessage) POSTHttpServletRequestWrapper(com.pogeyan.cmis.browser.shared.POSTHttpServletRequestWrapper) ServletException(javax.servlet.ServletException) CmisPermissionDeniedException(org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException) CmisUnauthorizedException(org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException) CmisNotSupportedException(org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException) IOException(java.io.IOException) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Aggregations

BaseMessage (com.pogeyan.cmis.api.BaseMessage)1 POSTHttpServletRequestWrapper (com.pogeyan.cmis.browser.shared.POSTHttpServletRequestWrapper)1 QueryStringHttpServletRequestWrapper (com.pogeyan.cmis.browser.shared.QueryStringHttpServletRequestWrapper)1 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 ServletException (javax.servlet.ServletException)1 CmisNotSupportedException (org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException)1 CmisPermissionDeniedException (org.apache.chemistry.opencmis.commons.exceptions.CmisPermissionDeniedException)1 CmisUnauthorizedException (org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException)1