You are here

function cmis_browser_content_get in CMIS API 7

Same name and namespace in other branches
  1. 6.4 cmis_browser/cmis_browser.content_get.inc \cmis_browser_content_get()
  2. 6.2 cmis_browser/cmis_browser.content_get.inc \cmis_browser_content_get()
  3. 6.3 cmis_browser/cmis_browser.content_get.inc \cmis_browser_content_get()
  4. 7.2 cmis_browser/cmis_browser.content_get.inc \cmis_browser_content_get()

Build cmis_browser browse page.

2 string references to 'cmis_browser_content_get'
cmis_browser_menu in cmis_browser/cmis_browser.module
Implementation of hook_menu().
_cmis_browser_content_get_document in cmis_browser/cmis_browser.content_get.inc
CMIS document download handler.

File

cmis_browser/cmis_browser.content_get.inc, line 7

Code

function cmis_browser_content_get() {
  module_load_include('api.inc', 'cmis');
  module_load_include('utils.inc', 'cmis_browser');

  // Invoke CMIS service
  try {
    $repository = cmis_get_repository();
    $object = _cmis_browser_content_object_from_request($repository);
    switch ($object->properties['cmis:baseTypeId']) {
      case 'cmis:document':
        return _cmis_browser_content_get_document($repository, $object);
        break;
      case 'cmis:folder':
        return _cmis_browser_content_get_folder($repository, $object, array_slice(explode('/', $_GET['q']), 2));
        break;
      default:
        throw new CMISException(t('Unable to handle cmis object @object_id of type @object_type', array(
          '@object_id' => $object->id,
          '@object_type' => $object->type,
        )));
    }
  } catch (CMISException $e) {
    cmis_error_handler('cmis_browser', $e);
    return '';
  }
}