navtree_properties not picked up by navigation portlet in policy product

Sean F wsfulmer at gmail.com
Sat Oct 27 02:41:19 UTC 2007


Hola list..

I'm working my way through Martin's new book, building a site policy
product for a client project, and I've hit a snag.

One of the requirements are some changes to the default nav portlet
configuration, which I have set in propertiestool.xml:

    <?xml version="1.0"?>
    <object name="portal_properties" meta_type="Plone Properties
Tool">
     <object name="navtree_properties" meta_type="Plone Property
Sheet">
      <property name="currentFolderOnlyInNavtree" type="boolean">True</
property>
      <property name="includeTop" type="boolean">True</property>
      <property name="topLevel" type="int">0</property>
      <property name="bottomLevel" type="int">0</property>
     </object>
    </object>

I've got unit tests to check each one of these settings, like so (lots
of stuff omitted for brevity):

    import unittest
    from enovant.policy.tests.base import EnovantPolicyTestCase

    from Products.CMFCore.utils import getToolByName

    class TestSetup(EnovantPolicyTestCase):
        """
        tests for Enovant Policy setup
        """

        def afterSetUp(self):
            """
            grab portal tools etc used by tests
            """
            self.portal_properties = getToolByName(self.portal,
'portal_properties')

        def test_navtree_current_only(self):
            """
            show current folders only
            """
            self.assertEquals(True,
 
self.portal_properties.navtree_properties.currentFolderOnlyInNavtree)

    def test_suite():
        """
        run the tests
        """
        suite = unittest.TestSuite()
        suite.addTest(unittest.makeSuite(TestSetup))
        return suite

All of my tests pass, and when I install the policy product on a newly-
created Plone 3 site, all of the properties are set in
navtree_properties in the ZMI.

But - the navigation portlet itself is not picking up these modified
properties, e.g. when I go to @@manage-portlets, click Navigation,
"Only show the contents of the current folder." is not checked.

What am I missing here?

Thanks,
--
Sean





More information about the Product-Developers mailing list