Skip to content

Commit 7b0dd2b

Browse files
authored
Merge branch '6-dev' into search_feature
2 parents 445b9d9 + 79c2d95 commit 7b0dd2b

34 files changed

+1747
-148
lines changed

docs/_static/custom.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,4 +449,10 @@ div.viewcode-block:target {
449449
background-color: var(--codeblock-color);
450450
border-top: 1px solid var(--codeblock-color);
451451
border-bottom: 1px solid var(--codeblock-color);
452+
}
453+
454+
/* Fix paragraphs in list items. */
455+
#main-content ol > li > p:nth-child(n+2),
456+
#main-content ul > li > p:nth-child(n+2) {
457+
margin-top: 1em;
452458
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Configuration Registry in Plone 6"
5+
"property=og:description": "Configuration Registry in Plone 6"
6+
"property=og:title": "Configuration Registry in Plone 6"
7+
"keywords": "Plone 6, Configuration Registry, backend, plone.registry, plone.app.registry, GenericSetup"
8+
---
9+
10+
(backend-configuration-registry-label)=
11+
12+
# Configuration Registry
13+
14+
```{todo}
15+
Explain how `plone.registry` / `plone.app.registry` and `GenericSetup` work together.
16+
Provide examples of how to import and export Plone settings.
17+
18+
See https://github.com/plone/documentation/issues/1424
19+
```
20+
21+
(backend-configuration-registry-generic-setup-label)=
22+
23+
## `GenericSetup`
24+
25+
```{todo}
26+
Explain how `GenericSetup` works.
27+
```

docs/backend/index.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
myst:
33
html_meta:
4-
"description": ""
5-
"property=og:description": ""
6-
"property=og:title": "Backend"
4+
"description": "Plone 6 Backend"
5+
"property=og:description": "Plone 6 Backend"
6+
"property=og:title": "Plone 6 Backend"
77
"keywords": "Plone 6, Volto, Classic UI, frontend, backend, plone.restapi, plone.api"
88
---
99

@@ -17,6 +17,7 @@ Insert introduction here.
1717

1818
```{toctree}
1919
:maxdepth: 2
20+
configuration-registry
2021
control-panels
2122
content-types
2223
behaviors
@@ -29,6 +30,7 @@ global-utils
2930
portal-actions
3031
users-groups
3132
security
33+
traversal-acquisition
3234
workflows
3335
search
3436
indexing

docs/backend/security.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
---
22
myst:
33
html_meta:
4-
"description": ""
5-
"property=og:description": ""
6-
"property=og:title": ""
7-
"keywords": ""
4+
"description": "From Zope, Plone provides various built-in security facilities."
5+
"property=og:description": "From Zope, Plone provides various built-in security facilities."
6+
"property=og:title": "Security"
7+
"keywords": "Security"
88
---
99

1010
(backend-security-label)=
1111

1212
# Security
1313

14+
From Zope, Plone provides various built-in security facilities.
15+
16+
[Security](https://5.docs.plone.org/develop/plone/security)
17+
1418

1519
(backend-security-permissions-label)=
1620

17-
## permissions
21+
## Permissions
22+
23+
[Available Permissions In Plone](https://5.docs.plone.org/develop/plone/security/permission_lists)
1824

1925

2026
(backend-security-roles-label)=
@@ -31,6 +37,8 @@ myst:
3137

3238
### Local Roles
3339

40+
[Local Roles](https://5.docs.plone.org/develop/plone/security/local_roles.html)
41+
3442

3543
(backend-security-sharing-label)=
3644

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Traversal and acquisition in Zope and Plone"
5+
"property=og:description": "Traversal and acquisition in Zope and Plone"
6+
"property=og:title": "Traversal and acquisition in Zope and Plone"
7+
"keywords": "Plone, traversal, acquisition, Zope"
8+
---
9+
10+
(traversal-and-acquisition-label)=
11+
12+
# Traversal and Acquisition
13+
14+
This chapter describes the concepts of {term}`traversal` and {term}`acquisition`.
15+
16+
17+
(backend-traversal-label)=
18+
19+
## Traversal
20+
21+
In Zope and Plone, {term}`traversal` is the process of determining the object that is the target of a request by examining the URL path of the request or in code, and looking up objects in the object hierarchy.
22+
The object hierarchy in Zope is made up of "containers" and "item" objects.
23+
Containers can contain other objects, while item objects cannot.
24+
This is to some degree like the tree structure of a filesystem with folders, subfolders, and files.
25+
26+
When a request is made to the server, it examines the URL path of the request, and starts at the root of the object hierarchy.
27+
It then looks up each element of the URL path, starting with the first element in the current container, and if it finds an object with a matching name, it sets that object as the current container and continues to the next element of the URL path.
28+
This process continues until the final element of the URL path is reached, at which point the server has determined the target object of the request.
29+
If not explicitly given, at the end a default view is looked up.
30+
This can be a registered page template, a callable view class, or a REST API endpoint.
31+
32+
```{seealso}
33+
{ref}`Chapter Views <classic-ui-views-label>`
34+
```
35+
36+
In code, traversal can be achieved by using the `restrictedTraverse` and `unrestrictedTraverse` methods of content objects.
37+
While request traversal and `restrictedTraverse` always include security checks, these checks can be bypassed when using `unrestrictedTraverse` in code.
38+
The developer has more control over the traversal process and can access objects without the normal security restrictions, but security restrictions have to be implemented by the developer accordingly.
39+
40+
41+
(backend-qcquisition-label)=
42+
43+
## Acquisition
44+
45+
In Zope, {term}`acquisition` is a mechanism that allows objects to inherit attributes from their parent objects in the object hierarchy.
46+
This enables objects to "acquire" attributes from their parent objects, rather than having to define all attributes themselves.
47+
48+
For example, if object A contains object `B`, and object `A` has an attribute `x`, then object `B` can access the attribute `x` via acquisition, without having to define the attribute itself.
49+
50+
51+
### Influences on traversal
52+
53+
This concept influences traversal in Zope because it allows objects to be accessed on traversal by acquisition in the object hierarchy, rather than having to know the exact location of an object.
54+
For example, if an object `C` is located at the path `/A/B/C`, it can also be accessed by traversing the hierarchy starting from object `E` in the path `/A/B/D/E` with `E.C`, because it is acquiring attributes of objects `D`, `B`, and `A` along the way.
55+
This makes it at the same time easier and more confusing to find and access objects in a large, complex object hierarchy.
56+
57+
58+
### Explicit versus implicit acquisition
59+
60+
In Zope, acquisition can be either explicit or implicit.
61+
62+
Explicit acquisition refers to the ability of an object to specifically request attributes from its parent object.
63+
This is done by using the `Acquire` or `aq_acquire` method to acquire a specific attribute from a parent object.
64+
For example, if object `A` contains object `B`, and object `A` has an attribute `x`, object `B` can explicitly acquire attribute x by calling `B.aq_acquire("x")`.
65+
66+
Implicit acquisition refers to the automatic inheritance of attributes from parent objects without the need for explicit requests.
67+
This is the default behavior in Zope, where objects automatically inherit attributes from their parent objects if they don't have the property defined themselves.
68+
For example, if object `A` contains object `B`, and object `A` has a property `x`, object `B` can implicitly acquire property `x` by accessing the property `x` via `B.x` without calling the `acquire` method.
69+
70+
The attribute is always acquired from its nearest parent, and if it does not exist there, then it looks at the next parent up the hierarchy.
71+
If the root is reached and no such attribute was found, an `AttributeError` is raised.
72+
73+
A common use of implicit acquisition in Plone is to access tools such as the `portal_catalog` from deep within the object hierarchy.
74+
This is done by calling methods on the tool, such as `context.portal_catalog.searchResults(**query)`, where `context` is a content object located deep within the hierarchy.
75+
This works because the `portal_catalog` tool is a child object of the Plone portal root, and is automatically acquired by objects further down the hierarchy.
76+
This allows developers to access the tool without having to know its exact location within the hierarchy.
77+
However, getting tools this way is discouraged, as this includes extra processing overhead.
78+
79+
In general, implicit acquisition is more commonly used in Zope, as it allows for a more natural and less verbose way of working with objects and their attributes.
80+
On the other hand, implicit acquisition needs to be blocked to be sure to not acquire attributes using the `aq_base` method.
81+
For example, if object `A` contains object `B`, and object `A` has a property `x`, and the question is whether an attribute `x` exists on object `B` or not, then `getattr(B.aq_base, "x", _marker)` avoids acquisition from `A`.
82+
83+
84+
## Further Reading
85+
86+
```{seealso}
87+
- About traversal: [Zope Developers Handbook, Chapter Object Publishing](https://zope.readthedocs.io/en/latest/zdgbook/ObjectPublishing.html)
88+
- About acquisition: [Zope Developers Handbook, Chapter Acquisition](https://zope.readthedocs.io/en/latest/zdgbook/Acquisition.html)
89+
```

docs/backend/upgrading/add-on-upgrade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This chapter describes the steps to migrate your third party products.
3333
If `/prefs_install_products_form` is unreachable, and you are using Plone 5.0.x or earlier, you should try doing the add-on upgrades from the Management Interface.
3434
Navigate to the `portal_quickinstaller` in the Management Interface at `/portal_quickinstaller/manage_installProductsForm`, and reinstall or upgrade products that are shown to be outdated.
3535
36-
```{versiondeprecated} 5.1
36+
```{deprecated} 5.1
3737
`portal_quickinstaller` was deprecated in Plone 5.1, and was removed in Plone 6.0.
3838
See [PLIP 1775](https://github.com/plone/Products.CMFPlone/issues/1775) and {ref}`upgrade-5.1-do-not-use-portal_quickinstaller-label` for Plone 5.1 and later.
3939
```

docs/backend/upgrading/preparations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Always back up your Plone site before upgrading.
5757
```
5858

5959
```{seealso}
60-
See Plone 5.2 documentation, [Backing up your Plone deployment](https://docs.plone.org/manage/deploying/backup.html).
60+
See Plone 5.2 documentation, [Backing up your Plone deployment](https://5.docs.plone.org/manage/deploying/backup.html).
6161
```
6262

6363
```{todo}

docs/backend/upgrading/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Watch for error messages in the console.
4444
You may be able to find more information about the error messages in the following documents.
4545

4646
- {doc}`Version-specific migration tips </backend/upgrading/version-specific-migration/index>` for your version of Plone
47-
- [Error Reference](https://docs.plone.org/appendices/error-reference.html)
47+
- [Error Reference](https://5.docs.plone.org/appendices/error-reference.html)
4848

4949
```{todo}
5050
See https://github.com/plone/documentation/issues/1323

docs/backend/upgrading/version-specific-migration/p4x-to-p5x-upgrade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ See https://github.com/smcmahon/Products.PloneFormGen/blob/master/Products/Plone
219219
## Resource registry
220220

221221
```{seealso}
222-
https://docs.plone.org/adapt-and-extend/theming/resourceregistry.html
222+
https://5.docs.plone.org/adapt-and-extend/theming/resourceregistry.html
223223
```
224224

225225
Plone 5 introduces some new concepts, for some, with working with JavaScript in Plone.
@@ -247,7 +247,7 @@ It also would combine and minify them for you in deployment mode.
247247

248248
#### Registration Changes
249249

250-
Prior to Plone 5, JavaScript files were added to the registry by using a [`GenericSetup` Profile](https://docs.plone.org/develop/addons/components/genericsetup.html) and including a `jsregistry.xml` file to it.
250+
Prior to Plone 5, JavaScript files were added to the registry by using a [`GenericSetup` Profile](https://5.docs.plone.org/develop/addons/components/genericsetup.html) and including a `jsregistry.xml` file to it.
251251

252252
This would add your JavaScript to the registry, with some options and potentially set ordering.
253253

docs/backend/upgrading/version-specific-migration/upgrade-addons-to-51.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ If you must use the old way, you can still use the `portal_quickinstaller` in th
3232
In a lot of cases, you can configure XML files instead of using Python code.
3333
In other cases you may need to write custom installer code (`setuphandlers.py`).
3434

35-
See https://docs.plone.org/develop/addons/components/genericsetup.
35+
See https://5.docs.plone.org/develop/addons/components/genericsetup.
3636

3737

3838
### Default Profile

0 commit comments

Comments
 (0)