You are here

README.txt in CMIS API 7

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