use of org.xwiki.extension.distribution.internal.DistributionManager.DistributionState in project xwiki-platform by xwiki.
the class DistributionInitializerListener method onEvent.
@Override
public void onEvent(Event event, Object arg1, Object arg2) {
XWikiContext xcontext = (XWikiContext) arg2;
// Do nothing if the automatic start of DW is disabled
if (!isAutoDistributionWizardEnabled(xcontext)) {
return;
}
DistributionState distributionState = this.distributionManager.getFarmDistributionState();
// Start the Distribution Wizard only if the current user has the right to access it
if (distributionState != DistributionState.NONE && this.distributionManager.canDisplayDistributionWizard()) {
if (xcontext.isMainWiki()) {
if (this.distributionManager.getFarmJob() == null) {
startFarmJob();
}
} else {
String wiki = xcontext.getWikiId();
if (this.distributionManager.getWikiJob(wiki) == null) {
startWikiJob(wiki);
}
}
}
}
Aggregations