def importCatalogTool(context): """Import catalog tool. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(ICatalogTool) importObjects(tool, '', context)
def importCompositeTool(context): """ Import composite tool properties. """ site = context.getSite() logger = context.getLogger('composite tool properties') tool = getToolByName(site, 'composite_tool', None) if tool is None: logger.info('Composite tool: No tool present.') return body = context.readDataFile('composite_tool.xml') if body is None: body = context.readDataFile('compositetool.xml') if body is None: logger.info('Composite tool: Nothing to import.') return logger.info('Composite tool: deprecation warning, please rename your profile to composite_tool.xml.') importer = queryMultiAdapter((tool, context), IBody) if importer is None: logger.warning('Composite tool: Import adapter misssing.') return importer.body = body importObjects(tool, '', context)
def importCachingPolicyManager(context): """Import caching policy manager settings from an XML file. """ site = context.getSite() tool = getToolByName(site, 'caching_policy_manager') importObjects(tool, '', context)
def importContentTypeRegistry(context): """Import content type registry settings from an XML file. """ site = context.getSite() tool = getToolByName(site, 'content_type_registry') importObjects(tool, '', context)
def importWorkflowTool(context): """Import workflow tool and contained workflow definitions from XML files. """ site = context.getSite() tool = getToolByName(site, 'portal_workflow') importObjects(tool, '', context)
def importSkinsTool(context): """Import skins tool FSDirViews and skin paths from an XML file. """ site = context.getSite() tool = getToolByName(site, 'portal_skins') importObjects(tool, '', context)
def importWorkflowPolicies(context): """Import workflow policies from the XML file. """ site = context.getSite() tool = getToolByName(site, 'portal_placeful_workflow', None) if tool is not None: importObjects(tool, '', context)
def importCatalogTool(context, name='portal_catalog'): """Import catalog. """ site = context.getSite() tool = getToolByName(site, name, None) if tool is not None: importObjects(tool, '', context)
def importContentTypeRegistry(context): """Import content type registry settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(IContentTypeRegistry) importObjects(tool, '', context)
def installTypeIfNeeded(type_name): """Make sure the dexterity-fti is already installed. If not we create a empty dexterity fti and load the information from the fti in the profile. """ if type_name not in DEFAULT_TYPES: raise KeyError('{0} is not one of the default types'.format(type_name)) portal = getSite() tt = getToolByName(portal, 'portal_types') fti = tt.getTypeInfo(type_name) if IDexterityFTI.providedBy(fti): # The dx-type is already installed, so keep it. But this # might be an old dexterity type of Collection, in which case # it is better to replace it. if type_name != 'Collection': return if fti.klass == 'plone.app.contenttypes.content.Collection': # If the klass is fine, we are happy. return if fti: tt.manage_delObjects(type_name) tt.manage_addTypeInformation('Dexterity FTI', id=type_name) dx_fti = tt.getTypeInfo(type_name) ps = getToolByName(portal, 'portal_setup') profile_info = ps.getProfileInfo('profile-plone.app.contenttypes:default') profile_path = os.path.join(profile_info['path']) environ = DirectoryImportContext(ps, profile_path) parent_path = 'types/' importObjects(dx_fti, parent_path, environ)
def importCachingPolicyManager(context): """Import caching policy manager settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(ICachingPolicyManager) importObjects(tool, '', context)
def importCookieCrumbler(context): """Import cookie crumbler settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(ICookieCrumbler) importObjects(tool, '', context)
def importControlPanel(context): """Import Plone control panel. """ site = context.getSite() tool = getToolByName(site, 'portal_controlpanel') importObjects(tool, '', context)
def importCatalogTool(context): """Import catalog tool. """ site = context.getSite() tool = getToolByName(site, 'research_database_catalog', None) if tool is not None: importObjects(tool, '', context)
def importCatalogTool(context): """Import catalog tool. """ site = context.getSite() tool = getToolByName(site, 'portal_catalog') importObjects(tool, '', context)
def importGlossaryTool(context): """Import glossary tool settings from an XML file. """ site = context.getSite() tool = getToolByName(site, PLONEGLOSSARY_TOOL) importObjects(tool, '', context)
def importActionProviders(context): """Import actions tool. """ site = context.getSite() tool = getToolByName(site, 'portal_actions') importObjects(tool, '', context)
def importTypesTool(context): """Import types tool and content types from XML files. """ site = context.getSite() tool = getToolByName(site, 'portal_types') importObjects(tool, '', context)
def importMailHost(context): """Import mailhost settings from an XML file. """ site = context.getSite() tool = getToolByName(site, 'MailHost') importObjects(tool, '', context)
def importFactoryTool(context): """Import Factory Tool configuration. """ site = context.getSite() tool = getToolByName(site, 'portal_factory') importObjects(tool, '', context)
def importATCTTool(context): """Import ATCT Tool configuration. """ site = context.getSite() tool = getToolByName(site, 'portal_atct') importObjects(tool, '', context)
def importLanguageTool(context): """Import Plone language tool settings from an XML file. """ site = context.getSite() tool = getToolByName(site, 'portal_languages') importObjects(tool, '', context)
def importTypesTool(context): """Import types tool and content types from XML files. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(ITypesTool) importObjects(tool, '', context)
def importActionProviders(context): """Import actions tool. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(IActionsTool) importObjects(tool, '', context)
def importCookieCrumbler(context): """Import cookie crumbler settings from an XML file. """ site = context.getSite() tool = getToolByName(site, 'cookie_authentication') importObjects(tool, '', context)
def importMimetypes(context): """Import mimetypes registry. """ site = context.getSite() tool = getToolByName(site, 'mimetypes_registry') importObjects(tool, '', context)
def importSkinsTool(context): """Import skins tool FSDirViews and skin paths from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(ISkinsTool) importObjects(tool, '', context)
def importMailHost(context): """Import mailhost settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.getUtility(IMailHost) importObjects(tool, '', context)
def importATCTTool(context): """Import ATCT Tool configuration. """ site = context.getSite() tool = getToolByName(site, 'portal_atct', None) if tool is not None: importObjects(tool, '', context)
def importDiffTool(context): """Import Factory Tool configuration. """ site = context.getSite() tool = getToolByName(site, 'portal_diff', None) if tool is not None: importObjects(tool, '', context)
def importPrimoSettings(context): """Import Primo Settings""" site = context.getSite() tool = getToolByName(site, 'portal_primo', None) if tool is None: return importObjects(tool, '', context)
def importMembraneTool(context): """ Import membrane_tool configuration. """ site = context.getSite() tool = getToolByName(site, 'membrane_tool') importObjects(tool, '', context)
def importTinyMCESettings(context): """Import TinyMCE Settings""" site = context.getSite() tool = getToolByName(site, 'portal_tinymce', None) if tool is None: return importObjects(tool, '', context)
def importControlPanel(context): """Import Plone control panel. """ site = context.getSite() tool = getToolByName(site, 'portal_controlpanel', None) if tool is None: return importObjects(tool, '', context)
def importMembraneTool(context): """ Import membrane_tool configuration. """ site = context.getSite() tool = getToolByName(site, 'membrane_tool', None) if tool is not None: importObjects(tool, '', context)
def importFactoryTool(context): """Import Factory Tool configuration. """ site = context.getSite() tool = getToolByName(site, 'portal_factory', None) if tool is None: return importObjects(tool, '', context)
def importSettings(context): """Import tool settings from an XML file. """ site = context.getSite() tool = getToolByName(site, 'plone4bio_predictors', None) if tool: importObjects(tool, '', context) tool = getToolByName(site, 'plone4bio_dbxrefpatterns', None) if tool: importObjects(tool, '', context)
def importSolrSettings(context): """ import settings for solr integration from an XML file """ site = context.getSite() utility = queryUtility(ISolrConnectionConfig, context=site) if utility is None: logger = context.getLogger('collective.solr') logger.info('Nothing to import.') return if IPersistent.providedBy(utility): importObjects(utility, '', context)
def importLemonLDAPPropertiesSettings(context): container = plone.api.portal.get() uf = getattr(aq_base(container), 'acl_users', None) if uf is not None: lemonLdapId = 'lemonldap' if lemonLdapId not in uf.objectIds(): manage_addLemonLDAPManager(uf, lemonLdapId) shibproperties = getattr(uf, lemonLdapId) importObjects(shibproperties, '', context)
def importAnalyticsReports(context): """ Import Analytics tool. """ site = context.getSite() tool = getToolByName(site, 'portal_analytics', None) if tool is None: return importObjects(tool, '', context)
def importWorkflowTool(context): """Import workflow tool and contained workflow definitions from XML files. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(IWorkflowTool) if tool is None: logger = context.getLogger('workflow') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importActionProviders(context): """Import actions tool. """ site = context.getSite() tool = getToolByName(site, 'portal_actions', None) if tool is None: logger = context.getLogger('actions') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importRepositoryTool(context): """Import Repository Tool configuration. """ site = context.getSite() tool = getToolByName(site, 'portal_repository', None) if tool is None: logger = context.getLogger("repositorytool") logger.info("Nothing to import.") return importObjects(tool, '', context)
def importCatalogTool(context): """Import catalog tool. """ site = context.getSite() tool = getToolByName(site, 'portal_catalog', None) if tool is None: logger = context.getLogger('catalog') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importCookieCrumbler(context): """Import cookie crumbler settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(ICookieCrumbler) if tool is None: logger = context.getLogger('cookies') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importMemberDataTool(context): """Import member data tool settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(IMemberDataTool) if tool is None: logger = context.getLogger('memberdata') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importSkinsTool(context): """Import skins tool FSDirViews and skin paths from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(ISkinsTool) if tool is None: logger = context.getLogger('skins') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importCatalogTool(context): """Import catalog tool. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(ICatalogTool) if tool is None: logger = context.getLogger('catalog') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importSkinsTool(context): """Import skins tool FSDirViews and skin paths from an XML file. """ site = context.getSite() tool = getToolByName(site, 'portal_skins', None) if tool is None: logger = context.getLogger('skins') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importContentTypeRegistry(context): """Import content type registry settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(IContentTypeRegistry) if tool is None: logger = context.getLogger('contenttypes') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importMailHost(context): """Import mailhost settings from an XML file. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(IMailHost) if tool is None: logger = context.getLogger('mailhost') logger.debug('Nothing to import.') return importObjects(tool, '', context)
def importTypesTool(context): """Import types tool and content types from XML files. """ sm = getSiteManager(context.getSite()) tool = sm.queryUtility(ITypesTool) if tool is None: logger = context.getLogger('types') logger.debug('Nothing to import.') return importObjects(tool, '', context)