Changeset 589

Show
Ignore:
Timestamp:
10/23/06 03:45:15
Author:
mylan
Message:

Add and register CanonicalURL adapter.cd '/data/mylan/opt/work/SimpleBlog/adsenseproduct/Extensions'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPingTool/branches/plone-2.5/Extensions/Install.py

    r588 r589  
    2525                                        action='string:${portal_url}/'+TOOL_ID+'/folder_contents', 
    2626                                        appId=PROJECTNAME,  permission=ManagePortal, imageUrl='group.gif') 
     27    controlpanel_tool.unregisterConfiglet('prefs_set_canonical') 
     28    controlpanel_tool.registerConfiglet(id="prefs_set_canonical", name='Canonical URL setting' \ 
     29        ,category='Products', action='string:${portal_url}/prefs_set_canonical' \ 
     30        ,appId=PROJECTNAME,  permission=ManagePortal, imageUrl='group.gif') 
    2731 
    2832    # Add 'portal_actionstool' to action provider list, if not yet exist 
     
    5963    controlpanel_tool = getToolByName(portal, 'portal_controlpanel') 
    6064    controlpanel_tool.unregisterConfiglet(TOOL_ID) 
     65    controlpanel_tool.unregisterConfiglet('prefs_set_canonical') 
    6166 
    6267    removeSkin(portal, ('ping_tool.pt',)) 
  • qPingTool/branches/plone-2.5/PingTool.py

    r588 r589  
    1515from Products.XMLRPCMethod.XMLRPCMethod import RPCThread, XMLRPCMethod 
    1616from Products.CMFCore.utils import getToolByName 
     17from util import getCanonicalURL 
    1718from zLOG import LOG 
    1819 
     
    8788        title = blog.Title() 
    8889        portal = context.portal_url.getPortalObject() 
    89         canonical_url = portal.getProperty('canonical_url', None
     90        canonical_url = getCanonicalURL(context
    9091        if canonical_url: 
    9192            #return "failure", "Please setup 'canonical_url' property for your Plone site" 
  • qPingTool/branches/plone-2.5/__init__.py

    r588 r589  
    77from config import * 
    88 
    9  
     9try: 
     10    from adapter import registerAdapter 
     11    registerAdapter() 
     12except: 
     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 
    1020 
    1121 
    1222registerDirectory(SKINS_DIR, GLOBALS) 
    13  
    1423tools = ( PingTool.PingTool, ) 
    1524 
    1625def initialize(context): 
     26    from AccessControl import allow_module 
     27    allow_module('Products.qPingTool.util') 
     28 
    1729    utils.ToolInit("PingTool", tools=tools, product_name=PROJECTNAME, icon=TOOL_ICON, 
    1830                  ).initialize(context) 
     
    2739        fti                = ftis, 
    2840        ).initialize(context) 
     41