old content import in Plone 3

5 messages Options
Embed this post
Permalink
francoise () old content import in Plone 3
Reply Threaded More More options
Print post
Permalink
Hello,

As I saw a post on content export / import, I posting my current import problem.

I am working on migrating content from a Plone 1 site to a Plone 3 site, i am using pickle instead of ini files as I saw Andreas Jung blog [1] after I succeeded in exporting / importing a few elements with pickle.

As I am a slow-coding person, not well knowing Archetypes, I would like to know how to set the workflow state property of my content objects without executing transitions.

The imported content objects, created by invokeFactory(), are in "private" state and most (if not all) of the imported content objects must be in "published" state.

Thanks for your ideas

[1] http://www.zopyx.de/blog/when-the-plone-migration-fails-doing-content-migration-only/

Thanks to Martin Aspeli for his Professional Plone Development book wich make me discover DocFinderTab and Clouseau
ajung () Re: old content import in Plone 3
Reply Threaded More More options
Print post
Permalink
On 03.07.09 10:31, francoise wrote:
>
>
> As I am a slow-coding person, not well knowing Archetypes, I would like to
> know how to set the workflow state property of my content objects without
> executing transitions.

Why? Using  doActionFor() is the way to go.

-aj

[lists.vcf]

begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[hidden email]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard



_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
francoise () Re: old content import in Plone 3
Reply Threaded More More options
Print post
Permalink
evtObj is the object created by invokeFactory

So I would to do the following :

<code>
        review_state = workflow_tool.getInfoFor(evtObj, 'review_state')

        if (review_state == "private") :
            # try perform 'archive' transition
            try:
                workflow_tool.doActionFor(evtObj, 'submit')
                workflow_tool.doActionFor(evtObj, 'publish')
            except WorkflowException:
                # Have to log the pb
</code>

Thank you

Andreas Jung-5 wrote:
Why? Using  doActionFor() is the way to go.

-aj
Raphael Ritz () Re: old content import in Plone 3
Reply Threaded More More options
Print post
Permalink
In reply to this post by francoise
francoise wrote:

> Hello,
>
> As I saw a post on content export / import, I posting my current import
> problem.
>
> I am working on migrating content from a Plone 1 site to a Plone 3 site, i
> am using pickle instead of ini files as I saw Andreas Jung blog [1] after I
> succeeded in exporting / importing a few elements with pickle.
>
> As I am a slow-coding person, not well knowing Archetypes, I would like to
> know how to set the workflow state property of my content objects without
> executing transitions.
>
> The imported content objects, created by invokeFactory(), are in "private"
> state and most (if not all) of the imported content objects must be in
> "published" state.

If you really, absolutely have to avoid transitions
or if you need to preserve WF history you can "manually"
manipulate the workflow_history. Copy it over from the
old objects or simply make sure that the first element
in the history reflects the published state.

Note, however, that you are on your own here as this is
not how it is meant to be dealt with. To stick to the
proper API do what Andreas suggested.

Raphael


>
> Thanks for your ideas
>
> [1]
> http://www.zopyx.de/blog/when-the-plone-migration-fails-doing-content-migration-only/
>
> Thanks to Martin Aspeli for his Professional Plone Development book wich
> make me discover DocFinderTab and Clouseau


_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers
ajung () Re: Re: old content import in Plone 3
Reply Threaded More More options
Print post
Permalink
On 03.07.09 10:53, Raphael Ritz wrote:

> francoise wrote:
>> Hello,
>>
>> As I saw a post on content export / import, I posting my current import
>> problem.
>>
>> I am working on migrating content from a Plone 1 site to a Plone 3
>> site, i
>> am using pickle instead of ini files as I saw Andreas Jung blog [1]
>> after I
>> succeeded in exporting / importing a few elements with pickle.
>>
>> As I am a slow-coding person, not well knowing Archetypes, I would
>> like to
>> know how to set the workflow state property of my content objects
>> without
>> executing transitions.
>>
>> The imported content objects, created by invokeFactory(), are in
>> "private"
>> state and most (if not all) of the imported content objects must be in
>> "published" state.
>
> If you really, absolutely have to avoid transitions
> or if you need to preserve WF history you can "manually"
> manipulate the workflow_history. Copy it over from the
> old objects or simply make sure that the first element
> in the history reflects the published state.
I don't think that is a recommendable solution since
workflows manage permissions. Setting permissions properly
after an import will work only by using the workflow API.

Andreas


[lists.vcf]

begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[hidden email]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard



_______________________________________________
Product-Developers mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/product-developers