source: products/ShortMessage/tags/0.1.3/Extensions/Install.py @ 1591

Last change on this file since 1591 was 1, checked in by myroslav, 18 years ago

Building directory structure

File size: 1.2 KB
Line 
1from Products.Archetypes.public import listTypes
2from Products.Archetypes.Extensions.utils import installTypes, install_subskin
3from Products.CMFCore.utils import getToolByName
4from Products.ShortMessage.config import *
5from StringIO import StringIO
6
7from Products.ShortMessage.ShortMessage import ShortMessage
8from Products.ShortMessage.Extensions.Sm_Workflow import *
9
10def setPortalFactoryType(self, out,):
11    pf=getToolByName(self, 'portal_factory')
12    ftypes=list(pf.getFactoryTypes())
13    if 'ShortMessage'not in ftypes:
14        ftypes.append('ShortMessage')
15        pf.manage_setPortalFactoryTypes(listOfTypeIds=ftypes)
16    else:
17        print >>out, " %s type already  in portal_factory..." %PROJECTNAME
18
19    print >> out, "Set %s type to portal_factory" %PROJECTNAME
20
21def install_workflow(self, out):
22
23    setupWorkflow(self)
24    print >> out, "Installed workflow..."
25
26def install(self):
27
28    out=StringIO();
29
30    installTypes(self, out, listTypes(PROJECTNAME), PROJECTNAME)
31    setPortalFactoryType(self, out)
32    install_workflow(self, out)
33
34#    install_subskin(self, out, GLOBALS)
35
36    print >> out, "Successfully installed %s." % PROJECTNAME
37    return out.getvalue()
Note: See TracBrowser for help on using the repository browser.