use of org.xwiki.extension.distribution.internal.DocumentsModifiedDuringDistributionListener.DocumentStatus.Action in project xwiki-platform by xwiki.
the class DocumentsModifiedDuringDistributionListener method checkDistributionAction.
private void checkDistributionAction(Event event, XWikiDocument document, XWikiContext xcontext) {
if (DistributionAction.DISTRIBUTION_ACTION.equals(xcontext.getAction())) {
String distributionWiki = xcontext.getOriginalWikiId();
DocumentStatus.Action action = toAction(event);
addDocument(distributionWiki, document, action, null, null);
}
}
use of org.xwiki.extension.distribution.internal.DocumentsModifiedDuringDistributionListener.DocumentStatus.Action in project xwiki-platform by xwiki.
the class DocumentsModifiedDuringDistributionListener method checkXARHandler.
private void checkXARHandler(Event event, XWikiDocument document, XWikiContext xcontext) {
ExecutionContext context = this.execution.getContext();
if (context != null) {
XarExtensionPlan xarExtensionPlan = (XarExtensionPlan) context.getProperty(XarExtensionPlan.CONTEXTKEY_XARINSTALLPLAN);
if (xarExtensionPlan != null) {
Request request = this.jobContext.getCurrentJob().getRequest();
// It's a job started by the Distribution Wizard
if (StringUtils.equals(request.<String>getProperty("context.action"), "distribution")) {
String distributionWiki = request.getProperty("context.wiki");
if (distributionWiki != null) {
DocumentReference reference = document.getDocumentReferenceWithLocale();
DocumentStatus.Action action = toAction(event);
LocalExtension previousExtension = xarExtensionPlan.getPreviousXarExtension(reference);
LocalExtension nextExtension = xarExtensionPlan.getNextXarExtension(reference);
addDocument(distributionWiki, document, action, previousExtension, nextExtension);
}
}
}
}
}
Aggregations