Changeset 76


Ignore:
Timestamp:
01/18/06 14:39:56 (14 years ago)
Author:
laszlo
Message:

Rename the SyndicatedFolder? to SectionFolder?, and created special folder types for our content types. refs #171 spent 2h

Location:
trunk
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r66 r76  
    101101    for item in SECTIONS: 
    102102        # Create folder 
    103         addObject(portal,item.lower(),'Folder',item) 
     103        if item in SECTION_FOLDER_TYPES: 
     104            addObject(portal,item.lower(),SECTION_FOLDER_TYPES[item],item) 
    104105        # Set up properties for folder 
    105106        if SECTION_PROPERTIES[item]: 
    106107            for property in SECTION_PROPERTIES[item].keys(): 
     108                value=SECTION_PROPERTIES[item][property] 
     109                if type(value) == type(True): 
     110                    dtype='boolean' 
     111                else: 
     112                    dtype='lines'  
    107113                safeEditProperty(obj=getattr(portal,item.lower()), 
    108114                    key=property,  
    109                     value=SECTION_PROPERTIES[item][property], 
    110                     data_type='lines')  
     115                    value=value, 
     116                    data_type=dtype)  
    111117        # Set up tab actions 
    112118        flag = False 
  • trunk/SectionFolder.py

    r75 r76  
    44from Products.CMFCore.utils import getToolByName 
    55 
    6 class SyndicatedFolder(ATFolder): 
    7     """Syndicated Folder""" 
     6class SectionFolder(ATFolder): 
     7    """Section Folder""" 
    88         
    9     archetype_name = "Syndicated Folder" 
     9    archetype_name = "Section Folder" 
     10    meta_type = "Section Folder" 
    1011 
    1112    # Override initializeArchetype to turn on syndication by default 
     
    1920        return ret_val 
    2021         
    21 registerType(SyndicatedFolder, PROJECTNAME) 
     22class ContentFolder(SectionFolder): 
     23 
     24    allowed_content_types = ('Piece', 'Material') 
     25    filter_content_types = True 
     26         
     27class ActivityFolder(SectionFolder): 
     28 
     29    allowed_content_types = () 
     30    filter_content_types = True 
     31     
     32class ToolFolder(SectionFolder): 
     33 
     34    allowed_content_types = () 
     35    filter_content_types = True 
     36 
     37registerType(ContentFolder, PROJECTNAME) 
     38registerType(ActivityFolder, PROJECTNAME) 
     39registerType(ToolFolder, PROJECTNAME) 
  • trunk/__init__.py

    r73 r76  
    1313 
    1414# Our own content types 
    15 import Piece, Material, SyndicatedFolder, Story, Activity, Tool 
     15import Piece, Material, SectionFolder, Story, Activity, Tool 
    1616 
    1717# Our own portal tools 
  • trunk/config.py

    r66 r76  
    2929} 
    3030 
     31SECTION_FOLDER_TYPES = { 
     32    'Activities':'ActivityFolder', 
     33    'Tools':'ToolFolder', 
     34    'Content':'ContentFolder' 
     35} 
     36 
     37 
    3138for section in SECTIONS: 
    3239    if section not in SECTION_PROPERTIES.keys(): 
Note: See TracChangeset for help on using the changeset viewer.