[626] | 1 | from Globals import DTMLFile |
---|
| 2 | from AccessControl import ClassSecurityInfo |
---|
| 3 | from Products.Archetypes.public import * |
---|
| 4 | from Products.CMFCore.permissions import ModifyPortalContent |
---|
| 5 | from Products.CMFDefault.utils import _dtmldir |
---|
| 6 | from Products.ATContentTypes.content.base import ATCTContent |
---|
| 7 | from Products.ATContentTypes.content.schemata import ATContentTypeSchema, finalizeATCTSchema |
---|
| 8 | from Products.ATContentTypes.lib.historyaware import HistoryAwareMixin |
---|
| 9 | |
---|
| 10 | from config import RSS_LIST, PROJECTNAME |
---|
| 11 | from quintagroup.pingtool import PingToolMessageFactory as _ |
---|
| 12 | |
---|
| 13 | PingInfoSchema = ATContentTypeSchema.copy() + Schema(( |
---|
| 14 | TextField('description', |
---|
| 15 | default='', |
---|
| 16 | searchable=False, |
---|
| 17 | widget=TextAreaWidget( |
---|
| 18 | label=_( |
---|
| 19 | u'label_description', |
---|
| 20 | default=u'Description'), |
---|
| 21 | description=_( |
---|
| 22 | u'help_description', |
---|
| 23 | default=u'Description of ping info'), |
---|
| 24 | ), |
---|
| 25 | ), |
---|
| 26 | StringField('url', |
---|
| 27 | default='', |
---|
| 28 | required=1, |
---|
| 29 | searchable=False, |
---|
| 30 | widget=StringWidget( |
---|
| 31 | label=_( |
---|
| 32 | u'label_url', |
---|
| 33 | default=u'Url ping servies'), |
---|
| 34 | description=_( |
---|
| 35 | u'help_url', |
---|
| 36 | default=u''), |
---|
| 37 | ), |
---|
| 38 | ), |
---|
| 39 | StringField('method_name', |
---|
| 40 | default='weblogUpdates.ping', |
---|
| 41 | required=1, |
---|
| 42 | searchable=False, |
---|
| 43 | widget=StringWidget( |
---|
| 44 | label=_( |
---|
| 45 | u'label_method_name', |
---|
| 46 | default=u'Method name'), |
---|
| 47 | description=_( |
---|
| 48 | u'help_method_name', |
---|
| 49 | default=u''), |
---|
| 50 | ), |
---|
| 51 | ), |
---|
| 52 | StringField('rss_version', |
---|
| 53 | default='Weblog', |
---|
| 54 | searchable=False, |
---|
| 55 | vocabulary=RSS_LIST, |
---|
| 56 | widget=SelectionWidget( |
---|
| 57 | label=_( |
---|
| 58 | u'label_rss_version', |
---|
| 59 | default=u'RSS version'), |
---|
| 60 | description=_( |
---|
| 61 | u'help_rss_version', |
---|
| 62 | default=u''), |
---|
| 63 | ), |
---|
| 64 | ), |
---|
| 65 | ),marshall=RFC822Marshaller()) |
---|
| 66 | |
---|
| 67 | |
---|
| 68 | class PingInfo(ATCTContent, HistoryAwareMixin): |
---|
| 69 | """Ping Info container |
---|
| 70 | id - name of the server to ping |
---|
| 71 | url - server ping url |
---|
| 72 | method_name - ping method |
---|
| 73 | rss_version - rss version supported by the server |
---|
| 74 | """ |
---|
| 75 | __implements__ = (ATCTContent.__implements__, |
---|
| 76 | HistoryAwareMixin.__implements__, |
---|
| 77 | ) |
---|
| 78 | schema = PingInfoSchema |
---|
| 79 | |
---|
| 80 | """Added some support of DublinCore""" |
---|
| 81 | security = ClassSecurityInfo() |
---|
| 82 | |
---|
| 83 | def Contributors(self): |
---|
| 84 | return self.contributors |
---|
| 85 | |
---|
| 86 | security.declareProtected(ModifyPortalContent, 'manage_metadata') |
---|
| 87 | manage_metadata = DTMLFile('zmi_metadata', _dtmldir) |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | registerType(PingInfo, PROJECTNAME) |
---|