#2 — Doesn't install with plone 3.1
| State | Tested and confirmed closed |
|---|---|
| Release: | 0.8 |
| Area | Bugs |
| Issue type | Bug |
| Severity | Medium |
| Submitted by | (anonymous) |
| Submitted on | 2008-05-16 |
| Responsible | Lukasz Lakomy |
| Target release: | 0.8 |
Last modified on
2008-05-22
by
Lukasz Lakomy
--- Install.py 2008-05-08 09:03:17.000000000 -0300
+++ /home/walter/reporter_brasil/products/FlashVideo/Extensions/Install.py 2008-05-16 12:07:20.000000000 -0300
@@ -32,23 +32,26 @@
out = StringIO()
portal = getToolByName(self,'portal_url').getPortalObject()
portal_setup = getToolByName(portal, 'portal_setup', None)
-
+
+ # Plone 3.0
+ if hasattr(portal_setup, 'runAllImportStepsFromProfile'):
+ portal_setup.runAllImportStepsFromProfile('profile-FlashVideo:default')
#Plone >= 2.5
- if portal_setup:
+ else:
print >> out, "Installation using Generic Setup"
old_context = portal_setup.getImportContextID()
portal_setup.setImportContext('profile-FlashVideo:default')
portal_setup.runAllImportSteps()
portal_setup.setImportContext(old_context)
#Plone <= 2.1
- else:
+ if not portal_setup:
print >> out, "Ordinary installation"
installFSS(portal, out)
installPloneTypes(portal, out, PROJECTNAME)
install_subskin(portal, out, GLOBALS)
- hideTypesInNavigation(portal, out)
+ hideTypesInNavigation(portal, out)
addViewActions(portal, out)
-
+
print >> out, "Installation completed."
return out.getvalue()
@@ -72,8 +75,8 @@
if t not in actions:
actions.append(t)
site_properties.typesUseViewActionInListings = tuple(actions)
- print >> out, "View actions in listings updated"
-
+ print >> out, "View actions in listings updated"
+
def installFSS(portal, out = None):
"""
Install FileSystemStorage if exists
@@ -83,11 +86,11 @@
portal = portal.getSite()
out = StringIO()
root = portal.getPhysicalRoot()
-
+
#This is necessary tests to work without FSS
Products = root.Control_Panel.Products
portal_quickinstaller=getToolByName(portal, 'portal_quickinstaller', None)
-
+
if 'FileSystemStorage' in Products.objectIds():
if portal_quickinstaller.isProductInstallable('FileSystemStorage'):
if not portal_quickinstaller.isProductInstalled('FileSystemStorage'):
@@ -99,7 +102,7 @@
print >>out, 'FileSystemStorage not installable.'
else:
print >>out, 'FileSystemStorage Product not added.'
-
+
def hideTypesInNavigation(portal, out):
"""
Hide selected types from the navtree
@@ -113,7 +116,7 @@
types_not_to_list.append(t)
navtree_properties._setPropValue('metaTypesNotToList',types_not_to_list)
print >>out, 'Types hidden from navigation: %s'%(", ".join(hidden_list))
-
+
def removeDuplicateActionsInTypes(portal, out = None):
"""
In Plone 3 xml configuraton adds duplicated 'local_roles' action.
@@ -133,11 +136,10 @@
actions_ids = [x.getId() for x in type_actions]
for i in range(len(type_actions)):
action = type_actions[i]
- expr = action.getActionExpression()
+ expr = action.getActionExpression()
if hasattr(expr,'text'):
expr = expr.text
if action.getId() == 'local_roles' and expr == 'string:${object_url}/sharing':
p_type.deleteActions(selections=(actions_ids.index('local_roles'),))
print >>out, "Duplicate 'local_roles' action from '%s' deleted"%(portal_type)
break
-
\ No newline at end of file
+++ /home/walter/reporter_brasil/products/FlashVideo/Extensions/Install.py 2008-05-16 12:07:20.000000000 -0300
@@ -32,23 +32,26 @@
out = StringIO()
portal = getToolByName(self,'portal_url').getPortalObject()
portal_setup = getToolByName(portal, 'portal_setup', None)
-
+
+ # Plone 3.0
+ if hasattr(portal_setup, 'runAllImportStepsFromProfile'):
+ portal_setup.runAllImportStepsFromProfile('profile-FlashVideo:default')
#Plone >= 2.5
- if portal_setup:
+ else:
print >> out, "Installation using Generic Setup"
old_context = portal_setup.getImportContextID()
portal_setup.setImportContext('profile-FlashVideo:default')
portal_setup.runAllImportSteps()
portal_setup.setImportContext(old_context)
#Plone <= 2.1
- else:
+ if not portal_setup:
print >> out, "Ordinary installation"
installFSS(portal, out)
installPloneTypes(portal, out, PROJECTNAME)
install_subskin(portal, out, GLOBALS)
- hideTypesInNavigation(portal, out)
+ hideTypesInNavigation(portal, out)
addViewActions(portal, out)
-
+
print >> out, "Installation completed."
return out.getvalue()
@@ -72,8 +75,8 @@
if t not in actions:
actions.append(t)
site_properties.typesUseViewActionInListings = tuple(actions)
- print >> out, "View actions in listings updated"
-
+ print >> out, "View actions in listings updated"
+
def installFSS(portal, out = None):
"""
Install FileSystemStorage if exists
@@ -83,11 +86,11 @@
portal = portal.getSite()
out = StringIO()
root = portal.getPhysicalRoot()
-
+
#This is necessary tests to work without FSS
Products = root.Control_Panel.Products
portal_quickinstaller=getToolByName(portal, 'portal_quickinstaller', None)
-
+
if 'FileSystemStorage' in Products.objectIds():
if portal_quickinstaller.isProductInstallable('FileSystemStorage'):
if not portal_quickinstaller.isProductInstalled('FileSystemStorage'):
@@ -99,7 +102,7 @@
print >>out, 'FileSystemStorage not installable.'
else:
print >>out, 'FileSystemStorage Product not added.'
-
+
def hideTypesInNavigation(portal, out):
"""
Hide selected types from the navtree
@@ -113,7 +116,7 @@
types_not_to_list.append(t)
navtree_properties._setPropValue('metaTypesNotToList',types_not_to_list)
print >>out, 'Types hidden from navigation: %s'%(", ".join(hidden_list))
-
+
def removeDuplicateActionsInTypes(portal, out = None):
"""
In Plone 3 xml configuraton adds duplicated 'local_roles' action.
@@ -133,11 +136,10 @@
actions_ids = [x.getId() for x in type_actions]
for i in range(len(type_actions)):
action = type_actions[i]
- expr = action.getActionExpression()
+ expr = action.getActionExpression()
if hasattr(expr,'text'):
expr = expr.text
if action.getId() == 'local_roles' and expr == 'string:${object_url}/sharing':
p_type.deleteActions(selections=(actions_ids.index('local_roles'),))
print >>out, "Duplicate 'local_roles' action from '%s' deleted"%(portal_type)
break
-
\ No newline at end of file
- Steps to reproduce:
- Install Plone 3.1 and install the FlashVideo.
Added by
Lukasz Lakomy
on
2008-05-16 16:19
Issue state:
unconfirmed → open
Target release:
None → 0.8
Responsible manager:
(UNASSIGNED) → lukasz
Thanks for reporting and for patch!
This patch doesn't looks nice here :) Can you send on my email lukasz_at_llakomy_dot_com modified Install.py
This patch doesn't looks nice here :) Can you send on my email lukasz_at_llakomy_dot_com modified Install.py
Added by
Lukasz Lakomy
on
2008-05-22 13:26
Issue state:
in-progress → resolved
fixed in release 0.8.1