Skip to content

sytskevanhasselt/Openpub

 
 

Repository files navigation

Openpub

Automated Testing

Open pub is een onderdeel van OpenWeb concept en behelst het beheren en publiceren van nieuwsberichten en taxanomien

Opzet van de plugin

  • Custom postype (publication)
  • Custom taxonnomy ()

Opzet van deze repository

Deze repository beheerd een variant van de OpenPub plugin die niet afhankenlijk is van composer en commerciele closed source softwhare

Deze repositoery voorziet daarnaast ook in een automatische test flow voor unit en integratie testing en een locale ontwikkel omgeving

Design afwegingen

  • De repository maakt gebruik van een oficial wordpress image
  • De repository maakt gebruik van de open source plugin Advanced Custom Fields

Local development environment

For easy development an docker based wordpress environment is included, this can be started up trough afhter installing the docker desktop client.

$docker compose up

Wordpress CLI and Unit Testing

For unit testing a separate CLI based wordpress is included, this can be started trough

$docker compose -f docker-compose-cli.yml up

You can than run Wordpress CLI commands with in the container. For example, getting a list of all available plugins can be done trough

$docker-compose exec wordpress wp plugin list

Local development configuration

Once your docker is running, you can configure the Wordpress installation:

  1. Navigate to localhost/wp-admin, initiate Wordpress and login

Setting up the plugin

Note: to start this step, you're expected to have an active WordPress installation running.

  1. Activate the plugins: OpenPub and Advanced Custom Fields
  2. Navigate to "Aangepaste velden" and then to "Gereedschap"
  3. Upload the file plugins/OpenPub/publication-acf-group.json within the "Veldgroepen Importeren" option
  4. Create one (or multiple) new users with the "KISS Redacteur" role
    Note: users with the assigned role "KISS Redacteur" can now create and maintain publications.
  5. Navigate to "OpenPub" > "Configuration" and add the gateway URI to the "API Domain" field and the gateway API key to the "API KEY" field.

Managing users

Note: Users with the user role "Administrator" can create new users, an account with this role is automatically assigned once WordPress is installed. For this portion of the documentation, you're expected to be logged in as an Administrator user.

Create a user

  1. Navigate to "Users" and click on "Add new"
  2. Fill the required fields (username and email), leave the other fields as-is
  3. Change the (default) role of "Subscriber" to "KISS Redacteur"
  4. Finally, click "Add New User"

Note: if you want to create another Admin user, follow the above steps and choose the role "Administrator" instead of "KISS Redacteur".

Remove a user

Note: removing a user can not be reverted.

  1. Navigate to "Users" and hover your mouse over the target user
  2. Click "Delete"
  3. Optionally, assign the user's content to another account
  4. Finally, click "Confirm Deletion"

Managing publications

Note: Users with the role "KISS Redacteur" can manage publications, an account with this role should be created as stated within #Managing users.

Create a publication

  1. Navigate to "Publications" and click "Add New"
  2. Add the following fields
    • Title: the title of the publication (required)
    • Publicatie: the content of the publication (required)
    • Publicatitetype: the type of the publication ("Nieuws" or "Werkinstructie) (required)
    • Skills: the skills relevant to this publication (optional)
    • Einddatum: the date after which the publication is no longer visible (optional; the value must be in the future if you want your publication to be shown)
    • Belangrijke publicatie: check this field to make your publication more prominent (optional)
  3. Finally, click "Publish"

Editing a publication

  1. Navigate to the publication you want to edit by clicking on "Publications" and then clicking on the target publication
  2. Edit any field that needs editing (note: you cannot remove the required fields)
  3. Finally, click "Publish"

Removing a publication

  1. Navigate to the publication you want to remove by clicking on "Publications" and then clicking on the target publication
  2. Click on "Move to Trash"

Note: removed publications can be found and restored in the trash, once the trash is emptied they can no longer be restored.

Proxy communication via Gateway

Optional parameter: per_page.

  • GET {gateway_environment_uri}/api/openpub/openpub_type Returns all openpub_type objects within the WordPress environment, via a gateway proxy.
  • GET {gateway_environment_uri}/api/openpub/openpub_skill Returns all openpub_skill objects within the WordPress environment, via a gateway proxy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 89.4%
  • Hack 9.2%
  • Other 1.4%