04-02-2015 01:04 AM
var alfDestination = null;
var result = remote.call("url call to repository");
if (result.status.code == status.STATUS_OK) {
alfDestination = JSON.parse(result).metadata.parent.nodeRef;
}
//Code snippet of my pop-dialog form,
widgets : [
{
name : "alfresco/menus/AlfMenuBarItem",
config : {
label : "Create Product Type using ALF_CREATE_DIALOG_REQUEST",
publishTopic : "ALF_CREATE_DIALOG_REQUEST",
publishPayload : {
dialogTitle : "Create New Product Type",
fixedWidth : false,
widgetsContent : [{
name : "alfresco/forms/Form",
config : {
showOkButton : true,
okButtonLabel : "Add",
showCancelButton : true,
cancelButtonLabel : "Cancel",
//Specify the TOPIC here
okButtonPublishTopic : "ALF_CRUD_CREATE",
okButtonPublishGlobal : true,
okButtonPublishPayload : {
url : "api/type/hccm%3AproductTypeFolder/formprocessor",
alf_destination : alfDestination,
alfResponseTopic : "HC_PRODUCT_CREATE"
},
widgets : [
{
name : "alfresco/forms/controls/TextBox",
config : {
fieldId : "PRODUCT_NAME",
label : "Product Name",
name : "prop_cm_name",
description : "Provide a Unique Value for the Product Name.",
requirementConfig : {
initialValue : true
},
validationConfig : [ {
validation : "validateUnique",
itemsProperty : "response.productNameList",
errorMessage : "The Product Name already exists!",
publishTopic : "ALF_CRUD_GET_ALL",
publishPayload : {
url : "retrieve-library-list?retrieve=Product%20Library"
}
} ]
}
},
{
name : "alfresco/forms/controls/DojoValidationTextBox",
config : {
label : "Product Title",
name : "prop_cm_title"
}
},
{
name : "alfresco/forms/controls/DojoValidationTextBox",
config : {
label : "Product Description",
name : "prop_cm_description"
}
},
{
name : "alfresco/forms/controls/TextBox",
config : {
fieldId : "PRODUCT_PREFIX",
label : "Product Prefix",
name : "prop_hccm_prefix",
description : "Provide a Unique Value for the Prefix field.",
requirementConfig : {
initialValue : true
},
validationConfig : [ {
validation : "validateUnique",
itemsProperty : "response.productPrefixList",
errorMessage : "This Prefix is already used. Please try different value.",
publishTopic : "ALF_CRUD_GET_ALL",
publishPayload : {
url : "retrieve-library-list?retrieve=Product%20Library"
}
} ]
}
}]
}
}]
}
}
} ]
"ALF_CREATE_FORM_DIALOG_REQUEST"
,(this form properly closes the pop-up upon submit) I am able to use formSubmissionTopic for pulish
, and I can create my own subscription topic for the topic published and call a function when subscribed, but in that function I am able to specify only the URL
but not the alf_destination
, so even after submitting nothing is happening because I haven't specify the alf_destination and just the dialog gets closed.
//Code snippet of ALF_CREATE_DIALOG_REQUEST
widgets : [
{
name : "alfresco/menus/AlfMenuBarItem",
config : {
label : "Create Product Type using ALF_CREATE_DIALOG_REQUEST",
publishTopic : "ALF_CREATE_DIALOG_REQUEST",
publishPayload : {
dialogTitle : "Create New Product Type",
fixedWidth : false,
widgetsContent : [{
name : "alfresco/forms/Form",
config : {
showOkButton : true,
okButtonLabel : "Add",
showCancelButton : true,
cancelButtonLabel : "Cancel",
//Specify the TOPIC here
okButtonPublishTopic : "ALF_CRUD_CREATE",
okButtonPublishGlobal : true,
okButtonPublishPayload : {
url : "api/type/hccm%3AproductTypeFolder/formprocessor",
alf_destination : alfDestination,
alfResponseTopic : "HC_PRODUCT_CREATE"
},
widgets : [
{
name : "alfresco/forms/controls/TextBox",
config : {
fieldId : "PRODUCT_NAME",
label : "Product Name",
name : "prop_cm_name",
description : "Provide a Unique Value for the Product Name.",
requirementConfig : {
initialValue : true
},
validationConfig : [ {
validation : "validateUnique",
itemsProperty : "response.productNameList",
errorMessage : "The Product Name already exists!",
publishTopic : "ALF_CRUD_GET_ALL",
publishPayload : {
url : "retrieve-library-list?retrieve=Product%20Library"
}
} ]
}
},
{
name : "alfresco/forms/controls/DojoValidationTextBox",
config : {
label : "Product Title",
name : "prop_cm_title"
}
},
{
name : "alfresco/forms/controls/DojoValidationTextBox",
config : {
label : "Product Description",
name : "prop_cm_description"
}
},
{
name : "alfresco/forms/controls/TextBox",
config : {
fieldId : "PRODUCT_PREFIX",
label : "Product Prefix",
name : "prop_hccm_prefix",
description : "Provide a Unique Value for the Prefix field.",
requirementConfig : {
initialValue : true
},
validationConfig : [ {
validation : "validateUnique",
itemsProperty : "response.productPrefixList",
errorMessage : "This Prefix is already used. Please try different value.",
publishTopic : "ALF_CRUD_GET_ALL",
publishPayload : {
url : "retrieve-library-list?retrieve=Product%20Library"
}
} ]
}
}]
}
}]
}
}
} ]
}
} ]
"ALF_CREATE_FORM_DIALOG_REQUEST"
, either in the subscribed function or in the dialog itself.04-13-2015 04:20 AM
04-13-2015 04:25 AM
04-24-2015 11:18 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.