03-07-2015 12:21 PM
/* Here is the code of student-form.get.js */
/*
This page is used to render a simple form and POST the data to repository,
to create a new student folder under Document Library.
The Student model in described here ……..
Import the student model as described here….
*/
/* get the current site */
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"
}
},
{
name: "alfresco/forms/controls/DojoValidationTextBox",
config: {
label: "Last Name",
name: "prop_student_lastName"
}
},
{
name: "alfresco/forms/controls/DojoValidationTextBox",
config: {
label: "Email",
name: "prop_student_email"
}
}
];
//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: "api/type/student%3AstudentFolder/formprocessor",
//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"] };
/* Details of student-form.get.desc.xml */
<webscript>
<shortname>Student Form Example</shortname>
<family>Aikau</family>
<url>/studentForm</url>
</webscript>
/* student-form.get.html.ftl */
<@processJsonModel group="share"/>
03-27-2015 10:41 PM
model.jsonModel = {
services: ["alfresco/services/CrudService","alfresco/services/ProductCreateListen"]
widgets:[title,anpForm]
}
03-29-2015 09:06 AM
org.alfresco.service.cmr.repository.DuplicateChildNodeNameException: Duplicate child name not allowed
03-12-2015 06:00 AM
04-07-2015 10:40 AM
04-15-2015 05:11 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.