public void Actuate(ImpulseContext context) { foreach (var h in ActuatingHandlers) { h(context); } }
public ActionResult Actuate(string name, int? contentId = null, int? contentVersionId = null, string returnUrl = null) { IContent content = null; if (contentId.HasValue) { if (contentVersionId.HasValue) { content = _contentManager.Get(contentId.Value, VersionOptions.VersionRecord(contentVersionId.Value)); } else { content = _contentManager.Get(contentId.Value, VersionOptions.Latest); } } var impulse = _impulseService.CheckForImpulse(name, content); // TODO: Extract data from query string if (impulse == null) { return HttpNotFound("Could not actuate impulse"); } var context = new ImpulseContext() { Impulse = impulse, ReturnUrl = returnUrl }; var result = _impulseService.ActuateImpulse(context); if (result == ImpulseActuationResult.NotAuthorized) { return new HttpUnauthorizedResult(); } // Back to origin page (or other as defined in context) if (returnUrl!=null) return Redirect(context.ReturnUrl); return Json(true); }
public IEnumerable<Orchard.ContentManagement.IContent> RightContent(ImpulseContext context) { // Connect to site return new[]{ _workContextAccessor.GetContext().CurrentSite }; }
public ImpulseActuationResult ActuateImpulse(ImpulseContext context) { // Check permissions var impulse = CheckForImpulse(context.ImpulseName, context.SourceContent); if (impulse == null) { return(ImpulseActuationResult.Failed); } impulse.Actuate(context); if (context.Actuated) { return(ImpulseActuationResult.Ok); } return(ImpulseActuationResult.Failed); }
public ImpulseActuationResult ActuateImpulse(ImpulseContext context) { // Check permissions var impulse = CheckForImpulse(context.ImpulseName, context.SourceContent); if (impulse == null) return ImpulseActuationResult.Failed; impulse.Actuate(context); if (context.Actuated) { return ImpulseActuationResult.Ok; } return ImpulseActuationResult.Failed; }
public void ConnectorAlteration(ImpulseContext context, Orchard.ContentManagement.IContent connector) { }
public string ConnectorType(ImpulseContext context) { return "MenuRootToSite"; }