- Login to Sitecore backend
- Switch DB to core
- Insert new item under /sitecore/client/Applications/WFFM/Resources/Parameters/ActionControl Parameters/ActionColumn/
- Add new item with call of your JavaScript function. E.g.:
javascript:app.doSomething()
- Open \sitecore\shell\client\Applications\WFFM\Pages\FormReport\FormReport.js file and add function
doSomething
to it. You can call any action from any controller with any parameters from your Javascript function.
- Create new pipeline and processor for it
- Execute new pipeline inside your action in controller by
CorePipeline.Run("doSomething", formExportArgs);
Here is for example disassembled code of default endpoint(action in WFFM controller). You can use it as example:
[ValidateHttpAntiForgeryToken]
public ActionResult Export(Guid id, int format)
{
Assert.ArgumentNotNull(id, "id");
Assert.ArgumentNotNull(format, "format");
bool flag = format == 0;
Item itemFromMasterDatabase = this.itemRepository.GetItemFromMasterDatabase(new ID(id));
Assert.IsTrue(itemFromMasterDatabase != null, "Can't find the form.");
Job job = Context.Job;
if (job != null)
{
job.Status.LogInfo(DependenciesManager.ResourceManager.Localize("READING_DATA_FROM_DATABASE"));
}
IEnumerable<FormData> formData = this.FormsDataProvider.GetFormData(id);
FormExportArgs formExportArgs = new FormExportArgs(this.itemRepository.CreateFormItem(itemFromMasterDatabase), new FormPacket(formData), this.webUtil.GetTempFileName(), flag ? "text/xml" : "application/vnd.ms-excel");
formExportArgs.Parameters.Add("contextUser", Context.User.Name);
CorePipeline.Run(flag ? "exportToXml" : "exportToExcel", formExportArgs);
return base.Json(new
{
File = formExportArgs.FileName
}, JsonRequestBehavior.AllowGet);
}