Search the FirstSpirit Knowledge Base
Hello all,
I'm using the following script to start the deployment process from the ContentCreator.
//!Beanshell
import de.espirit.firstspirit.access.ServicesBroker;
import de.espirit.firstspirit.access.AdminService;
// schedulerName = "publish %country% LIVE - PRESS";
schedulerName = "TEST Country Deployment RU";
try {
context.logInfo("Starting");
// Start deployment
sStorage = context.requireSpecialist(ServicesBroker.TYPE).getService(AdminService.class).getScheduleStorage();
sEntry = sStorage.getScheduleEntry(context.getProject(), schedulerName);
sEntry.execute();
context.logInfo("Started scheduler '" + schedulerName + "'");
context.showForm(false, "successMessage");
} catch(Exception e) {
context.logError("Couldn't start scheduler", e);
}
How can I add the current page in this script, from where the editor has started it?
How to deploy the page from where the script is executed, in the ContentCreator?
If you have a better approach, please share it with me. It doesn't need to be a script, it can be a workflow as well. That would be even better.
Kind Regards,
Dragan Rakita
Hi Dragan,
the usual approach is: The schedule contains at least a normal generation task (configured as partial generation but without start nodes) and a deployment task.
The idea is to temporarily modify the partial generation and add the desired PageRef as a start node.
Before calling .execute() on the schedule entry, get the generation task from the schedule, usually by iterating through its tasks and check for instanceof GenerateTask if there’s only one.
generateTask = ...
Then, use something like
generateTask.getStartNodes().add(myPageRef);
sEntry.execute();
Regards,
Michael
Hi Dragan,
the usual approach is: The schedule contains at least a normal generation task (configured as partial generation but without start nodes) and a deployment task.
The idea is to temporarily modify the partial generation and add the desired PageRef as a start node.
Before calling .execute() on the schedule entry, get the generation task from the schedule, usually by iterating through its tasks and check for instanceof GenerateTask if there’s only one.
generateTask = ...
Then, use something like
generateTask.getStartNodes().add(myPageRef);
sEntry.execute();
Regards,
Michael
Dear Mr. Bergmann,
Thank you very much.
Kind Regards,
Dragan Rakita