[CPS-devel] transtyping documents to folderish documents

Jean-Marc Orliaguet jmo at ita.chalmers.se
Fri Jun 2 15:12:21 CEST 2006


Jean-Marc Orliaguet wrote:
> Julien Anguenot wrote:
>> 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.
>>
>>   

sorry, I sent the one that didn't work. here is the correct one.

ciao.
/JM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: upgrade.py
Type: text/x-python
Size: 1588 bytes
Desc: not available
Url : http://lists.nuxeo.com/pipermail/cps-devel/attachments/20060602/4acaee2f/upgrade.py


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.