def install(self): out = StringIO() # register the core layer register_layer(self, 'common', 'kupu', out) # try for plone try: import Products.CMFPlone except ImportError: pass else: install_plone(self, out) print >>out, "kupu successfully installed" return out.getvalue()
def install_plone(self, out): """Install with plone """ # register the plone skin layers register_layer(self, 'plone/kupu_plone_layer', 'kupu_plone', out) # By default, add the directory view but not the skin layer for the reference browser register_layer(self, 'plone/kupu_references', 'kupu_references', out, add=False) register_layer(self, 'tests', 'kupu_tests', out) # register as editor portal_props = getToolByName(self, 'portal_properties') site_props = getattr(portal_props,'site_properties', None) attrname = 'available_editors' if site_props is not None: editors = list(site_props.getProperty(attrname)) if 'Kupu' not in editors: editors.append('Kupu') site_props._updateProperty(attrname, editors) print >>out, "Added 'Kupu' to available editors in Plone." install_libraries(self, out) install_configlet(self, out) uninstall_transform(self, out) install_transform(self, out) install_resources(self, out) install_customisation(self, out)
def install_plone(self, out): """Install with plone """ # register the plone skin layers register_layer(self, 'plone/kupu_plone_layer', 'kupu_plone', out) # By default, add the directory view but not the skin layer for the reference browser register_layer(self, 'plone/kupu_references', 'kupu_references', out, add=False) register_layer(self, 'tests', 'kupu_tests', out) # register as editor portal_props = getToolByName(self, 'portal_properties') site_props = getattr(portal_props,'site_properties', None) attrname = 'available_editors' if site_props is not None: editors = list(site_props.getProperty(attrname)) if 'Kupu' not in editors: editors.append('Kupu') site_props._updateProperty(attrname, editors) print >>out, "Added 'Kupu' to available editors in Plone." install_libraries(self, out) install_configlet(self, out) install_transform(self, out) install_resources(self, out) install_customisation(self, out)
def ensureReferencesLayer(self, add=False): """Called from the link tab code: we must have the kupu_references directory view at least present for the link tab to work.""" out = StringIO() util.register_layer(self, 'plone/kupu_references', 'kupu_references', out, add)