We want to use the repository scheduler to import content.
In the site we have a WebApplicationInvokingPipeline module, where all our services are deployed.
These services are build on the hst content beans generated with essentials.
There are several solutions possible:
Configure the module also inside the cms, but is this possible, can we also add the hst content beans inside the cms?
Create a subclass of the HippoEvent and use the hippo event bus to send messages between the cms (platform) and site instance.
Use a rest endpoint (would be my last resort)
What is the best way to use the repository scheduler to invoke the import service.
Not possible in v12 or earlier. Will be possible in v13.
Possible.
You don’t need a subclass. Just use HippoEvent and set specific values to action, message, etc. for your site application module to subscribe and understand.
The second option seems like the best. It works in any versions. As a byproduct, all the hippoEvent messages are logged under /hippo:log/ in the repository as well. You could make a JCR query to monitor them later.
Configure the module also inside the cms, but is this possible, can we also add the hst content beans inside the cms?
Not possible in v12 or earlier. Will be possible in v13.
Leon_Jongsma:
Create a subclass of the HippoEvent and use the hippo event bus to send messages between the cms (platform) and site instance.
Possible.
You don’t need a subclass. Just use HippoEvent and set specific values to action, message, etc. for your site application module to subscribe and understand.
As long as your services which are build on the hst content beans generated with essentials do not rely on an actual http servlet request or on the HstRequestContext this will be possible.
What will trigger the HippoEvent to be posted? A repository scheduled task? What kind of scheduling do you have? Is it like periodically? In that case, I think it is much easier to wire this with spring configuration in your site webapp, see [1]. The downside compared to HippoEvent is that with HippoEvent you can have ‘local listeners’ such that your importing of content only takes place on a single cluster node. This is also possible to achieve with [1] but requires some non-trivial master election logic that uses our LockManager (to get a cluster wide master for doing the content import)
We want to use the repository scheduled task since we then can also schedule tasks from the console.
The repository scheduled task will trigger the HippoEvent and on the site we will have a listener to listen to that event. The listener will inject the Service and will do the content import.
The service layer does not need a http servlet request or HstRequestClontext.
If we are implementing scheduling in the site instance we also have to create a frontend for the scheduling and setup security for that.
I think the option with the HippoEvent is the best scenario for our use case.