How to directly publish only child items of my Container type in Plone?

Viewed 307

I have a custom folderish Dexterity content-type in Plone. It can have only Documents as children. I want these documents to be directly published as they are created.

I can achieve this easily by setting an appropriate workflow for the Document type, but that would affect every document in my site. I want only the ones inside my container type to be directly published.

Two options come to my mind:

Custom page

Create basically just a copy of the stock Document type and set its workflow to something that has only published state.

Event

Add IObjectAdded event for Documents and check if the parent of the new Document is my container type and do manual publishing in python code.

Neither sounds too nice. Do I have other options?

3 Answers
Related