2022.2

Table Of Contents
JavaScript/jQuery
cch-process-by-dre-json.js
/* Content Creation (HTML) Service - Process Content Creation (By
Data Record) (JSON) Example */
(function ($, c) {
"use strict";
$(function () {
c.setupExample();
$("form").on("submit", function (event) {
event.preventDefault();
if (!c.checkSessionValid()) return;
var dataRecordId = $("#datarecord").val(),
templateId = $("#template").val(),
section = $("#section").val().trim(),
cssSelector = $("#cssSelector").val().trim(),
params = {
inline: $("#inline").val()
};
if (section.length) params.section = section;
if (cssSelector.length) params.cssSelector =
cssSelector;
/* Process Content Creation (By Data Record) (JSON) */
$.ajax({
type: "POST",
url:
"/rest/serverengine/workflow/contentcreation/html/" +
templateId + "/" +
dataRecordId,
data: JSON.stringify(params),
contentType: "application/json",
dataType: "file"
})
.done(function (response, status, request) {
c.displayStatus("Request Successful");
c.displayResult("Result", c.dataToFileLink
(response, "Output"), false);
Page 351