Modify Workflow
---------------

The folder1 object we just created is in the private workflow state and will
not be visible without authentication. Therefore, we are going to briefly
look at viewing and transitioning workflow.

So, let's verify our theory that folder1 is in the private workflow state as
it should be, since it is a newly created object, by using the 'get_workflow' call.

    >>> print http("""
    ... POST /plone HTTP/1.0
    ... Content-Type: text/xml
    ... Cookie: %s
    ... 
    ... %s
    ... """ % (self.cookie, format_xmlrpc('get_workflow', ('folder1',))) )
    HTTP/1.0 200 OK
    Content-Length: 373
    Content-Type: text/xml
    <BLANKLINE>
    <?xml version='1.0'?>
    <methodResponse>
    <params>
    <param>
    <value><struct>
    <member>
    <name>state</name>
    <value><string>private</string></value>
    </member>
    <member>
    <name>transitions</name>
    <value><array><data>
    <value><string>publish</string></value>
    <value><string>submit</string></value>
    </data></array></value>
    </member>
    </struct></value>
    </param>
    </params>
    </methodResponse>

Now that we have verified that we can transition the workflow state to
published. How can we tell we have the ability to transition workflow? In the
results of the 'get_workflow' call we get the possible transitions, which can
be used by the 'set_workflow' call. Let's try publishing folder1 using the
'publish' transition.

    >>> print http("""
    ... POST /plone HTTP/1.0
    ... Content-Type: text/xml
    ... Cookie: %s
    ... 
    ... %s
    ... """ % (self.cookie, format_xmlrpc('set_workflow', ('publish', 'folder1',))) )
    HTTP/1.0 200 OK
    Content-Length: 114
    Content-Type: text/xml
    <BLANKLINE>
    <?xml version='1.0'?>
    <methodResponse>
    <params>
    <param>
    <value><nil/></value></param>
    </params>
    </methodResponse>

Now that folder1 has been published we can call it without authenticating.
So let's try it!

    >>> print http("""
    ... POST /plone HTTP/1.0
    ... Content-Type: text/xml
    ... 
    ... %s
    ... """ % format_xmlrpc('get_object', (['folder1'],)) )
    HTTP/1.0 200 OK
    Content-Length: ...
    Content-Type: text/xml
    <BLANKLINE>
    <?xml version='1.0'?>
    <methodResponse>
    <params>
    <param>
    <value><struct>
    <member>
    <name>folder1</name>
    <value><array><data>
    <value><struct>
    ...
    <member>
    <name>id</name>
    <value><string>folder1</string></value>
    </member>
    ...
    </struct></value>
    <value><string>Folder</string></value>
    <value><struct>
    </struct></value>
    </data></array></value>
    </member>
    </struct></value>
    </param>
    </params>
    </methodResponse>