plone.app.redirector


Nameplone.app.redirector JSON
Version 3.0.1 PyPI version JSON
download
home_pagehttps://github.com/plone/plone.app.redirector
Summaryredirection tool
upload_time2023-04-15 08:00:06
maintainer
docs_urlNone
authorPlone Foundation
requires_python>=3.8
licenseGPL version 2
keywords links redirect
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Introduction
============

by Martin Aspeli <optilude@gmx.net> based on work by Helge Tesdal
(RedirectionTool) and Whit Morriss (topp.rose).

Bring dead links back to life! plone.app.redirector knows where your content
used to be and can bring you to its new location when content moves.

This component expects you to register storage.RedirectionStorage as a local
utility providing IRedirectionStorage (CMFPlone does this). Once that's done,
the subscribers in subscribers.py will listen for object moved and object
deleted events.

When an object is moved (renamed or cut/pasted into a different location),
the redirection storage will remember the old path. It is smart enough to
deal with transitive references (if we have a -> b and then add b -> c,
it is replaced by a reference a -> c) and circular references (attempting to
add a -> a does nothing).

When an object is deleted, all references to it are deleted as well.

The view in browser.py contains methods (used in Plone's
default_error_message.pt when it gets a NotFound error) that do the following:

- attempt to redirect from the assumed intended path to the new path of an
  object, if the redirection storage holds a reference from the old path.

- if not, look for the first valid parent of the assumed intended path, and
  present it as an option to the user

- further, use the last id of the assumed intended path and attempt to search
  for objects in the catalog that contain this, presenting the options to the
  user


Changelog
=========

.. You should *NOT* be adding new change log entries to this file.
   You should create a file in the news directory instead.
   For helpful instructions, please see:
   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst

.. towncrier release notes start

3.0.1 (2023-04-15)
------------------

Internal:


- Update configuration files.
  [plone devs] (93e1ab65)


3.0.0 (2022-11-30)
------------------

Bug fixes:


- Final release.
  [gforcada] (#600)


3.0.0a1 (2022-04-08)
--------------------

Breaking changes:


- Plone 6 only, remove Archetypes specific code.
  Also Code modernization (black, isort, pyupgrade).
  [jensens] (modernize)


2.2.1 (2020-04-20)
------------------

Bug fixes:


- Minor packaging updates. (#1)


2.2.0 (2020-03-13)
------------------

New features:


- The http status of the response is changed from 301 (Moved Permanently) to 302 (Found) for GET requests and to 307 (Temporary Redirect) for other request methods because nothing prevents the URL to be reused in the future. [ale-rt] (#8)


2.1.1 (2019-12-10)
------------------

Bug fixes:


- Allow performance tests to take more time.
  This seems needed on the Plone Jenkins test server when jobs are run in parallel.
  [maurits] (#20)


2.1.0 (2019-04-29)
------------------

New features:


- Store date information in the paths.
  Can be used as basis for removing for example all redirects that are older than a year.
  [maurits] (#17)
- Keep track if a redirect was added manually or automatically.
  [maurits] (#18)


2.0.1 (2019-03-03)
------------------

New features:


- Support using the 'in' operator for paths. Support using storage[old_path] to
  get the new path, possibly raising KeyError. Support using storage[old_path]
  to set or delete new paths. Support using len(storage) to get the number of
  paths. Support storage.clear() to clear out all data. Support
  storage.update() for bulk updates. Added performance tests. Call with
  ``export PLONE_APP_REDIRECTOR_PERFORMANCE_NUMBER=100000`` to enable.
  [maurits] (#13)


Bug fixes:


- Turned doctests into unittests. Removed no longer needed test_suite
  functions. [maurits] (#12)


2.0.0 (2019-02-13)
------------------

Breaking changes:


- No longer try to check portal_redirection for allowed types. This was from
  Products.RedirectionTool, which is scheduled to be merged into CMFPlone 5.2.
  The feature to allow redirections only for specific types will be either
  removed or changed. [maurits] (#1486)


1.3.7 (2018-11-21)
------------------

Bug fixes:


- Cleanup project level files (setup.py, pyproject.toml) [maurits] [gforcada]
  (#2524)


1.3.6 (2018-02-02)
------------------

Bug fixes:

- Add Python 2 / 3 compatibility
  [vincero]


1.3.5 (2017-06-20)
------------------

Bug fixes:

- remove unittest2 dependency
  [kakshay21]


1.3.4 (2017-01-12)
------------------

Bug fixes:

- Don't test repr of tree iterator.
  [davisagli]


1.3.3 (2016-11-10)
------------------

Bug fixes:

- Add coding header on python files.
  [gforcada]


1.3.2 (2016-08-18)
------------------

Fixes:

- Use zope.interface decorator.
  [gforcada]


1.3.1 (2015-09-09)
------------------

- Fixed tests to use registry for value lookup.
  [esteele]


1.3 (2015-08-14)
----------------

- Rerelease of 1.2.1 as 1.3 for clarity.  This is for Plone 5 only.
  [maurits]


1.2.2 (2015-08-14)
------------------

- Rerelease of same code as 1.2.  The changes from 1.2.1 are for Plone 5.
  [maurits]


1.2.1 (2014-02-26)
------------------

- Rename without using folder_contents.
  [davisagli]

- Use p.a.contenttypes test fixture and adapt/fix failing tests due to the
  ATContentTypes removal from PLONE_FIXTURE in Plone 5.
  [timo]


1.2 (2013-05-26)
----------------

- Support redirecting to external URLs.
  [rpatterson]


1.2a1 (2012-07-02)
------------------

- Import object events from zope.lifecycleevent.
  [davisagli]

- Move tests from PloneTestCase to plone.app.testing.
  [timo]


1.1.3 (2012-05-07)
------------------

- Support parts of views e.g. mypage/@@myview/somepart
  [anthonygerrard]

- #12354 will redirect based on the query string as well as path if query_string
  stored. [djay]

- #9967 will append the same query string after redirecting to be more tracker
  friendly. [djay]

- #12858 first suggestion on not found page can be unsuitable
  [anthonygerrard]


1.1.2 - 2011-07-05
------------------

- Don't break in the objectMoved handler if the request has no ACTUAL_URL, to
  facilitate testing.
  [davisagli]

- Add MANIFEST.in.
  [WouterVH]


1.1.1 - 2011-03-02
------------------

- Gracefully handle errors parsing the SearchableText query on the 404 view.
  [davisagli]


1.1 - 2010-07-18
----------------

- Update license to GPL version 2 only.
  [hannosch]


1.0.13 - 2010-01-25
-------------------

- Added optional support for the getRedirectionAllowedForTypes method of
  Products.RedirectionTool.
  [hannosch]


1.0.12 - 2009-06-17
-------------------

- Fix bad calling convention in IFourOhFourView definition.
  [wichert]

- Move event subscribers to a separate zcml file so they can easily be
  excluded.
  [wichert]

- Update browser view to handle environments where the storage utility is not
  available.
  [wichert]


1.0.11 - 2009-04-05
-------------------

- Fixed multiple steps circular references #8840
  [gotcha]

- Fixed a bug which caused URLs with %-escaped sequences to grow extra %25s upon
  redirect.
  [erikrose]


1.0.10 - 2009-03-07
-------------------

- Fixed tests to be independent of any default content.
  [hannosch]

- Fixed a test to be less dependent on the page rendering.
  [hannosch]

- Added quotation marks around open and close parens. This fixes
  http://dev.plone.org/plone/ticket/8588.
  [MatthewWilkes]


1.0.9 - 2008-07-07
------------------

- Fix for the fix regarding unnecessary creation of redirection entries for
  newly created objects.
  [witsch]


1.0.8 - 2008-07-07
------------------

- Fix release confusion by ensuring we have a "late" version number.
  Somewhere, someone created a 1.0.7. :-)
  [optilude]


1.0.6 - 2008-07-07
------------------

- Fix unnecessary creation of redirection entries for newly created objects.
  [witsch]


1.0.5 - 2008-01-03
------------------

- Start searches for missing items in the navigation root instead of the site
  root.
  [wichert]


1.0.2 - 2007-10-08
------------------

- also ignore ids from views.
  [ldr]

- Added __iter__ function to storage which iterates over all paths.
  [fschulze]


1.0 - 2007-08-17
----------------

- Initial release.
  [optilude]

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/plone/plone.app.redirector",
    "name": "plone.app.redirector",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "links redirect",
    "author": "Plone Foundation",
    "author_email": "plone-developers@lists.sourceforge.net",
    "download_url": "https://files.pythonhosted.org/packages/b8/ae/cb911200e31f994e9a472b984bf1fb14f7747cf6c298ffa7dd7b9d594c17/plone.app.redirector-3.0.1.tar.gz",
    "platform": null,
    "description": "Introduction\n============\n\nby Martin Aspeli <optilude@gmx.net> based on work by Helge Tesdal\n(RedirectionTool) and Whit Morriss (topp.rose).\n\nBring dead links back to life! plone.app.redirector knows where your content\nused to be and can bring you to its new location when content moves.\n\nThis component expects you to register storage.RedirectionStorage as a local\nutility providing IRedirectionStorage (CMFPlone does this). Once that's done,\nthe subscribers in subscribers.py will listen for object moved and object\ndeleted events.\n\nWhen an object is moved (renamed or cut/pasted into a different location),\nthe redirection storage will remember the old path. It is smart enough to\ndeal with transitive references (if we have a -> b and then add b -> c,\nit is replaced by a reference a -> c) and circular references (attempting to\nadd a -> a does nothing).\n\nWhen an object is deleted, all references to it are deleted as well.\n\nThe view in browser.py contains methods (used in Plone's\ndefault_error_message.pt when it gets a NotFound error) that do the following:\n\n- attempt to redirect from the assumed intended path to the new path of an\n  object, if the redirection storage holds a reference from the old path.\n\n- if not, look for the first valid parent of the assumed intended path, and\n  present it as an option to the user\n\n- further, use the last id of the assumed intended path and attempt to search\n  for objects in the catalog that contain this, presenting the options to the\n  user\n\n\nChangelog\n=========\n\n.. You should *NOT* be adding new change log entries to this file.\n   You should create a file in the news directory instead.\n   For helpful instructions, please see:\n   https://github.com/plone/plone.releaser/blob/master/ADD-A-NEWS-ITEM.rst\n\n.. towncrier release notes start\n\n3.0.1 (2023-04-15)\n------------------\n\nInternal:\n\n\n- Update configuration files.\n  [plone devs] (93e1ab65)\n\n\n3.0.0 (2022-11-30)\n------------------\n\nBug fixes:\n\n\n- Final release.\n  [gforcada] (#600)\n\n\n3.0.0a1 (2022-04-08)\n--------------------\n\nBreaking changes:\n\n\n- Plone 6 only, remove Archetypes specific code.\n  Also Code modernization (black, isort, pyupgrade).\n  [jensens] (modernize)\n\n\n2.2.1 (2020-04-20)\n------------------\n\nBug fixes:\n\n\n- Minor packaging updates. (#1)\n\n\n2.2.0 (2020-03-13)\n------------------\n\nNew features:\n\n\n- The http status of the response is changed from 301 (Moved Permanently) to 302 (Found) for GET requests and to 307 (Temporary Redirect) for other request methods because nothing prevents the URL to be reused in the future. [ale-rt] (#8)\n\n\n2.1.1 (2019-12-10)\n------------------\n\nBug fixes:\n\n\n- Allow performance tests to take more time.\n  This seems needed on the Plone Jenkins test server when jobs are run in parallel.\n  [maurits] (#20)\n\n\n2.1.0 (2019-04-29)\n------------------\n\nNew features:\n\n\n- Store date information in the paths.\n  Can be used as basis for removing for example all redirects that are older than a year.\n  [maurits] (#17)\n- Keep track if a redirect was added manually or automatically.\n  [maurits] (#18)\n\n\n2.0.1 (2019-03-03)\n------------------\n\nNew features:\n\n\n- Support using the 'in' operator for paths. Support using storage[old_path] to\n  get the new path, possibly raising KeyError. Support using storage[old_path]\n  to set or delete new paths. Support using len(storage) to get the number of\n  paths. Support storage.clear() to clear out all data. Support\n  storage.update() for bulk updates. Added performance tests. Call with\n  ``export PLONE_APP_REDIRECTOR_PERFORMANCE_NUMBER=100000`` to enable.\n  [maurits] (#13)\n\n\nBug fixes:\n\n\n- Turned doctests into unittests. Removed no longer needed test_suite\n  functions. [maurits] (#12)\n\n\n2.0.0 (2019-02-13)\n------------------\n\nBreaking changes:\n\n\n- No longer try to check portal_redirection for allowed types. This was from\n  Products.RedirectionTool, which is scheduled to be merged into CMFPlone 5.2.\n  The feature to allow redirections only for specific types will be either\n  removed or changed. [maurits] (#1486)\n\n\n1.3.7 (2018-11-21)\n------------------\n\nBug fixes:\n\n\n- Cleanup project level files (setup.py, pyproject.toml) [maurits] [gforcada]\n  (#2524)\n\n\n1.3.6 (2018-02-02)\n------------------\n\nBug fixes:\n\n- Add Python 2 / 3 compatibility\n  [vincero]\n\n\n1.3.5 (2017-06-20)\n------------------\n\nBug fixes:\n\n- remove unittest2 dependency\n  [kakshay21]\n\n\n1.3.4 (2017-01-12)\n------------------\n\nBug fixes:\n\n- Don't test repr of tree iterator.\n  [davisagli]\n\n\n1.3.3 (2016-11-10)\n------------------\n\nBug fixes:\n\n- Add coding header on python files.\n  [gforcada]\n\n\n1.3.2 (2016-08-18)\n------------------\n\nFixes:\n\n- Use zope.interface decorator.\n  [gforcada]\n\n\n1.3.1 (2015-09-09)\n------------------\n\n- Fixed tests to use registry for value lookup.\n  [esteele]\n\n\n1.3 (2015-08-14)\n----------------\n\n- Rerelease of 1.2.1 as 1.3 for clarity.  This is for Plone 5 only.\n  [maurits]\n\n\n1.2.2 (2015-08-14)\n------------------\n\n- Rerelease of same code as 1.2.  The changes from 1.2.1 are for Plone 5.\n  [maurits]\n\n\n1.2.1 (2014-02-26)\n------------------\n\n- Rename without using folder_contents.\n  [davisagli]\n\n- Use p.a.contenttypes test fixture and adapt/fix failing tests due to the\n  ATContentTypes removal from PLONE_FIXTURE in Plone 5.\n  [timo]\n\n\n1.2 (2013-05-26)\n----------------\n\n- Support redirecting to external URLs.\n  [rpatterson]\n\n\n1.2a1 (2012-07-02)\n------------------\n\n- Import object events from zope.lifecycleevent.\n  [davisagli]\n\n- Move tests from PloneTestCase to plone.app.testing.\n  [timo]\n\n\n1.1.3 (2012-05-07)\n------------------\n\n- Support parts of views e.g. mypage/@@myview/somepart\n  [anthonygerrard]\n\n- #12354 will redirect based on the query string as well as path if query_string\n  stored. [djay]\n\n- #9967 will append the same query string after redirecting to be more tracker\n  friendly. [djay]\n\n- #12858 first suggestion on not found page can be unsuitable\n  [anthonygerrard]\n\n\n1.1.2 - 2011-07-05\n------------------\n\n- Don't break in the objectMoved handler if the request has no ACTUAL_URL, to\n  facilitate testing.\n  [davisagli]\n\n- Add MANIFEST.in.\n  [WouterVH]\n\n\n1.1.1 - 2011-03-02\n------------------\n\n- Gracefully handle errors parsing the SearchableText query on the 404 view.\n  [davisagli]\n\n\n1.1 - 2010-07-18\n----------------\n\n- Update license to GPL version 2 only.\n  [hannosch]\n\n\n1.0.13 - 2010-01-25\n-------------------\n\n- Added optional support for the getRedirectionAllowedForTypes method of\n  Products.RedirectionTool.\n  [hannosch]\n\n\n1.0.12 - 2009-06-17\n-------------------\n\n- Fix bad calling convention in IFourOhFourView definition.\n  [wichert]\n\n- Move event subscribers to a separate zcml file so they can easily be\n  excluded.\n  [wichert]\n\n- Update browser view to handle environments where the storage utility is not\n  available.\n  [wichert]\n\n\n1.0.11 - 2009-04-05\n-------------------\n\n- Fixed multiple steps circular references #8840\n  [gotcha]\n\n- Fixed a bug which caused URLs with %-escaped sequences to grow extra %25s upon\n  redirect.\n  [erikrose]\n\n\n1.0.10 - 2009-03-07\n-------------------\n\n- Fixed tests to be independent of any default content.\n  [hannosch]\n\n- Fixed a test to be less dependent on the page rendering.\n  [hannosch]\n\n- Added quotation marks around open and close parens. This fixes\n  http://dev.plone.org/plone/ticket/8588.\n  [MatthewWilkes]\n\n\n1.0.9 - 2008-07-07\n------------------\n\n- Fix for the fix regarding unnecessary creation of redirection entries for\n  newly created objects.\n  [witsch]\n\n\n1.0.8 - 2008-07-07\n------------------\n\n- Fix release confusion by ensuring we have a \"late\" version number.\n  Somewhere, someone created a 1.0.7. :-)\n  [optilude]\n\n\n1.0.6 - 2008-07-07\n------------------\n\n- Fix unnecessary creation of redirection entries for newly created objects.\n  [witsch]\n\n\n1.0.5 - 2008-01-03\n------------------\n\n- Start searches for missing items in the navigation root instead of the site\n  root.\n  [wichert]\n\n\n1.0.2 - 2007-10-08\n------------------\n\n- also ignore ids from views.\n  [ldr]\n\n- Added __iter__ function to storage which iterates over all paths.\n  [fschulze]\n\n\n1.0 - 2007-08-17\n----------------\n\n- Initial release.\n  [optilude]\n",
    "bugtrack_url": null,
    "license": "GPL version 2",
    "summary": "redirection tool",
    "version": "3.0.1",
    "split_keywords": [
        "links",
        "redirect"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4ea27770d81e7c9c40362eba1327f6f0eb20911d4606562dbdd74f415ee01c1",
                "md5": "52f944de5219cd7ba8d9f4d24e6f6b8a",
                "sha256": "9143f6f4baa20d0241a0b82b527d572dd6d07beea803d84768c02aaae3e43fc9"
            },
            "downloads": -1,
            "filename": "plone.app.redirector-3.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52f944de5219cd7ba8d9f4d24e6f6b8a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 23628,
            "upload_time": "2023-04-15T08:00:03",
            "upload_time_iso_8601": "2023-04-15T08:00:03.415812Z",
            "url": "https://files.pythonhosted.org/packages/f4/ea/27770d81e7c9c40362eba1327f6f0eb20911d4606562dbdd74f415ee01c1/plone.app.redirector-3.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8aecb911200e31f994e9a472b984bf1fb14f7747cf6c298ffa7dd7b9d594c17",
                "md5": "61728ee9cc0cec62dc7ae9604db978d6",
                "sha256": "bceb0790920e7f82b5faf7f2d5b766725c3aaf78a66269333e107e700a377d36"
            },
            "downloads": -1,
            "filename": "plone.app.redirector-3.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "61728ee9cc0cec62dc7ae9604db978d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 29448,
            "upload_time": "2023-04-15T08:00:06",
            "upload_time_iso_8601": "2023-04-15T08:00:06.171481Z",
            "url": "https://files.pythonhosted.org/packages/b8/ae/cb911200e31f994e9a472b984bf1fb14f7747cf6c298ffa7dd7b9d594c17/plone.app.redirector-3.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-15 08:00:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "plone",
    "github_project": "plone.app.redirector",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "plone.app.redirector"
}
        
Elapsed time: 0.05484s