Repository navigation
Conversation
Documentation build overview
9 files changed ·
|
Member
Author
|
LGTM |
sneridagh
force-pushed
the
issue-2061-behaviors
branch
from
November 1, 2026 02:41
a1aebbc to
df49e0e
Compare
Member
Author
|
@jenkins-plone-org please run jobs |
davisagli
force-pushed
the
issue-2061-behaviors
branch
from
November 1, 2026 19:31
df49e0e to
a6a52eb
Compare
- @Content-Types: a behaviors fieldset with the complete, ordered list of a Dexterity type's behaviors. PATCH replaces it. Unregistered behaviors are kept. Written before versioning, so the versioning setting decides about its own behavior. - @behaviors: every registered behavior once, with the fields it adds by fieldset. - GET @types/{type}?behaviors=...: the schema the type would have with these behaviors, without changing it.
davisagli
force-pushed
the
issue-2061-behaviors
branch
from
November 1, 2026 20:06
a6a52eb to
522773a
Compare
davisagli
reviewed
Nov 1, 2026
davisagli
left a comment
Member
There was a problem hiding this comment.
I reviewed the docs, but not the implementation yet.
| method="GET" | ||
| factory=".get.BehaviorsGet" | ||
| for="plone.restapi.bbb.IPloneSiteRoot" | ||
| permission="plone.app.controlpanel.Overview" |
Member
There was a problem hiding this comment.
I think we should use plone.app.controlpanel.Types
| "description": "The complete list of the type's behaviors. Their order sets where their fields appear in the edit form.", | ||
| "factory": "Multiple Choice", | ||
| "items": { | ||
| "choices": [ |
Member
There was a problem hiding this comment.
Why are you including these choices inline instead of using the existing Behaviors vocabulary? It's a bit redundant to include a copy of the choices in each type's settings schema when it's already available as a vocabulary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 3 of #2061. Stacked on #2070.
What a behaviors UI needs: the order of a type's behaviors, what each behavior adds, and a preview of the edit form with other behaviors.
@content-types: ordered behaviorsbehaviorsfieldset for Dexterity types, with one field,behaviors: the complete, ordered list of the type's behaviors. Their order sets where their fields appear in the edit form.PATCHreplaces the list: a behavior left out is disabled. It's aListofChoices from the registered behaviors, so unknown or repeated behaviors return400with the field's error.plone.dublincore), also when the FTI stores the interface identifier or a former dotted name.PATCHkeeps them, so they come back with their add-on.orderis 45, before versioning. The service writes fieldsets in order, so in aPATCHthat changes both, the versioning setting decides about the versioning behavior, as it does when it changes alone.GET /@behaviorsname,title,descriptionandfieldsets: the fields it adds to the edit form, by fieldset. The fields are computed with the same autoform processing as the edit form, so fieldset directives apply. The list is empty for behaviors that add no fields.@content-types.GET /@types/{type}?behaviors=a,b,…get_jsonschema_for_fti,get_jsonschema_for_portal_typeandget_info_for_typetake an optionalbehaviorslist. A newbehavior_form_schematabuilds the form schemata from it, likegetAdditionalSchematadoes from the FTI.400, and non-Dexterity types return404.Docs
content-types.md: thebehaviorssetting, with an examplebehaviors.mdtypes.md: "Preview the schema with other behaviors"content_types_patch_behaviors,behaviors_get(request only, the list is long) andtypes_get_with_behaviors(request only).content_types_get_item.respandcontent_types_post.respgain the fieldset.Tests
test_services_contenttypes.py, 7 new tests:PATCHreplacing it in order, with the type schema followingtest_services_behaviors.py: listing, fields by fieldset, behaviors without fields, and permissionstest_services_types.py: the preview, an empty preview, and an unknown behaviorFull suite: 1508 tests. 7 fail, and the same 7 fail on #2070's branch: date-dependent tests in
test_workflow,test_searchandtest_statictime.The Aurora UI that uses this is plone/aurora#335. Its driver switches to these endpoints in a follow-up.