-
-
Notifications
You must be signed in to change notification settings - Fork 194
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: Using Dexterity for Plone Site #2454
Comments
How do you plan to migrate the Site Root? |
I haven't given it too much thought atm. Something like this should do using a view/script on the zope root for each Plone site: class MigrateRootToDx(BrowserView):
def __call__(self):
from Acquisition import aq_base
from plone.protect.auto import safeWrite
request = self.request
print("Start migration Plone Sites root to DX")
for site in self.context.objectValues('Plone Site'):
safeWrite(site, request)
print("Running for {}".format(site))
# Initialise the btree.
if '_tree' not in site.__dict__:
print("Initialising btrees")
site._initBTrees()
# Migrate existing portal content.
print("Migrate content")
for obj_meta in site._objects:
obj_id = obj_meta['id']
print("Migrating object {}".format(obj_id))
# Load the content item, tool, or whatever
obj = getattr(site, obj_id)
# insert it into the btree.
# Use _setOb so we don't reindex stuff. the paths stay the same.
site._setOb(obj_id, aq_base(obj))
# Drop the attribute
del site.__dict__[obj_id]
# Drop no-longer needed bookkeeping
print("Clean up bookkeeping data")
del site.__dict__['_objects']
site._p_changed = True I do need to check what bookkeeping can be dropped. edit: I've just tested the above and that seems to Just Works (tm).
|
We'll need to add the |
@jaroel The FWT is very positive about this PLIP. It would be useful to get more information about the motivations (what could be the benefits? What kind of behaviors could be usefully used on the Plone Site object) as it would help to communicate about this important improvement. Note: we will vote on the PLIP during our next meeting. |
for one, selectablecontrainstypes behavior would be super useful:) |
This makes it possible to add the rich text behavior to the site root. This way we don’t need to use extra documents to select as default views. This is the last step we need to be able to go with a full folderish objects site and get rid of the “select item as default view” which is a huge usability improvement. I can second this proposal. |
@jaroel, the @plone/framework-team approved this PLIP |
@ebrehault that's great news, thanks! |
How does this work? "This is the last step we need to be able to go with a full folderish objects site and get rid of the 'select item as default view'" In CastleCMS we got rid of default items by using Mosaic and including a rich text tile on the Folder content type default layout |
@jaroel would you mind giving us an update on the current status? What is missing before we can review your code? Do you plan to integrate this in Plone 5.2 or later? |
@tkimnguyen in Plone-React we got rid of default items as well. The new tiles-based "Page" type is folderish by default as well. |
@tisto In practice it seems to work just fine. I'm resolving the test failures when I have time. You can check the changes done so far using the PLIP buildout config https://github.com/plone/buildout.coredev/blob/5.1/plips/plip-2454-dx-siteroot.cfg . I wouldn't see this as a blocker for 5.2. I'd not even consider this for 5.2, unless people have used this in production somewhere. |
@gforcada or @tisto I'm getting timeout accessing the ftp server on jenkins (https://jenkins.plone.org/view/PLIPs/job/plip-dx-siteroot/12/testReport/plone.app/testing/layers_rst/) |
FYI I'm back on this. Primary goal is to make this work for 5.2+, as that seems stable enough now. |
@jaroel we do not plan to do a 5.3 release so this would be Plone 6 then. I added the label... |
@jensens FYI:
|
What's the current status of this? It looks like tests are currently green. |
I've just updated the branches in the repos I needed. To be honest I don't really have time nor incentive currently to work on this except for once in a blue moon. I'm fairly certain it would be more effective if someone like @ale-rt would champion this PLIP. |
I will work on this at the Not-an-Alpine-City-Sprint |
I already used Pone 6 master for that test but I'll test another project which still runs on Plone 5.2 |
I just tried the upgrade using |
@ale-rt we did not discuss this PLIP at our last FWT meeting. @mauritsvanrees would like to start doing a first (internal) release of Plone 6. Can you give us a heads up about the status here,? If needed, we could schedule a @plone/framework-team meeting on short notice to push this further in order to get this into the first release. |
I upgraded a Plone 6 site to dx site root and it seemed fine. Two minor things:
For the first one, we could make a copy of document_view and make this available in the view methods. Or is there some basic view which I am not aware of that renders all defined fields? The excludefromnavigation behavior is probably best removed now, unless someone sees a need for this anyway. |
We could add the versioning behavior, though I don't see this having an effect when I try it, so this might need changes elsewhere. We could add the constraintypes behavior. This seems to work well when I try it. Both could be done later, or we leave this as an option for the user. |
I created two PRs that were missing. Related PRs are now:
Plus the following PRs which can maybe be merged separately because they seem fine for current Plone as well:
If we merge the PRs which can be done separately, it makes the rest of the PLIP smaller. Note that some branches were created in 2019, and master has been merged into them several times, which makes for an ugly and confusing history. So it could be an option to create fresh branches, or do a rebase. I did a fresh branch for |
I have updated the PLIP config to only test the three remaining packages with branches. |
The three jobs all have five the same failures in the robot tests. So this may need some work. Locally the failing ones pass though. See the 3.9 job.
See the screenshot, which looks very wrong: the toolbar is visible inside a popup/overlay. When I try it locally, it looks fine though. The fifth is for the scenario "A page is opened to edit in TinyMCE" where we get:
See screenshot |
I have restarted the 3.7 job and it again had the same 34 robot failures. |
Sorry, I lost sight of the |
@tisto this PLIP gets periodically green. For me it is even good to be merged now, but nobody did a formal review of the 4 branches:
I never used this code on production, but using this plip branch I could easily migrate and run simple Plone 5.2 websites.
Unluckily I think some FWT people are now on vacation, that is why we agreed to meet next time the 7th of September (see https://community.plone.org/t/fwt-meeting-minutes-2021-07-20/14110). |
@ale-rt let's try to get a formal review of the four branches and feedback from as many @plone/framework-team members as possible. I'd be open to schedule a call on short notice (tomorrow?). Maybe if all available FWT members and the release managers @mauritsvanrees @esteele agree, we can merge this PLIP and make a holiday exception. I guess the only way to properly test this is to get it into Plone 6 alpha. |
Congratulation @jaroel!
I currently cannot do that myself because the merge button is disabled for me in #2612. |
Thank you @ale-rt for your help in landing this PLIP! |
I have no power to merge #2612 while a test is still failing, even if it is outdated. |
Branch: refs/heads/master Date: 2021-02-11T17:30:18+01:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@2c82ffb Make the Plone Site a dexterity container Refs. plone/Products.CMFPlone#2454 Files changed: A news/0000.breaking M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-02-14T12:16:37+01:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@699e6f9 Update the Plone Site FTI if it is not a dexterity one Files changed: A plone/app/upgrade/v60/profiles/to_dx_site_root/types.xml A plone/app/upgrade/v60/profiles/to_dx_site_root/types/Plone_Site.xml M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml M plone/app/upgrade/v60/profiles.zcml Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-04-23T11:58:40+02:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@7aea789 Merge remote-tracking branch 'origin/master' into dx-siteroot Files changed: A plone/app/upgrade/v60/profiles/to_alpha1/controlpanel.xml M CHANGES.rst M plone/app/upgrade/v52/configure.zcml M plone/app/upgrade/v52/final.py M setup.py D news/2957.breaking D news/3057.bugfix D news/3172.bugfix Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-08-21T01:38:33+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.upgrade@78f782e Merge remote-tracking branch 'origin/master' into dx-siteroot Files changed: A news/254.feature A news/255.feature A plone/app/upgrade/v60/profiles/to_alpha1/actions.xml M CHANGES.rst M plone/app/upgrade/v52/configure.zcml M plone/app/upgrade/v60/profiles/to_alpha1/controlpanel.xml M setup.py Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-09-07T09:45:21+02:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@ec75f02 Fix towncrier entry Files changed: A news/256.breaking D news/0000.breaking Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-09-11T23:09:34+02:00 Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl> Commit: plone/plone.app.upgrade@c3f6407 Merge pull request #256 from plone/dx-siteroot Dx siteroot Files changed: A news/256.breaking A plone/app/upgrade/v60/profiles/to_dx_site_root/types.xml A plone/app/upgrade/v60/profiles/to_dx_site_root/types/Plone_Site.xml M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml M plone/app/upgrade/v60/profiles.zcml
Branch: refs/heads/master Date: 2021-02-11T17:30:18+01:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@2c82ffb Make the Plone Site a dexterity container Refs. plone/Products.CMFPlone#2454 Files changed: A news/0000.breaking M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-02-14T12:16:37+01:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@699e6f9 Update the Plone Site FTI if it is not a dexterity one Files changed: A plone/app/upgrade/v60/profiles/to_dx_site_root/types.xml A plone/app/upgrade/v60/profiles/to_dx_site_root/types/Plone_Site.xml M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml M plone/app/upgrade/v60/profiles.zcml Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-04-23T11:58:40+02:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@7aea789 Merge remote-tracking branch 'origin/master' into dx-siteroot Files changed: A plone/app/upgrade/v60/profiles/to_alpha1/controlpanel.xml M CHANGES.rst M plone/app/upgrade/v52/configure.zcml M plone/app/upgrade/v52/final.py M setup.py D news/2957.breaking D news/3057.bugfix D news/3172.bugfix Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-08-21T01:38:33+02:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.upgrade@78f782e Merge remote-tracking branch 'origin/master' into dx-siteroot Files changed: A news/254.feature A news/255.feature A plone/app/upgrade/v60/profiles/to_alpha1/actions.xml M CHANGES.rst M plone/app/upgrade/v52/configure.zcml M plone/app/upgrade/v60/profiles/to_alpha1/controlpanel.xml M setup.py Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-09-07T09:45:21+02:00 Author: ale-rt (ale-rt) <alessandro.pisa@gmail.com> Commit: plone/plone.app.upgrade@ec75f02 Fix towncrier entry Files changed: A news/256.breaking D news/0000.breaking Repository: plone.app.upgrade Branch: refs/heads/master Date: 2021-09-11T23:09:34+02:00 Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl> Commit: plone/plone.app.upgrade@c3f6407 Merge pull request #256 from plone/dx-siteroot Dx siteroot Files changed: A news/256.breaking A plone/app/upgrade/v60/profiles/to_dx_site_root/types.xml A plone/app/upgrade/v60/profiles/to_dx_site_root/types/Plone_Site.xml M plone/app/upgrade/v60/alphas.py M plone/app/upgrade/v60/configure.zcml M plone/app/upgrade/v60/profiles.zcml
I have merged all three remaining PRs. Great job, Roel! Thanks for taking over, Alessandro! Thanks to all others who helped, reviewed, tested! |
For information on how to upgrade existing Plone 6 sites. please read https://community.plone.org/t/upgrade-plone-6-sites-dx-site-root/14303 |
PLIP (Plone Improvement Proposal)
Responsible Persons
Proposer: Roel Bruggink
Seconder: Alessandro Pisa
Abstract
Replace the CMFPlone Portal class with a Dexterity implementation.
Motivation
Moving from a CMF item to a Dexterity container will allow us to edit the site root directly using the DX framework including support for behaviors.
This makes it possible to add the rich text behavior to the site root. This way we don’t need to use extra documents to select as default views. This is the last step we need to be able to go with a full folderish objects site and get rid of the “select item as default view” which is a huge usability improvement
Assumptions
Proposal & Implementation
Replace the base class for Products.CMFPlone.Portal.PloneSite with a DX container.
Development is initially done on the latest stable (5.1) branch of Products.CMFPlone. We'll move to unstable (5.2) when this is done or if 5.2 is released, whichever is earlier.
Deliverables
PLIP buildout config can be found here: https://github.com/plone/buildout.coredev/blob/6.0/plips/plip-2454-dx-siteroot.cfg
Jenkins job: https://jenkins.plone.org/view/PLIPs/job/plip-dx-siteroot-3.8/
Change Products.CMFPlone.Portal.PloneSite from CMF to DX. #2612
Various supportive changes in -at least- plone/plone.app.contenttypes#475 and plone/plone.dexterity#85.
Risks
Currently unknown.
Participants
Roel Bruggink
Alessandro Pisa
The text was updated successfully, but these errors were encountered: