Last change
on this file since 1061 was
1,
checked in by myroslav, 19 years ago
|
Building directory structure
|
-
Property svn:eol-style set to
native
|
File size:
1.2 KB
|
Rev | Line | |
---|
[1] | 1 | from cStringIO import StringIO |
---|
| 2 | |
---|
| 3 | from Products.ExternalMethod.ExternalMethod import manage_addExternalMethod |
---|
| 4 | |
---|
| 5 | from Products.CMFCore.utils import getToolByName |
---|
| 6 | |
---|
| 7 | from Products.qMemberdataExport.config import * |
---|
| 8 | |
---|
| 9 | def addExternalMethod(self, out): |
---|
| 10 | """ Add external method to portal root directory """ |
---|
| 11 | |
---|
| 12 | if not hasattr(self, EXTERNAL_METHOD): |
---|
| 13 | manage_addExternalMethod(self, |
---|
| 14 | id=EXTERNAL_METHOD, |
---|
| 15 | title=EXTERNAL_METHOD, |
---|
| 16 | module=PROJECTNAME+'.'+'getMemberData', |
---|
| 17 | function='getMemberData') |
---|
| 18 | method = getattr(self, EXTERNAL_METHOD) |
---|
| 19 | if method: |
---|
| 20 | method.manage_permission('View', ['Manager',], acquire=0) |
---|
| 21 | out.write('%s external method added to portal\n' % EXTERNAL_METHOD) |
---|
| 22 | else: out.write('installation procedure could not create external method\n') |
---|
| 23 | else: out.write('%s external method already exists in portal\n' % EXTERNAL_METHOD) |
---|
| 24 | |
---|
| 25 | def install(self): |
---|
| 26 | """ Product installation """ |
---|
| 27 | |
---|
| 28 | out = StringIO() |
---|
| 29 | |
---|
| 30 | # add external method |
---|
| 31 | addExternalMethod(self, out) |
---|
| 32 | |
---|
| 33 | return out.getvalue() |
---|
| 34 | |
---|
| 35 | def uninstall(self): |
---|
| 36 | """ Product uninstallation """ |
---|
| 37 | |
---|
| 38 | out = StringIO() |
---|
| 39 | |
---|
| 40 | return out.getvalue() |
---|
Note: See
TracBrowser
for help on using the repository browser.