Changeset 420 in products


Ignore:
Timestamp:
Jul 25, 2006 1:51:08 PM (18 years ago)
Author:
fenix
Message:

fixed installation script, modify fti, fixed bugs

Location:
qTopic/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qTopic/trunk/Extensions/Install.py

    r392 r420  
    4141            path = ','.join(path) 
    4242            skinstool.addSkinSelection(skinName, path) 
    43  
    44  
    45  
     43         
     44    pact_icons = getToolByName(self, 'portal_actionicons') 
     45    pact_icons.removeActionIcon('plone', 'export_csv') 
  • qTopic/trunk/qTopic.py

    r391 r420  
    1717from Products.CMFPlone.PloneBatch import Batch 
    1818from Products.ATContentTypes.config import TOOLNAME 
     19from StringIO import StringIO 
     20from csv import DictWriter 
     21import csv 
    1922 
    2023qTopic_schema = ATTopicSchema.copy() + Schema(( 
     
    4649          )) 
    4750qTopic_schema["customViewFields"].schemata = "export" 
    48 qTopic_schema["customViewFields"].vocabulary = "getFieldsList" 
     51qTopic_schema["customViewFields"].vocabulary = "listMetaDataFields" 
    4952qTopic_schema["customViewFields"].default=("id","getFullName","getEmail") 
    5053 
     
    7881        return  DisplayList(zip(catalogs, catalogs)) 
    7982 
    80     def getFieldsList(self): 
    81         """ return DisplayList of fields 
    82         """ 
    83         pcatalog = getToolByName( self, self.getCatalog() ) 
    84         available = pcatalog.schema() 
    85         val = [ field 
    86                  for field in available 
    87                  if  field not in IGNORED_FIELDS 
    88                ] 
    89         val.sort(lambda x,y: strcoll(self.translate(x),self.translate( y))) 
    90         return [(i, i, i)for i in val] 
    91  
    9283    security.declareProtected(ChangeTopics, "criteriaByIndexId") 
    9384    def criteriaByIndexId(self, indexId): 
    94         """ get createrias bu index """ 
     85        """ get createrias by index """ 
    9586        catalog_tool = getToolByName(self, self.getCatalog()) 
    9687        indexObj = catalog_tool.Indexes[indexId] 
     
    114105            allowed = DisplayList(flat) 
    115106        return allowed 
    116     """ 
    117     security.declareProtected(ChangeTopics, "listFields") 
    118     def listFields(self): 
    119         pcatalog = getToolByName( self, self.getCatalog() ) 
    120         available = pcatalog.indexes() 
    121         val = [ field 
    122                  for field in available 
    123                  if  field not in IGNORED_FIELDS 
    124                ] 
    125         val.sort(lambda x,y: strcoll(self.translate(x),self.translate( y))) 
    126         return [(i, i, i)for i in val] 
    127      """ 
     107 
    128108    security.declareProtected(ChangeTopics, "listFields") 
    129109    def listFields(self): 
     
    202182        return results 
    203183 
     184    def toCSV(self, fields, data): 
     185        dialect = csv.excel() 
     186        dialect.delimiter = self.getDelimiter() 
     187        buffer = StringIO() 
     188        writer = DictWriter(buffer, fieldnames=fields, dialect=dialect) 
     189        if self.getShowHeader(): 
     190            writer.writerow(dict(zip(fields, fields))) 
     191        writer.writerows(data) 
     192        return buffer.getvalue() 
    204193 
    205194 
     
    210199    """ 
    211200    actions = [] 
     201    fti['allowed_content_types'] = ('qTopic',) 
     202    fti['filter_content_types'] = 1 
    212203    for action in fti["actions"]: 
    213204        if action["id"] == "folderlisting": 
Note: See TracChangeset for help on using the changeset viewer.