[1] | 1 | from Products.Archetypes.public import listTypes |
---|
| 2 | from Products.Archetypes.Extensions.utils import installTypes, install_subskin |
---|
| 3 | from Products.CMFCore.utils import getToolByName |
---|
| 4 | from Products.ShortMessage.config import * |
---|
| 5 | from StringIO import StringIO |
---|
| 6 | |
---|
| 7 | from Products.ShortMessage.ShortMessage import ShortMessage |
---|
| 8 | from Products.ShortMessage.Extensions.Sm_Workflow import * |
---|
| 9 | |
---|
| 10 | def 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 | |
---|
| 21 | def install_workflow(self, out): |
---|
| 22 | |
---|
| 23 | setupWorkflow(self) |
---|
| 24 | print >> out, "Installed workflow..." |
---|
| 25 | |
---|
| 26 | def 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() |
---|