Skip to main content

Small wrapper package to add support for collective.proxyprops

Project description

Introduction

This package listens for a IChildSiteCreation event and then adds a Proxy Properties local utility to that child site.

This package along with the Proxy Properties package are proof of concepts and are subject to re-writes :)

Lineage Proxy Props Tests

First a little set up:

>>> import zope.component
>>> from p4a.subtyper import interfaces
>>> from Products.CMFCore.interfaces import IPropertiesTool

Let’s enable a Child Site.

First we go ahead and register the default engine utility.

>>> from p4a.subtyper import engine
>>> zope.component.provideUtility(engine.Subtyper())

Now we can query the engine as we need information.

>>> subtyper = zope.component.getUtility(interfaces.ISubtyper)
>>> self.login('contributor')
>>> _ = self.portal.invokeFactory("Folder", "folder")

At first the simple folder we created has no subtype.

>>> subtyper.existing_type(self.portal.folder) is None
True
>>> subtyper.change_type(self.portal.folder, u'collective.lineage.childsite')
>>> subtyper.existing_type(self.portal.folder)
<DescriptorWithName name=collective.lineage.childsite; descriptor=<collective.lineage.descriptors.ChildSiteDescriptor ...>>
>>> interfaces.ISubtyped.providedBy(self.portal.folder)
True

Then we test that the subscriber from lineage.proxyprops has done its job and added a ProxyProperties utility to the microsite.

>>> sm = self.portal.folder.getSiteManager()
>>> sm.getUtility(IPropertiesTool)
<collective.proxyproperties.ProxyProperties ...>

Changelog

0.1 - (2009-07-10)

  • Initial release

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lineage.proxyprops-0.1.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file lineage.proxyprops-0.1.tar.gz.

File metadata

File hashes

Hashes for lineage.proxyprops-0.1.tar.gz
Algorithm Hash digest
SHA256 dac2adde6d6c73568da6f107cb248e37c0bac32f2c1e35d7ee7c9097e0f51bd9
MD5 62797e04067b587ce9babcdcb1cf79d9
BLAKE2b-256 0aa0424b640cb5495309d9235e2e10cb914986f7383abc619dbbfb51e8db22bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page