| 1 |
from Products.Archetypes.public import * |
|---|
| 2 |
from Products.Archetypes.BaseContent import BaseContentMixin |
|---|
| 3 |
from Products.CMFCore.ActionInformation import ActionInformation |
|---|
| 4 |
from Products.CMFCore.Expression import Expression, createExprContext |
|---|
| 5 |
from Products.CMFCore.utils import getToolByName |
|---|
| 6 |
from Acquisition import aq_inner, aq_parent |
|---|
| 7 |
from Products.CMFDefault.utils import _dtmldir |
|---|
| 8 |
from config import * |
|---|
| 9 |
from AccessControl import ClassSecurityInfo |
|---|
| 10 |
from Globals import InitializeClass, DTMLFile |
|---|
| 11 |
|
|---|
| 12 |
schema = BaseContentMixin.schema + Schema(( |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 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 |
|
|---|
| 39 |
class 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 |
|
|---|
| 67 |
registerType(PingInfo) |
|---|