Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

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'.

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')

And the result was:

ValueError: No such import step: registry
like image 815
David Bain Avatar asked Oct 19 '11 12:10

David Bain


1 Answers

You should try this:

stepregistry = portal.portal_setup.getImportStepRegistry()
stepregistry.listSteps()

edit:

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}
like image 63
Giacomo Spettoli Avatar answered Oct 05 '22 02:10

Giacomo Spettoli