Skip to content

Commit

Permalink
Add uninstall profile.
Browse files Browse the repository at this point in the history
Part of #139
  • Loading branch information
mauritsvanrees committed Sep 11, 2024
1 parent 652b59b commit 0dbafff
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 0 deletions.
2 changes: 2 additions & 0 deletions news/139.breaking.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add uninstall profile.
[maurits]
12 changes: 12 additions & 0 deletions plone/app/caching/profiles.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
i18n_domain="plone"
>

<utility
factory=".setuphandlers.NonInstallable"
name="plone.app.caching"
/>

<genericsetup:registerProfile
name="default"
title="HTTP caching support"
Expand All @@ -12,6 +17,13 @@
directory="profiles/default"
/>

<genericsetup:registerProfile
name="uninstall"
title="Uninstall HTTP caching support"
provides="Products.GenericSetup.interfaces.EXTENSION"
directory="profiles/uninstall"
/>

<genericsetup:registerProfile
name="v2"
title="Upgrade plone.app.caching to v2 with terse caching"
Expand Down
11 changes: 11 additions & 0 deletions plone/app/caching/profiles/uninstall/controlpanel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
name="portal_controlpanel"
i18n:domain="plone"
>

<configlet action_id="plone.app.caching"
remove="true"
/>

</object>
17 changes: 17 additions & 0 deletions plone/app/caching/profiles/uninstall/registry/basesettings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>

<records interface="plone.caching.interfaces.ICacheSettings"
remove="true"
/>
<records interface="plone.cachepurging.interfaces.ICachePurgingSettings"
remove="true"
/>
<records interface="plone.app.caching.interfaces.IPloneCacheSettings"
remove="true"
/>
<record name="plone.caching.operations.chain.operations"
remove="true"
/>

</registry>
21 changes: 21 additions & 0 deletions plone/app/caching/profiles/uninstall/registry/moderate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<record name="plone.app.caching.moderateCaching.smaxage"
remove="true"
/>
<record name="plone.app.caching.moderateCaching.etags"
remove="true"
/>
<record name="plone.app.caching.moderateCaching.lastModified"
remove="true"
/>
<record name="plone.app.caching.moderateCaching.ramCache"
remove="true"
/>
<record name="plone.app.caching.moderateCaching.vary"
remove="true"
/>
<record name="plone.app.caching.moderateCaching.anonOnly"
remove="true"
/>
</registry>
24 changes: 24 additions & 0 deletions plone/app/caching/profiles/uninstall/registry/strong.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<record name="plone.app.caching.strongCaching.maxage"
remove="true"
/>
<record name="plone.app.caching.strongCaching.smaxage"
remove="true"
/>
<record name="plone.app.caching.strongCaching.etags"
remove="true"
/>
<record name="plone.app.caching.strongCaching.lastModified"
remove="true"
/>
<record name="plone.app.caching.strongCaching.ramCache"
remove="true"
/>
<record name="plone.app.caching.strongCaching.vary"
remove="true"
/>
<record name="plone.app.caching.strongCaching.anonOnly"
remove="true"
/>
</registry>
24 changes: 24 additions & 0 deletions plone/app/caching/profiles/uninstall/registry/terse.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<record name="plone.app.caching.terseCaching.maxage"
remove="true"
/>
<record name="plone.app.caching.terseCaching.smaxage"
remove="true"
/>
<record name="plone.app.caching.terseCaching.etags"
remove="true"
/>
<record name="plone.app.caching.terseCaching.lastModified"
remove="true"
/>
<record name="plone.app.caching.terseCaching.ramCache"
remove="true"
/>
<record name="plone.app.caching.terseCaching.vary"
remove="true"
/>
<record name="plone.app.caching.terseCaching.anonOnly"
remove="true"
/>
</registry>
18 changes: 18 additions & 0 deletions plone/app/caching/profiles/uninstall/registry/weak.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<record name="plone.app.caching.weakCaching.etags"
remove="true"
/>
<record name="plone.app.caching.weakCaching.lastModified"
remove="true"
/>
<record name="plone.app.caching.weakCaching.ramCache"
remove="true"
/>
<record name="plone.app.caching.weakCaching.vary"
remove="true"
/>
<record name="plone.app.caching.weakCaching.anonOnly"
remove="true"
/>
</registry>
12 changes: 12 additions & 0 deletions plone/app/caching/setuphandlers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
from plone.base.interfaces import INonInstallable
from Products.CMFCore.utils import getToolByName
from zope.interface import implementer


@implementer(INonInstallable)
class NonInstallable:

def getNonInstallableProfiles(self):
return [
"plone.app.caching:uninstall",
"plone.app.caching:v2",
]


def enableExplicitMode():
Expand Down

0 comments on commit 0dbafff

Please sign in to comment.