-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/master Date: 2015-06-27T10:40:10+02:00 Author: Tom Gross (tomgross) <[email protected]> Commit: plone/plone.app.upgrade@3f3324d provide cmfdefault stubs for migration old Plone sites Files changed: M plone/app/upgrade/__init__.py M plone/app/upgrade/bbb.py Repository: plone.app.upgrade Branch: refs/heads/master Date: 2015-06-27T10:47:33+02:00 Author: Tom Gross (tomgross) <[email protected]> Commit: plone/plone.app.upgrade@0bded19 remove unused bbb tool Files changed: M plone/app/upgrade/bbb.py Repository: plone.app.upgrade Branch: refs/heads/master Date: 2015-06-27T20:44:41+02:00 Author: Timo Stollenwerk (tisto) <[email protected]> Commit: plone/plone.app.upgrade@2cf8c76 Merge pull request #35 from plone/tomgross-nocmfdefault Provide cmfdefault stubs for migration old Plone sites Files changed: M plone/app/upgrade/__init__.py M plone/app/upgrade/bbb.py
- Loading branch information
Showing
1 changed file
with
144 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,157 @@ | ||
Repository: Products.CMFPlone | ||
Repository: plone.app.upgrade | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2015-06-26T14:32:03-05:00 | ||
Author: vangheem (vangheem) <vangheem@gmail.com> | ||
Commit: https://github.com/plone/Products.CMFPlone/commit/b807876e3e7185a024f3d1f5e18fca3685848a41 | ||
Date: 2015-06-27T10:40:10+02:00 | ||
Author: Tom Gross (tomgross) <itconsense@gmail.com> | ||
Commit: https://github.com/plone/plone.app.upgrade/commit/3f3324d6d1f7a1a5e3d68190a0d2cdeea1b90397 | ||
|
||
better formatting of config.js | ||
provide cmfdefault stubs for migration old Plone sites | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M Products/CMFPlone/resources/browser/configjs.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 84dbe13..d16f58a 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -8,6 +8,9 @@ Changelog | ||
5.0b3 (unreleased) | ||
------------------ | ||
M plone/app/upgrade/__init__.py | ||
M plone/app/upgrade/bbb.py | ||
|
||
diff --git a/plone/app/upgrade/__init__.py b/plone/app/upgrade/__init__.py | ||
index cf0d7ca..23c5cc0 100644 | ||
--- a/plone/app/upgrade/__init__.py | ||
+++ b/plone/app/upgrade/__init__.py | ||
@@ -118,6 +118,19 @@ def getNonInstallableProducts(self): | ||
alias_module('Products.CMFPlone.MetadataTool', metadata) | ||
|
||
+- better formatting of config.js | ||
+ [vangheem] | ||
try: | ||
+ import Products.CMFDefault.MetadataTool | ||
+ Products.CMFDefault.MetadataTool # pyflakes | ||
+except ImportError: | ||
+ from Products.ATContentTypes.tool import metadata | ||
+ sys.modules['Products.CMFDefault.MetadataTool'] = metadata | ||
+ | ||
- Upload pattern uses the baseUrl to compute the upload URL, so this should | ||
always be the site root and not the current context | ||
[frapell] | ||
diff --git a/Products/CMFPlone/resources/browser/configjs.py b/Products/CMFPlone/resources/browser/configjs.py | ||
index 013e660..753d764 100644 | ||
--- a/Products/CMFPlone/resources/browser/configjs.py | ||
+++ b/Products/CMFPlone/resources/browser/configjs.py | ||
@@ -4,17 +4,10 @@ | ||
from zope.component import getMultiAdapter | ||
from zope.component import getUtility | ||
import re | ||
+import json | ||
|
||
|
||
-configjs = """requirejs.config({ | ||
- baseUrl: '%s', | ||
- paths: %s, | ||
- shim: %s, | ||
- optimize: 'uglify', | ||
- wrapShim: true | ||
-}); | ||
- | ||
-""" | ||
+configjs = """requirejs.config(%s);""" | ||
|
||
|
||
class RequireJsView(BrowserView): | ||
@@ -69,19 +62,18 @@ def get_requirejs_config(self): | ||
paths[name + '-url'] = src | ||
return (self.base_url(), paths, shims) | ||
+try: | ||
+ import Products.CMFDefault.SyndicationInfo | ||
+ Products.CMFDefault.SyndicationInfo # pyflakes | ||
+except ImportError: | ||
+ sys.modules['Products.CMFDefault.SyndicationInfo'] = bbb | ||
+ | ||
+try: | ||
from Products.PloneLanguageTool import interfaces | ||
except ImportError: | ||
alias_module('Products.PloneLanguageTool.interfaces', bbb) | ||
@@ -130,4 +143,4 @@ def getNonInstallableProducts(self): | ||
from Products.CMFPlacefulWorkflow.interfaces import portal_placeful_workflow | ||
except: | ||
from Products.CMFPlacefulWorkflow import interfaces | ||
- alias_module('Products.CMFPlacefulWorkflow.interfaces.portal_placeful_workflow', interfaces) | ||
\ No newline at end of file | ||
+ alias_module('Products.CMFPlacefulWorkflow.interfaces.portal_placeful_workflow', interfaces) | ||
diff --git a/plone/app/upgrade/bbb.py b/plone/app/upgrade/bbb.py | ||
index 1d5946b..a0c2f45 100644 | ||
--- a/plone/app/upgrade/bbb.py | ||
+++ b/plone/app/upgrade/bbb.py | ||
@@ -8,6 +8,7 @@ | ||
DiscussionTool = SimpleItem | ||
InterfaceTool = SimpleItem | ||
SyndicationTool = SimpleItem | ||
+SyndicationInfo = SimpleItem | ||
UndoTool = SimpleItem | ||
TinyMCE = SimpleItem | ||
|
||
- def get_requirejs_config_str(self): | ||
- base, paths, shims = self.get_requirejs_config() | ||
- shims_str = str(shims).replace('\'deps\'', 'deps').replace( | ||
- '\'exports\'', 'exports').replace( | ||
- '\'init\': \'', 'init: ').replace('}\'}', '}}') | ||
- return (self.base_url(), str(paths), shims_str) | ||
- | ||
@@ -64,3 +65,8 @@ def removeActionIcon(self, category, action_id): | ||
icons.remove(icon) | ||
del self._lookup[(category, action_id)] | ||
self._icons = tuple(icons) | ||
+ | ||
+# BBB from CMFDefault | ||
+class SyndicationInformation(SimpleItem): | ||
+ id='syndication_information' | ||
+ meta_type='SyndicationInformation' | ||
|
||
|
||
Repository: plone.app.upgrade | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2015-06-27T10:47:33+02:00 | ||
Author: Tom Gross (tomgross) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.upgrade/commit/0bded19e33cd1d97df2eab4ab4e7701c91231405 | ||
|
||
remove unused bbb tool | ||
|
||
Files changed: | ||
M plone/app/upgrade/bbb.py | ||
|
||
diff --git a/plone/app/upgrade/bbb.py b/plone/app/upgrade/bbb.py | ||
index a0c2f45..287de1c 100644 | ||
--- a/plone/app/upgrade/bbb.py | ||
+++ b/plone/app/upgrade/bbb.py | ||
@@ -8,7 +8,6 @@ | ||
DiscussionTool = SimpleItem | ||
InterfaceTool = SimpleItem | ||
SyndicationTool = SimpleItem | ||
-SyndicationInfo = SimpleItem | ||
UndoTool = SimpleItem | ||
TinyMCE = SimpleItem | ||
|
||
class ConfigJsView(RequireJsView): | ||
""" config.js for requirejs for script rendering. """ | ||
|
||
|
||
Repository: plone.app.upgrade | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2015-06-27T20:44:41+02:00 | ||
Author: Timo Stollenwerk (tisto) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.upgrade/commit/2cf8c76031190cc4b7da3a254c09e9028bb516f0 | ||
|
||
Merge pull request #35 from plone/tomgross-nocmfdefault | ||
|
||
Provide cmfdefault stubs for migration old Plone sites | ||
|
||
Files changed: | ||
M plone/app/upgrade/__init__.py | ||
M plone/app/upgrade/bbb.py | ||
|
||
diff --git a/plone/app/upgrade/__init__.py b/plone/app/upgrade/__init__.py | ||
index cf0d7ca..23c5cc0 100644 | ||
--- a/plone/app/upgrade/__init__.py | ||
+++ b/plone/app/upgrade/__init__.py | ||
@@ -118,6 +118,19 @@ def getNonInstallableProducts(self): | ||
alias_module('Products.CMFPlone.MetadataTool', metadata) | ||
|
||
def __call__(self): | ||
- (baseUrl, paths, shims) = self.get_requirejs_config_str() | ||
+ (baseUrl, paths, shims) = self.get_requirejs_config() | ||
self.request.response.setHeader("Content-Type", | ||
"application/javascript") | ||
- return configjs % (baseUrl, paths, shims) | ||
+ return configjs % json.dumps({ | ||
+ 'baseUrl': baseUrl, | ||
+ 'paths': paths, | ||
+ 'shim': shims, | ||
+ 'optimize': 'uglify', | ||
+ 'wrapShim': True | ||
+ }, indent=4) | ||
try: | ||
+ import Products.CMFDefault.MetadataTool | ||
+ Products.CMFDefault.MetadataTool # pyflakes | ||
+except ImportError: | ||
+ from Products.ATContentTypes.tool import metadata | ||
+ sys.modules['Products.CMFDefault.MetadataTool'] = metadata | ||
+ | ||
+try: | ||
+ import Products.CMFDefault.SyndicationInfo | ||
+ Products.CMFDefault.SyndicationInfo # pyflakes | ||
+except ImportError: | ||
+ sys.modules['Products.CMFDefault.SyndicationInfo'] = bbb | ||
+ | ||
+try: | ||
from Products.PloneLanguageTool import interfaces | ||
except ImportError: | ||
alias_module('Products.PloneLanguageTool.interfaces', bbb) | ||
@@ -130,4 +143,4 @@ def getNonInstallableProducts(self): | ||
from Products.CMFPlacefulWorkflow.interfaces import portal_placeful_workflow | ||
except: | ||
from Products.CMFPlacefulWorkflow import interfaces | ||
- alias_module('Products.CMFPlacefulWorkflow.interfaces.portal_placeful_workflow', interfaces) | ||
\ No newline at end of file | ||
+ alias_module('Products.CMFPlacefulWorkflow.interfaces.portal_placeful_workflow', interfaces) | ||
diff --git a/plone/app/upgrade/bbb.py b/plone/app/upgrade/bbb.py | ||
index 1d5946b..287de1c 100644 | ||
--- a/plone/app/upgrade/bbb.py | ||
+++ b/plone/app/upgrade/bbb.py | ||
@@ -64,3 +64,8 @@ def removeActionIcon(self, category, action_id): | ||
icons.remove(icon) | ||
del self._lookup[(category, action_id)] | ||
self._icons = tuple(icons) | ||
+ | ||
+# BBB from CMFDefault | ||
+class SyndicationInformation(SimpleItem): | ||
+ id='syndication_information' | ||
+ meta_type='SyndicationInformation' | ||
|
||
|