Skip to content

Commit

Permalink
Remove 'magic' around plone.app.stagingbehavior dependency
Browse files Browse the repository at this point in the history
We simply should not depend on it in any way; that's most likely the work of a policy package.
  • Loading branch information
hvelarde committed Mar 8, 2016
1 parent 5c35ec7 commit 3c5b9da
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 61 deletions.
1 change: 0 additions & 1 deletion CHANGES.rst
Expand Up @@ -35,7 +35,6 @@ There's a frood who really knows where his towel is.

- Remove hard dependency on plone.app.stagingbehavior as that package is no longer needed in Plone 5.
Under Plone < 5.0 you should now explicitly add it to the `eggs` part of your buildout configuration to avoid issues while upgrading.
Support for checkout and checkin operations will be automatically configured if ``plone.app.stagingbehavior`` is available.
[hvelarde]

- Implement drag and drop among tiles (closes `#487`_).
Expand Down
1 change: 0 additions & 1 deletion README.rst
Expand Up @@ -114,7 +114,6 @@ To enable this package in a buildout-based installation:
...
eggs =
collective.cover
plone.app.stagingbehavior

[versions]
...
Expand Down
8 changes: 0 additions & 8 deletions src/collective/cover/profiles.zcml
Expand Up @@ -32,14 +32,6 @@
<utility factory=".setuphandlers.HiddenProfiles" name="collective.cover" />
<utility factory=".setuphandlers.HiddenProducts" name="collective.cover" />

<genericsetup:importStep
name="collective.cover"
title="collective.cover: setup"
description="Import step for configuration that is not handled in XML files."
handler="collective.cover.setuphandlers.import_various">
<depends name="content" />
</genericsetup:importStep>

<genericsetup:upgradeSteps
source="5"
destination="6"
Expand Down
36 changes: 0 additions & 36 deletions src/collective/cover/setuphandlers.py
@@ -1,21 +1,8 @@
# -*- coding: utf-8 -*-
from collective.cover.config import PROJECTNAME
from plone.dexterity.interfaces import IDexterityFTI
from Products.CMFPlone import interfaces as Plone
from Products.CMFQuickInstallerTool import interfaces as QuickInstaller
from zope.component import queryUtility
from zope.interface import implements

import logging
import pkg_resources

try:
pkg_resources.get_distribution('plone.app.stagingbehavior')
except pkg_resources.DistributionNotFound:
IStagingSupport = None
else:
from plone.app.stagingbehavior.interfaces import IStagingSupport


class HiddenProfiles(object):

Expand All @@ -37,26 +24,3 @@ def getNonInstallableProducts(self):
"""Do not show on QuickInstaller's list of installable products."""
return [
]


def import_various(context):
"""Import step for configuration that is not handled in XML files:
Add staging behavior to content type. This will not be needed
under Plone 5 as checkout and checkin operations are directly
provided by plone.app.iterate.
"""
if context.readDataFile('collective.cover.marker.txt') is None:
return

if IStagingSupport is not None:
fti = queryUtility(IDexterityFTI, name='collective.cover.content')
behaviors = list(fti.behaviors)

if IStagingSupport.__identifier__ in behaviors:
return

behaviors.append(IStagingSupport.__identifier__)
fti.behaviors = tuple(behaviors)
logger = logging.getLogger(PROJECTNAME)
logger.info('Staging behavior for Cover content type was enabled.')
6 changes: 0 additions & 6 deletions src/collective/cover/testing.py
Expand Up @@ -7,9 +7,6 @@
plone.app.contenttypes:
installed under Plone 4.3, if requested; installed under Plone 5
plone.app.stagingbehavior
installed under Plone 4 only
plone.app.widgets
installed under Plone 4.3, if requested
Expand Down Expand Up @@ -133,9 +130,6 @@ class Fixture(PloneSandboxLayer):

def setUpZope(self, app, configurationContext):
if PLONE_VERSION < '5.0':
import plone.app.stagingbehavior
self.loadZCML(package=plone.app.stagingbehavior)

if DEXTERITY_ONLY:
import plone.app.contenttypes
self.loadZCML(package=plone.app.contenttypes)
Expand Down
7 changes: 0 additions & 7 deletions src/collective/cover/tests/test_cover.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from AccessControl import Unauthorized
from collective.cover.config import DEFAULT_GRID_SYSTEM
from collective.cover.config import PLONE_VERSION
from collective.cover.controlpanel import ICoverSettings
from collective.cover.interfaces import ICover
from collective.cover.testing import INTEGRATION_TESTING
Expand Down Expand Up @@ -63,12 +62,6 @@ def test_is_referenceable(self):
self.assertTrue(IReferenceable.providedBy(self.cover))
self.assertTrue(IAttributeUUID.providedBy(self.cover))

@unittest.skipIf(
PLONE_VERSION < '5.0', 'plone.app.stagingbehavior not needed')
def test_staging_behavior(self):
from plone.app.stagingbehavior.interfaces import IStagingSupport
self.assertTrue(IStagingSupport.providedBy(self.cover))

def test_cover_selectable_as_folder_default_view(self):
self.folder.setDefaultPage('c1')
self.assertEqual(self.folder.getDefaultPage(), 'c1')
Expand Down
1 change: 0 additions & 1 deletion versions-4.2.x.cfg
@@ -1,7 +1,6 @@
[buildout]
test-eggs =
Pillow
plone.app.stagingbehavior

[versions]
collective.js.bootstrap = 2.3.1.1
Expand Down
1 change: 0 additions & 1 deletion versions-4.3.x.cfg
@@ -1,7 +1,6 @@
[buildout]
test-eggs =
plone.app.contenttypes
plone.app.stagingbehavior
plone.app.widgets

[versions]
Expand Down

0 comments on commit 3c5b9da

Please sign in to comment.