icsemantic.catalog.Extensions.install

Package platecom :: Package ontocatalog :: Package Extensions :: Module install |
[hide private]
[frames] | no frames]

# Source Code for Module icsemantic.catalog.Extensions.install

     1  """Install the product.
     2  """
     3
     4  from StringIO import StringIO
     5
     6  from Products.CMFCore.utils import getToolByName
     7  from Products.Archetypes.utils import shasattr
     8
     9
    10 -def install(self):
    11      """External module to install the product.
    12
    13      @type self: PloneSite
    14      @param self: The Plone site object
    15
    16      @rtype: StringIO
    17      @return: Messages from the install process
    18      """
    19      out = StringIO()
    20
    21      # Run all import steps for icsemantic.catalog
    22      setup_tool = getToolByName(self, 'portal_setup')
    23      if shasattr(setup_tool, 'runAllImportStepsFromProfile'):
    24          # Plone 3
    25          setup_tool.runAllImportStepsFromProfile('profile-icsemantic.catalog:default')
    26      else:
    27          # Plone 2.5.
    28          old_context = setup_tool.getImportContextID()
    29          setup_tool.setImportContext('profile-icsemantic.catalog:default')
    30          setup_tool.runAllImportSteps()
    31          setup_tool.setImportContext(old_context)
    32
    33      return out.getvalue()
    34
    35
    36 -def uninstall( self ):
    37      """Uninstall method.
    38      """
    39      out = StringIO()
    40      print >> out, "Uninstalling"
    41      return out.getvalue()
    42