-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid frontend block serializers; just transport the raw data
(based on collective/collective.exportimport#241)
- Loading branch information
Showing
9 changed files
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from plone.exportimport.interfaces import IExportImportRequestMarker | ||
from plone.restapi.behaviors import IBlocks | ||
from plone.restapi.deserializer.dxfields import DefaultFieldDeserializer | ||
from plone.restapi.interfaces import IFieldDeserializer | ||
from plone.schema import IJSONField | ||
from zope.component import adapter | ||
from zope.interface import implementer | ||
|
||
|
||
@implementer(IFieldDeserializer) | ||
@adapter(IJSONField, IBlocks, IExportImportRequestMarker) | ||
class ExportImportBlocksDeserializer(DefaultFieldDeserializer): | ||
"""We skip the subscribers that deserialize the blocks from the frontend. | ||
We only need the raw data. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<configure xmlns="http://namespaces.zope.org/zope"> | ||
<adapter factory=".blob.ExportImportNamedFieldDeserializer" /> | ||
<adapter factory=".blocks.ExportImportBlocksDeserializer" /> | ||
</configure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from plone.exportimport.interfaces import IExportImportRequestMarker | ||
from plone.restapi.behaviors import IBlocks | ||
from plone.restapi.interfaces import IFieldSerializer | ||
from plone.restapi.serializer.dxfields import DefaultFieldSerializer | ||
from plone.schema import IJSONField | ||
from zope.component import adapter | ||
from zope.interface import implementer | ||
|
||
|
||
@adapter(IJSONField, IBlocks, IExportImportRequestMarker) | ||
@implementer(IFieldSerializer) | ||
class ExportImportBlocksSerializer(DefaultFieldSerializer): | ||
"""We skip the subscribers that serialize the blocks for the frontend. | ||
We only need the raw data. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters