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 CMISACTION_CREATEDOCUMENT
           
static String CMISACTION_CREATEFOLDER
           
static String CMISACTION_QUERY
           
static String CONTEXT_BASETYPE_ID
           
static String CONTEXT_OBJECT_ID
           
static String CONTEXT_OBJECT_TYPE_ID
           
static String CONTEXT_TRANSACTION
           
static String CONTROL_ADD_ACE_PERMISSION
           
static String CONTROL_ADD_ACE_PRINCIPAL
           
static String CONTROL_CMISACTION
           
static String CONTROL_CONTENT_TYPE
           
static String CONTROL_FILENAME
           
static String CONTROL_OBJECT_ID
           
static String CONTROL_POLICY
           
static String CONTROL_PROP_ID
           
static String CONTROL_PROP_VALUE
           
static String CONTROL_REMOVE_ACE_PERMISSION
           
static String CONTROL_REMOVE_ACE_PRINCIPAL
           
static String CONTROL_TRANSACTION
           
static String JSON_MIME_TYPE
           
static String PARAM_CLIENTTOKEN
           
static String PARAM_SELECTOR
           
static String PARAM_TRANSACTION
           
static String ROOT_PATH_FRAGMENT
           
static String SELECTOR_CHILDREN
           
static String SELECTOR_CONTENT
           
static String SELECTOR_DESCENDANTS
           
static String SELECTOR_FOLDER_TREE
           
static String SELECTOR_LAST_RESULT
           
static String SELECTOR_OBJECT
           
static String SELECTOR_PARENTS
           
static String SELECTOR_QUERY
           
static String SELECTOR_TYPE_CHILDREN
           
static String SELECTOR_TYPE_DEFINITION
           
static String SELECTOR_TYPE_DESCENDANTS
           
static String SELECTOR_VERSIONS
           
 
Method Summary
static UrlBuilder compileBaseUrl(javax.servlet.http.HttpServletRequest request)
          Compiles the base URL for links, collections and templates.
static UrlBuilder compileRepositoryUrl(javax.servlet.http.HttpServletRequest request, String repositoryId)
           
static UrlBuilder compileRootUrl(javax.servlet.http.HttpServletRequest request, String repositoryId)
           
static Acl createAddAcl(ControlParser controlParser)
           
static 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 Properties createProperties(ControlParser controlParser, String typeId, TypeCache typeCache)
           
static 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(ObjectData object, String name, Class<T> clazz)
          Extracts a property from an object.
static void prepareContext(CallContext context, BrowserBindingUtils.CallUrl callUrl, 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 writeJSON(org.json.simple.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

ROOT_PATH_FRAGMENT

public static final String ROOT_PATH_FRAGMENT
See Also:
Constant Field Values

SELECTOR_LAST_RESULT

public static final String SELECTOR_LAST_RESULT
See Also:
Constant Field Values

SELECTOR_TYPE_CHILDREN

public static final String SELECTOR_TYPE_CHILDREN
See Also:
Constant Field Values

SELECTOR_TYPE_DESCENDANTS

public static final String SELECTOR_TYPE_DESCENDANTS
See Also:
Constant Field Values

SELECTOR_TYPE_DEFINITION

public static final String SELECTOR_TYPE_DEFINITION
See Also:
Constant Field Values

SELECTOR_CONTENT

public static final String SELECTOR_CONTENT
See Also:
Constant Field Values

SELECTOR_OBJECT

public static final String SELECTOR_OBJECT
See Also:
Constant Field Values

SELECTOR_CHILDREN

public static final String SELECTOR_CHILDREN
See Also:
Constant Field Values

SELECTOR_DESCENDANTS

public static final String SELECTOR_DESCENDANTS
See Also:
Constant Field Values

SELECTOR_PARENTS

public static final String SELECTOR_PARENTS
See Also:
Constant Field Values

SELECTOR_FOLDER_TREE

public static final String SELECTOR_FOLDER_TREE
See Also:
Constant Field Values

SELECTOR_QUERY

public static final String SELECTOR_QUERY
See Also:
Constant Field Values

SELECTOR_VERSIONS

public static final String SELECTOR_VERSIONS
See Also:
Constant Field Values

CMISACTION_CREATEDOCUMENT

public static final String CMISACTION_CREATEDOCUMENT
See Also:
Constant Field Values

CMISACTION_CREATEFOLDER

public static final String CMISACTION_CREATEFOLDER
See Also:
Constant Field Values

CMISACTION_QUERY

public static final String CMISACTION_QUERY
See Also:
Constant Field Values

PARAM_SELECTOR

public static final String PARAM_SELECTOR
See Also:
Constant Field Values

PARAM_TRANSACTION

public static final String PARAM_TRANSACTION
See Also:
Constant Field Values

PARAM_CLIENTTOKEN

public static final String PARAM_CLIENTTOKEN
See Also:
Constant Field Values

CONTROL_CMISACTION

public static final String CONTROL_CMISACTION
See Also:
Constant Field Values

CONTROL_TRANSACTION

public static final String CONTROL_TRANSACTION
See Also:
Constant Field Values

CONTROL_OBJECT_ID

public static final String CONTROL_OBJECT_ID
See Also:
Constant Field Values

CONTROL_PROP_ID

public static final String CONTROL_PROP_ID
See Also:
Constant Field Values

CONTROL_PROP_VALUE

public static final String CONTROL_PROP_VALUE
See Also:
Constant Field Values

CONTROL_POLICY

public static final String CONTROL_POLICY
See Also:
Constant Field Values

CONTROL_ADD_ACE_PRINCIPAL

public static final String CONTROL_ADD_ACE_PRINCIPAL
See Also:
Constant Field Values

CONTROL_ADD_ACE_PERMISSION

public static final String CONTROL_ADD_ACE_PERMISSION
See Also:
Constant Field Values

CONTROL_REMOVE_ACE_PRINCIPAL

public static final String CONTROL_REMOVE_ACE_PRINCIPAL
See Also:
Constant Field Values

CONTROL_REMOVE_ACE_PERMISSION

public static final String CONTROL_REMOVE_ACE_PERMISSION
See Also:
Constant Field Values

CONTROL_CONTENT_TYPE

public static final String CONTROL_CONTENT_TYPE
See Also:
Constant Field Values

CONTROL_FILENAME

public static final String CONTROL_FILENAME
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 UrlBuilder compileBaseUrl(javax.servlet.http.HttpServletRequest request)
Compiles the base URL for links, collections and templates.


compileRepositoryUrl

public static UrlBuilder compileRepositoryUrl(javax.servlet.http.HttpServletRequest request,
                                              String repositoryId)

compileRootUrl

public static 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(CallContext context,
                                  BrowserBindingUtils.CallUrl callUrl,
                                  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(ObjectData object,
                                String name,
                                Class<T> clazz)
Extracts a property from an object.


createProperties

public static Properties createProperties(ControlParser controlParser,
                                          String typeId,
                                          TypeCache typeCache)

createPolicies

public static List<String> createPolicies(ControlParser controlParser)

createAddAcl

public static Acl createAddAcl(ControlParser controlParser)

createRemoveAcl

public static Acl createRemoveAcl(ControlParser controlParser)

createContentStream

public static ContentStream createContentStream(javax.servlet.http.HttpServletRequest request)

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.json.simple.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


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.