content type with no workflow associated

Wichert Akkerman wichert at wiggy.net
Wed Aug 1 06:57:13 UTC 2007


Previously Héctor Velarde wrote:
> I am helping newbery refactoring parts of the CacheFu install methods 
> and I want to know what is the right way to create a content type with 
> no workflow associated to it?

Using a GenericSetup profile with a workflows.xml that looks like this:

<?xml version="1.0"?>
<object name="portal_workflow">
 <bindings>
  <type type_id="YourType"/>
 <bindings>
</object>

> this is because I have noticed that CacheFu's content types use the 
> following method, but I think this is far from optimal:
> 
> def setupWorkflows(portal, out):
>     """Setup workflow
>     """
>     wftool = getToolByName(portal, 'portal_workflow')
>     typeInfo = listTypes(PROJECT_NAME)
>     for t in typeInfo:
>         portal_type = t['portal_type']
>         #if portal_type in ['HeaderSet']:
>         #    wftool.setChainForPortalTypes((portal_type,), '')
>         wftool.setChainForPortalTypes((portal_type,), '')

That looks correct. What makes you think it is far from optimal?

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.




More information about the Product-Developers mailing list