org.apache.chemistry.opencmis.server.impl.browser
Class BrowserBindingUtils

java.lang.Object
  extended by org.apache.chemistry.opencmis.server.impl.browser.BrowserBindingUtils

public class BrowserBindingUtils
extends Object


Nested Class Summary
static class BrowserBindingUtils.CallUrl
           
 
Field Summary
static String CONTEXT_BASETYPE_ID
           
static String CONTEXT_OBJECT_ID
           
static String CONTEXT_OBJECT_TYPE_ID
           
static String CONTEXT_TRANSACTION
           
static String HTML_MIME_TYPE
           
static String JSON_MIME_TYPE
           
static String ROOT_PATH_FRAGMENT
           
 
Method Summary
static org.apache.chemistry.opencmis.commons.impl.UrlBuilder compileBaseUrl(javax.servlet.http.HttpServletRequest request)
          Compiles the base URL for links, collections and templates.
static org.apache.chemistry.opencmis.commons.impl.UrlBuilder compileRepositoryUrl(javax.servlet.http.HttpServletRequest request, String repositoryId)
           
static org.apache.chemistry.opencmis.commons.impl.UrlBuilder compileRootUrl(javax.servlet.http.HttpServletRequest request, String repositoryId)
           
static org.apache.chemistry.opencmis.commons.data.Acl createAddAcl(ControlParser controlParser)
           
static org.apache.chemistry.opencmis.commons.data.ContentStream createContentStream(javax.servlet.http.HttpServletRequest request)
           
static String createCookieValue(int code, String objectId, String ex, String message)
           
static List<String> createPolicies(ControlParser controlParser)
           
static org.apache.chemistry.opencmis.commons.data.Properties createProperties(ControlParser controlParser, String typeId, org.apache.chemistry.opencmis.commons.impl.TypeCache typeCache)
           
static org.apache.chemistry.opencmis.commons.data.Acl createRemoveAcl(ControlParser controlParser)
           
static void deleteCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String repositoryId, String transaction)
          Deletes a transaction cookie.
static String getCookieName(String transaction)
          Transforms the transaction into a cookie name.
static String getPath(javax.servlet.http.HttpServletRequest request)
          Returns the current CMIS path.
static
<T> T
getProperty(org.apache.chemistry.opencmis.commons.data.ObjectData object, String name, Class<T> clazz)
          Extracts a property from an object.
protected static org.apache.chemistry.opencmis.commons.data.ObjectData getSimpleObject(org.apache.chemistry.opencmis.commons.server.CmisService service, String repositoryId, String objectId)
           
static void prepareContext(org.apache.chemistry.opencmis.commons.server.CallContext context, BrowserBindingUtils.CallUrl callUrl, org.apache.chemistry.opencmis.commons.server.CmisService service, String repositoryId, String objectId, String transaction, javax.servlet.http.HttpServletRequest request)
          Returns the object id of the current request.
static void setCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String repositoryId, String transaction, String value)
          Sets a transaction cookie.
static void setCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String repositoryId, String transaction, String value, int expiry)
          Sets a transaction cookie.
static void setStatus(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, int statusCode)
          Sets the given HTTP status code if the surpessResponseCodes parameter is not set to true; otherwise sets HTTP status code 200 (OK).
static void writeEmpty(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
static void writeJSON(org.apache.chemistry.opencmis.commons.impl.json.JSONStreamAware json, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Writes JSON to the servlet response and adds a callback wrapper if requested.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JSON_MIME_TYPE

public static final String JSON_MIME_TYPE
See Also:
Constant Field Values

HTML_MIME_TYPE

public static final String HTML_MIME_TYPE
See Also:
Constant Field Values

ROOT_PATH_FRAGMENT

public static final String ROOT_PATH_FRAGMENT
See Also:
Constant Field Values

CONTEXT_OBJECT_ID

public static final String CONTEXT_OBJECT_ID
See Also:
Constant Field Values

CONTEXT_OBJECT_TYPE_ID

public static final String CONTEXT_OBJECT_TYPE_ID
See Also:
Constant Field Values

CONTEXT_BASETYPE_ID

public static final String CONTEXT_BASETYPE_ID
See Also:
Constant Field Values

CONTEXT_TRANSACTION

public static final String CONTEXT_TRANSACTION
See Also:
Constant Field Values
Method Detail

compileBaseUrl

public static org.apache.chemistry.opencmis.commons.impl.UrlBuilder compileBaseUrl(javax.servlet.http.HttpServletRequest request)
Compiles the base URL for links, collections and templates.


compileRepositoryUrl

public static org.apache.chemistry.opencmis.commons.impl.UrlBuilder compileRepositoryUrl(javax.servlet.http.HttpServletRequest request,
                                                                                         String repositoryId)

compileRootUrl

public static org.apache.chemistry.opencmis.commons.impl.UrlBuilder compileRootUrl(javax.servlet.http.HttpServletRequest request,
                                                                                   String repositoryId)

getPath

public static String getPath(javax.servlet.http.HttpServletRequest request)
Returns the current CMIS path.


prepareContext

public static void prepareContext(org.apache.chemistry.opencmis.commons.server.CallContext context,
                                  BrowserBindingUtils.CallUrl callUrl,
                                  org.apache.chemistry.opencmis.commons.server.CmisService service,
                                  String repositoryId,
                                  String objectId,
                                  String transaction,
                                  javax.servlet.http.HttpServletRequest request)
Returns the object id of the current request.


getProperty

public static <T> T getProperty(org.apache.chemistry.opencmis.commons.data.ObjectData object,
                                String name,
                                Class<T> clazz)
Extracts a property from an object.


createProperties

public static org.apache.chemistry.opencmis.commons.data.Properties createProperties(ControlParser controlParser,
                                                                                     String typeId,
                                                                                     org.apache.chemistry.opencmis.commons.impl.TypeCache typeCache)

createPolicies

public static List<String> createPolicies(ControlParser controlParser)

createAddAcl

public static org.apache.chemistry.opencmis.commons.data.Acl createAddAcl(ControlParser controlParser)

createRemoveAcl

public static org.apache.chemistry.opencmis.commons.data.Acl createRemoveAcl(ControlParser controlParser)

createContentStream

public static org.apache.chemistry.opencmis.commons.data.ContentStream createContentStream(javax.servlet.http.HttpServletRequest request)

getSimpleObject

protected static org.apache.chemistry.opencmis.commons.data.ObjectData getSimpleObject(org.apache.chemistry.opencmis.commons.server.CmisService service,
                                                                                       String repositoryId,
                                                                                       String objectId)

setStatus

public static void setStatus(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             int statusCode)
Sets the given HTTP status code if the surpessResponseCodes parameter is not set to true; otherwise sets HTTP status code 200 (OK).


getCookieName

public static String getCookieName(String transaction)
Transforms the transaction into a cookie name.


setCookie

public static void setCookie(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             String repositoryId,
                             String transaction,
                             String value)
Sets a transaction cookie.


deleteCookie

public static void deleteCookie(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                String repositoryId,
                                String transaction)
Deletes a transaction cookie.


setCookie

public static void setCookie(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             String repositoryId,
                             String transaction,
                             String value,
                             int expiry)
Sets a transaction cookie.


createCookieValue

public static String createCookieValue(int code,
                                       String objectId,
                                       String ex,
                                       String message)

writeJSON

public static void writeJSON(org.apache.chemistry.opencmis.commons.impl.json.JSONStreamAware json,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws IOException
Writes JSON to the servlet response and adds a callback wrapper if requested.

Throws:
IOException

writeEmpty

public static void writeEmpty(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws IOException
Throws:
IOException


Copyright © 2014 Mairie de Paris. All Rights Reserved.