Planet Plone

This is where developers and integrators write about Plone, and is your best source for news and developments from the community.

June 24, 2014

Four Digits: Verslag Lightning Talks, volgende editie 26 september

by Kees Hink at 2014-06-24T07:40:00Z

Afgelopen vrijdag vond er een lightning talks-sessie plaats bij ons op kantoor. In dit stukje blikken we heel kort terug en kondigen we de volgende editie alvast aan.

De sprekers zorgden weer voor een gevariëerd programma. De eerste onderwerpen waren:

Foto: Patrick Kreling

  • Sherpa; the next step in E-learning (Henk Bohlander)
  • Subsidies in ICT (Rik van der Wel) (slides)
  • Bitcoin (Rogier Eijkelhof / Patrick van der Meijde)
  • LibreOffice (Cor Nouws)

Na een korte pauze ging het verder met:

  • Sociaal projectmanagent (Ton Meeuwissen)
  • GPX Energiebank (Egbert Bouwhuis)
  • Waarom zijn we aangetrokken tot mooie dingen? (Patrick Kreling)

Foto: Patrick Kreling

De sessie werd afgesloten met een borrel, waarbij er nog even werd nagepraat.

De volgende sessie zal plaatsvinden op vrijdag 26 september, weer vanaf 16:00. Opgeven, ook als spreker, kan via info@fourdigits.nl. Hopelijk zien we u dan.

(Foto's: Patrick Kreling)

June 23, 2014

Martijn Faassen: Morepath 0.3 released!

2014-06-23T13:53:13Z

Today I've released Morepath 0.3!

Morepath is a Python web framework that lets you write simple, flexible code for the modern web, and makes linking to things as easy as it should be.

New in Morepath 0.3 is the ability to write path directives that absorb the rest of the path. This is useful when you want to integrate a web server with a frontend that does its own client-side routing using the HTML 5 history API. In that case the server-side code needs an easy way to absorb all sub-paths so it can pass them to the frontend router.

Another feature is the ability to mark views as internal. This allows you to write a view that is not published on the web but is for reuse within other views.

Besides this Morepath 0.3 contains a number of bugfixes and documentation improvements. See CHANGES for more details.

If you like Morepath, please get in touch with me, either through the Morepath issue tracker or the #morepath IRC channel on Freenode. Let me know if there's interest in starting a mailing list too!

Six Feet Up: Plone "Cheese Sprint" a Success

by Calvin Hendryx-Parker at 2014-06-23T13:38:14Z

Six Feet Up recently participated in the "Cheese Sprint" that followed the annual Plone Symposium Midwest hosted at the University of Oshkosh on June 20-21-22, 2014. About 30 people gathered from various parts of the US and the world to work on six specific projects:

Improving the jbot resource editor was addressed by Nathan Van Gheem, Chrissy Wainwright, Rob Porter and Sam Schwartz, who worked toward being able to edit any Plone template through the web. This will make things easier for template developers as they will eventually be able to search through all available templates to make customizations without getting into the ZMI.

Enhancing the Plone login process (plone.login) was the focus of Joel Kleier, Franco Pellegrini, Andy Leeb and Clayton Parker, who strived to extend the overall Plone form modernization effort to the login process. The new system will support the use of external accounts to authenticate. It will also feature a more modern (and less intimidating) registration process whereby users can quickly create an account and fill out their profile later on.  Developers will also benefit from the improvements as it will be easier for them to customize elements of the login and authentication systems (e.g. password policy, user redirection after login, out-of-the-box user profile customization, etc.)

Improving collective.cover was done by Hector Velarde, Nathan Van Gheem, Gildardo Bautista and Adriana Ramirez. Collective.cover is an editor-friendly way of creating front pages and other composite pages. The goal is to make the tool more reliable by fixing some known bugs. The team is also working toward simplifying the code to facilitate the maintenance of the add-on down the road.

Accelerating back-end development was the focus of Ross Patterson, who specifically worked on improving the "test runner layers" tool. The idea is that improving the speed of the tests ran after each series of code changes will shorten development cycles, encourage more extensive test coverage, and facilitate bug fixes by keeping developers "in the flow".

Boosting the Plone installer approachability in Plone 5 was tackled by Sven Strack, Paul Roeland, Steve McMahon, Kurt Bendl, Calvin Hendryx-Parker and Clayton Parker. The team focused on various initiatives to make it much easier to deploy Plone. They worked on making the existing installer easier to use in different environments. They also worked on integrating the "Packer" tool into the Plone release process, so as to support the automatic creation of images for virtual boxes in various cloud environments.

Part of the efforts went toward simplifying the installation process in OS X and departing from the universal installer in response to the changes seen in OS X over the last few years. Finally, they also looked at making it easier for developers and integrators to create their own Plone add-ons through best practices documentation and an update of the Plone API.

Some team members specifically worked on generating example code to facilitate the integration into Plone of commonly used add-ons maintained by other open source communities (e.g. cookie, cutter, Mr Bob, etc.).

Adding success stories to the upcoming Plone.com site was tackled by Christina Mcneill, Carol Ganz, Gabrielle Hendryx-Parker, Sally Kleinfeldt, William Fennie, Luke Scorcio, Paul Roeland, Ken Wasetis and Peter Wood. The team identified a series of key features for various verticals and strived to develop a framework for submitting case studies for publication on the plone.com site. As a result of this exercise, several success stories were identified as potential illustrations of Plone use cases.

As always, sprints provide a great opportunity for community members to collaborate and advance. Check out plone.org for information about upcoming sprints.

eGenix: Python Meeting Düsseldorf - 2014-07-02

2014-06-23T08:00:00Z

The following text is in German, since we're announcing a regional user group meeting in Düsseldorf, Germany.

Ankündigung

Das nächste Python Meeting Düsseldorf findet an folgendem Termin statt:

Mittwoch, 02.07.2014, 18:00 Uhr
Raum 1, 2.OG im Bürgerhaus Stadtteilzentrum Bilk
Düsseldorfer Arcaden, Bachstr. 145, 40217 Düsseldorf


Neuigkeiten

Bereits angemeldete Vorträge

Marc-Andre Lemburg
       "Python Web Installer Pakete - On-Demand Download bei der Installation"
       "Die neue Python Software Foundation (PSF)"

Wir suchen noch weitere Vorträge. Bei Interesse, bitte unter info@pyddf.de melden.

Startzeit und Ort

Dieses Mal treffen wir uns wieder 18:00 Uhr im Bürgerhaus in den Düsseldorfer Arcaden.

Hier eine kurze Wegbeschreibung zum Meeting Raum:

Das Bürgerhaus teilt sich den Eingang mit dem Schwimmbad und befindet sich an der Seite der Tiefgarageneinfahrt der Düsseldorfer Arcaden.

Über dem Eingang steht ein großes “Schwimm’in Bilk” Logo. Hinter der Tür direkt links zu den zwei Aufzügen, dann in den 2. Stock hochfahren. Der Eingang zum Raum 1 liegt direkt links, wenn man aus dem Aufzug kommt.

>>> Eingang in Google Street View

Einleitung

Das Python Meeting Düsseldorf ist eine regelmäßige Veranstaltung in Düsseldorf, die sich an Python Begeisterte aus der Region wendet.

Einen guten Überblick über die Vorträge bietet unser PyDDF YouTube-Kanal, auf dem wir Videos der Vorträge nach den Meetings veröffentlichen.

Veranstaltet wird das Meeting von der eGenix.com GmbH, Langenfeld, in Zusammenarbeit mit Clark Consulting & Research, Düsseldorf:

Programm

Das Python Meeting Düsseldorf nutzt eine Mischung aus Open Space und Lightning Talks, wobei die Gewitter bei uns auch schon mal 20 Minuten dauern können :-)

Lightning Talks können vorher angemeldet werden, oder auch spontan während des Treffens eingebracht werden. Ein Beamer mit XGA Auflösung steht zur Verfügung. Folien bitte als PDF auf USB Stick mitbringen.

Lightning Talk Anmeldung bitte formlos per EMail an info@pyddf.de

Kostenbeteiligung

Das Python Meeting Düsseldorf wird von Python Nutzern für Python Nutzer veranstaltet.

Da Tagungsraum, Beamer, Internet und Getränke Kosten produzieren, bitten wir die Teilnehmer um einen Beitrag in Höhe von EUR 10,00 inkl. 19% Mwst. Schüler und Studenten zahlen EUR 5,00 inkl. 19% Mwst.

Wir möchten alle Teilnehmer bitten, den Betrag in bar mitzubringen.

Anmeldung

Da wir nur für ca. 20 Personen Sitzplätze haben, möchten wir bitten, sich per EMail anzumelden. Damit wird keine Verpflichtung eingegangen. Es erleichtert uns allerdings die Planung.

Meeting Anmeldung bitte formlos per EMail an info@pyddf.de

Weitere Informationen

Weitere Informationen finden Sie auf der Webseite des Meetings:

              http://pyddf.de/

Viel Spaß !

Marc-Andre Lemburg, eGenix.com

June 22, 2014

Steve McMahon: Installer Sprinting at Plone Symposium Midwest

2014-06-22T15:40:00Z

Sven Strack, Paul Roeland, Kurt Bendl and I -- with help from the assembled PSM masses -- got lots done on Plone 5 installers.

Decisions, Decisions

A major version change is a great opportunity to shake things up, so we spent the first half day of the conference detailing what we want to do for Plone 5. Paul, Sven and I have been tossing ideas at each other for months. With help from Kurt, it was decision time. In a head-spinning half day, we made all those decisions, then the fingers hit the keyboards.

Installers

Unified Installer

The next Unified Installer will try to be a bit kinder to new users by allowing them to choose configuration options interactively. You'll be able to use command-line options as before, but if you don't supply any command-line options, we'll start asking questions. When a console-dialog manager like whiptail or dialog is available, we'll use it to gather input. When not, we'll use text and read input from the console.

Steve wrote a wrapper that allows for menu, alert, confirmation, string input and password-input dialogs to be written with the same bash commands. whiptail ships with Ubuntu. dialog is available nearly everywhere else, including via homebrew on Macs.

Installer with Dialog

The UI will also incorporate Sven's dependency checker and installer. Written with help from Giacomo Spettoli, Alexander Pisa and Paul, this tries to sniff out the Unix variant and make the right decisions on system packages. You can have it list out needed dependencies, then make the decision whether to install them yourself or have the program do it.

OS X Installer

Plone has had a GUI-based binary installer for OS X since Plone 2.5. It is, however, getting harder and harder to maintain as Apple continues to make OS X a less and less welcoming environment for GNU-tools-style development. This reached a new extreme when Mavericks' Python didn't work with Mavericks' c compiler without special environment flags that Apple is promising won't work soon.

We've decided to address this by thinking of OS X as a homebrew environment -- in the sense that Ubuntu is a debian-packages environment and CentOS/Redhat/etc. are RPM environments. We'll strip from the Unified Installer the code that's OS X-specific and instead require a system-packages kit available from homebrew. This allows us to socialize the problem of getting GNUish tools and libraries that actually work together.

For Mac users who aren't comfortable at the command line, Sven worked on a set of AppleScript script wrappers that will allow a double-clicky install that does everything from install Apple's current command-line tools to setting up the homebrew kit to downloading and running the Plone installer. (Anyone who suggests that we should have done this in Swift will be ruthlessly ridiculed.)

Installing on OS X

Windows Installer

Windows continues to be a problem for us. Giacomo has been heroically maintaining a high-quality Windows Installer, but he's been doing it for love of Plone rather than because he's a Windows fan. If we're to maintain a Windows installer, we need one or more people or companies that actually use Windows to step up to work on this installer. A great opportunity: Ross Patterson has a proof of concept working for a Plone WebPI (Microsoft Web Platform Installer) installer. But Ross also is not a real Windows user, and doesn't want to take on long-term ownership of the project.

Virtual Machine Images

We believe the importance of traditional installers will be fading with the rise of virtual machine / container deployment. We want to make it point-and-click easy to deploy Plone on AWS, DigitalOcean, OpenStack, Docker, VirtualBox or VMWare with Plone-community-blessed images. We anticipate making images available for testing/deployment  and for full-stack production configurations.

We decided on Packer as our fundamental tool for this. Sven's been testing Packer, and has proof-of-concept tests for automated builds of popular image formats. Note that behind the scenes, we'll be using the same provisioner for all the environments.

Server Provisioning

We had a fun Birds of a Feather breakout from the symposium to talk about repeatable server provisioning. Various folks in the group had experience with Puppet, Chef, Salt and Ansible. CalvinHP and Claytron, in particular, talked about managing lots of VMs with Salt/Minion and experiments with Ansible. Allegiances didn't change, but Paul, Kurt, Sven and I thought Ansible was the clear winner for the installer team's purposes. Deciding points for us were simplicity, use of ssh as a transport, and that it's written in Python.

The Installer Team plans on making Ansible playbooks and roles available in kits that are immediately useful for provisioning everything from testing/development to full-stack production servers. These playbooks will also provision the virtual images we create with Packer.

We hope we'll have lots of community involvement in creation and maintenance of Ansible roles for Plone-oriented deployment of apache/nginx, varnish, haproxy, supervisor and buildout.

The Ansible kits will be a good option for integrators that aren't satisfied with the choices made for the community VM images, but would like to benefit from known-working stack configuration. A typical workflow might be to fork the Plone Ansible kit, customize a configuration file, run the Ansible playbooks to set up a server, and turn on your Plone site. Those specialized integrators will be able to use the kit in conjunction with Packer to create their own VM images.

Skeleton Generators

We continued discussion and research that began in Brasília about a viable replacement for ZopeSkel/Templer, which are at best unevenly maintained and have dependencies on unmaintained code that's not keeping up with changes in Python's setuptools.

We considered a wider set of options, looking for a skeleton generator that's got larger community support, is actively maintained, and meets our basic needs. Claytron did heroic research/testing for us. At the end, only Mr.Bob remained standing. Mr.Bob the skeleton generator, not Mr.Bob the portable-toilet vendor.

Oshkosh SunsetThanks to ...

UW Oshkosh was a great place to sprint, with easy movement from formal classrooms to dorm lounges, to restaurants and parks. Thanks to Kim Nguyen and the UWO crew for planning it all and taking care of us, and to the sprint sponsors: UW Oshkosh Office of the Provost, Six Feet Up, Wildcard Corp. and the Plone Foundation.

June 21, 2014

Maurits van Rees: Python Users Netherlands meeting 21 June 2014

by Maurits van Rees at 2014-06-21T10:54:25Z

Thanks to Reinout van Rees at Nelen & Schuurmans in Utrecht for organizing the meetup.

Tikitu de Jager - async, coroutines, event loops, etc

I work at http://buzzcapture.com

You have an infinite loop with blocking I/O. You do not want that. It could mean you need to work with threads, but you can use coroutines with asyncio. Two infinite loops at the same time, both potentially blocking, both in the same thread. And it all works.

Blocking I/O is like waiting for coffee.

Non-blocking I/O is: place your order, go somewhere else, pick it up when you get called. So: Starbucks.

So: instead of waiting, get out of the way.

This is handled by an event loop. Constantly checking: did anything happen? When anything happens, do I have a callback for it? Compare waiting for a click event in javascript. Be careful not to run into callback hell, otherwise known as callback spaghetti.

A coroutine is a routine that can pause and resume its execution. In python it does yield.

Now you want to be able to yield to the event loop.

You register a subscriber to the event loop. In this subscriber you indicate that you want to yield from somewhere: get some data from somewhere else when an event happens.

The event loop will need to have an API for adding a coroutine to the waiting list and a running list.

Let's compare some aproaches.

Twisted wants to make it easy for you to use networking protocols, with similar ideas. Twisted has been around for a long time, so it uses some different names for similar notions. Porting existing blocking code to Twisted is not always easy.

asyncio has similar high level protocols, but also intends to provide a base layer for other libraries. It uses yield from, which is syntax from Python 3. There is a backport for Python 2 (Tulip), which does not use this syntax.

Remember that you can send() a value to a generator. Also: throw and close. Look those up in the documentation! See also islice for taking a slice of a generator.

When you yield from a generator you hide a loop:

for value in generator:
    yield value

With gevent you monkey patch I/O functions:

from gevent import monkey; monkey.patch_all()

gevent uses greenlets, which are full coroutines. Pretty cool. It is a near drop-in in synchronous code. It needs a C extension, so it works only for CPython. Something similar exists for PyPy.

There is also node.js, but I am not going to tell you about that.

You can still use normal callbacks of course.

Audience question: how do tracebacks look with this? Not terrible, but still slightly evil.

See slides.

See Maurits (1 and 2) and Reinout for PyGrunn summaries.

Reinout van Rees - Python for flood simulation

Reinout works at Nelen & Schuurmans. Demonstration video of a simulation of a flooding in Cape Town. Running in browser, connected with web socket to the server.

Lots of big data. For the Netherlands there is data for the height of every 50 bij 50 centimeter of the country. We use Mercurial to store data.

Calculation core is written in Fortran... We use a Python ctypes wrapper.

Web interface is a Django site with angular.js interface. We have Tornado wrapped around a Django view as a socket interface. The map layers are done with GDAL and Flask. See another talk this evening.

So: Python is great! You can do a lot with it.

Boaz Leskes - python and elasticsearch

Elastic search is a distributed search engine on top of Lucene. Language independent. Json. Can use it for indexing, getting data.

There is a zipfile, you need Java, and then it runs.

Now talk to it with Python:

pip install elasticsearch

There is also a higher level client. See: https://github.com/elasticsearch/elasticsearch-dsl-py

Arjan Verkerk - lightning test

I work here. :-)

You can run a single test file test.py like this:

python -m unittest test

But can I just edit my test file and have the tests run, without me having to alt-tab to go to a different console and run the command again? That is where entr comes in, Event Notify Test Runner:

ls *py | entr -c python -m unittest test

See http://entrproject.org

Arjan Verkerk - GDAL raster magic

No, I do not know how to pronounce GDAL properly. ;-)

Tools for georeferenced raster data. python-gdal is the python implementation. Raster data is a raster of images, like those 50 by 50 centimeters of height data of the Netherlands (AHN2).

You need to know your coordinate system. 'Rijksdriehoekstelsel' is good for data in the Netherlands. geotransform can transform coordinates from one system to another.

You can use gdal to store sparse data efficiently. You may have a large area with no data and a small part with actual data.

Demo with AHN2 data.

We use Flask to serve the data.

On the javascript side: leaflets.

Wichert Akkerman - a new simple rest framework

I made REST-toolkit: reinventing the wheel again.

from rest_toolkit import quick_serve, resource

Json responses for all errors. CORS headers. CORS OPTIONS response.

Build on pyramid, so full access to the Pyramid toolset.

Concepts:

  • Every url matches a resource.
  • Multiple resources can map to the same stored data, but have different permissions and views, say one for anonymous and one for admin.
  • Actions are not resources, but handled via a controller, like a remote procedure call, for example to reboot a server. That is not pure REST: not everything is pure data.

SQLAlchemy integration:

from rest_toolkit.ext.sql import SQLResource

A couple of hundred lines of code currently. Coming soon:

  • standard views to view/update/delete resources using standard form schema, like json, wtform, Colander, etc.
  • Tutorial for AngularJS and other frameworks.

See:

https://github.com/wichert/rest_toolkit

http://rest-toolkit.rtfd.org

Dennis Kaarsemaker - whelk (makes subprocess easier)

Pretending python is a shell. Sometimes you just want to call a command on the command line and talk to that with python. Can be ugly to write with subprocess, especially when you want to pipe commands together.

Sample code [typos guaranteed, Maurits]:

from whelk import shell, pipe
shell.git(...)
shell['2to3']...
shell.make('test', output_callback=...,
           run_callback=..., exit_callback=...
           raise_on_error=True)

Easy redirection, per-line logging, encodings.

git = shell.git
git.checkout('next')
if not git.diff('--quiet', 'master', raise_on_error=True):
    ...
pip install whelk

See https://github.com/seveas/whelk

Marcel van den Elst - complete RESTful stack from pyramid and mongoengine to backbone

Example: ZooStack for managing RESTful animals front to back.

At http://progressiveplanning.com we use Pyramid, we came from Django and TastyPIE. We transformed it into something that MongoDB could use.

A RESTful stack from front to back.

  • Flexible, long-lived MVC client application framework
  • well defined, related and privilege-checked documents
  • secure RESTful API producer and consumer

MongoEngine is nearly dead, do not use it. So we are going to have to fix some things ourselves. Document definitions.

TastyMongo is a RESTful API for MongoEngine, a la Tastypie.

Backbone-Relational. Useful when an action triggers changes in multiple models on the client and the server. You can try to do it manually if you want, but Backbone-Relational takes care of it for you. See http://backbonerelational.org

June 20, 2014

Four Digits: Show a message for end users on errors with LDAP server in Plone

by Roel Bruggink at 2014-06-20T07:54:09Z

We needed to show a message to the end user when there were problems connecting to the LDAP server when authenticating, because people are muppets and don't remember their passwords or don't use a password manager.

Sometimes IT changes passwords because of policy/BOFH-ing and doesn't tell the user. Not to mention all the times IT take down a server for maintenance, or when someone needs a socket for the vacuum cleaner. Wow, someone's up for a surprise in the morning!

Now, what we've done is patch the authentication process and check if errors are logged. If so, display a message to the end user to bugger IT. Again.

Here's the gist.

patches.py:

from plone.api.portal import show_message
from cStringIO import StringIO
import logging
fake_log_file = StringIO()
aux_logger = logging.StreamHandler(fake_log_file)
aux_logger.setLevel(logging.ERROR)
ldap_logger = logging.getLogger('event.LDAPDelegate')
ldap_logger.addHandler(aux_logger)
msg = "Something went wrong while connecting to the LDAP server(s)"
def authenticateCredentials(self, credentials):
    fake_log_file.truncate(0)  # empty log to catch only current messages
    try:
        self._old_authenticateCredentials(credentials)
    except:
        raise
    finally:
        if fake_log_file.getvalue():
            # Assume something went wrong if it is logged.
            show_message(msg, self.REQUEST, type='error')
    return None, None

configure.zcml:

<monkey:patch
    description="Show message on LDAP errors."
    class="Products.LDAPMultiPlugins.LDAPPluginBase.LDAPPluginBase"
    original="authenticateCredentials"
    replacement=".patches.authenticateCredentials"
    preserveOriginal="true"
/>

June 19, 2014

Six Feet Up: Updating a Traditional Plone Theme to Diazo for Plone 5

by Chrissy Wainwright at 2014-06-19T12:00:00Z

If you have a traditional-style Plone theme that will continue to be in use for Plone 5 and beyond, I recommend updating it to use Diazo. This involves a few steps:

  • Add a folder for your static content
  • Move all custom CSS, JS, and images into the static folder
  • Use Plone Default as the base theme
  • Write an index.html and rules.xml
  • Remove all skins overrides
  • Reduce number of z3c.jbot overrides
  • Move custom skins templates into view templates

One nice thing about these steps is that they don't all need to be done at the same time. They can be done gradually in pieces if you are short on time.

Add a folder for your static content

This folder is basically a browser resource, which plone.app.theming converts into a theme.

<plone:static 
directory="static"
type="theme"
name="mytheme" />

Include a manifest.cfg in the directory for information about the theme that will display in the Theming control panel.

Move all custom CSS, JS, and images into the static folder

Move any CSS, JS, and images from your skins folders into the new static folder. They can be put into subdirectories to keep the file structure clean. The CSS and JS files can (and should) remain in the resource registries, the entries will need to be updated to include the new path, for example: ++theme++mytheme/main.css. If doing this from cssregistry.xml, remove the entries with the old path using remove=“true”. Paths to images from the CSS will need to be updated as well, and these can use relative paths as long as the applyPrefix is set to True in the CSS registry.

Use Plone Default as the base theme

Chances are, your theme is currently based on Sunburst. This should continue to work in Plone 5 initially, but eventually portal_skins will be removed completely (currently it is deprecated). In switching to Plone Default as the base, you can copy all styles from Sunburst and add them to your static folder. Entries in the CSS Registry will need to be updated by removing the files you copied, and re-adding them with the static path.

Write an index.html and rules.xml

These files will live directly inside the static folder. If you want to keep your theme looking the same, you can go to your site, View Source, copy all the code and put it in your index.html. Strip out any extra bits you don’t need. Then write your rules to map the dynamic content from Plone to this static html.

Remove all skins overrides, and reduce number of z3c.jbot overrides

portal_skins is being deprecated, and many of the skins templates are being moved into views, which means your customizations will no longer work in Plone 5. Now that you have a Diazo theme in place, see if your customizations can instead be done with a Diazo rule, so that you can remove the override completely. If you need to keep the override, use z3c.jbot instead of skins. When you upgrade to Plone 5, you will likely just need to change the name of the override to point to the original file’s new location. Try to do as much as you can with Diazo, to keep the number of overrides at a minimum. This will make upgrading easier.

Move custom skins templates into view templates

Let’s say you have a custom template for your homepage in skins. Move that template to the browser folder in your theme, and put this in the configure.zcml:

<browser:page
for="*"
name="homepage"
template="homepageview.pt"
permission="zope2.View" />

The template will now be accessible in the site at /@@homepage (path is based on the name you set). You will need to remove or update any code that assigns the template to the page. You can just specify the template as the href in a Diazo rule:

<replace
css:theme="#content"
css:content="#home"
href="http://www.sixfeetup.com/blog//@@homepage"/>

 

There will still need to be adjustments once you upgrade to Plone 5. The steps in this outline are just my recommendations from my theming experience and investigation into Plone 5. I would love to get some opinions and suggestions from developers that have been actively working on Plone 5.

June 18, 2014

Alex Clark: Plone 5 Alpha 2 is here!

by aclark at 2014-06-18T12:00:00Z

This post is long overdue since Plone 5 alpha 2 was released on 2014-04-20! It is also too short. I may do a followup blog entry to review more features, depending on how well this one is received. I also want to talk more about Plock.

When Plone 4 alpha 1 was released, I was so excited I immediately ran it in production. Now-a-days I use Pyramid for aclark.net but I still get excited about new Plone releases.

As such, I finally got around to testing the latest Plone 5 alpha with my deployment stack and the results were very impressive, so I thought I'd share.

Hosted configuration

Because of the "muscle memory" I've built up over the years doing this, I always install Plone in development and production via my hosted configuration files. If you are not a developer you may instead prefer the Unified Installer, VirtualBox/Vagrant installer or OS X Lion/Mountain Lion/Mavericks Binary Installer otherwise follow along [1]:

$ pip install tmp virtualenv
$ cd `tmp`
$ virtualenv .
$ bin/pip install zc.buildout
$ bin/buildout init

Edit buildout.cfg to contain:

[buildout]
extends = https://raw.github.com/plock/pins/master/plone-5-0

Run Buildout and start Plone:

$ bin/buildout
$ bin/plone fg

Create Plone Site

The first thing you will notice is the improved "Create a Plone Site" page which now includes a timezone configuration option:

Barceloneta Theme

I selected the US/Eastern timezone and clicked Create Plone Site, shortly after which I was greeted with a beautiful new Plone 5 site in all its open source glory. Immediately you will notice a new theme and toolbar:

Plone Toolbar

Here is a quick tour of the new toolbar.

Folder contents

Edit button

Sharing settings

Workflow settings

Add content

Layout settings

User menu

Love it! Of all these, only the eye icon didn't function as expected. Not sure what it's supposed to do but I assume it's not done yet. Additionally, I wish the small Plone logo in the toolbar navigated "home" like the portal logo. Or maybe it will close the toolbar? Oh, the possibilities!

Thanks

Many thanks to everyone who has worked hard to make Plone 5 a reality.

You should probably hire me or follow me on Twitter or both.

[1]And please try Plock which automates all of these steps e.g. pip install plock; plock .;bin/plone fg Once Plone (4) is installed, update the extends parameter in buildout.cfg to https://raw.github.com/plock/pins/master/plone-5-0 and rerun Buildout.

June 17, 2014

UW Oshkosh: Live Video Feed of Plone Symposium Midwest 2014

by nguyen at 2014-06-17T21:37:38Z

Plone Symposium Midwest 2014 training classes have been in session since last Friday, June 13, but we are now ready for our two main talk days!

 

Live Video Feed

If you are unable to attend PSM14 in person, please view our live video feed, on June 18 and 19, of our:

  • keynotes
  • talks
  • lightning talks
 
 

On Twitter

Please follow us on Twitter

Jazkarta Blog: New KCRW Website Launched

by Sally Kleinfeldt at 2014-06-17T14:42:56Z

KCRW is Southern California’s flagship National Public Radio affiliate, featuring an independent mix of music, news, and cultural programming supported by more than 55,000 member/subscribers. The non-commercial broadcast signal is simulcast on the web at KCRW.com, along with an all-music and an all-news stream and an extensive selection of podcasts. KCRW was a pioneer in online radio, they’ve been live streaming on the web since 1995.  The station has an international listening audience, and is widely considered one of the most influential independent music radio stations around the globe.

KCRW has used the Plone CMS for 7 years and for the last 6 the website has been running on Plone version 2.5, which has been increasingly showing its age. Over a year ago KCRW embarked on a project to redesign the site and upgrade the software and functionality, and they selected Jazkarta for the technical implementation. It was an amazingly fun and challenging project, with lots of interactive multimedia functionality and a beautiful responsive design by the New York City firm Hard Candy Shell. We’re very excited to announce that the site launched last Monday!

KCRW.com

Making the Most of the CMS

Plone is a robust and feature rich enterprise CMS with many features and add-ons that were invaluable for developing the KCRW site. Some highlights:

  • Flexible theming – Using Diazo, a theme contained in static HTML pages can be applied to a dynamic Plone site. For KCRW, Hard Candy Shell created a fully responsive design with phone, tablet and desktop displays. Jazkarta applied the theme to the site using Diazo rules, making adjustments to stylesheets or dynamically generated views where necessary so the CSS classes matched up.
  • Modular layouts – We used core Plone portlets and collective.cover tiles to build a system of standard layouts available as page fragments. Many custom tiles and portlets are based on the same underlying views so editors can easily reuse content fragments throughout the site. Plone portlets are particularly handy because of the way they can be inherited down the content tree – for example allowing the same promotion or collection of blog posts to be shown on all the episodes and segments within a show.
  • Managing editors – Plone provides granular control over editing permissions. For KCRW, this means that administrators can control what different types of users are allowed to edit in different parts of the site.
  • Customizable forms – We created PloneFormGen customizations to track RSVPs, signups, and attendance at events.
  • Salesforce integration – Plone has an excellent toolkit for integration with the Salesforce.com CRM. For this phase of the project we implemented basic integration. Stay tuned for additional KCRW member features to be added this fall that take advantage of the Plone-Salesforce connection.

Supporting a Radio Station

KCRW is a radio station, and we developed some cool features to support their content management process and all the rich media available on the site.

  • A set of custom content types (shows, episodes, segments, etc.) and APIs for scheduling radio programs and supporting live and on demand audio and video. The APIs provide all sorts of useful information in a consistent way across lots of contexts, including mobile and tablet applications.
  • An “always on top” player built using AJAX page loading – as you navigate around the site it just keeps playing and the controls continue to show. This works equally well on mobile devices and desktops.
  • Central configuration of underwriting messages in portlets using responsive Google DFP tags.
  • Integration with many external services like Disqus for threaded comments, Zencoder for audio encoding, Ooyala for video hosting and encoding, and Castfire for serving podcasts and live streams with advertising.
  • An API for querying data about songs played on the station – live or on demand.  The API is built on the Pyramid framework and queries a pre-existing data source.

A Robust Deployment Platform

More than any other client, KCRW’s site provided the impetus for us to adopt AWS OpsWorks. KCRW.com had been hosted on a complex AWS stack with multiple servers managed independently. We needed an infrastructure that was easier to manage and could even save KCRW money by being easily scaled up and down as needed. Another major concern was high availability and we tried to eliminate single points of failure.

To accomplish this we made sure everything on OpsWorks was redundant. We have multiple instances for nearly every piece of functionality (Plone, Blob Storage, Celery, Memcached, Nginx, Varnish and even HAProxy), and the redundant servers are in multiple Availability Zones so the website can withstand the failure of an entire Amazon AZ.  The layers of functionality can be grouped onto a single instance or spread across multiple instances. It’s easy to bring up and terminate new instances as needed; this can be done manually, or automated based on instance load or during specific times of day. Time-based scaling is particularly relevant to KCRW and we are still experimenting with how best to schedule extra servers during popular weekday listening hours. Amazon’s Elastic Load Balancer and Multi-AZ RDS services give us the ability to deploy resources in multiple Availability Zones and eliminate single points of failure.

Dynamic Client, Dynamic Site

All of these technical details are fun for developers to talk about, but what’s really impressive is how much fun the site is to look at and use. Kudos to KCRW for having the vision to create such a great site, and to KCRW staff for the appealing new content that appears every day.


Tagged: aws, live streaming, media player, multimedia, OpsWorks, Plone, podcasts, radio

June 16, 2014

Abstract Technology: Plone Mosaic sprint final report

by Simone Orsi at 2014-06-16T14:07:13Z

A report on the Plone Mosaic sprint in Barcelona and its amazing outcome: save the deco vision.

June 13, 2014

Reinout van Rees: Mail tips to your colleagues

by Reinout van Rees at 2014-06-13T07:47:00Z

tl;dr summary: mail a colleague if you see something that just might be useful to them.

A couple of weeks ago I made a django app way faster. The most important improvement was to use python's build-in datetime.datetime.strptime() to parse dates instead of the iso8601 library. 20 times faster for our use case.

Last week, a colleague mailed me a link to https://hack.close.io/posts/ciso8601 with as email subject "you're not the only one that found date parsing to be slow". He just saw the article and mailed it to me. He didn't even read it in detail.

To me, it looked quite relevant and I did read it in detail. Wow! A datetime parsing library that promises to be even faster? https://github.com/elasticsales/ciso8601 . Trying it out meant changing 5 lines or so. Wow! Another 6x speed increase compared to strptime()!

Good news for our customers. Good news for the django app. All because of a simple quick mail.

So... think about your colleagues when you spot something that might be especially useful! It might just be the link that makes their day.

June 12, 2014

Netsight Developers: Plone Intranet Development Sprint update (May 2014)

2014-06-12T15:07:59Z

Netsight is working with Cosent and the Plone Intranet Consortium to design and build an open source social intranet platform.

At this relatively early stage of development, a small team from Netsight have been focussing on the architecture and initial implementation of some of the core components. With regular consultation amongst the Plone Intranet Consortium, we are hoping to establish a stable base intranet platform that can be extended and improved in future within the broader Plone Community.

One of the core requirements that came out of early discussions was the need for a flexible team/community workspace solution, that would allow teams of employees to communicate and collaborate effectively within their own area of the intranet. We established an architecture plan which distills the extensive permission framework within Plone into a set of distinct policies that control who can access a workspace, who can join a workspace, and what users can do once they are part of a workspace.

A few sprints in, and there are a number of key packages around this functionality that now have (or are nearing) an initial release:

experimental.securityindexing

An optimisation for catalog security re-indexing after role/workflow changes.

For more details see Matt Hamilton's separate blog post.

ploneintranet.workspace

  • Provides workspace container and content workflow working in conjunction to provide flexible levels of content access
  • Three levels of access controlled via a single ‘policies’ tab:
    • External visibility (who can see the workspace)
    • Join policy (who can join / add users to a workspace)
    • Participation policy (default permissions given to members of a workspace)
  • Built on dynamic PAS group/role plugins from collective.workspace 
  • New ‘self-publisher’ role that allows users to publish their own content, but not the content of others (something that cannot be achieved with existing contributor/editor/reviewer roles). 
  • Support for easily copying/moving members between workspaces

For more information see the ploneintranet.workspace architecture document.

ploneintranet.invitations

  • Generic token framework to support dropbox/drive-style URL-based actions
  • Demo implementation that allows user account login (and creation) via unique url

plone.api extension

  • An update to api.content.transition that allows you to move an item to a target workflow state, regardless of the number of transitions required to get there.

For details see https://github.com/plone/plone.api/pull/164


Further reading:

 

June 11, 2014

Abstract Technology: A few notes from the Plone Mosaic Sprint

by Maurizio Delmonte at 2014-06-11T16:43:00Z

In Barcelona, a dozen plonistas are scratching their hitches around the composite page issue.