source: products/qPingTool/trunk/PingInfo.py

Last change on this file was 1, checked in by myroslav, 15 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1from Products.Archetypes.public import *
2from Products.Archetypes.BaseContent import BaseContentMixin
3from Products.CMFCore.ActionInformation import ActionInformation
4from Products.CMFCore.Expression import Expression, createExprContext
5from Products.CMFCore.utils import getToolByName
6from Acquisition import aq_inner, aq_parent
7from Products.CMFDefault.utils import _dtmldir
8from config import *
9from AccessControl import ClassSecurityInfo
10from Globals import InitializeClass, DTMLFile
11
12schema = BaseContentMixin.schema +  Schema((
13    #StringField('id',
14    #            required=1,
15    #            widget=StringWidget(size=70,
16    #                                label_msgid = 'label_id',
17    #                                description_msgid = 'help_id'),
18    #            ),
19    StringField('url',
20                required=1,
21                widget=StringWidget(label_msgid = 'label_url',
22                                    description_msgid = 'help_url'),
23               ),
24    StringField('method_name',
25                default='weblogUpdates.ping',
26                required=1,
27                widget=StringWidget(label_msgid = 'label_method_name',
28                                    description_msgid = 'help_method_name'),
29               ),
30    StringField('rss_version',
31                vocabulary=RSS_LIST,
32                default='Blog',
33                widget=SelectionWidget(label_msgid = 'label_rss_version',
34                                    description_msgid = 'help_rss_version'),
35                ),
36    ))
37
38
39class PingInfo(BaseContentMixin):
40    """Ping Info container
41       id - name of the server to ping
42       url - server ping url
43       method_name - ping method
44       rss_version - rss version supported by the server
45    """
46
47    schema = schema
48
49    """
50        Added some support of DublinCore
51    """
52    security = ClassSecurityInfo()
53
54    def Contributors(self):
55        return self.contributors
56
57    try:
58        from Products.CMFCore import permissions
59        security.declareProtected(permissions.ModifyPortalContent, 'manage_metadata' )
60    except:
61        from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
62        security.declareProtected(ModifyPortalContent, 'manage_metadata' )
63
64    manage_metadata = DTMLFile('zmi_metadata', _dtmldir)
65
66
67registerType(PingInfo)
Note: See TracBrowser for help on using the repository browser.