You are here

README.txt in Entity Share 8.2

Same filename in this branch
  1. 8.2 README.txt
  2. 8.2 tests/fixtures/files/README.txt
Same filename and directory in other branches
  1. 8.3 README.txt
  2. 8 README.txt
  3. 7 README.txt
CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Field types
 * Requirements
 * Recommended modules
 * Similar modules
 * Installation
 * Configuration
 * Maintainers


INTRODUCTION
------------

This module allows to share entities using the JSON:API. It provides an UI to
use the endpoints provided by the JSON:API module.

You can define one website as a "server" and another website as a "client". A
website can be both "client" and "server".

Currently you can only, on the client website, get content exposed from the
server website. You can't push content from the client website to the server
website.

When pulling content, referenced entities are also pulled recursively. If you
reselect a content it will be updated and referenced entities will also be
updated recursively.

The entities you want to share must have the same structure (machine name, field
machine name and storage) across the different websites.

Note about links and embed entities in RTE:

To ensure the share of links referencing entities (most of the time content) and
entities that are embedded in RTE, we recommend to use the following modules, as
they use UUID to operate:
 * Linkit (https://www.drupal.org/project/linkit)
 * Entity Embed (https://www.drupal.org/project/entity_embed)

This module does nothing to ensure the embed entities are shared automatically,
you must share the entities by yourself.

Note about path and Pathauto:

To expose the information if a content entity has its path managed by Pathauto,
Entity share provides a field enhancer plugin to enable on the server website.

Note about multilingual content:

When pulling translatable content, the default langcode is dropped to avoid to
have to pull the content in its original language and because the original
language may be not enabled on the client website.

Referenced entities will be imported in the same language as the referencing
entity if possible. If a referenced entity is not available in the same
language, Drupal will display the entity in the first language available
depending of the languages weight.

Note about CRON usage:

If you want to synchronize entities automatically using CRON:
 * the Entity Share Cron (https://www.drupal.org/project/entity_share_cron)
   module provides an UI to import channels using Cron.
 * there is a test module 'entity_share_client_test' in Entity share that
   provides example code.

Note about Entity share client module:

As the Entity share client sub-module has a dependency on the JSON:API module,
on your client website, content and configuration will be exposed in JSON:API
endpoints, by default on /jsonapi. As the JSON:API use the Drupal access API to
check access to entities, if you have used the access API and permission system
correctly, users will not have access to content they should not access. But for
example, they will be able to access fields not displayed in view modes.

So to add a new security layer, it is advised to block requests on JSON:API
endpoints on your client website (and also if needed or possible on your server
website). This configuration can be done in your webserver configuration to
block external requests and only authorized requests coming from internal
networks or trusted IPs.

This configuration will differ based on the webserver you are using (Apache,
Nginx, Microsoft IIS, etc.) and also based on your network structure, for
example if you have a cache server (Varnish or other) or load balancer (Nginx,
HAProxy, etc.).

Note about full pager feature:

On the pull form, you can get a full pagination if on the server side, the
JSON:API Extras module is enabled and if the configuration "Include count in
collection queries" is enabled on JSON:API Extras settings form.

Limitation:

Currently we do not handle config entities and user entities to avoid side
effects.

FIELD TYPES
-----------

Supported:
 * Block (with JSON:API Extras, see troubleshooting section)
 * Boolean
 * Content (entity reference)
 * Date:
  - date only
  - date and time
 * Date range:
  - date only
  - date all day
  - date and time
 * Email
 * File
 * Image
 * Link:
  - internal (with JSON:API Extras, see troubleshooting section)
  - external
 * List:
  - float
  - integer
  - text
 * Media:
  - audio
  - image
  - file
  - remote video
  - video
 * Metatags (with JSON:API Extras, see troubleshooting section)
 * Number:
  - decimal
  - float
  - integer
 * Paragraphs
 * Taxonomy
 * Telephone
 * Text:
  - plain
  - plain, long
  - formatted
  - formatted, long
  - formatted, long, with summary
 * Timestamp

Not supported:
 * Comment: See https://www.drupal.org/project/jsonapi_comment
 * Dynamic entity reference: See https://www.drupal.org/project/entity_share/issues/3056102

REQUIREMENTS
------------

This module requires the following modules:
 * JSON:API (https://www.drupal.org/project/jsonapi)


RECOMMENDED MODULES
-------------------

 * JSON:API Extras (https://www.drupal.org/project/jsonapi_extras):
   To allow to customize the JSON:API endpoints and to enable full pager
   feature. See the troubleshooting section about the link fields.
 * Diff (https://www.drupal.org/project/diff):
   To see a diff if entities are not synchronized. Note that the following patch
   needs to be applied on the diff module:
   https://www.drupal.org/project/diff/issues/3088274#comment-13312389


SIMILAR MODULES
---------------

 * Entity pilot (https://www.drupal.org/project/entity_pilot): Entity share does
   not require any subscription to a service.


INSTALLATION
------------

 * Install and enable the Entity share server on the site you want to get
   content from.
 * Install and enable the Entity share client on the site you want to put
   content on.


CONFIGURATION
-------------

On the server website:
 * Enable the Entity share server module.
 * Optional: Prepare an user with the permission "Access channels list" if you
   do not want to use the admin user.
 * Go to the configuration page, Configuration > Web services > Entity share >
   Channels (admin/config/services/entity_share/channel) and add at least one
   channel.

On the client website:
 * Enable the Entity share client module.
 * Go to the configuration page, Configuration > Web services > Entity share >
   Remote websites (admin/config/services/entity_share/remote) and create a
   remote website corresponding to your server website with the user name and
   password configured on the server website.
 * Go to the pull form, Content > Entity share > Pull entities
   (admin/content/entity_share/pull), and select your remote website, the
   available channels will be listed and when selecting a channel, the entities
   exposed on this channel will be available to synchronize.


TROUBLESHOOTING
---------------

 * Block fields: To support Block fields, Entity share provides a field
   enhancer plugin to enable on the server website. It will allow to import
   block content automatically.
 * Internal link fields: As Drupal stores the id of entities for internal link
   fields that reference entities, we need Drupal to store the value of these
   fields using UUID. There is an issue for that
   https://www.drupal.org/node/2873068.
   As a workaround, it is possible to use the JSON:API Extras module to alter
   the data for link fields. for the concerned JSON:API endpoints, you can use
   the field enhancer "UUID for link (link field only)" on the link fields.
   Note 1: This configuration must be applied and identical on both websites
   (server and client).
   Note 2: If the target entity of a link field value has not been imported yet,
   the value of the link field will be unset. So an update will be required to
   update the link field value.
 * Metatag fields: To support Metatag fields, Entity share provides a field
   enhancer plugin to enable on the server website.

MAINTAINERS
-----------

Current maintainers:
 * Thomas Bernard (ithom) - https://www.drupal.org/user/3175403
 * Florent Torregrosa (Grimreaper) - https://www.drupal.org/user/2388214

This project has been sponsored by:
 * Smile - https://www.drupal.org/smile
   Sponsored initial development, evolutions, maintainance and support.
 * Lullabot - https://www.drupal.org/lullabot
   Sponsored development of new features in association with
   https://www.drupal.org/carnegie-mellon-university

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Field types
  5. * Requirements
  6. * Recommended modules
  7. * Similar modules
  8. * Installation
  9. * Configuration
  10. * Maintainers
  11. INTRODUCTION
  12. ------------
  13. This module allows to share entities using the JSON:API. It provides an UI to
  14. use the endpoints provided by the JSON:API module.
  15. You can define one website as a "server" and another website as a "client". A
  16. website can be both "client" and "server".
  17. Currently you can only, on the client website, get content exposed from the
  18. server website. You can't push content from the client website to the server
  19. website.
  20. When pulling content, referenced entities are also pulled recursively. If you
  21. reselect a content it will be updated and referenced entities will also be
  22. updated recursively.
  23. The entities you want to share must have the same structure (machine name, field
  24. machine name and storage) across the different websites.
  25. Note about links and embed entities in RTE:
  26. To ensure the share of links referencing entities (most of the time content) and
  27. entities that are embedded in RTE, we recommend to use the following modules, as
  28. they use UUID to operate:
  29. * Linkit (https://www.drupal.org/project/linkit)
  30. * Entity Embed (https://www.drupal.org/project/entity_embed)
  31. This module does nothing to ensure the embed entities are shared automatically,
  32. you must share the entities by yourself.
  33. Note about path and Pathauto:
  34. To expose the information if a content entity has its path managed by Pathauto,
  35. Entity share provides a field enhancer plugin to enable on the server website.
  36. Note about multilingual content:
  37. When pulling translatable content, the default langcode is dropped to avoid to
  38. have to pull the content in its original language and because the original
  39. language may be not enabled on the client website.
  40. Referenced entities will be imported in the same language as the referencing
  41. entity if possible. If a referenced entity is not available in the same
  42. language, Drupal will display the entity in the first language available
  43. depending of the languages weight.
  44. Note about CRON usage:
  45. If you want to synchronize entities automatically using CRON:
  46. * the Entity Share Cron (https://www.drupal.org/project/entity_share_cron)
  47. module provides an UI to import channels using Cron.
  48. * there is a test module 'entity_share_client_test' in Entity share that
  49. provides example code.
  50. Note about Entity share client module:
  51. As the Entity share client sub-module has a dependency on the JSON:API module,
  52. on your client website, content and configuration will be exposed in JSON:API
  53. endpoints, by default on /jsonapi. As the JSON:API use the Drupal access API to
  54. check access to entities, if you have used the access API and permission system
  55. correctly, users will not have access to content they should not access. But for
  56. example, they will be able to access fields not displayed in view modes.
  57. So to add a new security layer, it is advised to block requests on JSON:API
  58. endpoints on your client website (and also if needed or possible on your server
  59. website). This configuration can be done in your webserver configuration to
  60. block external requests and only authorized requests coming from internal
  61. networks or trusted IPs.
  62. This configuration will differ based on the webserver you are using (Apache,
  63. Nginx, Microsoft IIS, etc.) and also based on your network structure, for
  64. example if you have a cache server (Varnish or other) or load balancer (Nginx,
  65. HAProxy, etc.).
  66. Note about full pager feature:
  67. On the pull form, you can get a full pagination if on the server side, the
  68. JSON:API Extras module is enabled and if the configuration "Include count in
  69. collection queries" is enabled on JSON:API Extras settings form.
  70. Limitation:
  71. Currently we do not handle config entities and user entities to avoid side
  72. effects.
  73. FIELD TYPES
  74. -----------
  75. Supported:
  76. * Block (with JSON:API Extras, see troubleshooting section)
  77. * Boolean
  78. * Content (entity reference)
  79. * Date:
  80. - date only
  81. - date and time
  82. * Date range:
  83. - date only
  84. - date all day
  85. - date and time
  86. * Email
  87. * File
  88. * Image
  89. * Link:
  90. - internal (with JSON:API Extras, see troubleshooting section)
  91. - external
  92. * List:
  93. - float
  94. - integer
  95. - text
  96. * Media:
  97. - audio
  98. - image
  99. - file
  100. - remote video
  101. - video
  102. * Metatags (with JSON:API Extras, see troubleshooting section)
  103. * Number:
  104. - decimal
  105. - float
  106. - integer
  107. * Paragraphs
  108. * Taxonomy
  109. * Telephone
  110. * Text:
  111. - plain
  112. - plain, long
  113. - formatted
  114. - formatted, long
  115. - formatted, long, with summary
  116. * Timestamp
  117. Not supported:
  118. * Comment: See https://www.drupal.org/project/jsonapi_comment
  119. * Dynamic entity reference: See https://www.drupal.org/project/entity_share/issues/3056102
  120. REQUIREMENTS
  121. ------------
  122. This module requires the following modules:
  123. * JSON:API (https://www.drupal.org/project/jsonapi)
  124. RECOMMENDED MODULES
  125. -------------------
  126. * JSON:API Extras (https://www.drupal.org/project/jsonapi_extras):
  127. To allow to customize the JSON:API endpoints and to enable full pager
  128. feature. See the troubleshooting section about the link fields.
  129. * Diff (https://www.drupal.org/project/diff):
  130. To see a diff if entities are not synchronized. Note that the following patch
  131. needs to be applied on the diff module:
  132. https://www.drupal.org/project/diff/issues/3088274#comment-13312389
  133. SIMILAR MODULES
  134. ---------------
  135. * Entity pilot (https://www.drupal.org/project/entity_pilot): Entity share does
  136. not require any subscription to a service.
  137. INSTALLATION
  138. ------------
  139. * Install and enable the Entity share server on the site you want to get
  140. content from.
  141. * Install and enable the Entity share client on the site you want to put
  142. content on.
  143. CONFIGURATION
  144. -------------
  145. On the server website:
  146. * Enable the Entity share server module.
  147. * Optional: Prepare an user with the permission "Access channels list" if you
  148. do not want to use the admin user.
  149. * Go to the configuration page, Configuration > Web services > Entity share >
  150. Channels (admin/config/services/entity_share/channel) and add at least one
  151. channel.
  152. On the client website:
  153. * Enable the Entity share client module.
  154. * Go to the configuration page, Configuration > Web services > Entity share >
  155. Remote websites (admin/config/services/entity_share/remote) and create a
  156. remote website corresponding to your server website with the user name and
  157. password configured on the server website.
  158. * Go to the pull form, Content > Entity share > Pull entities
  159. (admin/content/entity_share/pull), and select your remote website, the
  160. available channels will be listed and when selecting a channel, the entities
  161. exposed on this channel will be available to synchronize.
  162. TROUBLESHOOTING
  163. ---------------
  164. * Block fields: To support Block fields, Entity share provides a field
  165. enhancer plugin to enable on the server website. It will allow to import
  166. block content automatically.
  167. * Internal link fields: As Drupal stores the id of entities for internal link
  168. fields that reference entities, we need Drupal to store the value of these
  169. fields using UUID. There is an issue for that
  170. https://www.drupal.org/node/2873068.
  171. As a workaround, it is possible to use the JSON:API Extras module to alter
  172. the data for link fields. for the concerned JSON:API endpoints, you can use
  173. the field enhancer "UUID for link (link field only)" on the link fields.
  174. Note 1: This configuration must be applied and identical on both websites
  175. (server and client).
  176. Note 2: If the target entity of a link field value has not been imported yet,
  177. the value of the link field will be unset. So an update will be required to
  178. update the link field value.
  179. * Metatag fields: To support Metatag fields, Entity share provides a field
  180. enhancer plugin to enable on the server website.
  181. MAINTAINERS
  182. -----------
  183. Current maintainers:
  184. * Thomas Bernard (ithom) - https://www.drupal.org/user/3175403
  185. * Florent Torregrosa (Grimreaper) - https://www.drupal.org/user/2388214
  186. This project has been sponsored by:
  187. * Smile - https://www.drupal.org/smile
  188. Sponsored initial development, evolutions, maintainance and support.
  189. * Lullabot - https://www.drupal.org/lullabot
  190. Sponsored development of new features in association with
  191. https://www.drupal.org/carnegie-mellon-university