-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Migrate docs from Plone 5 to Plone 6 based on TODOs #1917
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies for not providing clear direction about the TODOs. I edited the issue description and added a comment here to clarify.
I will need to do a more thorough review later, but these suggestions should be incorporated now. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I realized the original description was not clear. I updated it just now. Please revert changes in this file. Instead set the configuration values in conf.py
, changing code from the following...
Lines 381 to 385 in b4462a8
# -- Options for sphinx.ext.todo ----------------------- | |
# See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos | |
todo_include_todos = True | |
...to the following.
# -- Options for sphinx.ext.todo -----------------------
# See http://sphinx-doc.org/ext/todo.html#confval-todo_include_todos
todo_include_todos = False
todo_emit_warnings = True
todo_link_only = True
Ref: https://www.sphinx-doc.org/en/master/usage/extensions/todo.html#configuration
Since this TODO already contains a link to an existing issue, we do not need to create an issue or add a link to the issue.
```{seealso} | ||
See Plone 5.2 documentation, [Backing up your Plone deployment](https://5.docs.plone.org/manage/deploying/backup.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert. This was deliberate.
|
||
```{seealso} | ||
See Plone 5.2 documentation, [Backing up your Plone deployment](https://5.docs.plone.org/manage/deploying/backup.html). | ||
### Introduction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Introduction | |
``` | |
### Introduction |
```{todo} | ||
Why do we use pnpm? | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert, create an issue if one does not already exist either in Documentation or Volto repo, and add its link here.
@plone/classicui-team could I get a technical review from y'all? Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR should be split for each file in a separate PR.
I only reviewed the subscribers part and its some work to get it right.
Some of the notable characteristics of the Plone event system are: | ||
|
||
- It is simple; | ||
- Subscriber calling order is not modifiable — you cannot set the order in which event handlers are called; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this? Otherwise second part is kind of a dup of the first.
- Subscriber calling order is not modifiable — you cannot set the order in which event handlers are called; | |
- Subscriber calling is random — you cannot set the order in which event handlers are called; |
- Globally (no scope) | ||
- Per content type | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Globally (no scope) | |
- Per content type | |
- Globally (no scope) | |
- Per content type | |
- per behavior/ marker interface |
handler=".your_python_file.your_method" | ||
/> | ||
``` | ||
The first line defines to which interface you want to bind the execution of your code, which means here, that the code will only be executed if the object is one of your contenttype’s. If you want this to be interface-agnostic, insert an asterix as a wildcard instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first line defines to which interface you want to bind the execution of your code, which means here, that the code will only be executed if the object is one of your contenttype’s. If you want this to be interface-agnostic, insert an asterix as a wildcard instead. | |
The second line defines to which interface you want to bind the execution of your code. | |
Here, the event handler code will only be executed if the object is a content-type providing the interface `.interfaces.IMyContentTypeClass`. | |
If you want this to be interface-agnostic, insert an asterix `*` as a wildcard instead. |
### Example: Register an event-handler on your content type’s creation | ||
|
||
In your `.product/your/product/configure.zcml` insert: | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
append XML for syntax highlighting
``` | ||
The first line defines to which interface you want to bind the execution of your code, which means here, that the code will only be executed if the object is one of your contenttype’s. If you want this to be interface-agnostic, insert an asterix as a wildcard instead. | ||
|
||
The second line defines the event on which this should happen, which is here ‘IObjectCreatedEvent’ – for Archetypes you should use ‘Products.Archetypes.interfaces.IObjectInitializedEvent’ instead. For more available possible events to be used as a trigger, see [Event handlers](https://6.docs.plone.org/backend/subscribers.html#event-handlers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No Archetypes anymore.
The second line defines the event on which this should happen, which is here ‘IObjectCreatedEvent’ – for Archetypes you should use ‘Products.Archetypes.interfaces.IObjectInitializedEvent’ instead. For more available possible events to be used as a trigger, see [Event handlers](https://6.docs.plone.org/backend/subscribers.html#event-handlers) | |
The third line defines the event on which this should happen, which is here ‘IObjectCreatedEvent’. | |
For more available possible events to be used as a trigger, see [Event handlers](https://6.docs.plone.org/backend/subscribers.html#event-handlers) |
The URL should not be absolute here I suppose?
|
||
The second line defines the event on which this should happen, which is here ‘IObjectCreatedEvent’ – for Archetypes you should use ‘Products.Archetypes.interfaces.IObjectInitializedEvent’ instead. For more available possible events to be used as a trigger, see [Event handlers](https://6.docs.plone.org/backend/subscribers.html#event-handlers) | ||
|
||
The third line gives the path to the script that is supposed to be executed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The third line gives the path to the script that is supposed to be executed. | |
The fourth line gives the path to the callable (function) that is supposed to be executed. |
|
||
Create your `.product/your/product/your_python_file.py` and insert: | ||
``` | ||
def your_method(object, event): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a function and it does not help much, tell the reader what it is: a subscriber
def your_method(object, event): | |
def your_subscriber(object, event): |
# do sth with your created contenttype |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# do sth with your created contenttype | |
... | |
# do sth with your created contenttype |
`Products.Archetypes.interfaces.IObjectInitializedEvent` is fired for an Archetypes-based object when it’s being initialised; i.e. when it’s being populated for the first time. | ||
|
||
`Products.Archetypes.interfaces.IWebDAVObjectInitializedEvent` is fired for an Archetypes-based object when it’s being initialised via WebDAV. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all archetypes
|
||
`zope.processlifetime.IDatabaseOpened` is triggered after the main ZODB database has been opened. | ||
|
||
## Event handlers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is more conceptional, right?
@jensens I'll create a separate PR for the other files. I copied the docs from Plone 5 but wasn't sure which parts were deprecated or still functional. Sorry for the extra work. |
Thanks for your work! I am looking forward to review again! |
Closing this PR to open separate ones. |
Issue number
Description
📚 Documentation preview 📚: https://plone6--1917.org.readthedocs.build/