You are here

README.txt in CMIS API 7.2

Content Management Interoperability Services client api
-------------------------------------------------------

 CMIS package contains the following modules:
  * cmis.module - CMIS client api
  * cmis_common.module - CMIS common client library implementation (loads external library)
  * cmis_browser.module - CMIS repository browser
  * cmis_query.module - Provides the ability to run CMIS 1.0 queries against
                        the current CMIS repository.
  * cmis_sync.module - Allows synchronization between
                       Drupal nodes and CMIS objects.
  * cmis_headerswing.module - Demo module that demonstrates using hook_cmis_invoke()
			      to access the CMIS repository via header-based authentication
                              such as Basic Auth or NTLM.
  * cmis_dev.module - Demo module that displays current CMIS repository's properties. Useful for basic connection testing.


Contents
--------
 * Requirements
 * Installation
 * Repository Configuration
 * Drupal-CMIS Syncronization
 * CMIS Hooks
 * CMIS Sync Hooks
 * CMIS Headerswing Settings
 * Credits
 
Requirements
------------
PHP cURL 

Installation
------------

 * Place the entire cmis folder into your modules directory.
 * Either:
   * Download the PHP CMIS Lib from https://people.apache.org/~richardm/chemistry/phpclient/0.2.0-RC1/ and unzip in the libraries folder 
   * Download the PHP CMIS Lib via Drush 'drush cmis-phplib' will install to sites/all/libraries/php-cmislib, or pass directory as a paramater 'drush cmis-phplib sites/cmis/libraries/php-cmislib'
 * Go to Administer -> Site building -> Modules and enable the cmis modules.
 * Check that the CMIS Library is being found (http://<site>/admin/settings/cmis/common)
 * Configure at least one CMIS repository (see below)


Repository Configuration
------------------------

 Make sure that `cmis`, `cmis_common`, `cmis_browser` and `cmis_query` modules
 are enabled and add the following lines in your `settings.php` file:
 
$conf['cmis_repositories'] = array(
  'default' => array(
    'user' => '<cmis_user_username>',
    'password' => '<cmis_user_password>',
    'url' => 'http://path/to/cmis/interface'
  )
);
 
 
 Settings:
  * user - Generic username used by cmis_common to authenticate Drupal to the CMIS repository
         - optional, used by cmis_common
  * password - Generic password used by cmis_common to authenticate Drupal to the CMIS repository
             - optional, used by cmis_common
  * url - CMIS repository endpoint url
        - mandatory, used by cmis_common
  * label - repository label
          - optional, used by cmis_browser's CMIS repository switcher block, useful if connecting to multiple repositories
  * browser_default_folderId, browser_default_folderPath
      - default CMIS folder displayed by cmis_browser module
      - optional, defaults to `repositoryInfo['cmis:rootFolderId']`, used by cmis_browser
  * transport - Drupal's module that implements hook_cmis_invoke($url, $properties, $settings) hook, where :
                      - $url - CMIS absolute REST url
                      - $properties - request properties
                      - $settings - CMIS repositories settings comming from $conf['cmis_repositories']
              - optional, defaults to `cmis_common` used by cmis module
	      - See cmis_headerswing section below for more information


 To browse the CMIS repository go to http://localhost/cmis/browser.
 To query it go to http://localhost/cmis/query.
 
 Query example: 
 To perform the query "select * from cmis:document" go to
 http://localhost/cmis/query/select%2B%252A%2Bfrom%2Bcmis%253Adocument  
 
Drupal-CMIS synchronization
---------------------------

 Make sure that cmis_sync module is enabled and cmis_repositories config var is set.
 Add the following lines to your settings.php file:

$conf['cmis_sync_map'] = array(
  'page' => array(
    'enabled' => TRUE,
    'cmis_folderPath' => '/SomePath'
  ),

 'custom_drupal_content_type' => array(
    'enabled' => TRUE,
    'cmis_folderPath' => '/SomeOtherPath'
		'fields' => array(
			'title' => 'cmis:name',
			'custom_field' => 'cmis:otherCustomProperty',
			array('drupal' => 'some_other_custom_field', 'cmis' => 'cmis:someOtherCustomProperty', 'cmis to drupal' => TRUE, 'drupal to cmis' => TRUE)
		)
  ),
	
 	// ...
);

 This will enable the synchronization process which will sync drupal nodes
 of type page to cmis:document cmis objects under /SomePath folder.
 For each created/updated node, sync process will create/update a cmis object
 under cmis_folderPath by mapping $node->title to cmis:name
 and $node->body to cmis object's content stream.

 
 Settings:
  * enabled - synchronization state for current drupal content type
            - mandatory
  * cmis_repositoryId - repository id or alias
                      - optional, deaults to 'default' CMIS repository
  * cmis_type - CMIS type used by sync process for CMIS objects synchronized
                with Drupal nodes
              - optional, defaults to 'cmis:document'
  * cmis_folderId, cmis_folderPath
      - CMIS folder used as destination for CMIS objects synchronized
        with Drupal nodes
      - mandatory
  * content_field - Drupal node field that will be considered as content.
                  - optional, defaults to 'body'
  * fields - field sync map. Which Drupal field should sync with which CMIS property.
           - optional, defaults to 'array('title' => 'cmis:name')`'
  * deletes - if TRUE, sync process will delete drupal nodes
              if CMIS objects have been deleted and vice versa
            - optional, default: 'FALSE'
  * subfolders - if TRUE, CMIS objects under cmis_folderId will also be synchronized.
               - optional, default: 'FALSE'
  * full_sync_next_cron - if TRUE, at next cron run, sync process
                          will synchronize all CMIS objects under cmis_folderId
                          not only the recent changed items
                        - optional, default: 'FALSE'
  * cmis_sync_cron_enabled - if TRUE, CMIS to Drupal sync will be triggered by cron.
                           - useful if sync process is triggered by another event
                           - optional, default: 'TRUE'
  * cmis_sync_nodeapi_enabled - if TRUE, Drupal to CMIS sync will be triggered by
                                nodeapi's insert, update, and delete operations
                              - useful if sync process is triggered by another event.
                              - optional, default: 'TRUE'

 Fields sync setting syntax:
  * short hand syntax:
  
$conf['cmis_sync_map']['page']['fields'] = array(
  'title' => 'cmis:name',
  'custom_cck_field' => 'some cmis custom property'
)

  * long hand syntax

$conf['cmis_sync_map']['page']['fields'] = array(
  array('drupal' => 'title', 'cmis' => 'cmis:name', 'drupal to cmis' => TRUE, 'cmis to drupal' => TRUE),
  array('drupal' => 'custom_cck_field', 'cmis' => 'some cmis custom property', 'drupal to cmis' => TRUE, 'cmis to drupal' => TRUE),
  
  // copy cmis:objectId to custom_cck_field2 drupal field.
  // 'drupal to cmis' => FALSE, 'cmis to drupal' => TRUE means that only custom_cck_field2 Drupal field is updated.
  // sync process will not try to update cmis:objectId from custom_cck_field2 field's value.
  array('drupal' => 'custom_cck_field2', 'cmis' => 'cmis:objectId', 'drupal to cmis' => FALSE, 'cmis to drupal' => TRUE)
)
  
  
CMIS Hooks
----------
 
 * hook_cmis_invoke() - allows control over CMIS repository connection.
 * hook_cmis_info() - used to register a module that implements a CMIS client.
 * hook_cmisapi_invoke() - called by cmis api whenever a cmisapi_* is called.
 * hook_cmisapi_*() - where * means any CMIS call(ie. getRepositoryInfo).
                    - these hooks are called only if hook_cmisapi_invoke()
                    is not defined.

 Examples of how these hooks are used, can be found in the following files:
  - cmis.module
  - cmis.api.inc
  - cmis_custom.module (hook_cmisapi_invoke)
  - cmis_headerswing.module (hook_cmis_invoke)
 
  
CMIS Sync Hooks
---------------
 
 In order to allow other Drupal modules to manipulate the way Drupal nodes
 are mapped to CMIS objects and back, cmis_sync module exposes two hooks:
  * hook_sync_drupal_cmis_prepare($node, $cmis_object)
        - Called after cmis_sync, based on $conf['cmis_sync_map'],
        prepared `$cmis_object` to be sent to CMIS repository.
  * hook_sync_cmis_drupal_prepare($cmis_object, $node)
        - Called after cmis_sync, based on $conf['cmis_sync_map'],
        prepared $node to be sent to Drupal's node_save()
  
  
CMIS Headerswing Settings
-------------------------

 The CMIS Headerswing module provides a mechanism for relaying (or "swinging") HTTP header data
 from Drupal to the CMIS repository. In theory, this can be used to relay any HTTP header.
 In practice, this is particularly useful for passing user authentication information from 
 Drupal to the CMIS repository, providing Single Sign-On (SSO), when authentication is managed by 
 a third party component that populates $_SERVER vars with credentials, such as HTTP Basic or NTLM.

 This module also provides an example of how to create a custom implementation of 
 hook_cmis_invoke(), overriding the default transport mechanism.

 Configuration sample:

$conf['cmis_repositories'] = array(
  'default' => array(
    'user' => 'admin',
    'password' => 'admin',
    'label' => 'local cmis repo',
    'url' => 'http://127.0.0.1:8080/cmis',
    'transport' => 'cmis_headerswing', 
    'headerswing_headers' => array(
      'HTTP_HOST' => 'FRONTEND_HOST',
      'HTTP_HOST' => 'FRONTEND_HOST_AGAIN',
      'HTTP_USER' => 'FRONTEND_USER',
      'PHP_AUTH_USER' => 'FRONTEND_USER'
      'PHP_AUTH_DIGEST' => 'FRONTEND_AUTH'
    )
  )
);

 Based on these settings cmis_headerswing module will copy $_SERVER[ headerswing_headers's keys ]
 to the CMIS request headers.


Credits
-------

 Contributors
  - Dries Buytaert (dries@acquia.com)
  - Yong Qu (yong.qu@alfresco.com)
  - Matt Asay (masay@alfresco.com)
  - Scott Davis (scott.davis@alfresco.com)
  - Jeff Potts (jpotts@optaros.com)
  - Dave Gynn (dgynn@optaros.com)
  - Chris Fuller (cfuller@optaros.com)
  - Rich McKnight (rich.mcknight@alfresco.com)
  - Ian Norton (ian.norton@alfresco.com)

 Maintainers
  - Catalin Balan (cbalan@optaros.com)

File

README.txt
View source
  1. Content Management Interoperability Services client api
  2. -------------------------------------------------------
  3. CMIS package contains the following modules:
  4. * cmis.module - CMIS client api
  5. * cmis_common.module - CMIS common client library implementation (loads external library)
  6. * cmis_browser.module - CMIS repository browser
  7. * cmis_query.module - Provides the ability to run CMIS 1.0 queries against
  8. the current CMIS repository.
  9. * cmis_sync.module - Allows synchronization between
  10. Drupal nodes and CMIS objects.
  11. * cmis_headerswing.module - Demo module that demonstrates using hook_cmis_invoke()
  12. to access the CMIS repository via header-based authentication
  13. such as Basic Auth or NTLM.
  14. * cmis_dev.module - Demo module that displays current CMIS repository's properties. Useful for basic connection testing.
  15. Contents
  16. --------
  17. * Requirements
  18. * Installation
  19. * Repository Configuration
  20. * Drupal-CMIS Syncronization
  21. * CMIS Hooks
  22. * CMIS Sync Hooks
  23. * CMIS Headerswing Settings
  24. * Credits
  25. Requirements
  26. ------------
  27. PHP cURL
  28. Installation
  29. ------------
  30. * Place the entire cmis folder into your modules directory.
  31. * Either:
  32. * Download the PHP CMIS Lib from https://people.apache.org/~richardm/chemistry/phpclient/0.2.0-RC1/ and unzip in the libraries folder
  33. * Download the PHP CMIS Lib via Drush 'drush cmis-phplib' will install to sites/all/libraries/php-cmislib, or pass directory as a paramater 'drush cmis-phplib sites/cmis/libraries/php-cmislib'
  34. * Go to Administer -> Site building -> Modules and enable the cmis modules.
  35. * Check that the CMIS Library is being found (http:///admin/settings/cmis/common)
  36. * Configure at least one CMIS repository (see below)
  37. Repository Configuration
  38. ------------------------
  39. Make sure that `cmis`, `cmis_common`, `cmis_browser` and `cmis_query` modules
  40. are enabled and add the following lines in your `settings.php` file:
  41. $conf['cmis_repositories'] = array(
  42. 'default' => array(
  43. 'user' => '',
  44. 'password' => '',
  45. 'url' => 'http://path/to/cmis/interface'
  46. )
  47. );
  48. Settings:
  49. * user - Generic username used by cmis_common to authenticate Drupal to the CMIS repository
  50. - optional, used by cmis_common
  51. * password - Generic password used by cmis_common to authenticate Drupal to the CMIS repository
  52. - optional, used by cmis_common
  53. * url - CMIS repository endpoint url
  54. - mandatory, used by cmis_common
  55. * label - repository label
  56. - optional, used by cmis_browser's CMIS repository switcher block, useful if connecting to multiple repositories
  57. * browser_default_folderId, browser_default_folderPath
  58. - default CMIS folder displayed by cmis_browser module
  59. - optional, defaults to `repositoryInfo['cmis:rootFolderId']`, used by cmis_browser
  60. * transport - Drupal's module that implements hook_cmis_invoke($url, $properties, $settings) hook, where :
  61. - $url - CMIS absolute REST url
  62. - $properties - request properties
  63. - $settings - CMIS repositories settings comming from $conf['cmis_repositories']
  64. - optional, defaults to `cmis_common` used by cmis module
  65. - See cmis_headerswing section below for more information
  66. To browse the CMIS repository go to http://localhost/cmis/browser.
  67. To query it go to http://localhost/cmis/query.
  68. Query example:
  69. To perform the query "select * from cmis:document" go to
  70. http://localhost/cmis/query/select%2B%252A%2Bfrom%2Bcmis%253Adocument
  71. Drupal-CMIS synchronization
  72. ---------------------------
  73. Make sure that cmis_sync module is enabled and cmis_repositories config var is set.
  74. Add the following lines to your settings.php file:
  75. $conf['cmis_sync_map'] = array(
  76. 'page' => array(
  77. 'enabled' => TRUE,
  78. 'cmis_folderPath' => '/SomePath'
  79. ),
  80. 'custom_drupal_content_type' => array(
  81. 'enabled' => TRUE,
  82. 'cmis_folderPath' => '/SomeOtherPath'
  83. 'fields' => array(
  84. 'title' => 'cmis:name',
  85. 'custom_field' => 'cmis:otherCustomProperty',
  86. array('drupal' => 'some_other_custom_field', 'cmis' => 'cmis:someOtherCustomProperty', 'cmis to drupal' => TRUE, 'drupal to cmis' => TRUE)
  87. )
  88. ),
  89. // ...
  90. );
  91. This will enable the synchronization process which will sync drupal nodes
  92. of type page to cmis:document cmis objects under /SomePath folder.
  93. For each created/updated node, sync process will create/update a cmis object
  94. under cmis_folderPath by mapping $node->title to cmis:name
  95. and $node->body to cmis object's content stream.
  96. Settings:
  97. * enabled - synchronization state for current drupal content type
  98. - mandatory
  99. * cmis_repositoryId - repository id or alias
  100. - optional, deaults to 'default' CMIS repository
  101. * cmis_type - CMIS type used by sync process for CMIS objects synchronized
  102. with Drupal nodes
  103. - optional, defaults to 'cmis:document'
  104. * cmis_folderId, cmis_folderPath
  105. - CMIS folder used as destination for CMIS objects synchronized
  106. with Drupal nodes
  107. - mandatory
  108. * content_field - Drupal node field that will be considered as content.
  109. - optional, defaults to 'body'
  110. * fields - field sync map. Which Drupal field should sync with which CMIS property.
  111. - optional, defaults to 'array('title' => 'cmis:name')`'
  112. * deletes - if TRUE, sync process will delete drupal nodes
  113. if CMIS objects have been deleted and vice versa
  114. - optional, default: 'FALSE'
  115. * subfolders - if TRUE, CMIS objects under cmis_folderId will also be synchronized.
  116. - optional, default: 'FALSE'
  117. * full_sync_next_cron - if TRUE, at next cron run, sync process
  118. will synchronize all CMIS objects under cmis_folderId
  119. not only the recent changed items
  120. - optional, default: 'FALSE'
  121. * cmis_sync_cron_enabled - if TRUE, CMIS to Drupal sync will be triggered by cron.
  122. - useful if sync process is triggered by another event
  123. - optional, default: 'TRUE'
  124. * cmis_sync_nodeapi_enabled - if TRUE, Drupal to CMIS sync will be triggered by
  125. nodeapi's insert, update, and delete operations
  126. - useful if sync process is triggered by another event.
  127. - optional, default: 'TRUE'
  128. Fields sync setting syntax:
  129. * short hand syntax:
  130. $conf['cmis_sync_map']['page']['fields'] = array(
  131. 'title' => 'cmis:name',
  132. 'custom_cck_field' => 'some cmis custom property'
  133. )
  134. * long hand syntax
  135. $conf['cmis_sync_map']['page']['fields'] = array(
  136. array('drupal' => 'title', 'cmis' => 'cmis:name', 'drupal to cmis' => TRUE, 'cmis to drupal' => TRUE),
  137. array('drupal' => 'custom_cck_field', 'cmis' => 'some cmis custom property', 'drupal to cmis' => TRUE, 'cmis to drupal' => TRUE),
  138. // copy cmis:objectId to custom_cck_field2 drupal field.
  139. // 'drupal to cmis' => FALSE, 'cmis to drupal' => TRUE means that only custom_cck_field2 Drupal field is updated.
  140. // sync process will not try to update cmis:objectId from custom_cck_field2 field's value.
  141. array('drupal' => 'custom_cck_field2', 'cmis' => 'cmis:objectId', 'drupal to cmis' => FALSE, 'cmis to drupal' => TRUE)
  142. )
  143. CMIS Hooks
  144. ----------
  145. * hook_cmis_invoke() - allows control over CMIS repository connection.
  146. * hook_cmis_info() - used to register a module that implements a CMIS client.
  147. * hook_cmisapi_invoke() - called by cmis api whenever a cmisapi_* is called.
  148. * hook_cmisapi_*() - where * means any CMIS call(ie. getRepositoryInfo).
  149. - these hooks are called only if hook_cmisapi_invoke()
  150. is not defined.
  151. Examples of how these hooks are used, can be found in the following files:
  152. - cmis.module
  153. - cmis.api.inc
  154. - cmis_custom.module (hook_cmisapi_invoke)
  155. - cmis_headerswing.module (hook_cmis_invoke)
  156. CMIS Sync Hooks
  157. ---------------
  158. In order to allow other Drupal modules to manipulate the way Drupal nodes
  159. are mapped to CMIS objects and back, cmis_sync module exposes two hooks:
  160. * hook_sync_drupal_cmis_prepare($node, $cmis_object)
  161. - Called after cmis_sync, based on $conf['cmis_sync_map'],
  162. prepared `$cmis_object` to be sent to CMIS repository.
  163. * hook_sync_cmis_drupal_prepare($cmis_object, $node)
  164. - Called after cmis_sync, based on $conf['cmis_sync_map'],
  165. prepared $node to be sent to Drupal's node_save()
  166. CMIS Headerswing Settings
  167. -------------------------
  168. The CMIS Headerswing module provides a mechanism for relaying (or "swinging") HTTP header data
  169. from Drupal to the CMIS repository. In theory, this can be used to relay any HTTP header.
  170. In practice, this is particularly useful for passing user authentication information from
  171. Drupal to the CMIS repository, providing Single Sign-On (SSO), when authentication is managed by
  172. a third party component that populates $_SERVER vars with credentials, such as HTTP Basic or NTLM.
  173. This module also provides an example of how to create a custom implementation of
  174. hook_cmis_invoke(), overriding the default transport mechanism.
  175. Configuration sample:
  176. $conf['cmis_repositories'] = array(
  177. 'default' => array(
  178. 'user' => 'admin',
  179. 'password' => 'admin',
  180. 'label' => 'local cmis repo',
  181. 'url' => 'http://127.0.0.1:8080/cmis',
  182. 'transport' => 'cmis_headerswing',
  183. 'headerswing_headers' => array(
  184. 'HTTP_HOST' => 'FRONTEND_HOST',
  185. 'HTTP_HOST' => 'FRONTEND_HOST_AGAIN',
  186. 'HTTP_USER' => 'FRONTEND_USER',
  187. 'PHP_AUTH_USER' => 'FRONTEND_USER'
  188. 'PHP_AUTH_DIGEST' => 'FRONTEND_AUTH'
  189. )
  190. )
  191. );
  192. Based on these settings cmis_headerswing module will copy $_SERVER[ headerswing_headers's keys ]
  193. to the CMIS request headers.
  194. Credits
  195. -------
  196. Contributors
  197. - Dries Buytaert (dries@acquia.com)
  198. - Yong Qu (yong.qu@alfresco.com)
  199. - Matt Asay (masay@alfresco.com)
  200. - Scott Davis (scott.davis@alfresco.com)
  201. - Jeff Potts (jpotts@optaros.com)
  202. - Dave Gynn (dgynn@optaros.com)
  203. - Chris Fuller (cfuller@optaros.com)
  204. - Rich McKnight (rich.mcknight@alfresco.com)
  205. - Ian Norton (ian.norton@alfresco.com)
  206. Maintainers
  207. - Catalin Balan (cbalan@optaros.com)