Skip to content

Commit

Permalink
Setting up plone export and import. (#36)
Browse files Browse the repository at this point in the history
* initial commit

* Fix exports

* Pin plone.distribution >= 2.0.0b1

---------

Co-authored-by: Víctor Fernández de Alba <[email protected]>
Co-authored-by: David Glick <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 18dfa3c commit 78e8d27
Show file tree
Hide file tree
Showing 137 changed files with 66,736 additions and 31,355 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ ifeq ($(PYTHON_VERSION_OK),0)
endif

BACKEND_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
EXAMPLE_CONTENT_FOLDER=${BACKEND_FOLDER}/src/kitconcept/voltolighttheme/setuphandlers/examplecontent
PLONE_SITE_ID=Plone


GIT_FOLDER=$(BACKEND_FOLDER)/.git

Expand Down Expand Up @@ -123,6 +126,14 @@ i18n: bin/i18ndude ## Update locales
@echo "$(GREEN)==> Updating locales$(RESET)"
bin/update_dist_locale


# Example Content
.PHONY: update-example-content
update-example-content: bin/tox ## Export example content inside package
@echo "$(GREEN)==> Export example content into $(EXAMPLE_CONTENT_FOLDER) $(RESET)"
if [ -d $(EXAMPLE_CONTENT_FOLDER)/content ]; then rm -r $(EXAMPLE_CONTENT_FOLDER)/* ;fi
bin/plone-exporter instance/etc/zope.conf $(PLONE_SITE_ID) $(EXAMPLE_CONTENT_FOLDER)

# Tests
.PHONY: test
test: bin/tox ## run tests
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ Or, create a site from the command line (first stop the instance):
```shell
make create-site
```

### Exporting the content

After editing the content on the running instance, point your browser to [http://localhost:8080/Plone/@@dist_export_all](http://localhost:8080/Plone/@@dist_export_all), select this distribution and export everything.

After that, you will have the content available (in the `collective.exportimport` format) at `src/kitconcept/voltolighttheme/distributions/voltolighttheme/content`.
After that, you will have the content available (in the `plone.exportimport` format) at `src/kitconcept/voltolighttheme/distributions/voltolighttheme/content`.

### Resources

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
install_requires=[
"setuptools",
"Plone",
"plone.distribution==1.0.0b4",
"plone.distribution>=2.0.0b1",
],
extras_require={
"test": [
Expand Down
29,598 changes: 0 additions & 29,598 deletions src/kitconcept/voltolighttheme/distributions/voltolighttheme/content/content.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"@id": "/block/introduction-block",
"@type": "Document",
"UID": "00cef5f245a342958288ace545e3c097",
"allow_discussion": false,
"blocks": {
"177de529-ce72-4721-a58c-15feadaf285e": {
"@type": "slate",
"plaintext": "Lorem ipsum dolor sit amet adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.",
"value": [
{
"children": [
{
"text": "Lorem ipsum dolor sit amet adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."
}
],
"type": "p"
}
]
},
"26accd80-9715-43ea-9b7c-aa0b3be7d0da": {
"@type": "slate",
"plaintext": "Headline H2",
"styles": {},
"value": [
{
"children": [
{
"text": "Headline H2"
}
],
"type": "h2"
}
]
},
"50727b9a-1f8a-4857-aab5-8acc6985bfc6": {
"@type": "title"
},
"cec08900-0334-4288-9ece-f5d15d4dd6f1": {
"@type": "separator",
"styles": {
"align": "full"
}
},
"d0438a28-aaaf-4db1-8887-c9b3351787d3": {
"@type": "separator",
"styles": {
"align": "full"
}
},
"d35f209e-12c1-4a30-ae36-52f84a4a0b7b": {
"@type": "introduction",
"plaintext": "Highlight Title H2\nLorem ipsum vitae elit libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Vestibulum id ligula porta felis euismod semper.",
"value": [
{
"children": [
{
"text": "Highlight Title H2 "
}
],
"type": "h2"
},
{
"children": [
{
"text": "Lorem ipsum vitae elit libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Vestibulum id ligula porta felis euismod semper."
}
],
"type": "p"
}
]
}
},
"blocks_layout": {
"items": [
"50727b9a-1f8a-4857-aab5-8acc6985bfc6",
"d0438a28-aaaf-4db1-8887-c9b3351787d3",
"d35f209e-12c1-4a30-ae36-52f84a4a0b7b",
"cec08900-0334-4288-9ece-f5d15d4dd6f1",
"26accd80-9715-43ea-9b7c-aa0b3be7d0da",
"177de529-ce72-4721-a58c-15feadaf285e"
]
},
"contributors": [],
"created": "2023-07-06T21:35:19+00:00",
"creators": [
"admin"
],
"description": "\nThe introductory block allows the display of an introductory text, which is displayed larger than normal continuous text.",
"effective": "2023-07-06T18:35:00",
"exclude_from_nav": false,
"expires": null,
"exportimport.constrains": {},
"exportimport.conversation": [],
"exportimport.versions": {},
"id": "introduction-block",
"is_folderish": true,
"language": "##DEFAULT##",
"layout": "document_view",
"lock": {
"locked": false,
"stealable": true
},
"modified": "2023-09-22T14:41:12+00:00",
"nav_title": null,
"parent": {
"@id": "/block",
"@type": "Document",
"UID": "425695d2b7cb47e69374d6f211f17e38",
"description": "",
"image_field": null,
"image_scales": null,
"review_state": "published",
"title": "Blocks",
"type_title": "Page"
},
"preview_caption": null,
"preview_image": {
"blob_path": "00cef5f245a342958288ace545e3c097/preview_image/black-starry-night.jpg",
"content-type": "image/jpeg",
"filename": "black-starry-night.jpg",
"height": 1708,
"size": 693013,
"width": 2400
},
"review_state": "published",
"rights": "",
"subjects": [],
"title": "Introduction",
"type_title": "Page",
"version": "current",
"workflow_history": {
"simple_publication_workflow": [
{
"action": null,
"actor": "admin",
"comments": "",
"review_state": "private",
"time": "2023-07-06T21:35:19+00:00"
},
{
"action": "publish",
"actor": "admin",
"comments": "",
"review_state": "published",
"time": "2023-07-06T21:35:19+00:00"
}
]
},
"working_copy": null,
"working_copy_of": null
}
Loading

0 comments on commit 78e8d27

Please sign in to comment.