def installPlonePAS(portal, out): """We have to install PlonePAS by calling the function directly instead of through QuickInstaller because our patches won't take if the function is called as an ExternalMethod.""" NO_PLONEPAS = os.environ.get('SUPPRESS_PLONEPAS_INSTALLATION', None)=='YES' if NO_PLONEPAS: return origGrabUserData = InstallPlonePAS.grabUserData origReplaceUserFolder = InstallPlonePAS.replaceUserFolder origMigrateMemberDataTool = InstallPlonePAS.migrateMemberDataTool origRestoreUserData = InstallPlonePAS.restoreUserData # we assume the remember migration is desired if CMFMember is # installed qi = getToolByName(portal, 'portal_quickinstaller') HAS_CMFMEMBER = qi.isProductInstalled('CMFMember') if HAS_CMFMEMBER: InstallPlonePAS.grabUserData = grabUserData InstallPlonePAS.replaceUserFolder = replaceUserFolder InstallPlonePAS.migrateMemberDataTool = migrateMemberDataTool InstallPlonePAS.restoreUserData = restoreUserData installOrReinstallProduct(portal, 'PasswordResetTool', out) if HAS_CMFMEMBER: # run the installer directly and undo the patches result = InstallPlonePAS.install(portal) out.extend(result.split('\n')) InstallPlonePAS.grabUserData = origGrabUserData InstallPlonePAS.replaceUserFolder = origReplaceUserFolder InstallPlonePAS.migrateMemberDataTool = origMigrateMemberDataTool InstallPlonePAS.restoreUserData = origRestoreUserData else: installOrReinstallProduct(portal, 'PlonePAS', out)
def installPlonePAS(portal, out): """We have to install PlonePAS by calling the function directly instead of through QuickInstaller because our patches won't take if the function is called as an ExternalMethod.""" NO_PLONEPAS = os.environ.get('SUPPRESS_PLONEPAS_INSTALLATION', None) == 'YES' if NO_PLONEPAS: return origGrabUserData = InstallPlonePAS.grabUserData origReplaceUserFolder = InstallPlonePAS.replaceUserFolder origMigrateMemberDataTool = InstallPlonePAS.migrateMemberDataTool origRestoreUserData = InstallPlonePAS.restoreUserData # we assume the remember migration is desired if CMFMember is # installed qi = getToolByName(portal, 'portal_quickinstaller') HAS_CMFMEMBER = qi.isProductInstalled('CMFMember') if HAS_CMFMEMBER: InstallPlonePAS.grabUserData = grabUserData InstallPlonePAS.replaceUserFolder = replaceUserFolder InstallPlonePAS.migrateMemberDataTool = migrateMemberDataTool InstallPlonePAS.restoreUserData = restoreUserData installOrReinstallProduct(portal, 'PasswordResetTool', out) if HAS_CMFMEMBER: # run the installer directly and undo the patches result = InstallPlonePAS.install(portal) out.extend(result.split('\n')) InstallPlonePAS.grabUserData = origGrabUserData InstallPlonePAS.replaceUserFolder = origReplaceUserFolder InstallPlonePAS.migrateMemberDataTool = origMigrateMemberDataTool InstallPlonePAS.restoreUserData = origRestoreUserData else: installOrReinstallProduct(portal, 'PlonePAS', out)
def installPlonePAS(portal, out): """Quickinstalls PlonePAS if not installed yet.""" NO_PLONEPAS = os.environ.get('SUPPRESS_PLONEPAS_INSTALLATION',None)=='YES' if not NO_PLONEPAS: installOrReinstallProduct(portal, 'PasswordResetTool', out) installOrReinstallProduct(portal, 'PlonePAS', out)
def installPlacefulWorkflow(portal, out): """Quickinstalls CMFPlacefulWorkflow if not installed yet.""" # CMFPlacefulWorkflow is not installed by e.g. tests if 'CMFPlacefulWorkflow' in portal.Control_Panel.Products.objectIds(): installOrReinstallProduct(portal, 'CMFPlacefulWorkflow', out)