Changeset 307

Show
Ignore:
Timestamp:
01/31/08 06:25:04 (11 months ago)
Author:
andy
Message:

Current developments in line with plumi 0.2 rc4 process

Location:
EngagePlumiSkin/trunk
Files:
4 modified

Legend:

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

    r286 r307  
    1515from Products import EngagePlumiSkin 
    1616from Products.EngagePlumiSkin import skin_globals 
     17from Products.EngagePlumiSkin.config import USER 
     18 
    1719 
    1820from cStringIO import StringIO 
     
    3335skinFolders = plumi_skin_folders + plumi_overrides 
    3436 
    35 #leave as Plone Default til now - customise your own skin in here. 
    36 #ie these skin setup functions are not called below 
     37#New skin name 
    3738skinName = 'EngagePlumiSkin' 
     39#Base skin is PlumiSkin 
    3840baseSkin = 'PlumiSkin' 
     41 
     42#this is a superflous function, guarateened to introduce bugs 
     43#but the install process is hideous 
     44#anyway, copied from PlumiSkin (called there installUser) 
     45def reinstallEngageMediaUser(self,out): 
     46    """We create a user for EngageMedia 
     47    It will first try to delete the user with the same id 
     48    and then register a new one with all the infos. 
     49    Read config.py for more informations 
     50    """ 
     51    mt = getToolByName(self,'portal_membership') 
     52    # If you are going to have an installed password, at least make it pseduo-random 
     53    password = md5.md5(str(time.time())).hexdigest()[:12] 
     54 
     55    if mt.getMemberById(USER['id']) is None: 
     56        mt.addMember(USER['id'], password, ['Member','Manager'], []) 
     57    member = mt.getMemberById(USER['id']) 
     58    member.setMemberProperties({'fullname': USER['fullname'], 
     59                                'email': USER['email'], 
     60                                'last_login_time': DateTime('2006-06-01'),}) 
     61 
     62    #We need to reclaim 'latestvideos' 'news' 'events' 'featured-videos' 'news_and_events' 
     63    #  
     64    items = ['latestvideos', 'news', 'events', 'featured-videos', 'news_and_events'] 
     65    for i in items: 
     66        obj = getattr(self,i,None) 
     67        if obj is not None: 
     68                publishObjectandOwnership(self,obj,USER['id']) 
     69 
     70    # Checks for Taxonomy objects installed by ATVideo (ATEngageVideo) 
     71    # take ownership of them by the Plumi user, update layouts 
     72    # 
     73    from Products.ATVideo.config import GENRE_FOLDER, CATEGORIES_FOLDER, COUNTRIES_FOLDER, SUBMISSIONS_FOLDER, TOPLEVEL_FOLDER 
     74    from zLOG import LOG, INFO 
     75 
     76    #thats to remind us of this evil we face 
     77    if hasattr(self,TOPLEVEL_FOLDER): 
     78        out.write('Changing ownership of taxonomy folder and sub-folders!\n') 
     79        toplvl_fldr = getattr(self,TOPLEVEL_FOLDER) 
     80        publishObjectandOwnership(self, toplvl_fldr ,USER['id']) 
     81        idstochange = [  GENRE_FOLDER, CATEGORIES_FOLDER, COUNTRIES_FOLDER, SUBMISSIONS_FOLDER ] 
     82        for x in idstochange: 
     83            obj = getattr(toplvl_fldr,x,None) 
     84            if obj is not None: 
     85                LOG('EngagePlumiSkin Installer',INFO,' about to change %s ' % obj.Title()) 
     86                #change ownership of smart folder 
     87                publishObjectandOwnership(self,obj,USER['id']) 
     88                #update the children objects too 
     89                ids_to_update = [ sub_obj for sub_obj in obj.objectIds() ] 
     90                for y in ids_to_update: 
     91                        sub_obj = getattr(obj,y) 
     92                        LOG('EngagePlumiSkin Installer',INFO,' about to change  %s ' % sub_obj.Title()) 
     93                        publishObjectandOwnership(self,sub_obj,USER['id']) 
     94                        #update the layout  
     95                        sub_obj.setLayout('video_listing_view') 
     96    else: 
     97        out.write('No top level taxonomy folder found!\n') 
     98 
     99#This is copied from PlumiSkin also 
     100def publishObjectandOwnership(self, obj,user_id): 
     101    """This method sets the given user as creator of the 
     102    given object. Then, it tries to trigger the workflow 
     103    transition to publish it. 
     104    """ 
     105    obj.setCreators(user_id) 
     106    self.plone_utils.changeOwnershipOf(obj, user_id, 1) 
     107 
     108    try: 
     109        # Try to publish it straight away 
     110        workflow = getToolByName(self,'portal_workflow') 
     111        workflow.doActionFor(obj, 'publish') 
     112    except WorkflowException: 
     113        pass 
     114 
     115 
    39116 
    40117def setupSkin (self, out): 
     
    203280 
    204281    setupSkin (self, out) 
     282    reinstallEngageMediaUser(self,out) 
    205283    updateSlots(self,out) 
    206284    changePloneLayout(self, out) 
  • EngagePlumiSkin/trunk/config.py

    r303 r307  
    5858                'qPloneComments'] 
    5959 
    60 USER = dict(id = "Plumi", 
    61             fullname = "Plumi", 
    62             email = "contact@plumi.org.yourdomain") 
     60USER = dict(id = "EngageMedia", 
     61            fullname = "EngageMedia", 
     62            email = "contact@engagemedia.org") 
    6363 
    6464# Default Member folders 
  • EngagePlumiSkin/trunk/skins/engage_plumi_styles/plumi.css.dtml

    r302 r307  
    536536 
    537537.plumi-nice-description { 
    538   font-size: 90%; 
    539   color: #222; 
     538  font-size: 95%; 
     539  color: black; 
    540540  margin: 0.5em 0; 
    541541  width: auto; 
     
    761761} 
    762762 
     763.featured-item-description { 
     764    font-size: 95%; 
     765} 
     766 
    763767.videos-listing h4 { 
    764768  font-weight: bold; 
     
    871875} 
    872876 
     877#portal-blurb { 
     878  position: absolute; 
     879  width: 100%; 
     880  color: #444; 
     881  font-size: 100%; 
     882  margin: 85px 0 0 115px; 
     883} 
     884 
     885#content #region-content #featured-front-page { 
     886  margin-top: -2em; 
     887} 
     888 
     889#featured-news-events dt.featuredHeader a, 
     890#featured-item dt.featuredHeader a { 
     891  font-weight: normal; 
     892} 
     893 
    873894/* </dtml-with> */ 
  • EngagePlumiSkin/trunk/version.txt

    r299 r307  
    1 1.0 
     11.01 
    22