Changeset 941
- Timestamp:
- 08/23/07 17:42:43
- Files:
-
- qPloneSkinDump/branches/plone_3.0/skin_template/Extensions/Install.py.old (modified) (2 diffs)
- qPloneSkinDump/branches/plone_3.0/skin_template/Extensions/utils.py (modified) (2 diffs)
- qPloneSkinDump/branches/plone_3.0/skin_template/profiles/default/import_steps.xml (modified) (2 diffs)
- qPloneSkinDump/branches/plone_3.0/skin_template/profiles/default/skins.xml (added)
- qPloneSkinDump/branches/plone_3.0/skin_template/profiles/default/skins_1.xml (deleted)
- qPloneSkinDump/branches/plone_3.0/skin_template/setuphandlers.py (modified) (3 diffs)
- qPloneSkinDump/branches/plone_3.0/utils.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneSkinDump/branches/plone_3.0/skin_template/Extensions/Install.py.old
r935 r941 103 103 portal_js = getToolByName(portal, 'portal_javascripts', None) 104 104 # Get all properies, saving during installation, for uninstalling 105 actual_skin_name = getProperty(pp, 'uninstall_properties', 'q_actual_skin_name',default=SKIN_NAME) 105 106 actual_skin_name = getProperty(pp, 'uninstall_properties', 'q_actual_skin_name',default=SKIN_NAME) # XXX-1 Removed as overintelligence 107 106 108 initial_skin = getProperty(pp, 'uninstall_properties', 'q_default_skin',default="") 107 109 original_css_list = getProperty(pp, 'uninstall_properties', 'q_registered_css') … … 113 115 pp.manage_delObjects(ids=['uninstall_properties',]) 114 116 # Uninstall skin 117 118 # [XXX-1] -> uninstallSkin(skinsTool, SKIN_NAME, initial_skin) 115 119 uninstallSkin(skinsTool, actual_skin_name, initial_skin) 116 120 # Unregister skin's CSS-es from portal_css. Only for Plone 2.1+ qPloneSkinDump/branches/plone_3.0/skin_template/Extensions/utils.py
r935 r941 425 425 pp.addPropertySheet(id='uninstall_properties', title= 'uninstall_properties') 426 426 print >> out, "Created 'portal_properties.uninstall_properties' PropertySheet (UP) for backup purpose" 427 427 return pp.uninstall_properties 428 428 CHECKED_MESSAGE = "The base installation checkings completed." 429 429 … … 447 447 qi.uninstallProducts(products=installed_skin_products) 448 448 449 ################################### 450 ## Prepare UNINSTALL 451 452 def prepareUninstallSkin(portal, pp_up, out): # ?? 453 # Checking for presense SKIN_NAME in portal_skins directory view or among Skin Names 454 skinsTool = getToolByName(portal, 'portal_skins') 455 # Get unique product_skin_name and remember it in case of differ from SKIN_NAME. 456 default_skin = skinsTool.getDefaultSkin() 457 addProperty(pp_up, 'q_default_skin', default_skin, 'string', out) qPloneSkinDump/branches/plone_3.0/skin_template/profiles/default/import_steps.xml
r935 r941 12 12 title="Perform old installation steps (temporary)"> 13 13 <dependency step="toolset"/> 14 <dependency step="skins"/>15 14 <dependency step="cssregistry"/> 16 15 <dependency step="jsregistry"/> … … 18 17 Perform old installation steps (temporary) 19 18 </import-step> 19 20 <import-step id="skins" version="20040630-01" 21 handler="Products.CMFCore.exportimport.skins.importSkinsTool" 22 title="Skins Tool"> 23 <dependency step="toolset"/> 24 <dependency step="%(skin_name)s_old_install"/> 25 Import skins tool's filesystem directory views and skin path definitions. 26 </import-step> 27 28 20 29 </import-steps> qPloneSkinDump/branches/plone_3.0/skin_template/setuphandlers.py
r935 r941 73 73 # Checking base condition for installation 74 74 skinsTool = getToolByName(self, 'portal_skins') 75 # Checking for absence of SKIN_NAME skin in site 76 skin_names = skinsTool.getSkinSelections() 77 if SKIN_NAME in skin_names: 78 raise AttributeError("Installation aborted due to '%%s' skin already present in your site." %% SKIN_NAME) 75 79 # Checking for BASE_SKIN_NAME presenting in portal 76 80 skin_names = skinsTool.getSkinSelections() … … 79 83 # Checking for presenting lower_SKIN_NAME directory in portal skins 80 84 lower_SKIN_NAME = string.lower(SKIN_NAME) 81 if lower_SKIN_NAME in skinsTool.objectIds():82 raise AttributeError("%%s skin layer already exist in portal skins. Installation Impossible." %% lower_SKIN_NAME)85 #if lower_SKIN_NAME in skinsTool.objectIds(): 86 # raise AttributeError("%%s skin layer already exist in portal skins. Installation Impossible." %% lower_SKIN_NAME) 83 87 84 88 #return CHECKED_MESSAGE … … 92 96 portal_js = getToolByName(portal, 'portal_javascripts', None) 93 97 # Make main prepare procedures 94 prepareInstallation(portal, pp, out) 95 pp_up = pp.uninstall_properties 98 pp_up = prepareInstallation(portal, pp, out) # create 'uninstall_properties' propertySheet in portal_properties 96 99 # Install skin 97 installSkin(portal, pp_up, out) 100 #installSkin(portal, pp_up, out) # performed with portal_setup 101 prepareUninstallSkin(portal, pp_up, out) 102 98 103 # Register css resources 99 104 if portal_css and DOES_COSTOMIZE_CSS: qPloneSkinDump/branches/plone_3.0/utils.py
r935 r941 131 131 132 132 return slot_structure 133 134 def buildSkinLayers(context, zmi_base_skin_name): 135 pskins = getToolByName(context,'portal_skins') 136 layers = (pskins.getSkinPath(zmi_base_skin_name) or '').split(',') 137 return "\n".join([' <layer name="%s"/>'%l for l in layers]) 133 138 134 139 def dumpSkin(context, \ … … 278 283 left_slots = right_slots = None 279 284 slot_forming = main_column = None 285 286 # Prepare XML strings for add to skins.xml 287 skin_layers = buildSkinLayers(context, zmi_base_skin_name) 288 280 289 # Copy skin_template to SKIN_PRODUCT directory 281 290 templatePath = ospJoin(products_path, PROJECTNAME, TEMPLATE_PATH) … … 299 308 ,"product_name" : productName \ 300 309 ,"skin_name" : productSkinName \ 310 ,"skin_name_lowercase" : productSkinName.lower() \ 301 311 ,"skin_name_capital" : '%s%s' % (productSkinName[0].upper(), productSkinName[1:]) \ 302 312 ,"product_name_lowercase" : productName.lower() \ … … 304 314 ,"version1" : time.strftime('%Y%m%d') + '-1' \ 305 315 ,"version2" : time.strftime('%Y%m%d') + '-2' \ 306 ,"slot_structure" : str(slots) 307 }316 ,"slot_structure" : str(slots) \ 317 ,"skin_layers" : skin_layers } 308 318 sp_updated_files = ['config.py' \ 309 319 ,'README.txt' \ … … 316 326 ,ospJoin('browser', 'configure.zcml')\ 317 327 ,ospJoin('profiles', 'default', 'import_steps.xml')\ 328 ,ospJoin('profiles', 'default', 'skins.xml')\ 318 329 ,ospJoin('browser', 'configure.zcml') 319 330 ]
