AnsweredAssumed Answered

How to get JSON object in repository webscript, which is passed from aikau page in POST request?

Question asked by manav on Feb 27, 2017
Latest reply on Mar 1, 2017 by mbajpai

This is my web console snippet.

 

My form widget code.

var site = page.url.templateArgs.site;
// Read the node reference of Document Library
var alfDestination = null;
var result = remote.call("/slingshot/doclib/container/" + site
+ "/documentLibrary");
if (result.status.code == status.STATUS_OK) {
alfDestination = JSON.parse(result).container.nodeRef;
}
// Create the form control for the student
var studentFormWidget = [ {
name : "alfresco/forms/controls/DojoValidationTextBox",
config : {
label : "Student ID",
name : "prop_student_StudentID"
}, {
     name : "alfresco/forms/controls/DojoValidationTextBox",
     config : {
          label : "First Name",
          name : "prop_student_firstName"
     }
}
}];
// Create the form here
var form = {
name : "alfresco/forms/Form",
config : {
showOkButton : true,
okButtonLabel : "Save",
showCancelButton : false,
cancelButtonLabel : "",
// Specify the TOPIC here
okButtonPublishTopic : "ALF_CRUD_CREATE",
okButtonPublishGlobal : true,
okButtonPublishPayload : {
// Specify the URL here to POST the data
url : "/sample/helloworld",
// To create the folder under document library, we need the
// documberLibrary nodeRer,So POST that too.
alf_destination : alfDestination
},
widgets : studentFormWidget
}
};
// Add the form and services to the JSON MODEL
model.jsonModel = {
widgets : [ form ],
services : [ "alfresco/services/CrudService",
"alfresco/services/NavigationService",
"alfresco/services/UserService",
"alfresco/services/DocumentService"]
};

url of repo webscript:  "/sample/helloworld",

How can I get the data passed here in this form

prop_student_studentId  ,  prop_student_firstName

 

in repository webscript?

Outcomes