클라이언트 라이브러리 만들기
사용자 지정 클라이언트 라이브러리인 clientlib을 만들어 간단히 url 매개 변수를 추출하려면 GET 호출에서 해당 매개 변수를 전달합니다. GET 호출은 패키지에 로그인할 다음 양식의 URL을 반환하는 /bin/getnextformtosign에 탑재된 서블릿에 대해 수행됩니다.
다음은 clientlib javascript 함수에 사용되는 코드입니다
function getUrlVars()
{
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value)
{
vars[key] = value;
});
return vars;
}
function navigateToNextForm()
{
console.log("The id is " + guidelib.runtime.adobeSign.submitData.agreementId);
var guid = getUrlVars()["guid"];
var customerID = getUrlVars()["customerID"];
console.log("The customer Id is " + customerID);
$.ajax(
{
type: 'GET',
url: '/bin/getnextformtosign?guid=' + guid + '&customerID=' + customerID,
contentType: false,
processData: false,
cache: false,
success: function(response)
{
console.log(response);
var jsonResponse = JSON.parse(JSON.stringify(response));
console.log(jsonResponse.nextFormToSign);
var nextFormToSign = jsonResponse.nextFormToSign;
if (nextFormToSign != "AllDone")
{
window.open(nextFormToSign, '_self');
}
else
{
window.open("http://localhost:4502/content/forms/af/formsandsigndemo/alldone.html", '_self');
}
}
});
}
$(document).ready(function()
{
$(document).on("click", ".nextform", navigateToNextForm);
});
8de24117-1378-413c-a581-01e660b7163e