Back to index

plone3  3.1.7
portal_quickinstaller.py
Go to the documentation of this file.
00001 from zope.interface import Interface, Attribute
00002 
00003 class IQuickInstallerTool(Interface):
00004     ''' the QuickInstaller Tool
00005         contains 'InstalledProduct' instances
00006     '''
00007     id = Attribute('id', 'Must be set to "portal_quickinstaller"')
00008 
00009     def listInstallableProducts(skipInstalled=True):
00010         ''' list candidate CMF products for installation -> list of dicts with
00011             keys:(id,hasError,status)'''
00012 
00013     def listInstalledProducts(showHidden=False):
00014         ''' returns a list of products that are installed -> list of dicts with
00015             keys:(id,hasError,status,,isLocked,isHidden)'''
00016 
00017     def isProductInstallable(productname):
00018         ''' is the product directory present and ready for installation '''
00019 
00020     def isProductAvailable(productname):
00021         ''' is the product directory present (to check if it has been deleted
00022             from the Filesystem '''
00023 
00024     def installProduct(p, locked=False, hidden=False,
00025                        swallowExceptions=False, forceProfile=False):
00026         ''' installs a product by name
00027             throws AlreadyInstalled exception, if components of the product are
00028             already installed
00029 
00030             if swallowExceptions is true, exceptions are caught and logged
00031         '''
00032 
00033     def installProducts(products=[], stoponerror=False, REQUEST=None,
00034                         forceProfile=False):
00035         ''' installs the products specified in the products list'''
00036 
00037     def getProductFile(p,fname='readme.txt'):
00038         ''' returns the content of a file of the product case-insensitive, if it
00039              does not exist -> None '''
00040 
00041     def getProductReadme(p):
00042         ''' returns the readme file of the product case-insensitive '''
00043 
00044     def getProductVersion(p):
00045         ''' returns the version string stored in version.txt'''
00046 
00047     def isProductInstalled(productname):
00048         ''' checks wether a product is installed (by name) '''
00049 
00050     def notifyInstalled(p,locked=True, hidden=False, **kw):
00051         ''' marks a product that has been installed without QuickInstaller
00052          as installed
00053          if locked is set -> the prod cannot be uninstalled
00054          if hidden is set -> the prod is not listed in the UI
00055          the **kw param is passed to the constructor of InstalledProduct
00056          '''
00057 
00058     def uninstallProducts( products, cascade=['types','skins','actions',
00059         'portalobjects','workflows','slots','registrypredicates'],REQUEST=None):
00060         ''' removes a list of products, cascade defines which items created by
00061             the install shall be uninstalled '''
00062 
00063     def reinstallProducts( products, REQUEST=None):
00064         ''' reinstalls a list of products, the main difference to
00065             ininstall/reinstall is that it does not remove portal objects
00066             created  during install (e.g. tools, etc.)'''
00067 
00068 class IInstalledProduct(Interface):
00069     ''' represents the installed product
00070         is contained inside the QuickInstallerTool '''
00071 
00072     id = Attribute('id', 'Must be set to the same name as the product directory')
00073 
00074     types = Attribute('types','default: []')
00075     skins = Attribute('types','default: []')
00076     actions = Attribute('types','default: []')
00077     portalobjects = Attribute('types','default: []')
00078     workflows = Attribute('types','default: []')
00079     leftslots = Attribute('types','default: []')
00080     rightslots = Attribute('types','default: []')
00081 
00082     def __init__(id):
00083         ''' constructor '''
00084 
00085     def update(settings, installedversion='', logmsg='', status='installed',
00086                error=False, locked=False, hidden=False):
00087         ''' updates the product attributes '''
00088 
00089     def log(logmsg):
00090         ''' adds a log to the transcript '''
00091 
00092     def hasError():
00093         ''' returns if the prod is in error state '''
00094 
00095     def isLocked():
00096         ''' is the product locked for uninstall '''
00097 
00098     def isHidden():
00099         ''' is the product hidden'''
00100 
00101     def isInstalled():
00102         ''' determines if the product is in already installed '''
00103 
00104     def getTranscriptAsText():
00105         ''' return the product's install log as plain text '''
00106 
00107     def uninstall(cascade=['types','skins','actions','portalobjects',
00108             'workflows','slots','registrypredicates'],REQUEST=None):
00109         '''uninstalls the prod and removes its deps
00110            the parameter 'cascade' specifies what should be deleted while
00111            uninstalling the product
00112 
00113            if the Product has an uninstall() method in its Install.py it gets
00114            called automatically
00115         '''
00116     def getInstalledVersion():
00117         ''' returns the version of the prod in the moment of installation '''
00118 
00119     def getValue(name):
00120         ''' returns a value that is tracked by QuickInstaller '''