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

Migrate docs from Plone 5 to Plone 6 based on TODOs #1917

Closed
wants to merge 1 commit into from

Conversation

@Manas-Kenge Manas-Kenge changed the title migrate content from plone 5 to 6 Migrate docs from Plone 5 to Plone 6 based on TODOs Mar 17, 2025
Copy link
Contributor

@stevepiercy stevepiercy left a 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!

Copy link
Contributor

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...

documentation/docs/conf.py

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.

Comment on lines -59 to -60
```{seealso}
See Plone 5.2 documentation, [Backing up your Plone deployment](https://5.docs.plone.org/manage/deploying/backup.html).
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Introduction
```
### Introduction

Comment on lines -62 to -64
```{todo}
Why do we use pnpm?
```
Copy link
Contributor

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.

@stevepiercy
Copy link
Contributor

@plone/classicui-team could I get a technical review from y'all? Thank you!

Copy link
Member

@jensens jensens left a 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;
Copy link
Member

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.

Suggested change
- 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;

Comment on lines +28 to +30
- Globally (no scope)
- Per content type

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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:
```
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

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

No Archetypes anymore.

Suggested change
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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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):
Copy link
Member

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

Suggested change
def your_method(object, event):
def your_subscriber(object, event):

Comment on lines +50 to +51
# do sth with your created contenttype
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# do sth with your created contenttype
...
# do sth with your created contenttype

Comment on lines +126 to +128
`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.
Copy link
Member

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
Copy link
Member

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?

@Manas-Kenge
Copy link
Contributor Author

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.

@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.

@jensens
Copy link
Member

jensens commented Mar 18, 2025

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.

@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!

@Manas-Kenge
Copy link
Contributor Author

Closing this PR to open separate ones.

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

Successfully merging this pull request may close these issues.

3 participants