Ignore:
Timestamp:
08/26/08 11:22:31 (2 years ago)
Author:
gbastien
Message:

Completed tag before announcing stable release 1.0

Location:
communesplone/CPComarquage/tags/1.0
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • communesplone/CPComarquage/tags/1.0/ConfigurationMethods.py

    r491 r2503  
    4747    get_transaction().commit(1) 
    4848 
    49      
    50 def updateSubjectsMetadata(self, portal):     
     49 
     50def updateSubjectsMetadata(self, portal): 
    5151    """ We add the differents subject from the 'Portail de la Région Wallonne' in the lists of Subject in portal_metadata """ 
    5252    #retrieve every subjects from RSS 
     
    5454    sin = getToolByName(portal, 'sin_tool') 
    5555    rows = sin.sin(map_name=MAPNAME, max_size=MAXRSS) 
    56      
     56 
    5757    rss_subjects = [] 
    5858    for row in rows: 
    5959        rss_subjects.append(unicode(row.get('category'), 'latin1').encode('utf-8')) 
    60      
     60 
    6161    element = meta_tool.getElementSpec('Subject') 
    6262    existing_subjects = list(element.getPolicy('Document').allowed_vocabulary) 
    63      
     63 
    6464    try: 
    6565        meta_tool.addElementPolicy(element='Subject', 
     
    7878            if subj not in existing_subjects: 
    7979                existing_subjects.append(subj) 
    80                  
     80 
    8181        #we sort by alphabetical order 
    8282        existing_subjects.sort() 
     
    9999class CPComarquageSetup(SetupWidget): 
    100100   type = 'CPComarquage Setup' 
    101     
     101 
    102102   description = "Permet d'adapter le portail pour l'utilisation du produit CPComarquage" 
    103          
     103 
    104104   functions = functions 
    105     
     105 
    106106   single = 0 
    107107 
     
    121121       for fn in fns: 
    122122           self.functions[fn](self, self.portal) 
    123        out.append(('Function %s has been applied' % fn, INFO)) 
     123           out.append(('Function %s has been applied' % fn, INFO)) 
    124124       return out 
    125125 
  • communesplone/CPComarquage/tags/1.0/Extensions/AppInstall.py

    r1320 r2503  
    3131from Products.ExternalMethod.ExternalMethod import manage_addExternalMethod 
    3232from zExceptions import BadRequest 
     33from Products.CPComarquage.config import * 
    3334 
    3435def install(self): 
     
    4041        #if the ExternalMethod already exists, we pass 
    4142        pass 
    42          
     43 
     44    try: 
     45        portal = getToolByName(self, 'portal_url', None).getPortalObject() 
     46        manage_addExternalMethod(portal, 'cpcdisplayfooter', 'cpcdisplayfooter', 'CPComarquage.cpcurl', 'displayfooter') 
     47    except: 
     48        #if the ExternalMethod already exists, we pass 
     49        pass 
     50 
    4351    #we add the Plone Property Sheet to portal_properties 
    4452    self.portal_properties.addPropertySheet('cpcomarquage_properties', 'CPComarquage Properties', propertysheet=None) 
    45     
     53 
    4654    #we add the properties to the Property Sheet 
    4755    self.portal_properties.cpcomarquage_properties.manage_addProperty('absolute_urls', True, 'boolean') 
    4856    self.portal_properties.cpcomarquage_properties.manage_addProperty('full_replace', True, 'boolean') 
    49      
     57 
     58    #add the "wal" channel in CMFSin, updated every 7 days... 
     59    #period and frequency are passed as kwargs 
     60    self.sin_tool.addChannel(CHANNELNAME, CHANNELURL, period='d', frequency=7) 
     61    self.sin_tool.addMap(MAPNAME, channels = [CHANNELNAME, ]) 
     62    self.sin_tool.sin(MAPNAME) 
     63 
     64    #update Subject metadata for Content type 'Page' 
     65    from Products.CPComarquage.ConfigurationMethods import updateSubjectsMetadata 
     66    updateSubjectsMetadata(self, self) 
     67 
    5068def uninstall(self): 
    51     """ Unistall method for CPComarquage """ 
     69    """ Uninstall method for CPComarquage """ 
    5270    try: 
    5371        #we remove the added property sheet 
  • communesplone/CPComarquage/tags/1.0/Extensions/cpcurl.py

    r1160 r2503  
    3838    except IOError: 
    3939        return None 
    40      
     40 
    4141    data = f.read() 
    4242    f.close() 
    4343    return data 
     44 
     45def displayfooter(self, rows, sujet): 
     46    lst = [] 
     47    for row in rows: 
     48        lst.append(row['category']) 
     49 
     50    for s in sujet: 
     51        if s in lst: 
     52            return True 
     53 
     54    return False 
  • communesplone/CPComarquage/tags/1.0/config.py

    r1319 r2503  
    7070##code-section config-bottom #fill in your manual code here 
    7171#the name of the map for CMFSin 
     72CHANNELNAME = "wal" 
     73CHANNELURL = "http://www.wallonie.be/fr/comarquage.rss" 
    7274MAPNAME = "wal" 
    7375#the maximum of lines we want to read in the RSS 
  • communesplone/CPComarquage/tags/1.0/skins/cpcomarquage/cpcomarquage_macros.pt

    r1556 r2503  
    1616                  display_header python:1; 
    1717                  display_footer python:0; 
    18                   rows python:sin.sin(map, max_size=max);"> 
     18                  rows python:sin.sin(map, max_size=max); 
     19                  display_footer python: context.cpcdisplayfooter(rows, sujet)" 
     20      tal:condition="display_footer" > 
    1921 
    2022  <div class="cpcomarquageHeader">Retrouvez ici les informations émanant du portail de la Région Wallonne</div> 
    21  
    2223  <table class="cpcomarquageTable"> 
    2324  <tal:repeat tal:repeat="row rows"> 
Note: See TracChangeset for help on using the changeset viewer.