34.1. The code for the training – Mastering Plone Development – 34. Appendix

34.1. The code for the training#

You can get the complete code for this training from GitHub. See Installation.

The main training project is mastering-plone-project.

The add-on developed in chapter 31 is mastering-plone-votable-add-on.

Both of these repositories are monorepos which contain:

  • a backend package

  • a frontend package

  • Makefile commands to use during development

  • configuration for automatic continuous integration workflows on GitHub

Get the code for a particular chapter#

The default branches of these repositories hold the code of the final chapter of the training. Each chapter that adds code to the package has a tag that can be used to get the code for that chapter.

To use the code for a certain chapter, you need to checkout the appropriate tag for the chapter. The package will then contain the complete code for that chapter (excluding exercises).

If you want to add the code for the chapter yourself, you have to check out the tag of the previous chapter. Each chapter has a card at the top which tells you which tags to use. The full list of tags is also shown in a table below.

How to check out a tag of a git repository#

You have two options: terminal or source editor (for example VSCode).

  1. Terminal

    • cd to the folder which contains the repository (mastering-plone-project).

    • To check out the tag talks: git checkout talks

  2. VSCode

    • Open mastering-plone-project in VSCode.

    • If not installed, install the extension "GitHub Pull Requests".

    • Open the source control sidebar.

    • Select the tag.

      ../_images/vscode_git.png

      Check out a tag#

Move from chapter to chapter#

To change the code to the state of the next chapter, check out the tag for the next chapter:

git checkout views_3

If you made any changes to the code, you have to get them out of the way first. This involves two things.

Warning

Make sure you have no new files or changes in the folder structure of mastering-plone-project that you want to keep, because the following will delete them!

git clean -fd
git stash

This does two things:

  1. It deletes any files that you added and are not part of the package.

  2. It will move away changes to files that are part of the package but not delete them. You can get them back later. You should learn about the command git stash before you try to reapply stashed changes.

Tags#

These are the tags of the repositories mastering-plone-project and mastering-plone-votable-add-on for which there is code:

Chapter

Tag name

Package

About Mastering Plone Development

Introduction

The case study

What is Plone?

Installation

initial

mastering-plone-project

Features of Plone

Configure Plone "through the web"

Extend Plone with add-on packages

addons

mastering-plone-project

Extend and customize Plone

Content types I

Development tools

Content types II: Talk

talks

mastering-plone-project

Content types reference

Customize Volto components

overrides

mastering-plone-project

Add a custom view

talkview

mastering-plone-project

Behaviors

behaviors_1

mastering-plone-project

Create a dynamic front page listing

frontpage

mastering-plone-project

Programming Plone

Add event dates to talks

events

mastering-plone-project

Registry, control panels, and vocabularies

vocabularies

mastering-plone-project

Custom search

search

mastering-plone-project

Testing

testing

mastering-plone-project

Content types III: Sponsor

schema

mastering-plone-project

Upgrade steps

upgrade_steps

mastering-plone-project

Search block variation

listing_variation

mastering-plone-project

Search for additional fields

searchable

mastering-plone-project

The Sponsors component

sponsors

mastering-plone-project

Create a custom block

block

mastering-plone-project

Workflow, roles and permissions

user_generated_content

mastering-plone-project

Relations

relations

mastering-plone-project

Create an add-on [The voting story]

initial

mastering-plone-votable-add-on

Complex behaviors [voting story]

behaviors

mastering-plone-votable-add-on

REST API endpoints [voting story]

endpoints

mastering-plone-votable-add-on

Volto actions and component state [voting story]

actions

mastering-plone-votable-add-on

Permissions [voting story]

permissions

mastering-plone-votable-add-on

Deploy in production