Changeset 2532 in products


Ignore:
Timestamp:
Jun 14, 2010 8:05:19 PM (14 years ago)
Author:
mylan
Message:

#206: remove BBB code for plone<3.0

Location:
quintagroup.plonegooglesitemaps/branches/test_refactoring/quintagroup/plonegooglesitemaps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/branches/test_refactoring/quintagroup/plonegooglesitemaps/config.py

    r1729 r2532  
    2020AVAILABLE_WF_SCRIPTS = [ping_googlesitemap, ''] 
    2121 
    22 try: 
    23     from Products.DCWorkflow.events import AfterTransitionEvent 
    24 except ImportError: 
    25     IS_PLONE_3 = False 
    26 else: 
    27     IS_PLONE_3 = True 
    28  
    2922# Turn-ON/OFF portal_catalog 
    3023# updating on product installation 
  • quintagroup.plonegooglesitemaps/branches/test_refactoring/quintagroup/plonegooglesitemaps/content/sitemap.py

    r2406 r2532  
    158158        """ 
    159159        self.getField('pingTransitions').set(self, value) 
    160         if not IS_PLONE_3: 
    161             # Update Workflow if needed 
    162             pw = getToolByName(self, 'portal_workflow') 
    163             #ping_googlesitemap = PING_EMETHODS_MAP[self.getSitemapType()] 
    164             transmap = {} 
    165             for key in value: 
    166                 if key.find('#')>0: 
    167                     ids = key.split('#') 
    168                     wfid = ids[0] 
    169                     if not wfid in transmap.keys(): 
    170                         transmap[wfid]=[] 
    171                     transmap[wfid].append(ids[1]) 
    172             for wfid in transmap.keys(): 
    173                 workflow = pw.getWorkflowById(wfid) 
    174                 if ping_googlesitemap not in workflow.scripts.objectIds(): 
    175                     workflow.scripts.manage_addProduct['ExternalMethod'].manage_addExternalMethod( 
    176                         ping_googlesitemap, 
    177                         'Ping sitemap', 
    178                         'quintagroup.plonegooglesitemaps.ping_googlesitemap', 
    179                         ping_googlesitemap) 
    180                 transitions_set = transmap[wfid] 
    181                 for transition in workflow.transitions.values(): 
    182                     trid = transition.id 
    183                     tras = transition.after_script_name 
    184                     if (tras == '') and (trid in transitions_set): 
    185                         #set 
    186                         after_script = ping_googlesitemap 
    187                     elif (tras == ping_googlesitemap) and not (trid in transitions_set): 
    188                         #reset 
    189                         after_script = '' 
    190                     else: 
    191                         #avoid properties set 
    192                         continue 
    193                     transition.setProperties(title=transition.title, 
    194                         new_state_id=transition.new_state_id, 
    195                         after_script_name=after_script, 
    196                         actbox_name=transition.actbox_name) 
    197160 
    198161atapi.registerType(Sitemap, PROJECTNAME) 
Note: See TracChangeset for help on using the changeset viewer.