Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for REST API PO endpoint (#234) #244

Merged
merged 6 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions admin-manual/maintenance/cli-tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,12 @@ task described above.

* :ref:`rename-title-slug`

Users can also use the CLI rename-slug tool if they want to update one or
more slugs via the command line. For more infomation, see:

* :ref:`cli-rename-slugs`


Finally, :term:`static pages <static page>`, or permanent links, include a
slug :term:`field` option, but only slugs for new static pages can be edited
by users; the slugs for the default :term:`Home page` and :term:`About page`
Expand All @@ -1114,6 +1120,57 @@ AtoM, see: :ref:`manage-static-pages`.
For developers interested in seeing the code where slugs are handled in
AtoM, see ``/lib/model/QubitSlug.php``

.. _cli-rename-slugs:

Rename slugs via command line
=============================

This command line tool can be used to rename existing slugs in AtoM. It offers
the ability to either rename a single slug, or to run a batch rename using a
csv file.

.. code:: bash

php symfony tools:rename-slug [<old-slug> <new-slug>] [--csv=<path-to-file.csv>]

**Task options**

.. image:: images/cli-rename-slug.*
:align: center
:width: 70%
:alt: An image of the CLI options when invoking the tools:rename-slug command

By entering ``php symfony help tools:rename-slug`` into the command-line, you
see the options and descriptions available on this tool, as pictured above.

The ``--application``, ``--env``, and ``connection`` options **should not be
used** - AtoM requires the uses of the pre-set defaults for symfony to be
able to execute the task.

When used without any other options, the rename slugs task expects two
arguments: an existing slug, and a new name for the existing slug. For example,
to rename my-example-slug to new-slug, the following command should be run:
``php symfony tools:rename-slug my-example-slug new-slug``.

The ``--csv`` option can be used to provide a CSV file to use for a batch
import. The supplied CSV file only needs two columns: an oldSlug column
(containing the existing slugs), and a newSlug column. Here is an example CSV:

.. image:: images/cli-rename-example.*
:align: center
:width: 70%
:alt: An image of an example CSV file used for a rename-slug command

For example, to use a CSV file to batch update slugs, this command can be run:
``php symfony tools:rename-slug --csv="path/to/my/slug-file.csv"``

.. SEEALSO::

* :ref:`rename-title-slug`
* :ref:`slugs-in-atom`
* :ref:`description-permalinks`
* :ref:`cli-generate-slugs`

.. _cli-normalize-taxonomy:

Taxonomy normalization
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions dev-manual/api/add-po.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. _api-add-po:

================================
Add physical object endpoint
================================

**POST /api/physicalobjects**

This endpoint will allow adding a :term:`physical object`.

.. _add-po-ex-req:

Example request
===============

.. code-block:: none

curl -v -X POST http://localhost:63001/api/physicalobjects -H 'Content-Type: application/json' -H 'REST-API-Key: 3e136949f7b9b915' -d '{ "name": "T-01", "location": "Example location", "type": "Shelf" }'

.. _add-po-ex-resp:

Example response
================

Example response is truncated and edited for readability.

.. code-block:: none

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: private

{"slug":"t-01"}


:ref:`Back to top <api-add-po>`
2 changes: 2 additions & 0 deletions dev-manual/api/api-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ parameters. There are three endpoints available:
* :ref:`Browse taxonomy terms <api-browse-taxonomies>`
* :ref:`Browse information objects <api-browse-io>`
* :ref:`Read information object <api-read-io>`
* :ref:`Download digital objects <api-download-do>`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keen eye! ;D

* :ref:`Add physical objects <api-add-po>`

.. _api-intro-i18n:

Expand Down
1 change: 1 addition & 0 deletions dev-manual/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ set of links to each chapter's main sections.
api/browse-io
api/read-io
api/download-do
api/add-po

:ref:`Back to top <dev-manual-index>`
8 changes: 8 additions & 0 deletions user-manual/add-edit-content/archival-descriptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,14 @@ the filename of a linked digital object will be covered on the
specific description on an external website, they may break after changing
the slug.

.. SEEALSO::

Users can also update slug(s) via a command line tool. For more information,
see:

* :ref:`cli-rename-slugs`


:ref:`Back to top <archival-descriptions>`

.. _view-modification-history:
Expand Down
Binary file added user-manual/administer/images/diacritics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified user-manual/administer/images/manage-jobs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 14 additions & 13 deletions user-manual/administer/manage-jobs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ browser.
.. IMPORTANT::

You must have the necessary dependencies installed and configured to be able
manage asynchronous jobs in AtoM. See:
manage asynchronous jobs in AtoM. See:

* Installation: :ref:`installation-ubuntu-serve-workers`.
* :ref:`maintenance-asynchronous-jobs`
Expand Down Expand Up @@ -110,16 +110,17 @@ below: :ref:`job-details`.

**User**: The :term:`username` of the AtoM user who initiated the job.

.. image:: images/manage-jobs-active-tab.*
.. image:: images/manage-jobs-tabs.*
:align: right
:width: 20%
:alt: An image of the Jobs page tab

The Jobs page also includes a tab that allows users to view only those jobs that
are currently still being executed (e.g., a status of "Running"). This can be
useful when a large number of jobs are being executed simultaneously, and/or the
list of jobs has not been cleared in some time. Click on the blue hyperlink to
switch the view from "All jobs" to "Active jobs". AtoM will refresh the page and
:alt: An image of the Jobs page tabs

The Jobs page also includes tabs that allows users to view only those jobs that
are currently still being executed (e.g., a status of "Running") or jobs that
have failed (e.g., a status of "Error"). These can be useful when a large number
of jobs are being executed simultaneously, and/or the list of jobs has not been
cleared in some time. Click on one of the other tabs to switch the view from
"All jobs" to "Active jobs" or "Failed jobs". AtoM will refresh the page and
the table will be limited to the selected view.

.. _jobs-button-block:
Expand Down Expand Up @@ -187,9 +188,9 @@ AtoM will indicate this in the jobs page with a message.
.. SEEALSO::

The Administrator's manual includes installation instructions for setting up
`Gearman <http://gearman.org>`__ and asynchronous job support in AtoM. A
separate page also includes some examples of how to manage workers and
jobs from the command-line. For more information, see:
`Gearman <http://gearman.org>`__ and asynchronous job support in AtoM. A
separate page also includes some examples of how to manage workers and
jobs from the command-line. For more information, see:

* Installation: :ref:`installation-ubuntu-serve-workers`.
* :ref:`maintenance-asynchronous-jobs`
Expand Down Expand Up @@ -228,6 +229,6 @@ All authenticated (e.g. logged in) users can access the Jobs page. However, most
users will only see jobs and be able to clear jobs which they have started. Only
an :term:`administrator` can see the status of all jobs - however, like all users,
administrators can only clear jobs that belong to them. Administrators can clear
jobs that are associated with tasks run on the command-line.
jobs that are associated with tasks run on the command-line.

:ref:`Back to top <manage-jobs>`
Loading
Loading