通用设置导入步骤的名称是否有很好的参考列表 [英] Is there a good reference list for the names of the genericsetup import steps
问题描述
是否有通用设置导入步骤名称的完整参考列表?
Is there a comprehensive reference list of the generic setup import step names?
通用设置导入步骤的名称并不总是与它们相应的xml文件的名称匹配,例如"types.xml"具有一个名为"typeinfo"的导入步骤.
The names of generic setup import steps don't always match the names of their corresponding xml files for example 'types.xml' has an import step called 'typeinfo'.
在没有列表的情况下,我将对找到导入步骤名称的简单方法感到满意.例如,由"registry.xml"文件管理的plone.app.registry的导入步骤名称并不明显,我尝试将其称为"registry",但这失败了,请参见下面的代码:
In the absence of a list, I would be satisfied with a simple approach to finding out the name of the import step. For example the import step name for plone.app.registry which is managed by the 'registry.xml' file is not obvious, I tried to refer to it as 'registry' but this fails, see code below:
from Products.CMFCore.utils import getToolByName
PROFILE_ID = 'profile-my.package:default'
setup = getToolByName(context, 'portal_setup')
setup.runImportStepFromProfile(PROFILE_ID, 'registry')
结果是:
ValueError: No such import step: registry
推荐答案
您应该尝试以下操作:
stepregistry = portal.portal_setup.getImportStepRegistry()
stepregistry.listSteps()
修改:
实际上这会给您完整的列表(我已经测试过了):
actually this will give you the complete list (I've tested it this time):
>>> portal.portal_setup.getSortedImportSteps()
(u'PloneSurvey_various', u'rolemap', u'sharing', u'plone-difftool',...
...,如果您想要更多的元数据,请使用此:
...and if you want more metadata use this:
>>> portal.portal_setup.getImportStepMetadata('jsregistry')
{'handler': 'Products.ResourceRegistries.exportimport.jsregistry.importJSRegistry', 'description': u'Import javascript registry', 'version': None, 'title': u'Javascript registry', 'dependencies': (u'toolset', u'componentregistry'), 'id': u'jsregistry', 'invalid': False}
这篇关于通用设置导入步骤的名称是否有很好的参考列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!