Script to change objects effectivedates to be the same as the parent folder

Hi,

I have 300 folders (for magazine editions), each with 10 ~15 newsitems. I had already manually set the correct date for each issue of this magazine. It would be a nightmare to do the same for all those thousands of newsitems...

When I change the state of a item, I can check a box to make this change for all the content inside. This should be also possible for other changes, such as edits in metadata... I did not find this option.

Is there any product to help me with this? Bulk edit metadata?

If not, I know I can do (and probably will have to) a script to get all the newsitens and set the fathers date to them... Before I start, I am just checking if anyone has something ready I can reuse and modify.

Thanks a lot,

Rafael

barely related: have you seen sc.periodicals?

I think this could cover your use case: it defines a Dexterity-based folderish content type (a periodical) that has a number, an image associated and a publication date; it can contain only News Articles as defined in the collective.nitf package.

we have been using it in production for many years but development became staled early; we need now to resurrect it in order to fix some issues like removing the dependency on five.grok and take a look at performance. I want also to rename it to sc.periodical (without the s).

take a look at it in:

1 Like

Hi,

I will definitively take a look.

I have a problem that people come from google nad read a news that is 20 years old and comment it as it just happened. So I needed to display This is from edition number 7, published in september 1993, for example.

One questions, is there an easy way to convert newsitem to collective.nitf? Do you know if it has a migration script?

Thanks,
Rafael

If you are using plone 5 you can look at rapido. It has the ability to make scriptable content rules. Content rules let you run code when content changes. The script to update the contents modification dates when a folder changes would not be hard. Look at plone.api.

we have been working on sc.periodicals these days and I'm ready to make a 1.1a1 release (just as a tag) to test it in our production environments.

I suggest you to wait for 2.0 as I still want to remove the portlet included and rename the current content type (from Periodical to Issue), add a new one (Periodical, as a container of issues) and rename the whole package as mentioned above.

anyway, feel free to test it and provide some feedback because, as I said, development didn't evolve.

I created this eons ago: GitHub - hvelarde/transmogrify.nitf: A transmogrifier pipeline to convert Plone's news items in collective.nitf's news articles

but I think that option should be available directly inside the collective.nitf package; feel free to check the code and provide a PR :wink:

Thanks a lot hvelarde. I don't know how to thank you. Maybe: Obrigado, irmão!

I am using Plone 5. Hope 2.0 is compatible with it.

I just released v1.1b (you have to use it via mr.developer):

sc.periodicals and collective.nitf should work under Plone 5 as long as you don't use the portlets (I will remove that code from both of them soon).

please help testing or it will not be compatible with Plone 5 in the near future as I have no projects running on it, neither plans to have any in the following months.