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

PLIP 20239: Behavior name in ZCML directive, registration lookup utility #2

Merged
merged 8 commits into from Jul 9, 2015

Conversation

rnixx
Copy link
Member

@rnixx rnixx commented Nov 12, 2014

According to http://comments.gmane.org/gmane.comp.web.zope.plone.devel/34834 this pull request introduces behavior short names which are set at ZCML registration time and should later be used for behavior lookup on dexterity content and for behavior introspection.

This change is 100% B/C and only logs a warning at instance startup if a behavior registration has no name set.

More to come in downstream packages

cheers

@jensens jensens force-pushed the rnixx_behavior_name_and_lookup branch from 48da195 to 4a506c7 Compare November 14, 2014 09:59
@davisagli
Copy link
Sponsor Member

What if I want to replace a core behavior, so that every time code looks it up by name it gets my replacement behavior instead of the core one? Doesn't look like that is possible with this implementation.

@jensens
Copy link
Sponsor Member

jensens commented May 6, 2015

@do3cc +1 for the fallback

@davisagli at the moment you have to register a new behavior too - which gets a new name by __identifier__ - so nothing changes or do i oversee something? Do you request a new feature?

@jensens jensens force-pushed the rnixx_behavior_name_and_lookup branch from 4a506c7 to 9ef9099 Compare May 12, 2015 08:27
@jensens
Copy link
Sponsor Member

jensens commented May 12, 2015

First I rebased master and now I took care to always register the __identifier__ and if given the name. That way nothing breaks.
Todo: add this to the examples in README.rst.

@jensens jensens mentioned this pull request May 12, 2015
@jensens
Copy link
Sponsor Member

jensens commented May 13, 2015

Lets get jenkins opinion about this
http://jenkins.plone.org/view/All/job/pull-request/136/

@jensens
Copy link
Sponsor Member

jensens commented May 13, 2015

State here: full documentation in README.rst missing (down in ZCML and examples section.

@jensens jensens changed the title Behavior name in ZCML directive, registration lookup utility PLIP 20239: Behavior name in ZCML directive, registration lookup utility May 20, 2015
@jensens
Copy link
Sponsor Member

jensens commented May 27, 2015

Documentation for name was added to README.rst.
tests are running here:
http://jenkins.plone.org/job/pull-request/162/

  • ok
  • fails

http://jenkins.plone.org/view/All/job/pull-request-4.3/24/

  • ok
  • fails

@@ -88,6 +89,20 @@ After this is done you can adapt a context to ``ILockingSupport`` as normal::
if locking is not None:
locking.lock()

The ``name`` is can be used for lookup instead of the full dotted name of the interface::
Copy link
Member Author

Choose a reason for hiding this comment

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

-is

@jensens
Copy link
Sponsor Member

jensens commented Jul 8, 2015

@jensens
Copy link
Sponsor Member

jensens commented Jul 9, 2015

tests ok

jensens added a commit that referenced this pull request Jul 9, 2015
PLIP 20239: Behavior name in ZCML directive, registration lookup utility
@jensens jensens merged commit e1de125 into master Jul 9, 2015
@jensens jensens deleted the rnixx_behavior_name_and_lookup branch July 9, 2015 08:09
@mauritsvanrees
Copy link
Sponsor Member

When I start my plone-coredev 4.3 buildout, I now get these warnings:

2015-07-29 23:09:55 WARNING plone.behavior Specifying 'for' in behavior 'Name from title' if no 'factory' is given has no effect and is superfluous.
2015-07-29 23:09:55 WARNING plone.behavior Specifying 'for' in behavior 'Name from file name' if no 'factory' is given has no effect and is superfluous.
2015-07-29 23:09:55 WARNING plone.behavior Specifying 'for' in behavior 'Navigation root' if no 'factory' is given has no effect and is superfluous.
2015-07-29 23:09:55 WARNING plone.behavior Specifying 'for' in behavior 'Exclude From navigation' if no 'factory' is given has no effect and is superfluous.
2015-07-29 23:09:55 WARNING plone.behavior Specifying 'for' in behavior 'Next previous navigation toggle' if no 'factory' is given has no effect and is superfluous.
2015-07-29 23:09:55 WARNING plone.behavior Specifying 'for' in behavior 'Allow discussion' if no 'factory' is given has no effect and is superfluous.
2015-07-29 23:09:55 WARNING plone.behavior Specifying 'for' in behavior 'Next previous navigation' if no 'factory' is given has no effect and is superfluous.

Two things:

  1. coredev 4.3 pins plone.behavior 1.0.3, but checks out the master branch. We should probably create a 1.0.x branch and use that on 4.3. Right? (I can do that.)
  2. Alternatively, should we fix those warnings in the various packages?

@jensens
Copy link
Sponsor Member

jensens commented Jul 29, 2015

+1 to fix them, its a wrong registration (predicting to bind for something that has no effect), the change just shows it, nothing new.

@jensens
Copy link
Sponsor Member

jensens commented Jul 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants