Changeset 1224

Show
Ignore:
Timestamp:
09/03/08 13:29:21
Author:
liebster
Message:

change product for plone3.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPingTool/branches/plone-3.1/PingInfo.py

    r697 r1224  
     1from Globals import DTMLFile 
     2from AccessControl import ClassSecurityInfo 
    13from Products.Archetypes.public import * 
    24from Products.Archetypes.BaseContent import BaseContentMixin 
    3 from Products.CMFCore.ActionInformation import ActionInformation 
    4 from Products.CMFCore.Expression import Expression, createExprContext 
     5from Products.CMFCore.permissions import ModifyPortalContent 
    56from Products.CMFCore.utils import getToolByName 
    6 from Acquisition import aq_inner, aq_parent 
    77from Products.CMFDefault.utils import _dtmldir 
    88from config import * 
    9 from AccessControl import ClassSecurityInfo 
    10 from Globals import InitializeClass, DTMLFile 
    119 
    1210schema = BaseContentMixin.schema +  Schema(( 
     
    5553        return self.contributors 
    5654 
    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  
     55    security.declareProtected(ModifyPortalContent, 'manage_metadata' ) 
    6456    manage_metadata = DTMLFile('zmi_metadata', _dtmldir) 
    6557 
    6658 
    67 registerType(PingInfo
     59registerType(PingInfo, PROJECTNAME
  • qPingTool/branches/plone-3.1/PingTool.py

    r697 r1224  
    11#from Globals import InitializeClass 
    22import os 
     3from Acquisition import aq_base 
     4 
     5from zope.interface import implements 
     6from AccessControl import ClassSecurityInfo 
     7 
     8from Products.Archetypes.public import * 
     9 
     10from Products.CMFPlone.interfaces.OrderedContainer import IOrderedContainer 
     11from Products.CMFPlone.PloneFolder import PloneFolder 
     12 
     13from Products.PageTemplates.PageTemplateFile import PageTemplateFile 
     14 
     15from Products.CMFCore.permissions import ManagePortal 
     16from Products.CMFCore.utils import getToolByName 
    317from Products.CMFCore.ActionProviderBase import ActionProviderBase 
    4 from Products.CMFPlone.PloneFolder import PloneFolder 
    5 from config import TOOL_ID, PROJECTNAME 
    6 from Products.Archetypes.public import * 
     18 
    719from Products.ATContentTypes.content.folder import ATFolder 
    8 from Products.ATContentTypes.content.base import updateActions, updateAliases 
    9 from Products.CMFPlone.interfaces.OrderedContainer import IOrderedContainer 
    10 from Products.CMFCore.ActionInformation import ActionInformation 
    11 from Products.CMFCore.Expression import Expression 
    12 from Products.CMFCore.CMFCorePermissions import ManageProperties 
    13 from Acquisition import aq_base 
    14 from Products.CMFCore.utils import _getViewFor 
    15 from Products.PageTemplates.PageTemplateFile import PageTemplateFile 
     20 
    1621from Products.XMLRPCMethod.XMLRPCMethod import RPCThread, XMLRPCMethod 
    17 from Products.CMFCore.utils import getToolByName 
     22 
    1823from util import getCanonicalURL 
    1924from zLOG import LOG 
     25from config import TOOL_ID, PROJECTNAME 
    2026 
    2127_marker = [] 
     
    3339    """This tool serve for operation with ActionInfo objects 
    3440    """ 
     41    security = ClassSecurityInfo() 
    3542 
    36     #schema = BaseSchema 
    37     filter_content_types = 1 
    38     allowed_content_types = ('PingInfo',) 
    39     global_allowed = 0 
     43    archetype_name = portal_type = 'PingTool' 
    4044 
    41     meta_type = archetype_name = portal_type = 'PingTool' 
    42  
    43     ######## 
    44     content_icon   = 'tool.gif' 
    45     immediate_view = 'view' 
    46     default_view   = 'view' 
    47  
    48     ######## 
    4945    __implements__ = (IOrderedContainer,) 
    50     _actions = ( ActionInformation( 
    51                     id='ping' 
    52                   , title='Ping setup' 
    53                   , action=Expression( 
    54                         text='string:${folder_url}/ping_setup') 
    55                   , condition=Expression( 
    56                         text='python: folder is object and portal.portal_syndication.isSyndicationAllowed(object)') 
    57                   , permissions=(ManageProperties,) 
    58                   , category='folder' 
    59                   , visible=1 
    60                   ), 
    61                ) 
    62  
    63     actions = updateActions(ATFolder, 
    64         ({'id'         : 'view' \ 
    65          ,'name'       : 'View' \ 
    66          ,'action'     : 'string:folder_contents' \ 
    67          ,'permissions': ('Manage portal',) \ 
    68          ,'category'   :'object' \ 
    69          }, 
    70         ) 
    71     ) 
    72      
    73     aliases = updateAliases(ATFolder, 
    74         {'(Default)'   : 'folder_listing' \ 
    75         ,'view'        : 'folder_contents' \ 
    76         }, 
    77     ) 
    7846 
    7947    manage_options =  ( 
     
    8149        ) + ATFolder.manage_options 
    8250 
     51    security.declareProtected(ManagePortal, 'manage_overview') 
    8352    manage_overview = PageTemplateFile(os.path.join('www','overview'), globals()) 
    8453    manage_overview.__name__ = 'manage_overview' 
    8554    manage_overview._need__name__ = 0 
    8655 
     56    def om_icons(self): 
     57        """ Checking on ZMI for canonical_url setting.""" 
     58        icons = ({'path':'misc_/qPingTool/tool.gif' \ 
     59                    ,'alt':self.meta_type \ 
     60                    ,'title':self.meta_type \ 
     61                },) 
     62        if not getCanonicalURL(self): 
     63            icons = icons + ({'path':'misc_/PageTemplates/exclamation.gif' \ 
     64                                ,'alt':'Error' \ 
     65                                ,'title':'PingTool needs setting canonical_url' \ 
     66                                },) 
     67        return icons 
     68 
     69    security.declareProtected(ManagePortal, 'pingFeedReader') 
    8770    def pingFeedReader(self,context): 
    8871        """ ping """ 
     
    129112        return status, message 
    130113 
    131  
     114    security.declareProtected(ManagePortal, 'setupPing') 
    132115    def setupPing(self,context, 
    133116                  enable_ping=0, 
     
    149132        return status, message 
    150133 
     134    security.declareProtected(ManagePortal, 'getPingProperties') 
    151135    def getPingProperties(self, context): 
    152136        """ """ 
     
    159143        return  pingPropeties 
    160144 
    161     def om_icons(self): 
    162         """ Checking on ZMI for canonical_url setting.""" 
    163         icons = ({'path':'misc_/qPingTool/tool.gif' \ 
    164                     ,'alt':self.meta_type \ 
    165                     ,'title':self.meta_type \ 
    166                 },) 
    167         if not getCanonicalURL(self): 
    168             icons = icons + ({'path':'misc_/PageTemplates/exclamation.gif' \ 
    169                                 ,'alt':'Error' \ 
    170                                 ,'title':'PingTool needs setting canonical_url' \ 
    171                                 },) 
    172         return icons 
    173  
    174 registerType(PingTool) 
     145registerType(PingTool, PROJECTNAME) 
  • qPingTool/branches/plone-3.1/__init__.py

    r697 r1224  
    1 from Globals import package_home 
    21from Products.Archetypes.public import process_types, listTypes 
    32from Products.CMFCore import utils 
    4 from Products.CMFCore.DirectoryView import registerDirectory 
    5 import os, os.path 
    63import PingInfo, PingTool 
    74from config import * 
    85 
    9 try: 
    10     from adapter import registerAdapter 
    11     registerAdapter() 
    12 except: 
    13     from Products.CMFCore.utils import getToolByName 
    14     from Products.CMFPlone.URLTool import URLTool 
    15     def getCanonicalURL(self): 
    16         portal = getToolByName(self, 'portal_url').getPortalObject() 
    17         return portal.getProperty('canonical_url', None) 
    18     #URLTool.security.declarePublic('getCanonicalURL') 
    19     URLTool.getCanonicalURL = getCanonicalURL 
    20  
    21  
    22 registerDirectory(SKINS_DIR, GLOBALS) 
    236tools = ( PingTool.PingTool, ) 
    247 
     
    2710    allow_module('Products.qPingTool.util') 
    2811 
    29     utils.ToolInit("PingTool", tools=tools, product_name=PROJECTNAME, icon=TOOL_ICON, 
     12    utils.ToolInit("PingTool", tools=tools, icon=TOOL_ICON, 
    3013                  ).initialize(context) 
    3114 
  • qPingTool/branches/plone-3.1/adapter.py

    r697 r1224  
    11from zope.interface import Interface, implements #, Attribute 
     2from zope.component import adapts 
     3 
     4from Products.CMFPlone.interfaces import IPloneBaseTool 
    25from Products.CMFCore.utils import getToolByName 
    36 
     
    2124    """ CanonicalURL adapter 
    2225    """ 
     26    adapts(IPloneBaseTool) 
    2327    implements(ICanonicalURL) 
    2428 
     
    5862# Register adapter 
    5963 
    60 def registerAdapter(): 
    61     from Products.CMFPlone.interfaces import IPloneBaseTool 
    62     from zope.component import provideAdapter 
    63     provideAdapter(CanonicalURL, adapts=[IPloneBaseTool,], provides=ICanonicalURL ) 
     64#def registerAdapter(): 
     65#    from Products.CMFPlone.interfaces import IPloneBaseTool 
     66#    from zope.component import provideAdapter 
     67#    provideAdapter(CanonicalURL, adapts=[IPloneBaseTool,], provides=ICanonicalURL ) 
  • qPingTool/branches/plone-3.1/config.py

    r697 r1224  
    1 from Products.CMFCore import CMFCorePermissions 
    21from Products.Archetypes.utils import DisplayList 
     2from Products.CMFCore.permissions import ManagePortal 
    33 
    4 SKINS_DIR = 'skins' 
    54GLOBALS = globals() 
    65PROJECTNAME = 'qPingTool' 
    76 
    8 ADD_PERMISSION = CMFCorePermissions.ManagePortal 
     7ADD_PERMISSION = ManagePortal 
    98 
    109TOOL_ID = 'portal_pingtool' 
     
    1211TOOL_ICON = 'skins/qpingtool/tool.gif' 
    1312 
    14 RSS_LIST = DisplayList((('Blog','Blog'),('RSS','RSS1'),('RSS2','RSS2'))) 
     13RSS_LIST = DisplayList((('Weblog','Weblog'),('RSS','RSS1'),('RSS2','RSS2'))) 
    1514 
    1615CONFIGURATION_CONFIGLET = 'pingtool_config' 
  • qPingTool/branches/plone-3.1/version.txt

    r699 r1224  
    1 0.3.1 
     11.0.0