imio.restapi


Nameimio.restapi JSON
Version 1.0rc1 PyPI version JSON
download
home_pagehttps://pypi.python.org/pypi/imio.restapi
SummaryExtended rest api service for IMIO usecases
upload_time2024-03-14 14:18:29
maintainer
docs_urlNone
authorMartin Peeters
requires_python
licenseGPL version 2
keywords python plone
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.
   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html
   This text does not appear on pypi or github. It is a comment.

.. image:: https://travis-ci.com/IMIO/imio.restapi.svg?branch=master
    :target: https://travis-ci.com/IMIO/imio.restapi

.. image:: https://coveralls.io/repos/github/IMIO/imio.restapi/badge.svg?branch=master
    :target: https://coveralls.io/github/IMIO/imio.restapi?branch=master

.. image:: http://img.shields.io/pypi/v/imio.restapi.svg
   :alt: PyPI badge
   :target: https://pypi.org/project/imio.restapi


============
imio.restapi
============

plone.restapi endpoints and adaptations

Features
--------

- ``add element``:

    - with children
    - trigger WF transitions
- ``@pod-templates`` endpoint (collective.documentgenerator)
- ``disable returning fullobject serialization upon creation``:

  - by default when an object is created, the fullobject serialization is returned which is doing some processing sometimes unnecessary
  - adding an environment variable ``RETURN_FULLOBJECT_AFTER_CREATION_DEFAULT False`` will return the summary serialization when an object is created
  - this will change the default behavior but it is still possible to change this behavior for a particular POST by defining the ``"return_fullobject": true/false`` in the Body

Todo
----

- manage wf_transitions triggered when creating an element in the deserializer when we will be using only DX
- include cleanHTML functionnality at the deserializer level, also when we will be using only DX


Installation
------------

Install imio.restapi by adding it to your buildout::

    [buildout]

    ...

    eggs =
        imio.restapi


and then running ``bin/buildout``


Contribute
----------

- Issue Tracker: https://github.com/collective/imio.restapi/issues
- Source Code: https://github.com/collective/imio.restapi
- Documentation: https://docs.plone.org/foo/bar


License
-------

The project is licensed under the GPLv2.


Contributors
============

- Martin Peeters [Affinitic], Original author


Changelog
=========


1.0rc1 (2024-03-14)
-------------------

- Moved unused `utils.listify` to `imio.pyutils.utils.listify`.
  [gbastien]
- When using a `base_search_uid` take also `sort_on/sort_order`
  defined on the Collection.
  [gbastien]

1.0b3 (2023-08-25)
------------------

- Added parameter `debug_mode` to the settings, when enabled, input and output
  requests are displayed into the Zope log.
  [gbastien]

1.0b2 (2023-05-31)
------------------

- Added helper `utils.serialize_term` that will serialize a vocabulary term
  the same way it is done by the `FieldSerializer`.
  [gbastien]

1.0b1 (2022-01-03)
------------------

- In `FolderPost.do_reply` if an error occurs, do not continue,
  stop and return the result with the error immediately.
  [gbastien]

- Added `return_fullobject_after_creation_default`, `True` by default,
  to the `imio.restapi` settings panel. This will do the full serialized object to
  be returned after an object is created (this is already the current behavior).
  When set to False, the summary serialization will be returned.
  [gbastien]

- Fixed `@infos?include_stats=1` blobstorage size computation to use `.size.json`.
  [gbastien]

1.0a15 (2021-11-08)
-------------------

- Override 'update' and 'workflow transition' to use the uid
  [vpiret]


1.0a14 (2021-07-16)
-------------------

- Avoid duplicates in `metadata_fields`.
  [gbastien]

- In `@infos` if `PWD` env variable is not available, try to determinate instance
  path using the `INSTANCE_HOME` env variable.
  [gbastien]

- Require `plone.restapi<8` in `setup.py` as versions 8+ are only for Python3.
  [gbastien]

- Fixed tests due to changes in `collective.documentgenerator` where
  the `ConfigurablePODTemplate` named `test_ods_template` is no more generable
  on type `Document`.
  [gbastien]

- Added possibility to redefine the name of the `metadata_fields` form parameter
  so it may be overrided by a subclass for example.
  [gbastien]


1.0a13 (2021-02-15)
-------------------

- Cleanup `base_search_uid` parameter to avoid warnings in instance logs
  [mpeeters]

- Adapt `@search` service to use the context instead of using `path` index that can be buggy on some circumstances
  [mpeeters]


1.0a12 (2021-02-03)
-------------------

- Improve `@search` by allowing element UID other than Collection for `base_search_uid` parameter that can be used as a base path
  [mpeeters]

- Moved management of additional `metadata_fields` from the `SearchGet` service
  to the `DefaultJSONSummarySerializer` created for that, it will override
  the default `plone.restapi` `DefaultJSONSummarySerializer` and add
  `id` and `UID` by default to the results.
  [gbastien]


1.0a11 (2020-09-10)
-------------------

- Leave `FolderPost._after_reply_hook` empty (was managing `wf_transitions`)
  or `wf_transitions` could be broken if a package overrides
  `_after_reply_hook` and forget to call super's original method
  [gbastien]


1.0a10 (2020-06-28)
-------------------

- Add class on list of actions
  [mpeeters]


1.0a9 (2020-06-24)
------------------

- Improve caching of REST vocabularies
  [mpeeters]

- Display `imio-restapi-actions` and `imio-restapi-links` viewlets
  only when package is installed (`IImioRestapiLayer`)
  [gbastien]


1.0a8 (2020-06-23)
------------------

- Improve filtering for remote rest vocabulary by using the id without the domain
  [mpeeters]

- Use `@relative_path` attribute for links
  [mpeeters]

- Implement base serializer to add `@relative_path` attribute
  [mpeeters]


1.0a7 (2020-06-23)
------------------

- Fix an issue with search vocabulary term ids when `b_size` parameter is used
  [mpeeters]


1.0a6 (2020-06-23)
------------------

- Fix permissions for viewlet
  [mpeeters]


1.0a5 (2020-06-23)
------------------

- Fix an error with vocabulary request when there is no body
  [mpeeters]


1.0a4 (2020-06-22)
------------------

- Add missing french translations
  [mpeeters]

- Implement basic auth adapter for requests
  [mpeeters]

- Add an adapter to allow data transform during import of content
  [mpeeters]

- Ensure that REST vocabulary base class have context available
  [mpeeters]

- Add `@uid` rest service
  [mpeeters]

- Add `ImportForm` base class for content import from remote app
  [mpeeters]

- Make `_request_schema` optional to handle more usecases
  [mpeeters]

- Add `import_content` utils to create content from rest call result
  [mpeeters]

- Add `get_application_url` and improve `generate_request_parameters` utils
  [mpeeters]

- Implement a base class vocabulary for search of objects on remote app
  [mpeeters]

- Remove `client_id` parameter from base vocabulary class since the value is set directly on zope config
  [mpeeters]

- Add caching for vocabularies
  [mpeeters]

- Update translations
  [mpeeters]

- Update form implementation for links
  [mpeeters]

- Improve link viewlet
  [mpeeters]

- Implement services for REST links
  [mpeeters]

- Add a serializer for links
  [mpeeters]

- Renamed `@pod endpoint` to `@pod-templates` to be more explicit.
  Endpoint `@pod-templates` is now a default exapandable element
  available in `@components`.
  [gbastien]

- Moved `FolderPost.wf_transitions` call into `FolderPost._after_reply_hook`.
  Update `serialized_obj` `review_state` key if transitions were triggered in
  `FolderPost.wf_transitions`.
  [gbastien]

- Added endpoint `@infos` to get various informations about application.
  This is soft depending on `Products.CPUtils` and `imio.pyutils`.
  [gbastien]

- Require `plone.restapi>=6.13.3`.
  [gbastien]

- Override `@search` default endpoint so it is easier to complete and
  is a base for sub-packages.
  Added management of `base_search_uid`, being able to give a `Collection UID`
  as base query.
  [gbastien]

1.0a3 (2020-06-08)
------------------

- Add `requests` to package dependencies
  [mpeeters]

- In `add.FolderPost.reply`, call `self.__class__` instead `FolderPost`
  to manage `children` in case we inherit from `FolderPost`.
  [gbastien]

- Added `add.FolderPost.prepare_data` to be able to prepare data
  before calling `reply` that will create the element.
  By default, this checks that data for file is correct.
  [gbastien]

- Added hook after `reply` (`_after_reply_hook`).
  [gbastien]

- If key `wf_transitions` is found during creation,
  given WF transitions are triggered.
  [gbastien]

- Added `@warnings` management in `FolderPost`.
  [gbastien]


1.0a2 (2020-01-10)
------------------

- Add REST links
  [mpeeters]

- Add REST actions
  [mpeeters]

- Add a base form class for REST interaction
  [mpeeters]

- Implement a converter from json schema to a z3c.form interface
  [mpeeters]

- Implement an endpoint to return a json schema schema
  [mpeeters]

- Implement control panel
  [mpeeters]

- Add `bulk` endpoint
  [mpeeters]

- Add a endpoint to get Archetypes vocabulary values
  [mpeeters]

- Add package tests
  [mpeeters]

- Add `@pod` endpoint that will return every `collective.documentgenerator`
  generable POD template for a context.
  This include information on the POD template and links to generate the final
  document in available output formats.
  [gbastien]


1.0a1 (2018-12-04)
------------------

- Initial release.
  [mpeeters]
            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.python.org/pypi/imio.restapi",
    "name": "imio.restapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Python Plone",
    "author": "Martin Peeters",
    "author_email": "martin.peeters@affinitic.be",
    "download_url": "https://files.pythonhosted.org/packages/db/03/89c6af93471d4fa14fff230569de44ad461464bd2194dfb75749640b3d56/imio.restapi-1.0rc1.tar.gz",
    "platform": null,
    "description": ".. This README is meant for consumption by humans and pypi. Pypi can render rst files so please do not use Sphinx features.\n   If you want to learn more about writing documentation, please check out: http://docs.plone.org/about/documentation_styleguide.html\n   This text does not appear on pypi or github. It is a comment.\n\n.. image:: https://travis-ci.com/IMIO/imio.restapi.svg?branch=master\n    :target: https://travis-ci.com/IMIO/imio.restapi\n\n.. image:: https://coveralls.io/repos/github/IMIO/imio.restapi/badge.svg?branch=master\n    :target: https://coveralls.io/github/IMIO/imio.restapi?branch=master\n\n.. image:: http://img.shields.io/pypi/v/imio.restapi.svg\n   :alt: PyPI badge\n   :target: https://pypi.org/project/imio.restapi\n\n\n============\nimio.restapi\n============\n\nplone.restapi endpoints and adaptations\n\nFeatures\n--------\n\n- ``add element``:\n\n    - with children\n    - trigger WF transitions\n- ``@pod-templates`` endpoint (collective.documentgenerator)\n- ``disable returning fullobject serialization upon creation``:\n\n  - by default when an object is created, the fullobject serialization is returned which is doing some processing sometimes unnecessary\n  - adding an environment variable ``RETURN_FULLOBJECT_AFTER_CREATION_DEFAULT False`` will return the summary serialization when an object is created\n  - this will change the default behavior but it is still possible to change this behavior for a particular POST by defining the ``\"return_fullobject\": true/false`` in the Body\n\nTodo\n----\n\n- manage wf_transitions triggered when creating an element in the deserializer when we will be using only DX\n- include cleanHTML functionnality at the deserializer level, also when we will be using only DX\n\n\nInstallation\n------------\n\nInstall imio.restapi by adding it to your buildout::\n\n    [buildout]\n\n    ...\n\n    eggs =\n        imio.restapi\n\n\nand then running ``bin/buildout``\n\n\nContribute\n----------\n\n- Issue Tracker: https://github.com/collective/imio.restapi/issues\n- Source Code: https://github.com/collective/imio.restapi\n- Documentation: https://docs.plone.org/foo/bar\n\n\nLicense\n-------\n\nThe project is licensed under the GPLv2.\n\n\nContributors\n============\n\n- Martin Peeters [Affinitic], Original author\n\n\nChangelog\n=========\n\n\n1.0rc1 (2024-03-14)\n-------------------\n\n- Moved unused `utils.listify` to `imio.pyutils.utils.listify`.\n  [gbastien]\n- When using a `base_search_uid` take also `sort_on/sort_order`\n  defined on the Collection.\n  [gbastien]\n\n1.0b3 (2023-08-25)\n------------------\n\n- Added parameter `debug_mode` to the settings, when enabled, input and output\n  requests are displayed into the Zope log.\n  [gbastien]\n\n1.0b2 (2023-05-31)\n------------------\n\n- Added helper `utils.serialize_term` that will serialize a vocabulary term\n  the same way it is done by the `FieldSerializer`.\n  [gbastien]\n\n1.0b1 (2022-01-03)\n------------------\n\n- In `FolderPost.do_reply` if an error occurs, do not continue,\n  stop and return the result with the error immediately.\n  [gbastien]\n\n- Added `return_fullobject_after_creation_default`, `True` by default,\n  to the `imio.restapi` settings panel. This will do the full serialized object to\n  be returned after an object is created (this is already the current behavior).\n  When set to False, the summary serialization will be returned.\n  [gbastien]\n\n- Fixed `@infos?include_stats=1` blobstorage size computation to use `.size.json`.\n  [gbastien]\n\n1.0a15 (2021-11-08)\n-------------------\n\n- Override 'update' and 'workflow transition' to use the uid\n  [vpiret]\n\n\n1.0a14 (2021-07-16)\n-------------------\n\n- Avoid duplicates in `metadata_fields`.\n  [gbastien]\n\n- In `@infos` if `PWD` env variable is not available, try to determinate instance\n  path using the `INSTANCE_HOME` env variable.\n  [gbastien]\n\n- Require `plone.restapi<8` in `setup.py` as versions 8+ are only for Python3.\n  [gbastien]\n\n- Fixed tests due to changes in `collective.documentgenerator` where\n  the `ConfigurablePODTemplate` named `test_ods_template` is no more generable\n  on type `Document`.\n  [gbastien]\n\n- Added possibility to redefine the name of the `metadata_fields` form parameter\n  so it may be overrided by a subclass for example.\n  [gbastien]\n\n\n1.0a13 (2021-02-15)\n-------------------\n\n- Cleanup `base_search_uid` parameter to avoid warnings in instance logs\n  [mpeeters]\n\n- Adapt `@search` service to use the context instead of using `path` index that can be buggy on some circumstances\n  [mpeeters]\n\n\n1.0a12 (2021-02-03)\n-------------------\n\n- Improve `@search` by allowing element UID other than Collection for `base_search_uid` parameter that can be used as a base path\n  [mpeeters]\n\n- Moved management of additional `metadata_fields` from the `SearchGet` service\n  to the `DefaultJSONSummarySerializer` created for that, it will override\n  the default `plone.restapi` `DefaultJSONSummarySerializer` and add\n  `id` and `UID` by default to the results.\n  [gbastien]\n\n\n1.0a11 (2020-09-10)\n-------------------\n\n- Leave `FolderPost._after_reply_hook` empty (was managing `wf_transitions`)\n  or `wf_transitions` could be broken if a package overrides\n  `_after_reply_hook` and forget to call super's original method\n  [gbastien]\n\n\n1.0a10 (2020-06-28)\n-------------------\n\n- Add class on list of actions\n  [mpeeters]\n\n\n1.0a9 (2020-06-24)\n------------------\n\n- Improve caching of REST vocabularies\n  [mpeeters]\n\n- Display `imio-restapi-actions` and `imio-restapi-links` viewlets\n  only when package is installed (`IImioRestapiLayer`)\n  [gbastien]\n\n\n1.0a8 (2020-06-23)\n------------------\n\n- Improve filtering for remote rest vocabulary by using the id without the domain\n  [mpeeters]\n\n- Use `@relative_path` attribute for links\n  [mpeeters]\n\n- Implement base serializer to add `@relative_path` attribute\n  [mpeeters]\n\n\n1.0a7 (2020-06-23)\n------------------\n\n- Fix an issue with search vocabulary term ids when `b_size` parameter is used\n  [mpeeters]\n\n\n1.0a6 (2020-06-23)\n------------------\n\n- Fix permissions for viewlet\n  [mpeeters]\n\n\n1.0a5 (2020-06-23)\n------------------\n\n- Fix an error with vocabulary request when there is no body\n  [mpeeters]\n\n\n1.0a4 (2020-06-22)\n------------------\n\n- Add missing french translations\n  [mpeeters]\n\n- Implement basic auth adapter for requests\n  [mpeeters]\n\n- Add an adapter to allow data transform during import of content\n  [mpeeters]\n\n- Ensure that REST vocabulary base class have context available\n  [mpeeters]\n\n- Add `@uid` rest service\n  [mpeeters]\n\n- Add `ImportForm` base class for content import from remote app\n  [mpeeters]\n\n- Make `_request_schema` optional to handle more usecases\n  [mpeeters]\n\n- Add `import_content` utils to create content from rest call result\n  [mpeeters]\n\n- Add `get_application_url` and improve `generate_request_parameters` utils\n  [mpeeters]\n\n- Implement a base class vocabulary for search of objects on remote app\n  [mpeeters]\n\n- Remove `client_id` parameter from base vocabulary class since the value is set directly on zope config\n  [mpeeters]\n\n- Add caching for vocabularies\n  [mpeeters]\n\n- Update translations\n  [mpeeters]\n\n- Update form implementation for links\n  [mpeeters]\n\n- Improve link viewlet\n  [mpeeters]\n\n- Implement services for REST links\n  [mpeeters]\n\n- Add a serializer for links\n  [mpeeters]\n\n- Renamed `@pod endpoint` to `@pod-templates` to be more explicit.\n  Endpoint `@pod-templates` is now a default exapandable element\n  available in `@components`.\n  [gbastien]\n\n- Moved `FolderPost.wf_transitions` call into `FolderPost._after_reply_hook`.\n  Update `serialized_obj` `review_state` key if transitions were triggered in\n  `FolderPost.wf_transitions`.\n  [gbastien]\n\n- Added endpoint `@infos` to get various informations about application.\n  This is soft depending on `Products.CPUtils` and `imio.pyutils`.\n  [gbastien]\n\n- Require `plone.restapi>=6.13.3`.\n  [gbastien]\n\n- Override `@search` default endpoint so it is easier to complete and\n  is a base for sub-packages.\n  Added management of `base_search_uid`, being able to give a `Collection UID`\n  as base query.\n  [gbastien]\n\n1.0a3 (2020-06-08)\n------------------\n\n- Add `requests` to package dependencies\n  [mpeeters]\n\n- In `add.FolderPost.reply`, call `self.__class__` instead `FolderPost`\n  to manage `children` in case we inherit from `FolderPost`.\n  [gbastien]\n\n- Added `add.FolderPost.prepare_data` to be able to prepare data\n  before calling `reply` that will create the element.\n  By default, this checks that data for file is correct.\n  [gbastien]\n\n- Added hook after `reply` (`_after_reply_hook`).\n  [gbastien]\n\n- If key `wf_transitions` is found during creation,\n  given WF transitions are triggered.\n  [gbastien]\n\n- Added `@warnings` management in `FolderPost`.\n  [gbastien]\n\n\n1.0a2 (2020-01-10)\n------------------\n\n- Add REST links\n  [mpeeters]\n\n- Add REST actions\n  [mpeeters]\n\n- Add a base form class for REST interaction\n  [mpeeters]\n\n- Implement a converter from json schema to a z3c.form interface\n  [mpeeters]\n\n- Implement an endpoint to return a json schema schema\n  [mpeeters]\n\n- Implement control panel\n  [mpeeters]\n\n- Add `bulk` endpoint\n  [mpeeters]\n\n- Add a endpoint to get Archetypes vocabulary values\n  [mpeeters]\n\n- Add package tests\n  [mpeeters]\n\n- Add `@pod` endpoint that will return every `collective.documentgenerator`\n  generable POD template for a context.\n  This include information on the POD template and links to generate the final\n  document in available output formats.\n  [gbastien]\n\n\n1.0a1 (2018-12-04)\n------------------\n\n- Initial release.\n  [mpeeters]",
    "bugtrack_url": null,
    "license": "GPL version 2",
    "summary": "Extended rest api service for IMIO usecases",
    "version": "1.0rc1",
    "project_urls": {
        "Homepage": "https://pypi.python.org/pypi/imio.restapi"
    },
    "split_keywords": [
        "python",
        "plone"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db0389c6af93471d4fa14fff230569de44ad461464bd2194dfb75749640b3d56",
                "md5": "59d1ec44fbd9eb0f64746a0e70fb974b",
                "sha256": "e57d120b36067275b00247757d0393a03661cb56a410667938c21b0736e31b98"
            },
            "downloads": -1,
            "filename": "imio.restapi-1.0rc1.tar.gz",
            "has_sig": false,
            "md5_digest": "59d1ec44fbd9eb0f64746a0e70fb974b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 47523,
            "upload_time": "2024-03-14T14:18:29",
            "upload_time_iso_8601": "2024-03-14T14:18:29.459263Z",
            "url": "https://files.pythonhosted.org/packages/db/03/89c6af93471d4fa14fff230569de44ad461464bd2194dfb75749640b3d56/imio.restapi-1.0rc1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-14 14:18:29",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "imio.restapi"
}
        
Elapsed time: 0.19520s