source: products/qPingTool/branches/plone-3.1/PingInfo.py @ 3522

Last change on this file since 3522 was 243, checked in by mylan, 18 years ago

Remove workflow chain for Discussion Item on installation - resolved cataloging bug.

  • Property svn:eol-style set to native
File size: 2.7 KB
RevLine 
[198]1from Globals import DTMLFile
2from AccessControl import ClassSecurityInfo
[1]3from Products.Archetypes.public import *
[198]4from Products.CMFCore.permissions import ModifyPortalContent
[1]5from Products.CMFDefault.utils import _dtmldir
[198]6from Products.ATContentTypes.content.base import ATCTContent
7from Products.ATContentTypes.content.schemata import ATContentTypeSchema, finalizeATCTSchema
8from Products.ATContentTypes.lib.historyaware import HistoryAwareMixin
9from config import RSS_LIST, PROJECTNAME
[1]10
[225]11from Products.qPingTool import qPingToolMessageFactory as _
12
[198]13PingInfoSchema =  ATContentTypeSchema.copy() +  Schema((
14    TextField('description',
[225]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    ),
[1]26    StringField('url',
[225]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    ),
[1]39    StringField('method_name',
[225]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    ),
[1]52    StringField('rss_version',
[225]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())
[1]66
[225]67#finalizeATCTSchema(PingInfoSchema)
68
[198]69class PingInfo(ATCTContent, HistoryAwareMixin):
[1]70    """Ping Info container
71       id - name of the server to ping
72       url - server ping url
73       method_name - ping method
74       rss_version - rss version supported by the server
75    """
[198]76    __implements__ = (ATCTContent.__implements__,
77                      HistoryAwareMixin.__implements__,
78                     )
79    schema = PingInfoSchema
[1]80
81    """
82        Added some support of DublinCore
83    """
84    security = ClassSecurityInfo()
85
86    def Contributors(self):
87        return self.contributors
88
[198]89    security.declareProtected(ModifyPortalContent, 'manage_metadata' )
[1]90    manage_metadata = DTMLFile('zmi_metadata', _dtmldir)
91
92
[198]93registerType(PingInfo, PROJECTNAME)
Note: See TracBrowser for help on using the repository browser.