News

Description

The news magazine provides a “push comms” channel for company-wide news distribution.

Configuration

database

Warning

You must configure a database backend for client installs.

Please configure a registry record collective.mustread.interfaces.IMustReadSettings.connectionstring.

It is recommended to make this value identical to the connectionstring used by collective.auditlog. The mustread implementation takes care to not step on the toes of auditlog, and it will even optimize by re-using the same database connector if possible.

The default connector for both collective.mustread and collective.auditlog is a memory database, which is obviously unsuitable for production since it gets wiped on process restart.

ploneintranet.news provides an upgrade step to initialize the database. If you don’t provide your own database connection string, it will fall back to a sqlite file store and avoid a in-memory database.

editor access

Use the Barceloneta admin UI on yoursite/news/@@sharing to share Contributor, Editor and Reviewer access with the users that ought to manage news items in the News Publisher App.

async routing

Database writes registering each view on a news item are handled asynchronously via a call to the @@mustread-hit view on news items. You may want to configure your load balancer to route requests matching that URL part to a dedicated async worker.

User stories

News Publisher App

  • As a news editor, when I visit the Apps section, I can open the News publisher app.
  • As a news editor, I can use the News publisher to create and edit news sections.
  • As a news editor, I can use the News publisher to create and edit news items. This includes setting the section for the item, setting an image, and various display options.
  • As a news editor, I can mark individual news items as “must read” for all employees.
  • As a news reviewer, I can use the News publisher to publish news items to the news magazine.

News Magazine

  • As a user, I can visit the News section and see a beautiful news magazine.
  • As a user, when I visit the News magazine I see the most recently published news items.
  • As a user, when I visit the News magazine I see the most-read “trending” news items.
  • As a user, when I visit the News magazine I can get a news listing per section.
  • As a user, when I visit the News magazine I can read the full news item pages.
  • As a user, when I access a news item page either via the dashboard or via the magazine, that item disappears from my “must read” listing.
  • As a news editor, when I visit the News magazine, I can use a special link on each news item to go to the editing page for that news item.

News listing on Dashboard

  • As a user, when I visit the dashboard I see a list with the most recent news items, which I can click and read in full.
  • As a user, when I visit the dashboard “must read” news items that I have not read yet show up on top of the news listing.
  • As a user, when I visit the dashboard I can mark “must read” news items as read, without having to actually visit the news item page.

Architecture

Packages

The news functionality is implemented across several packages:

  • The main package is ploneintranet.news: this contains the content types, behaviors and browser views for the News publisher app and the News magazine.
  • The dashboard News tile lives in ploneintranet.layout. This also shows an App tile in the apps listing that links to the News publisher app.
  • The must read and trending logic are factored out to collective.mustread which was created to support the Quaive news functionality.
  • The write-intensive user view tracking is routed to collective.mustread via our ploneintranet.async Asynchronous Functionality.

Tests

  • collective.mustread has a very extensive test suite on the view tracking backend.
  • ploneintranet.news has some basic smoke tests on behaviors and views.

Warning

Robot tests are lacking, because of threading issues with the sqlalchemy ORM in test mode.

Publisher app, magazine and dashboard tile

The NewsApp lives as a singleton in the site root. Because of its multiple roles (it’s a portal tab, it’s an app, it contains content objects) this required some tweaking of the ploneintranet.layout interface contracts:

  • The NewsApp is an IApp which means it’s listed as an app tile in the Apps section. The implementation for app tiles has been refactored make it possible for an IApp to live outside the IAppsContainer toplevel Apps section.
  • The NewsApp is an IAppContainer (without an ‘s’!) which means it’s a toplevel content container which sports its own browser layers that are switched on only for contained content, by the Theme Switcher

The NewsApp contains all News Items and NewsSection objects as direct children, without any nesting. So News Items are not contained within NewsSection.

News items are vanilla plone.app.contenttypes news items, with some additional behaviors applied. The NewsMeta behavior on News Items provides references from the news items to their sections. The implementation of the news publisher enforces that there always must be at least one news section.

Both the News Magazine and the News Publisher App are views on the NewsApp content type that live in ploneintranet.news.

For historical compatibility reasons, the News Tile on the dashboard lives in ploneintranet.layout.browser.dashboard.