Changeset 1316


Ignore:
Timestamp:
01/29/07 17:50:22 (13 years ago)
Author:
jukka
Message:

Closed #1070, spent 8h. Quickinstaller should be able to do the job. With LeMill.net content it will take a while, but not ginormously, 20-30min.

FROM NOW ON USE LARGESECTIONFOLDER for all development. SectionFolder? will be removed after few version cycles.

It is sweet how quick LargeContentFolder? is compared to previous.

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ConfigurationMethods.py

    r1295 r1316  
    134134    for item in SECTIONS: 
    135135        # Create folder 
     136          
    136137        if item in SECTION_FOLDER_TYPES: 
    137             addObject(portal,item.lower(),SECTION_FOLDER_TYPES[item],item) 
     138            if not hasattr(portal, item.lower()): 
     139                addObject(portal,item.lower(),SECTION_FOLDER_TYPES[item],item) 
    138140            folder = getattr(portal,item.lower()) 
    139141            folder.manage_permission(ADD_CONTENT_PERMISSION, ('Member',), acquire=1)  
  • trunk/Extensions/Install.py

    r1285 r1316  
    2222from Products.Archetypes.Extensions.utils import install_subskin, installTypes 
    2323from Products.Archetypes.public import listTypes 
     24from Products.CMFPlone.migrations.migration_util import safeEditProperty 
     25 
    2426 
    2527from StringIO import StringIO 
     
    2729from itertools import chain 
    2830 
    29 from Products.LeMill.config import GLOBALS, PROJECTNAME, MEMBER_PROPERTIES, MATERIAL_TYPES, CONTENT_TYPES, TOOLS_TYPES, ACTIVITY_TYPES, COMMUNITY_TYPES 
     31from Products.LeMill.config import * 
    3032from Products.LeMill.Resources import Resource 
     33from Products.LeMill.SectionFolder import SectionFolder 
    3134 
    3235def install(self): 
     
    687690        print >>out,"Migration completed." 
    688691 
     692        if old<='1.6.0': 
     693            print >>out, "Starting migration from 1.6" 
     694            print >>out, "Removing strange local role bug" 
     695            for x in self.content.objectValues(MATERIAL_TYPES): 
     696                keys= self.acl_users._getAllLocalRoles(x).keys() 
     697                for k in keys: 
     698                    if isinstance(k, tuple): 
     699                        print >>out, 'Faulty item: %s has key %s in local roles' % (x.getId(), k) 
     700                        x.manage_delLocalRoles((k,))                 
     701 
     702            print >>out, "Moving stuff from Folders to Large Folders, this will take a while" 
     703 
     704            for (folder_old, new_type) in [(self.content, 'LargeContentFolder'), (self.activities, 'LargeActivityFolder'), (self.tools, 'LargeToolFolder'), (self.community, 'LargeCommunityFolder')]: 
     705                if isinstance(folder_old, SectionFolder): 
     706                    folder_id=folder_old.getId() 
     707                    print >>out, "Cut-pasting objects from %s to Large version of folder" % folder_id 
     708                    self.manage_renameObject(folder_id,folder_id+'_old') 
     709                    self.invokeFactory(id=folder_id,type_name=new_type) 
     710                    folder_new= getattr(self, folder_id) 
     711                    try: 
     712                        folder_old._delObject('syndication_information') 
     713                    except: 
     714                        print >>out, 'no syndication_information here' 
     715                     
     716                    ### Set new folder properties ### 
     717                    safeEditProperty(folder_new, 
     718                        key='left_slots',  
     719                        value=folder_old.left_slots, 
     720                        data_type='lines')  
     721                    folder_new.setTitle(folder_old.title) 
     722                    if folder_id=='community':                
     723                        folder_new.setCollaboration_proposals(folder_old.getCollaboration_proposals()) 
     724                    folder_new.manage_permission(ADD_CONTENT_PERMISSION, ('Member',), acquire=1)  
     725                    folder_new.manage_permission(LIST_FOLDER_CONTENTS, ('Member',), acquire=1) 
     726                    folder_new.manage_permission(ADD_TOPICS, ('Member',), acquire=1) 
     727                    ### End setting new folder properties ###                 
     728                     
     729                    objects=[o.getId() for o in folder_old.objectValues()] 
     730                     
     731                    cb=folder_old.manage_cutObjects(objects) ## CUT 
     732                    folder_new.manage_pasteObjects(cb) ## PASTE 
     733                     
     734                    self._delObject(folder_old.getId()) ## DELETE FOLDER 
     735                else: 
     736                    print >>out, 'Section %s is already large folder' % folder_old.getId() 
     737            print >>out, "Migration from 1.6 complete" 
     738             
     739 
    689740 
    690741def uninstall(self): 
  • trunk/SectionFolder.py

    r1315 r1316  
    1717# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    1818 
     19# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     20#  
     21# DEPRECATED, USE LARGESECTIONFOLDER INSTEAD  !!!!!! 
     22#  
     23# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     24 
    1925from config import * 
    2026from Products.Archetypes.public import * 
     
    4046)) 
    4147 
     48# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     49#  
     50# DEPRECATED, USE LARGESECTIONFOLDER INSTEAD  !!!!!! 
     51#  
     52# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
    4253 
    4354 
     
    741752    meta_type = "Content Folder"  
    742753 
    743     allowed_content_types = CONTENT_TYPES +('Topic',) 
     754    allowed_content_types = CONTENT_TYPES +('Topic','Redirector') 
    744755    default_view = ('lemill_content_view') 
    745756    filter_content_types = True 
     
    839850    meta_type = "Activity Folder" 
    840851 
    841     allowed_content_types = ('Activity','KB', 'Topic') 
     852    allowed_content_types = ('Activity','KB', 'Topic','Redirector') 
    842853    default_view = ('lemill_activities_view') 
    843854    filter_content_types = True 
     
    853864    meta_type = "Tool Folder" 
    854865 
    855     allowed_content_types = ('Tool', 'Topic') 
     866    allowed_content_types = ('Tool', 'Topic','Redirector') 
    856867    default_view = ('lemill_tools_view') 
    857868    filter_content_types = True 
     
    868879    meta_type = "Community Folder" 
    869880 
    870     allowed_content_types = ('Topic',) 
     881    allowed_content_types = ('Topic','Redirector') 
    871882    default_view = ('lemill_community_view') 
    872883    filter_content_types = True 
  • trunk/__init__.py

    r947 r1316  
    3939 
    4040# Our own content types 
    41 import Piece, Material, SectionFolder, Story, Activity, Tool, Collection, MemberFolder, GroupBlog, BlogPost 
     41import Piece, Material, SectionFolder, LargeSectionFolder, Story, Activity, Tool, Collection, MemberFolder, GroupBlog, BlogPost 
    4242import PresentationMaterial, MultimediaMaterial 
    4343import Resources 
  • trunk/config.py

    r1315 r1316  
    133133 
    134134SECTION_FOLDER_TYPES = { 
    135     'Activities':'ActivityFolder', 
    136     'Tools':'ToolFolder', 
    137     'Content':'ContentFolder', 
    138     'Community':'CommunityFolder' 
     135    'Activities':'LargeActivityFolder', 
     136    'Tools':'LargeToolFolder', 
     137    'Content':'LargeContentFolder', 
     138    'Community':'LargeCommunityFolder' 
    139139} 
    140140 
  • trunk/version.txt

    r1291 r1316  
    1 1.6 
     11.6.1 
Note: See TracChangeset for help on using the changeset viewer.