source: products/quintagroup.pingtool/trunk/quintagroup/pingtool/PingInfo.py @ 1232

Last change on this file since 1232 was 626, checked in by crchemist, 17 years ago

Modified tests.

File size: 2.6 KB
Line 
1from Globals import DTMLFile
2from AccessControl import ClassSecurityInfo
3from Products.Archetypes.public import *
4from Products.CMFCore.permissions import ModifyPortalContent
5from Products.CMFDefault.utils import _dtmldir
6from Products.ATContentTypes.content.base import ATCTContent
7from Products.ATContentTypes.content.schemata import ATContentTypeSchema, finalizeATCTSchema
8from Products.ATContentTypes.lib.historyaware import HistoryAwareMixin
9
10from config import RSS_LIST, PROJECTNAME
11from quintagroup.pingtool import PingToolMessageFactory as _
12
13PingInfoSchema =  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
68class 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
90registerType(PingInfo, PROJECTNAME)
Note: See TracBrowser for help on using the repository browser.