Salut Jean-Marc,

Jean-Marc Orliaguet wrote:
> I'm about to migrate a couple of documents from "documentish" to
> folderish (FolderishProxyDocument)
> 
> CPS uses isinstance(ProxyFolderishDocument) in some places, so changing
> to portal type to folderish is not enough.
> 
> instances must be changed too.
> 
> the current script does:
> 
>     for brain in brains:
>        ob = brain.getObject()
>        if ob is None:
>            continue
> 
>        if isinstance(ob, ProxyFolderishDocument):
>            continue
> 
>        ob.__class__ = ProxyFolderishDocument
>        ob._p_changed = 1 # trigger persistence
>        ob.proxyChanged()
> 
>        # + some workflow history stuff omitted here
> 
> anything more to think about ?

You may need to update the workflow related annotations on the object as
well and ensure it's compatible with the folferish workflow your objects
are gonna follow after this migration. I guess you will need to update
your workflow associations as well to specify a folderish workflow
instead of the former one.

Keep us posted about the result.

        J.

-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - www.nuxeo.com
CPS Platform - http://www.cps-project.org
Mobile: +33 (0) 6 72 57 57 66

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel

Reply via email to