Depublish api for any level of directory or files

Hi all,

As a part of multisite feature(since we are using headless cms) I want to delete very old sites(here refering sites but it may be any folder) after a period of time, I have a delete api for deleting root or any level folder, problem is it’s just deleting all data without depublishing it first. We want to unpublish entire data of selected level first i.e. folder1, folder2…etc.

image

Below I see when I do it from UI.

image

Some api’s are getting called behind it, kindly help me to find it.

Thanks,
Manish Kumar

Hi @jasper.floor , @machak , @jeroen.hoffman ,
Please help me to find api for taking offline all in folder.
Thanks,

you can loop through all documents and then use
org.onehippo.repository.documentworkflow.DocumentWorkflow.depublish

HI @Quang_Tran,

Other microservice is calling Bloomreach to delete and depublish all it’s data(only live data), for that I need direct api call. Seems above will not fullfill my requirements, please correct me.

Thanks

@kumamanish you may need to create an endpoint for other services to use to delete/depublish documents. In that endpoint, you can use org.onehippo.repository.documentworkflow.DocumentWorkflow.depublish

Are you on SaaS or on PaaS?

Hi @jasper.floor , we are using PaaS.

Check out this plugin:

https://bloomreach-forge.github.io/folder-context-menus/

Thanks for your reply, but I am looking for unpublish api that will depublish all nested directory items.

There is no ootb api that does this, but you can easily build your own service to handle that case. See
RESTful JAX-RS Component Support - Bloomreach Experience Manager (PaaS/Self-Hosted) - The Fast and Flexible Headless CMS