Plone
This is here to serve as contents for the atom/rss feed for Plone, also read by planet.plone.org.
Lightning talks Thursday
Lightning talks on Thursday at the Plone Conference 2017 in Barcelona.
Andreas Jung: Plone and the blockchain
Blockchain is the base technology behind bitcoin, but it is not bound to crypto currencies. It is a distributed data structure, usually based on peer to peer. No central entity of control.
Each block has a hash of its previous block, timestamp, transaction root, and a nonce.
Use cases: auditing, financial transactions, logistics, QA, legal, automotive, others.
What does this have to do with Plone and CMS? Some ideas:
- revision safety
- audit trail
- verification of content integrity and authenticity
Our use case: collaborative editing environment. So we created SmashDocs. Using Plone and BigChainDb.
Erico Andrei: Websauna
Websauna is a web framework based on Pyramid. https://tokenmarket.net is created with that, also with blockchain BTW. Miko says hi!
I am using it too, and helping him. We want you on board as well, and we can sprint on it. Also we want to improve Pyramid. Move Websauna to Pyramid 1.9. Documentation. User testing.
See https://websauna.org.
Alexander, Anton: Ploneconf and PyconWeb
Why don't we make a PyconWeb conference? We did that last year. Next one starting on 9 June 1918. See you at https://pyconweb.com
Fred van Dijk: Music to your ears
Confession: I am a bit of an audiophile. When I talk with people about how they listen to music, I get sad. Lot of people use a ten euro headphone. "I don't hear a difference with more expensive ones." I am convinced that a better audio setup helps you work better.
What is the weakest link? Music source (up the settings), D/A converter (underestimated component), cables (spend twenty euros, that's the sweet spot), headphones (ten euro and you expect quality?).
If you divide the costs over the number of hours you listen music: I came at six cents an hour.
Especially the D/A converter (USB) really helped me.
Nejc Zupan: A few Pyramid goodies by Niteo
- pyramid_force_https
- pyramid_redirect
- pyramid_heroku
Releases are on PyPI, enjoy!
Manuel Reinhardt: Giesing 2060
Science fiction writing project about an area of Munich in the year 2060. Using Plone, two content types, snippets that give links to other story snippets, different story lines, you can read through it in various ways.
If you like reading or writing science fiction or Python code, or both, have a look at http://giesing2060.de
Alexander Pilz: Ten years of Euphorie
A Plone success story.
This is a software to guide employers and employees for mandatory health and safety risk assessment. In 2007 Euphorie was created by Wichert Akkerman and Cornelis Kolbach, with the NuPlone interface (currently still working on Plone 5 actually). In 2008 adopted by Europe. In 2016 interest by an industry client of ours.
Why was this successful with Plone? Customisation and enhancement was made easy. Good security. Open source. Now they no longer need to cary kilos of paperwork to factories.
Jens Klein: Alpine City Sprint
I invite you to come to Innsbruck to work with us on the next Plone. Today on an open space we discussed that we may be using Zope 4 on Plone 5.2, and we can work on that.
Welcome January 2018 in Austria. We always visit a special place as well, now a space lab, with simulation for Mars missions.
Denys Mishunov: debugger; for Developers
Keynote talk by Denys Mishunov at the Plone Conference 2017 in Barcelona.
It's been a long time since I have been in the Plone community. Good to see so many old friends! Literally old. :-)
I am Denys and I have a problem. I am a developer. Should I use Angular or React? Plone? I am not going to talk about that. I am going to talk about us as humans.
Goldman's dilemma, phrased in 1982: 'If I had a magic pill and it would let me win every match for the next five years, and then kill me, would I take it?' A lot of people would do that, for five years of success. There is no such pill, no single road to success.
As developer your life begins, you read a first book, you do a first project, you get your first job as developer, things look good. But: our program starts raising errors. When that happens, you stop, debug, and fix.
Perfectionism
One of the bugs is: perfectionism. 'Denys, your work style is like champagne. The company that we merge with, their style is more like prosecco. Less good, but at a party no one notices the difference.'
Perfectionism can be really good and bad. It can be healthy and unhealthy, positive and negative. Steve Jobs was a perfectionist. That worked out good for consumers, but he could be hard to work with, having problems picking the perfect beige color.
Several perfectionist problems:
- Perfectionist paralysis. This can be one reason for procrastination, waiting for an ideal moment to start with an ideal project. Fear of failure: not getting a perfect result. They want perfect tasks, where they know they will succeed.
- Picking a detail.
- Unnecessary task. 'This can be improved. It is not hard, it would not take more than fifteen minutes.' And you spend a day on something that does not give value, or even makes things worse. Perfectionists never know when to stop.
So stop being a perfectionist? No, make your perfectionism positive. Henry Ford was a perfectionist, constantly improving the design, and never going in production. He failed at two companies before investors stopped him.
Think: 'My product should be perfect. And this release/feature/commit moves me one step closer to this perfect result.' Stephen Hawking: 'Perfection simply doesn't exist.'
Imposter phenomenon
- You think that your success is due to luck/timing/etc.
- You think that others might discover that you are not as skilled as they think you are
- You think that others are more intelligent than you are.
Will Smith: 'What people think is my self confidence, is actually my fear.' Lots of people have this. Among them very successful people. Both men and women have this, also in science, shown by studies.
I read websites, Twitter, news feeds, RSS, I get a lot of information, but I cannot read everything. And I still have to work. So I stopped reading them. I may skim the titles, and open a few browser tabs, and leave them open for a few days. I did not want to read it, but my imposter syndrome wanted to read it.
What do we do about it?
- Embrace imposterism. When you are about to read yet another news story: stop and enjoy. You are learning.
- Measure yourself with your own yard stick. That is a good comparison.
- Communicate your fears. Writer Neill Gaiman met Neill Armstrong. 'If he feels like an imposter, maybe everyone else does.'
Long hours
Have you ever worked long hours? Once? Regularly? Did the code work the day after?
A regret of many people before they die is: why have I worked so hard?
Long hours happen. It can be temporary, which can be normal for a hard worker. But it can also be permanent, which is a signal for a workaholic. It is hard to spot the difference. Hard working people have some balance. Are you working and thinking of skiing? Or the other way around?
If you normally work 40 hours, and you work 20 hours more, then this raises productivity for three to four weeks. After that, it drops. Why? Our brain gets tired. So we make errors. So we lack accomplishment. So we make long hours to fix those bugs. And we are in a loop.
The Japanese have a word 'karoshi': death by overwork. Same for 'Guolaosi' in Chinese: 1600 deaths a day.
When the brain detects stress, it sends signals: the chemicals adrenalin and cortisol. This couple is essential for our well being. But when applied for a prolonged period of time, things go wrong: premature ageing of our brain, drop in learning abilities, weakened memory. So it leads to mental disability: you work long hours, and you end up with dementia or alzheimer.
How do we prevent stress?
Look at Harvard University, established 1636, home to 133 nobel laureates and 8 presidents. Students asked if they could do a four year study in three years. Answer: 'Slow down. Get more out of Harvard by doing less. Take a year off.' It helped those who returned after a year. 'College can help you learn how to think, more than what to think.' We need room to think.
Our lives have only version 1.0. We need to fix bugs live, in production.
We need more healthy and happy developers. Acknowledging a problem is the first step to mental health. Debug yourself often and stay healthy and happy. Thank you.
See also my article in Smashing magazine which was published yesterday.
Trust me: at thirty five, either you start thinking about health, or health starts thinking about you.
Alexander Loechel: Modern Python Testing
Talk by Alexander Loechel at the Plone Conference 2017 in Barcelona.
I have worked in the German air force. They have rules on how to write software. For example, you start with user requirements. In open source, who is writing down user requirements? The requirements are there, but they are often implicit. Write tests that test the requirements.
'Testing leads to failure. Failure leads to understanding.'
A test is a specific set of assertions.
You can test requirements, design, interfaces, code/implementation, documentation (embedded code), conventions.
The basis for tests in Python is the unittest module. It has lots of specific assertions, like assertEqual, assertIsNotNone, etc. But why can't we simply use assert? That is what the pytest module does instead. It makes writing the test simpler. It is by now the de facto standard in the Python world. It has a pluggable add-on system.
There is unittest2, nose, nose2, but today they are mostly outdated. Use pytest.
Robot framework is used by Plone to do web testing with a real browser.
Richard Feynman: 'The first principle is that you must not fool yourself, and you are the easiest person to fool.'
For test runners we have the unittest testrunner, zope.testrunner, pytest-testrunner, gocept.pytestlayer. Such a runner collects tests for execution and shows the outcome to the user. If you use unittest, you can use these. A test runner can interact with other tools, like coverage.
On a command line you can usually run python setup.py test to run tests. Or you have scripts to run it, like buildout can install with a recipe.
You want to run your tests automatically on a test server:
- Travis CI has Linux and MacOSX machines, and are perfect for pure Python tests
- Circle CI has Docker containers for Linux and MacOSX
- Appveyor tests on Windows.
On Travis you can use travis_retry in your .travis.yml file to retry a command three times. This can help when there is a temporary network problem.
tox is a test invocation tool. You use it to run your tests on multiple environments, for example Python 2 and 3, or with an extra package installed. You can use additional helpers like pyenv for virtual environments. One of the environments can apply isort, or run zest.releaser, even if these environments are not run by default. Or you can run a linter and have it report on your code quality.
My wishes for better practices in Plone:
- Adapt tox on all packages.
- Switch to different package structure and enforce that, like bobtemplates.plone, with docs, src, Tests.
Maybe do not ship with the tests in the PyPI releases: this code will not be run in production. Tests belong in the source distribution, but not in binary packages like wheels or eggs. The unit tests should be tested within the actual package. Integration tests could live somewhere else.
See http://plone-best-practices-discussion.readthedocs.io/
See the slides.
Open space about headless CMS
Open space at the Plone Conference 2017 in Barcelona.
MVP (minimal viable product) approach can be good. Start with a basic skate board, then go for the best skate board in the world. Create a set of user stories, like: login, add, edit, delete content, add images. SEO so you can be found on search engines. Get something basic where companies and individuals can jump on board. Start with a small project that can grow.
'Medium' editor can be an option, more lightweight than TinyMCE. Editors can be fine on their own, but are usually hard to extend. Just some inline styles, like bold, italic, link, can be enough as basis. We can start with any editor and try to make it work. We can base on the GraphJS editor, where Rob Gietema did a prototype. We don't want to reinvent our own editor.
Which exact editor we use, should be an implementation detail. We should still decide what the features should be, how the user experience should work for the editor.
We need to put an editor in the hands of actual users and see if they can actually use it or are confused.
We know about React and Angular, and they can battle it out. But what css framework should we choose? If we have a prototype with either React or Angular, then after that we will be more able to pick a certain css framework.
Just get something done. If we wait until we are sure, then it will automatically be the wrong choice by the time we are done.
We will not take everything we currently have in Plone and reimplement it in Javascript. Expose the backend to the frontend, and then you can do on the frontend whatever you want to do. Want other widgets? Take another javascript widget library.
Don't try to solve too many problems at the same time.
We can also just call it a proof of concept, then no one will care about the implementation. Hire someone to do it in PHP, that is fine too.
MVP:
- login
- add a page with title and text, no wysiwyg yet
- view a page
- edit a page
- mark body text as bold, italic, add a link
- add image to the body text of a page. That includes folderish content, and drag and drop, so that is a large thing that can be split up
- Take less than half a second to view the page.
- Let Google see the page.
The backend can just be current Plone, maybe with a bit of helper code.
We may need a folderish page type, where you can drop files and images. But let's not discuss folderish types for hours, let's start building. Try it and see what works.
If with plone.restapi it works on Plone 4, then that makes it far easier to show on current existing sites to actual users.
But apparently we want to store the page content as json and not html, so that is not likely on Plone 4. Well, for new content it could work, but you will not be able to edit content that was created with TinyMCE. For example, you cannot edit tables yet.
Is the user the end user, or the frontend developer?
For A/B testing, we could strip down TinyMCE to only do what our new UI will be able to do, for better comparison.
It is not up to us to decide if this goes into Plone core or not. We just want to show the Pastanaga UI.
Second part: how do we make this happen?
We can work on this during the conference sprint. We already had sprints. We can fund more sprints.
We could build an MVP during a project that we have recently started, but the budget is probably not enough. If other companies have similar projects, that would help.
Raise awareness on the Pastanaga project homepage, showing which company or individual sponsored or did another contribution.
An MVP would help to make more things happen. I don't want the MVP to take a year to finish.
The highest risk is: not doing something.
Lots of us no longer have the possibility to put in free time. Albert and Rob and Roel put in a lot of time. I (Timo) hardly have time to code anymore.
If this takes two years, then it is too long.
Can we get people from the Javascript community interested and involved? If we can't attract them, then why are we doing this and where will Plone be in a couple of years? Aren't they our target users after all?
Can we explain the Pastanaga UI on a website, and get people on board that way.
Money can also make things happen, get some companies to fund it, and hire some developers from the Plone community to do it.
Artur Iulian Daschevici: Hacking real time messaging with Firebase
Talk by Artur Iulian Daschevici at the Plone Conference 2017 in Barcelona.
For notifications I would normally use Redis and PubSub. Then you need an app server, a way of scaling this, centralized logging, etcetera. You end up with an overengineered system for which you need three fulltime developers. Can we do better?
I use Firebase. This is a suite of lots of things, inluding:
- free CDN and SSL
- easy OAuth
- a free tier
- good scaling
It includes the Firebase realtime database which I will use. You can register a new firebase based app only and start building quickly.
Some packages in combination with React:
- reactfire
- react-redux-firebase
- firebase
I use Pyrebase on the Python backend.
In the frontend, I use redux-saga, a redux middleware for handling side effects. It communicates directly with the API.
Demo code: https://github.com/adaschevici/firebase-demo
Twitter: @_arturdas.