Skip to content

Commit

Permalink
Hide uninstall profile
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou authored and hvelarde committed Nov 27, 2015
1 parent dc3d181 commit 15ee10e
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,9 @@ Changelog
2.0a1 (unreleased)
-------------------

- Hide uninstall profile.
[rodfersou]

- Update Brazilian Portuguese and Spanish translations.
[hvelarde]

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Expand Up @@ -6,4 +6,5 @@ Contributors
- Gonzalo Almeida
- Franco Pellegrini
- Leonardo J. Caballero G.
- Rodrigo Ferreira de Souza

23 changes: 1 addition & 22 deletions collective/googlenews/configure.zcml
Expand Up @@ -18,28 +18,7 @@
<include package=".browser" />
<include package=".upgrades" />

<genericsetup:registerProfile
name="default"
title="Support for Google News"
directory="profiles/default"
description="To include a site in Google News you need to comply with certain technical requirements. This package provides support for this."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
name="uninstall"
title="collective.googlenews uninstall"
directory="profiles/uninstall"
description="Removes support for Google News from your site."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:importStep
name="collective.googlenews"
title="Import step for configuration not handled in XML files"
description="Add indexes to the portal_catalog."
handler="collective.googlenews.setuphandlers.import_various"
/>
<include file="profiles.zcml" />

<browser:page
name="googlenews-controlpanel"
Expand Down
34 changes: 34 additions & 0 deletions collective/googlenews/profiles.zcml
@@ -0,0 +1,34 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="collective.googlenews">

<genericsetup:registerProfile
name="default"
title="Support for Google News"
directory="profiles/default"
description="To include a site in Google News you need to comply with certain technical requirements. This package provides support for this."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:registerProfile
name="uninstall"
title="collective.googlenews uninstall"
directory="profiles/uninstall"
description="Removes support for Google News from your site."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<genericsetup:importStep
name="collective.googlenews"
title="Import step for configuration not handled in XML files"
description="Add indexes to the portal_catalog."
handler="collective.googlenews.setuphandlers.import_various"
/>

<utility factory=".setuphandlers.HiddenProfiles" name="collective.googlenews" />
<utility factory=".setuphandlers.HiddenProducts" name="collective.googlenews" />

</configure>

24 changes: 24 additions & 0 deletions collective/googlenews/setuphandlers.py
@@ -1,6 +1,30 @@
# -*- coding: utf-8 -*-
from collective.googlenews.logger import logger
from plone import api
from Products.CMFPlone import interfaces as Plone
from Products.CMFQuickInstallerTool import interfaces as QuickInstaller
from zope.interface import implements


class HiddenProfiles(object):

implements(Plone.INonInstallable)

def getNonInstallableProfiles(self):
"""Do not show on Plone's list of installable profiles."""
return [
u'collective.googlenews:uninstall',
]


class HiddenProducts(object):

implements(QuickInstaller.INonInstallable)

def getNonInstallableProducts(self):
"""Do not show on QuickInstaller's list of installable products."""
return [
]


class Empty:
Expand Down

0 comments on commit 15ee10e

Please sign in to comment.