# -*- coding: utf-8 # Copyright 2005 by Vahur Rebas from StringIO import StringIO from Products.Archetypes.Extensions.utils import install_subskin, installTypes from Products.Archetypes.public import listTypes from Products.CMFCore.utils import getToolByName from Products.CMFProgressInterview.config import GLOBALS, PROJECT_NAME def install(self): """ install. """ out = StringIO() install_subskin(self, out, GLOBALS) installTypes(self, out, listTypes(PROJECT_NAME), PROJECT_NAME) site_props = getToolByName(self, 'portal_properties') if 'ProgressClassFolder' not in site_props.navtree_properties.metaTypesNotToList: site_props.navtree_properties.metaTypesNotToList += ('ProgressClassFolder',) if 'ProgressUserFolder' not in site_props.navtree_properties.metaTypesNotToList: site_props.navtree_properties.metaTypesNotToList += ('ProgressUserFolder',) return out.getvalue() def uninstall(self): """ uninstall. """ out = StringIO() self.portal_controlpanel.unregisterApplication(PROJECT_NAME) return out.getvalue()