# -*- coding: utf-8 # Copyright 2006 by Pjotr Savitski from Products.CMFCore.utils import getToolByName from Products.Archetypes.Extensions.utils import install_subskin, installTypes from Products.Archetypes.public import listTypes from StringIO import StringIO import string from Products.iCampfolio.config import * def install(self): """ install. """ out = StringIO() install_subskin(self, out, GLOBALS) installTypes(self, out, listTypes(PROJECT_NAME), PROJECT_NAME) # Install stylesheet portal_css = getToolByName(self, 'portal_css') stylesheet = portal_css.getResourcesDict().get('icampfolio.css', None) if stylesheet is None: portal_css.manage_addStylesheet(id = 'icampfolio.css', expression = '', media = 'all', title = 'iCampfolio styles', enabled = True) # Enable portal factory factory = getToolByName(self, 'portal_factory') types = factory.getFactoryTypes().keys() for type in object_types: if type not in types: types.append(type) factory.manage_setPortalFactoryTypes(listOfTypeIds = types) return out.getvalue() def uninstall(self): """ uninstall """ out = StringIO() return out.getvalue()