GSoC 2018 Ideas: "Big Green Button" with plone.restapi and GatsbyJS

Hi all,
I'm Aditya Todkar from India. I am interested in working on this project idea: GatsbyJS Integration as part of GSOC2018. I am proficient in Javascript, Python, ReactJS. How can I proceed further ? Should I fork this repo -> https://github.com/plone/plone-react/issues and start contributing. As the project also needs GraphQL knowledge can you please suggest some core concepts which I should look in GraphQL as I am not familiar with GraphQL.

Regards,
Aditya

Please bear with us for a few more days. We are currently working hard on contributing back our work to plone-react to bring it into a stable state.

@tisto Ok no problem till then I will go through the plone-react code repo https://github.com/plone/plone-react/issues to get familiar with the code base and I will also got through GraphQL docs. Anything else I should be familiar with before contributing ? For GatsbyJS Integration project do I need to download and setup plone as mentioned in this thread Information for Interested GSoC Students

If you are interested in Gatsby and Plone please use https://github.com/collective/gatsby-source-plone/. You can ignore plone-react then.

@tisto I see that we're using Plone at localhost:8080 to get the data. Then is it required that I should use the Plone installation created using buildout in the repo? Or can I use an existing Plone installation? Any specific buildout configs changed here?

It works for me with the existing Plone installation.
As you can see in the code, the data is being fetched from localhost:8080.

1 Like

7 posts were split to a new topic: What does "ZEO" stand for?

One more thing I noticed was that, throughout the gatsby-node.js there is no specification stating retrieve all objects from Plone/@search as allNewsItem. But when using GraphQL to query from these nodes, we seem to be specifying allNewsItem as the array of objects. How does this happen?

Sounds like an error to me. Though, in den end we want to be able to retrieve all content objects anyways. Querying just the news items was just a PoC.

1 Like

@tisto (/cc @ajayns) Why does Pastanaga UI have so big role in this idea? AFAIK Pastanaga is mainly CMS authoring UI / UX for logged-in users while GatsbyJS is for building static web sites from CMS (which could have Pastanaga UI for its editor). Even if GatsbyJS built site had interactive elements, those would more probably be themed after customer design than reusing things from Pastanaga?

IMO, having a 1st class and well documented GatsbyJS plugin would be more than enough deliverable from GSOC already without any Pastanaga related work?

@ajayns Something to consider as a very concrete user scenario for GatsbyJS with Plone:

Plone CMS has awesome support for managing multiple small "subsites" in a single Plone site with zero extra effort. Unfortunately, theming and hosting those subsites separately from the main site is no longer trivial, easy or cheap. It's possible, but there is no single obvious solution. GatsbyJS-integration could be that solution.

I have no clue why we mix Gatsby and Pastanaga UI here to be honest. The two projects are separated. I fully agree that a working GatsbyJS plugin would be more than enough for a single GSoC project.

2 Likes

Thanks for confirming that :slight_smile:

I'd like to note here that a week ago our great @ericof published a pip based Plone docker image, which can be extended in a standardized trivial way (=pip) with plone.restapi for this GSOC project.

https://hub.docker.com/r/ericof/plone/

So, only GatsbyJS related technical experience is required here. Understanding / learning the basic concepts of managing content with Plone would help.

That makes a lot of sense, so better focus on the plugin.

I agree Gatsby would be an efficient and simple solution here. But I didn't quite understand what's meant by Plone sites with multiple subsites, can you give me any example so that I can better understand?
@datakurre Thank you

This seems be a misunderstanding. The information provided in the GSoC ideas page for Plone for GatsbyJS integration is misleading as it mentions such goals. @tisto

Plone maps content into folder and pages and manages permissions similarly to hierarchical filesystem (objects inherit permissions from their parents). This makes Plone good CMS for large hierarchical organizations like universities. Think about having:

  • A single big Plone CMS for an university faculty.
  • It could have subfolders for departments.
  • Departments can have subfolders for subjects.
  • Some subject decides to organize on event, which requires a branded promotion site.

With good GatsbyJS plugin we could let event organizers to manage the event details with their familiar CMS environment, in their own section with proper permissions, but still easily publish branded static promotion site with its own domain etc. (So, with good GatsbyJS plugin we could spin-off many small branded static sites from one big CMS whenever we like to.)

(To better support this use case, Plone has feature called "navigation root". Once some subfolder is marked to be a "navigation root". It will affect sidebar navigation, breadcrumbs, etc. to behave like that "navigation root marker subfolder" was the actual site root.)

@ajayns have a look at collective.lineage, which packages this sort of behaviour

IMO, understanding the concept is enough :slight_smile: And for simply use cases, no extra add-ons are required (it's enough to add "/manage" after the current subfolder URL, click "Interfaces" tab from that "Zope management interface", find and add line with INavigationRoot to the folder "interfaces").

@sneridagh also created a docker image with Plone 5.1.0 and plone.restapi:

https://hub.docker.com/r/kitconcept/plone.restapi/

a 'single' solution? are you not overreaching a little ? if there is dynamic content, generated with javascript, there is no way that plone.restapi will give appropriate information to gatsby.js (or anything else than a compatible Plone site) to regenerate an equivalent display. To give an simple example : if a map is displayed on the Plone site, gatsby.js will get a json file with data along the lines of

"coordinates": "POINT (35.506568821049 33.898032315579)",
(...)
"marker_image": "string:++plone++openlayers.static/openlayers/img/marker.png",
"marker_image_size": 0.7,

absolutely not something standard like a KMS file. For it to work someone should write a specific interface, no restapi magic will solve this. If gatsby.js can't display a KMS file, it would be necessary to replace the map with a static image or a PDF.

So it can be 'a' solution for some sites yes of course.
Not a general solution for all cases IMO.