Metadata-Version: 2.1
Name: plone.app.lockingbehavior
Version: 1.0.7
Summary: Locking integration for dexterity content objects.
Home-page: https://github.com/plone/plone.app.lockingbehavior/
Author: Plone Foundation
Author-email: mailto:dexterity-development@googlegroups.com
License: GPL version 2
Keywords: dexterity locking behavior plone
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 4.3
Classifier: Framework :: Plone :: 5.0
Classifier: Framework :: Plone :: 5.1
Classifier: Framework :: Plone :: 5.2
Classifier: Framework :: Plone :: Core
Classifier: Framework :: Zope2
Classifier: Framework :: Zope :: 4
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: setuptools
Requires-Dist: plone.app.locales (>=4.3.9)
Requires-Dist: plone.behavior
Requires-Dist: plone.dexterity (>=1.1)
Requires-Dist: plone.locking
Provides-Extra: tests
Requires-Dist: plone.app.testing ; extra == 'tests'

Introduction
============

The ``plone.app.lockingbehavior`` package provides a ``plone.locking`` integration
for dexterity.

Usage
-----

Just use the behavior ``plone.app.lockingbehavior.behaviors.ILocking`` in
your dexterity content type. Also check the condition of the "edit" action
of your type, it should check if the object is locked.

In your *profiles/default/types/YOURTYPE.xml* add the behavior and the
edit action::

    <?xml version="1.0"?>
    <object name="example.conference.presenter" meta_type="Dexterity FTI"
            i18n:domain="example.conference" xmlns:i18n="http://xml.zope.org/namespaces/i18n">

        <!-- enabled behaviors -->
        <property name="behaviors">
            <element value="plone.app.lockingbehavior.behaviors.ILocking" />
        </property>

        <action action_id="edit"
                visible="True"
                title="Edit"
                category="object"
                url_expr="string:${object_url}/edit"
                condition_expr="not:object/@@plone_lock_info/is_locked_for_current_user|python:True">
            <permission value="Modify portal content"/>
        </action>

    </object>

The ILocking behavior enables locking support for your content type. This adds
the ``ITTWLockable`` interface from ``plone.locking``. The locking viewlet
from ``plone.app.layout`` is also working for the dexterity content type.


More Information
----------------

* http://pypi.python.org/pypi/plone.locking

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

1.0.7 (2020-04-20)
------------------

Bug fixes:


- Minor packaging updates. (#1)


1.0.6 (2018-11-21)
------------------

Bug fixes:


- Cleanup project level files (setup.py, .travis-ci.yml...) [maurits]
  [gforcada] (#2524)


1.0.5 (2017-02-12)
------------------

Bug fixes:

- Add coding header on python files.
  [gforcada]

- Unskip test for Zope 4, as isolation problems are already fixed.
  [thet]


1.0.4 (2016-05-02)
------------------

New:

- Add behavior short name.
  [jensens]


1.0.3 (2016-02-20)
------------------

Fixes:

- Use a functional layer to resolve test isolation problems.
  [gforcada]

- Refactor doctest to an integration test and skip it for Zope 4 due to isolation problems.
  [pbauer]

- Changed i18n_domain to "plone".
  Requires plone.app.locales 4.3.9 or higher.
  [claytonc]


1.0.2 (2015-09-09)
------------------

- Remove superfluous 'for'.
  [fulv]

- Fix tests: redirect was changed in commit e7367258.
  [jone]

- If the content is locked, the redirect points to the default view and
  not to the absolute_url of the object. It avoids image opening on redirect
  [parruc]


1.0.1 (2011-12-06)
------------------

- Fix version requirement of plone.dexterity: 1.1 is compatible.
  [jone]


1.0 (2011-11-27)
----------------

- Fixed problem: locks were not released when editing content and saving
  it without changing anything. Fixed by using new IEditFinishedEvent instead
  of IObjectModifiedEvent.
  [jbaumann]

- Fixed problem which caused widget traversal to fail.
  The edit form is now protected for non-anonymous user, since locking for
  anyonmous users does not work anyway.
  [jbaumann]

- Initial implementation
  [jbaumann]


