[Zope] Re: Function reindexObject()
Thanks ;) but it's no really what I want sorry I work like that : __ |ZMI(zope 2.7)| | | |Product : Document, my_product...| Export script | |-- A file with all data |_|of product (text) | | | Import script | |ZMI(zope2.9) |--- |Product : Document,.. | (reindexObject) | | |__| So, the export script copy all data of a product in a text file (whit accessor : getID,etTitle, getText...). Each line of this file is the datas of a product, next lines are other products. The import script run very well, I transform each line of the text file to a correspondant product as zope2.7. But I want put each new product in the same repertory as zope 2.7. So how say to each product in my import script where it must be copy. This import script: - id = self.generateUniqueId('J_product') self.invokeFactory('J_product', id) mct = getattr(self, id) mct.setTitle(row[1]) mct.setJ_product_descriptif(row[2]) mct.setJ_product_web(row[3]) ## add images ## im = recup_image(mesimages,compteur,) if im != 'no_image': mct.setJ_product_image(im) self.portal_workflow.doActionFor(mct,publish, comment=) self.reindexObject() My subject is reindexObject because I think it's this function that put the new Object (product) in ZMI. I don't know :s Maybe I should make a line like that : mct.setDirectory(/SITES/plone_mySite/repertory1/) repertory1 is where I want put the object (I have in my text file generated with export script, the url of each product). So, It's nothing if nobody understand ;) but I would like. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Function reindexObject()
Maybe I can cut and paste each product(object) from /SITES/Plone_site/ to /SITES/Plone_site/goodDirectory But I don't find how cut and paste an object in zope with a python script. Could you help me :) Tahnks Julian ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: Function reindexObject()
The import script run very well, I transform each line of the text file to a correspondant product as zope2.7. But I want put each new product in the same repertory as zope 2.7. So how say to each product in my import script where it must be copy. Why don't you just export object path along with it's data? use |getPhysicalPath() for example. Take a look at http://plope.com/Books/2_7Edition/AppendixB.stx#2-396 for description. Also consider use of restrictedTraverse to get access to object that you will add newly created objects to (during import). Sth like: container = self.|restrictedTraverse('/SITES/plone_mySite/repertory1/) container.invokeFactory Or something like that. My subject is reindexObject because I think it's this function that put the new Object (product) in ZMI. I don't know :s AFAIK reindexObject is used to reindex object in Catalog. invokeFactory puts new object of the specific type to ZMI. -- Maciej Wisniowski ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Function reindexObject()
Very thanks !!! :) It's exactly the good method, thanks Julian ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Function reindexObject()
I want rebuil all product in zope2.9 in the same directory as zope 2.7. I have the same structure for zope 2.7 and zope 2.9. But where is the problem? What are 'products' for you and what do you mean by rebuild? Where are folders like /SITES/plone_mySite/? Is this filesystem path or path in your ZODB? What are your scripts? External methods? In fact my scripts are external methods. For me a product is a document, a file and my own product (a product is made with a schema.py...). The folder /SITES/plone_mySite/ is in my ZMI (http://zope.mop.com:75473/manage). My problem is I want add the product in my new ZMI(zope2.9) in the same directory as old ZMI (zope2.7). At this time all products are added in /SITES/plone_mySite/... I hope it's more comprehensible. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: Function reindexObject()
julian, on 2007-05-30: I want rebuil all product in zope2.9 in the same directory as zope 2.7. I have the same structure for zope 2.7 and zope 2.9. But where is the problem? What are 'products' for you and what do you mean by rebuild? Where are folders like /SITES/plone_mySite/? Is this filesystem path or path in your ZODB? What are your scripts? External methods? In fact my scripts are external methods. For me a product is a document, a file and my own product (a product is made with a schema.py...). The folder /SITES/plone_mySite/ is in my ZMI (http://zope.mop.com:75473/manage). My problem is I want add the product in my new ZMI(zope2.9) in the same directory as old ZMI (zope2.7). At this time all products are added in /SITES/plone_mySite/... I hope it's more comprehensible. Well, at least I do not know what this would have to do with the subject of your post: reindexObject. But anyway, it sounds like your imported content is ending up in folder A and you want it in folder B instead. Then the easiest seems to do one of the following manually in the ZMI: - rename folder A to folder B or - create folder B and move the imported contents of folder A into folder B But I think I misunderstand you, sorry. -- Maurits van Rees | http://maurits.vanrees.org/ [NL] Work | http://zestsoftware.nl/ Do not worry about your difficulties in computers, I can assure you mine are still greater. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )