[CPS-devel] transtyping documents to folderish documents

Julien Anguenot ja at nuxeo.com
Fri Jun 2 14:36:38 CEST 2006


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.nuxeo.com/pipermail/cps-devel/attachments/20060602/1a44b033/signature.pgp


More information about the cps-devel mailing list

This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.