erp5-base18
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Erp5-base18]Problem with base18 product


From: Peter Funk
Subject: Re: [Erp5-base18]Problem with base18 product
Date: Tue, 13 Aug 2002 10:04:33 +0200 (CEST)

Hi,

Pierre Gumy:
> Hello,
> 
> I need to build a zope-cmf web site with multilingual content, and I just 
> found Base18 product, which seems interesting.

Now we are at least two of us. ;-)
Last week I've done nearly the same:

> I downloaded it and followed the installation instructions:
> - install cmf, localizer and base18 products
> - patch localizer
> - imports of the 2 .zexpr
> - put the extension file in my extensions folder
> 
> After these steps, all seems to be all right: all my products are correctly 
> installed and are available through the ZMI.
> 
> BUT when I attempt to do the last step - run the external method 
> migrate_content - it doesn't work, and I have the following error message:
[...]

What version of CMF?  I've CMF-1.3 and ran into the problem, that 
a method from CMF changed its API from CMF-1.2 to CMF-1.3.  
Instead of going back to CMF-1.2 I hacked and applied a patch
to migrate_content and wrote the following EMail:
---- snip ----
To: address@hidden
Date: Wed, 7 Aug 2002 08:24:37 +0200 (CEST)

Hi Jean-Paul Smets,

yesterday I stumbled over your exciting work (the Base18 product for Zope)
and downloaded it to play around with it.  

I've tried it here on my notebook together with Zope-2.5.1 and CMF-1.3beta1.

Due to this I noticed a API change in CMF which affects the operation of
    erp5/Base18/Extensions/MigrateContent.py
The API of the method manage_addTypeInformation() of the class TypesTool 
has changed between CMF-1.2 and CMF-1.3: This method now has another 
formal parameter called 'add_meta_type', which (as far as my very limited 
understanding of CMF goes :-( ) should be 'FactoryTypeInformation.meta_type' 
from CMFCore/TypesTool.py itself.  Don't ask me why.  

To get around my problem I hacked the following patch into 'Base18'.
Please have a look at it:
------------------------------------------
--- MigrateContent.py.orig      Wed Aug  7 08:05:49 2002
+++ MigrateContent.py   Wed Aug  7 08:11:03 2002
@@ -39,6 +39,7 @@
 import Products.CMFDefault.DiscussionItem
 import Products.CMFDefault.Favorite
 import Products.CMFCore.PortalFolder
+from Products.CMFCore.TypesTool import FactoryTypeInformation
 
 # Destination
 import Products.Base18.NewsItem
@@ -142,7 +143,15 @@
     for oid in ptlist:
         try: pt.manage_delObjects((oid,))
         except: pass
-        pt.manage_addTypeInformation(id=oid,typeinfo_name="Base18: Base18 %s" %
+        try:
+            pt.manage_addTypeInformation(id=oid,
+                   typeinfo_name="Base18: Base18 %s" % oid)
+        except TypeError:
+            pt.manage_addTypeInformation(
+                   add_meta_type=FactoryTypeInformation.meta_type,
+                   id=oid,
+                   typeinfo_name="Base18: Base18 %s" % oid)
+
     # Add Skin
     try:
         from Products.CMFCore.DirectoryView import createDirectoryView
------------------------------------------

With this patch the external method 'migrate_content' works successfully.


---- snap ----

Hope this helps.

Regards, Peter
-- 
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen, Germany)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]