/publisher

Publishes mainstream content on GOV.UK

Primary LanguageRubyMIT LicenseMIT

Publisher

Publisher is the primary content design app for GOV.UK. It provides the user interface for entering all the key editorial formats and an API so other apps (primarily frontend) can access that data for display. It is sometimes referred to as "mainstream publisher".

Screenshots

alt tag alt tag alt tag

Live examples

Retired formats

  • Campaign
  • Programme
  • Video

Removed formats

  • Business Support - used to be retired, and the documents remained visible, now they're fully removed as editions and no longer visible in the app (although the artefacts do still exist). They have been fully migrated to specialist-publisher.

Working with Service Sign In pages

These pages do not have an admin interface and are instead managed through rake tasks.

See the README for more details.

Nomenclature

  • Artefact: a document on GOV.UK.

Technical documentation

This is a Ruby on Rails application that publishes the content for mainstream document formats to the shared mongo database. The frontend app reads this content from the Content Store.

Dependencies

  • imminence - provides geographical search tools
  • content-store - new central storage of published content on GOV.UK
  • publishing-api - will provide workflow for all content published to GOV.UK - creating a new document, publishing it, etc. Content published here will end up in the content-store
  • govuk-content-schemas - defines the schemas for new-style document formats. Required to run the tests.
bundle exec rake local_transactions:import SOURCE=/path/to/local_authority_service_details.CSV
  • statsd - this application uses statsd-ruby to send metrics to statsd. If a statsd process isn't present on the server it won't matter as statsd-ruby sends metrics over UDP. If a statsd process is present then it'll send strings with the respective increment/decrement/gauge function to use.
  • asset-manager - manages uploaded assets (images, PDFs, videos etc.). Publisher needs an OAuth bearer token in order to authenticate with Asset Manager. By default, this is loaded from the PUBLISHER_ASSET_MANAGER_BEARER_TOKEN environment variable in config/initializers/gds_api.rb, which is automatically provided if using the development VM. Otherwise, to obtain this bearer token you should create an API user in the signonotron2 application. In the signonotron2 directory, to generate the bearer token you need, run:
rake api_clients:create[publisher,publisher@example.com,asset-manager,signin]
  • calendars - provides bank holiday information to feed into working days calculator. Working days calculator is used to generate deadlines for fact checks.
  • link-checker-api - checks all the links in an edition on request from the edition show page.

Running the application

If you're just interested in running the Publisher locally, with a minimum of interaction with other apps, here's how. This assumes you're using this development setup.

cd /var/govuk/development
bowl publisher

Running the test suite

bundle exec rake

The test suite relies on the presence of the govuk-content-schemas repository. If should be at the same directory level as the government-frontend repository.

Or to specify the location explicitly:

GOVUK_CONTENT_SCHEMAS_PATH=/some/dir/govuk-content-schemas bundle exec rake

State machine

Maps out the transitions between states for the Edition class. These transitions are defined in the workflow module. A diagram of the current state machine can be seen here: state machine diagram. The diagram can be (re)generated using the state_machines-graphviz gem, by doing:

bundle exec rake state_machines:draw CLASS=Edition

This will generate a diagram in the doc/state_machines folder.

LinkCheckerAPI

The link-checker-api has been integrated on the show page for editions. It extracts all links from within any GovSpeak fields and sends them to the /batch endpoint of the API. In this request it also sends across a webhook_callback which then populates any information about broken/warning links. More reading about the endpoints can be found here

Licence

MIT License