03-31-2015 05:43 AM
<!– Each Produt Type folder should contain a prefix associated to it. –>
<type name="hccm:productTypeFolder">
<title>Product Type Folder</title>
<parent>cm:folder</parent>
<properties>
<property name="hccm:prefix"> //Custom prefix fileld
<type>d:text</type>
<mandatory>true</mandatory>
<!– TODO Need to add Regex Constraint for Prefix Field –>
</property>
</properties>
</type>
/slingshot/doclib2/doclist/file/site/" +site+ "/documentLibrary/Product%20Library
,
var site = "product-management";
//Read the node reference of Product Library under Document Library
var alfDestination = null;
//Derived based on the URI "/slingshot/doclib2/doclist/{type}/site/{site}/{container}/{path}"
var result = remote.call("/slingshot/doclib2/doclist/file/site/" + site
+ "/documentLibrary/Product%20Library");
if (result.status.code == status.STATUS_OK) {
alfDestination = JSON.parse(result).metadata.parent.nodeRef;
};
var productName = {
name:"alfresco/forms/controls/DojoValidationTextBox",
config: {
label:"Product Name",
name:"prop_cm_name"
}
};
var productTitle = {
name:"alfresco/forms/controls/DojoValidationTextBox",
config: {
label:"Product Title",
name:"prop_cm_title"
}
};
var productDescription = {
name:"alfresco/forms/controls/DojoValidationTextBox",
config: {
label:"Product Description",
name:"prop_cm_description"
}
};
var productPrefix = {
name:"alfresco/forms/controls/DojoValidationTextBox",
config: {
label:"Product Prefix",
name:"prop_hccm_prefix" //Custom prefix field
}
};
var anpForm = {
name : "alfresco/forms/Form",
config:{
okButtonLabel : "Create",
okButtonPublishTopic : "ALF_CRUD_CREATE",
okButtonPublishGlobal : true,
okButtonPublishPayload : {
//Specify the URL here to POST the data
//Dereived based on the URI "/api/{item_kind}/{item_id}/formprocessor"
url : "api/type/hccm%3AproductTypeFolder/formprocessor",
//To create the folder under product Library of document library, we need the productLibrary nodeRer,So POST that too.
alf_destination : alfDestination,
alfResponseTopic :"PRODUCT_CREATE"
},
widgets:[]
}
};
anpForm.config.widgets.push(productName,productTitle,productDescription,productPrefix);
model.jsonModel = {
services:["alfresco/services/CrudService","example/widgets/ProductCreateListen"],
widgets:[title,anpForm]
}
/slingshot/doclib2/doclist/file/site/" +site+ "/documentLibrary/Product%20Library
" and if exists, then show some red text in the UI like the prefix you entered is already used for some other "product type folder", is there a way I can achieve this.04-06-2015 12:14 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.