Weblog

published Nov 03, 2021, last modified Nov 04, 2021

Jens Klein: Forging a New Installer

published Oct 26, 2021

Talk by Jens Klein at the online Plone Conference 2021.

The old installer needs updating.

In the past we had the UnifiedInstaller. This tried to do all in one: install Python from scratch at first (not anymore), buildout based, support as many OS as possible. It has become too complex and won't be used for plone 6.

In the future we want to use the standard tooling. There is tooling for backend Python and frontend Node. Python and Node themselves are widely available. Use pip and npm to install backend and frontend. Use containers / Docker.

So: no installer. But we have tooling.

  • Use pip install Plone
  • Use pip to install add-ons.
  • Use standard Zope scripts to create the instance.
  • npm run yo init @plone/volto to bootstrap your Volto frontend.

You may now say: "Stop! This is a lot to install on my machine!." So we use containers:

docker run plone-[webserver|frontend|backend|database]

Run it in Docker of Kubernetes. Inside it, we run:

  • webserver: nginx (or Traefik, Caddy)
  • frontend: Volto
  • backend: Plone application server
  • database: ZEO+blobstorage, or PostGreSQL (recommended) or MySQL/Oracle

It is easy to start with. You can do local development with containers. It integrates well with CI/CD processes. The container image is a frozen version of the whole application. So you have isolated environments and repeatable deployments.

Workflow example:

  • Two repos or directories with backend and frontend customizations
  • Dockerfile
  • Setup Gitlab CI/CD workflow to build containers and store in registry.
  • Auto deploy to testing/staging/live.

You could use Ansible and similar tools (I won't).

Disclaimer: this is work in progress. Official images:

This needs help.

  • Try the new setup.
  • Ask questions at community.plone.org
  • Is it inconvenient? Tell us how to improve.
  • Have you found a problem? Create an issue.
  • Have you fixed a problem? Create a pull request.

Philip Bauer: Why relations are awesome

published Oct 26, 2021

Talk by Philip Bauer at the online Plone Conference 2021.

Relations in Plone are incredibly powerful. It has lots of sophisticated options. But Plone does not use most of them. Plone here is like a toddler in a Lamborghini.

You can use relations in fields, and Plone also uses two relations without fields:

  • working copy (iterate)
  • linkintegrity checking

There are at least nine packages required to build one simple relation. Is that okay? My answer: yes, that's all fine. Why? It is stable, very fast, very flexible (more than Plone needs), and documented. Well, the documentation is difficult.

What's new in Plone?

  1. We now have a sane Python api for relations:

    api.relation.create
    api.relation.get
    api.relation.delete
    

Get all friends who have a relation with Bob:

api.relation.get(target=bob, relationship="friend)

Get all relations of Alice:

api.relation.get(source=alice)

Create a relation between Bob and Alice and store it on a field with name "friend" if it exists:

api.relation.create(source=bob, target=alice, relationship="friend")

You can use this in Plone 5 on Python 3. On Python 2 you can use the similar collective.relationhelpers.

  1. We have a controlpanel for relations.

You can inspect relations and back relations. It also has a magic "Rebuild" button. This will purge all relations, and restore them. This is useful, especially after an in-place migration, to get rid of broken relations.

In Plone 6 this is built in. In Plone 5 you can use `` collective.relationhelpers`` but you need to remember the url of the controlpanel.

  1. Helpers to manage, inspect and rebuild relations.

See from Products.CMFPlone import relationhelper.

  1. Better and more relation fields

There are default relation fields with default widgets, but you now have more choices for the widgets.

A nice helper is the new StaticCatalogVocabulary that you can use a vocabulary.

Documentation and examples:

You can also do relation fields without relations: store a uuid instead of a relation value. You can use a schema.Choice field with a RelatedItemsFieldWidget. But watch out: when you delete a content item that this field points to, Plone will do no cleanup for you. For relations, this does happen.

What about Volto?

  • The related items field is not displayed.
  • RelationChoice is broken
  • None of the new widget types work

We need to fix those, and I have filed issues for them. Also, we may want to have an endpoint in plone.restapi to query relations.

Timo Stollenwerk: Plone 6 - Power and Control

published Oct 26, 2021

Keynote talk by Timo Stollenwerk at the online Plone Conference 2021.

As a kid, I played tennis. I was taught to hit the ball hard, and as close as possible over the net. Nowadays, trainers tell you to hit the ball slower, hit it longer, giving you more control, with topspin. So that is a trade-off between power and control.

A traditional, classic CMS is usually stuck in the past. Using dead technologies, like jQueryUI, an old stack. That is partially true for Plone 5 as well, although it looks prettier than most of the others.

WordPress uses the Gutenberg editor. Whenever I try out WordPress again, I keep having the feeling: I am not smart enough for this. I add a few images, and want to make them look the same size. They have lots of controls for that. Eventually I succeed, because I am a web developer. For text, you can choose lots of sizes and colors.

But: I am not a designer. I can accidentally pick a color combination that does not work for colorblind people. I don't know all this, so I tinker around and end up with a bad product.

The web is hard. You need a consistent design. Designers themselves are specialized into UI or UX. It needs to be responsive.

Plone 6 is not a classic CMS. It is a modern CMS providing both power and easy of use, and I think it is the only enterprise CMS that offers this.

Albert Casado created the Pastanaga UI. In the toolbar you see options to add or edit or order content, and the rest is still there, but hidden. For image alignment we show four options, and for size three options. This is simple, but it already gives you twelve possible combinations.

The Plone 6 UI is all about blocks, blocks, blocks. Responsive design means you usually have only one column, instead of the three that you can have in Plone 5.2. That single column will be a stream of blocks.

In Plone 6 you can use grid layouts. We started from scratch a couple of times on this, but we have something good now.

We have a teaser block. This is often used for landing pages. You add a teaser block that is linked to an existing content item, and it will show its image, title, description.

Plone 6 will ship with a few default blocks, like text, image, video, table of contents, etcetera. There are about a hundred Plone packages on npm now which have their own blocks. The Plone company Eau de Web works for the EEA (European Environment Agency) and they open source all their blocks, for example a faceted search block. RedTurtle created a forms block. Some others did as well, and then we usually cooperate and end up with an improved version.

We have "No Code Content Types". You can create contenttypes TTW in Plone, but what was always missing, was templates so you can customize how they look. We now have that.

The Volto frontend that will be in Plone 6 is in production use since 2019. A top German government institution uses Plone 6, American universities, Osaka University in Japan, EEA in Europe, many municipalities in Italy.

Today you can use battle tested Plone 5.2 plus Plone REST api plus Volto. That is already Plone 6-ish. You can also use the real Plone 6 alpha release.

In the past, all Plone versions were supported for many many years, but we never really advertised it. Now the Release Team and Security Team have said they will support Plone 6 for at least five years.

If you are not ready yet and need more time before you jump on Volto, then you can use Plone Classic UI. There is no need to rush, we have got you covered.

Summary: Plone 6 provides something really unique.

Maik Derstappen: Efficient Backend development for Plone

published Oct 25, 2021

Talk by Maik Derstappen at the online Plone Conference 2021.

How can we efficiently develop a Plone backend? What do we expect from the tooling?

  • Should be easy to adopt for new developers
  • reduced development time
  • following best practices
  • provide test infrastructure and basic tests

These are our two friends:

  • plonecli
  • plone-snippets for VS Code

plonecli is a command line tool, installed with pip together with bobtemplates.plone, here version 6.0b10. With it, you iteratively enhance your add-on.

Let's create a restaurant add-on with a content type for the menu data, a vocabulary for the menu category, control panel, plus a bit more.

Demo:

plonecli create addon collective.restaurant
cd collective.restaurant/
plonecli add controlpanel

Open Visual Studio Code (my preferred editor) and edit the created controlpanel.py. Add a field: a list of categories. Now add a vocabulary for this:

plonecli add vocabulary

Edit menu_category.py to let this get the contents of the controlpanel field from the registry.

Add two content types: Menu and Menu Item:

plonecli add content_type

Edit menu_item.py. When you have plone-vs-snippets installed in VS Code, it is easy to add fields. Add a photo (NamedBlobImage), menu_category (Choice with your menu vocabulary name).

Edit the types/*.xml files to enable behaviors like plone.basic and plone.namefromtitle.

Now get a local environment, mostly by running buildout, and start the instance, with:

plonecli build
plonecli serve

On http://localhost:8080 create a Plone Site and activate collective.restaurant and plone.restapi. Go to the Restaurant control panel and add a few categories, like Starters, Main, Desserts. Now you can add a Menu folder and add menu items in various categories.

The basic data is available through the REST api. But we want more. Add a service RelatedDishes:

plonecli add restapi service

Edit api/services/related_dishes/get.py and use api.content.find to look for other Menu Items with the same category.

To make searching easier, edit profiles/default/catalog.xml. With the Plone VS code snippets, you can agains easily add a catalog index here. We will need an upgrade step to apply this:

plonecli add upgrade_step

Restart, reindex, and it works.

Please help by contributing templates to bobtemplates.plone or create an issue when you think a template can be improved. Or create an own similar package, like bobtemplates.migration.

Ideas for the future:

  • Rest API support question in addon template
  • Rest API sub-templates for serializer and deserializer
  • support for Mosaic tiles
  • graphical UI (ncurses) to make choices easier

Kim Paulissen: Revamping the plone training and documentation setup for plone 6

published Oct 25, 2021

Talk by Kim Paulissen at the online Plone Conference 2021.

I have been working alongside of the documentation training teams the past months. In this talk I will tell you about the past, present and future of these. Of course, I follow this with a call to contribute!

I am just a messenger. Discussions can get heated between developers when talking about how to document things. Don't shoot the messenger.

https://plone.org should use Plone 6, with default frontend Volto. Rikupekka Oksanen will talk about that tomorrow.

Plone documentation

In the past, the documentation has been written in ReStructuredText, which is a markup language mostly used in the Python community. It was turned into readable web pages using Sphinx, a Python tool.

The main current contents, with target groups:

  • Working with content: for users
  • Adapting and extending Plone: for power users
  • Installing, managing and updating Plone: for sysadmins
  • Developing for Plone: for developers

Now to the present, or what is presently being created. Technology:

  • Markdown as markup language / syntax
  • Docusaurus as React based static site generator

Why this shift?

  • Plone 6 is a headless CMS with Volto (React) as default frontend.
  • Markdown is easier for new (and old) contributors.
  • Easy preview on GitHub and in an IDE.
  • For the people who need to create the new documentation focusing on Volto, they do not need to switch tech stacks.
  • In this way you can focus on the content.

We are not there yet. Various people are working on various branches:

The documentation is still setup to to separated into the two frontend options: Volto and Classic.

All content will be made from scratch. There was an enormous set of docs, some very old, and completely different from what we need now. The old docs will still be kept available.

Daydreaming for the future:

  • up to date documentation that is intuitive for all different parts of our setup
  • improved options for contributing
  • good CI/CD, resulting in changes that get to the live site fast

Plone training

For https://training.plone.org in the past we were using the same technology as docs.plone.org: ReStructuredText and Sphinx.

In the present, we moved to Markdown. Well, to MyST actually. This has most benefits of ReStructuredText added inside Markdown. If you don't know RST, you can simply write Markdown.

It still uses Sphinx, but with Markdown. We use the sphinx-book-theme.

The training team has restructured all the trainings. All were migrated to MyST.

Daydreaming for the future:

  • use the same tech stack for both docs and training
  • integrated following a good documentation system