Creare una libreria client

Crea una libreria client personalizzata, clientlib in breve, per estrarre i parametri URL e trasmetterli nella chiamata GET. La chiamata GET viene effettuata a un servlet montato su /bin/getnextformtosign che restituisce l’URL del modulo successivo per l’accesso al pacchetto.

Di seguito è riportato il codice utilizzato nella funzione javascript clientlib

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);
});

Risorse

La libreria client può essere scaricata da qui

Passaggi successivi

Crea un modello di modulo personalizzato per questo caso d’uso

recommendation-more-help
8de24117-1378-413c-a581-01e660b7163e