Changeset 1570 in products


Ignore:
Timestamp:
Jan 20, 2010 4:43:44 PM (10 years ago)
Author:
liebster
Message:

Added reinstall profile and removed using content_types_seoprops_enabled propery in seo_properties

Location:
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer
Files:
12 added
6 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/Extensions/Install.py

    r1545 r1570  
    22from quintagroup.seoptimizer.config import PROJECT_NAME 
    33 
     4def install(portal, reinstall=False): 
     5    setup_tool = getToolByName(portal, 'portal_setup') 
     6    setup_tool.setBaselineContext('profile-%s:uninstall'%PROJECT_NAME) 
     7    if reinstall: 
     8        setup_tool.setBaselineContext('profile-%s:reinstall'%PROJECT_NAME) 
     9        setup_tool.runAllImportStepsFromProfile('profile-%s:reinstall'%PROJECT_NAME) 
     10        return "Ran reinstall steps." 
     11    else: 
     12        setup_tool.setBaselineContext('profile-%s:uninstall'%PROJECT_NAME) 
     13        setup_tool.runAllImportStepsFromProfile('profile-%s:default'%PROJECT_NAME) 
     14        return "Ran all install steps." 
    415 
    516def uninstall(portal, reinstall=False): 
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/templates/seo_controlpanel.pt

    r1555 r1570  
    9696                                                tal:attributes="id name; 
    9797                                                                value name; 
    98                                                                 checked python:view.isEnableCT(name)"/> 
     98                                                                checked python:view.hasSEOAction(type)"/> 
    9999                                        <label tal:attributes="for python:type.getId()" 
    100100                                               tal:content="type/Title"/> 
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/browser/views.py

    r1518 r1570  
    211211        """ 
    212212        return filter(lambda x:x.id == 'seo_properties', type_info.listActions()) 
    213  
    214  
    215     def isEnableCT(self, type_id): 
    216         """ 
    217         """ 
    218         seo_props = getToolByName(self.portal_properties, 'seo_properties') 
    219         return type_id in seo_props.getProperty('content_types_seoprops_enabled', '') 
    220213 
    221214    def test( self, condition, first, second ): 
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/configure.zcml

    r1466 r1570  
    1717      directory="profiles/default" 
    1818      description="Install quintagroup.seoptimizer" 
     19      provides="Products.GenericSetup.interfaces.EXTENSION" 
     20      /> 
     21 
     22  <genericsetup:registerProfile 
     23      name="reinstall" 
     24      title="quintagroup.seoptimizer reinstall" 
     25      directory="profiles/reinstall" 
     26      description="Reinstall quintagroup.seoptimizer" 
    1927      provides="Products.GenericSetup.interfaces.EXTENSION" 
    2028      /> 
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/profiles/default/propertiestool.xml

    r1517 r1570  
    8585   <element value="distribution seo_distribution"/> 
    8686  </property> 
    87   <property name="content_types_seoprops_enabled" type="lines" purge='False'> 
    88    <element value="Document"/> 
    89    <element value="File"/> 
    90    <element value="News Item"/> 
    91   </property> 
    9287 </object> 
    9388 <object name="site_properties" meta_type="Plone Property Sheet"> 
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/setuphandlers.py

    r1519 r1570  
    99    new = '@@seo-context-properties' 
    1010    condition = "python:exists('portal/@@seo-context-properties')" 
    11     seo_props = site.portal_properties.seo_properties 
    12     content_types_seoprops_enabled = list(seo_props.getProperty('content_types_seoprops_enabled')) 
    1311    for ptype in site.portal_types.objectValues(): 
    1412        acts = filter(lambda x: x.id == 'seo_properties' , ptype.listActions()) 
    1513        for act in acts: 
    1614            log = 0 
    17             if ptype.id not in content_types_seoprops_enabled: 
    18                 content_types_seoprops_enabled.append(ptype.id) 
    1915            if not act.condition: 
    2016                act.condition = Expression(condition) 
     
    2622            if log: 
    2723                logger.log(logging.INFO, "Updated \"SEO Properties\" action in %s type." % ptype.id) 
    28     seo_props.manage_changeProperties(content_types_seoprops_enabled=tuple(content_types_seoprops_enabled)) 
    29  
    30  
    31 def importVarious(context): 
    32     """ Do customized installation. 
    33     """ 
    34     if context.readDataFile('seo_install.txt') is None: 
    35         return 
    36     site = context.getSite() 
    37     migrationActions(site) 
    3824 
    3925def removeSkin(self, layer): 
     
    6551                logger.log(logging.INFO, "Deleted \"SEO Properties\" action for %s type." % ptype.id) 
    6652 
    67 def remove_configlets( context, conf_ids ): 
     53def remove_configlets(context, conf_ids): 
    6854    """ Remove configlets. 
    6955    """ 
     
    7460            logger.log(logging.INFO, "Unregistered \"%s\" configlet." % id) 
    7561 
    76 def uninstall( context ): 
     62def importVarious(context): 
     63    """ Do customized installation. 
     64    """ 
     65    if context.readDataFile('seo_install.txt') is None: 
     66        return 
     67 
     68def reinstall(context): 
     69    """ Do customized reinstallation. 
     70    """ 
     71    if context.readDataFile('seo_reinstall.txt') is None: 
     72        return 
     73    site = context.getSite() 
     74    migrationActions(site) 
     75 
     76def uninstall(context): 
    7777    """ Do customized uninstallation. 
    7878    """ 
     
    8080        return 
    8181    site = context.getSite() 
    82     removeSkin( site, 'quintagroup.seoptimizer' ) 
    83     removeActions( site ) 
    84     remove_configlets( site, ('quintagroup.seoptimizer',)) 
     82    removeSkin(site, 'quintagroup.seoptimizer' ) 
     83    removeActions(site) 
     84    remove_configlets(site, ('quintagroup.seoptimizer',)) 
Note: See TracChangeset for help on using the changeset viewer.