I made this model
<types>
<type name="sp:configuration">
<title>Configuration</title>
<parent>cm:content</parent>
<properties>
<property name="sp:username">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="sp:users">
<type>d:text</type>
<multiple>true</multiple>
</property>
</properties>
</type>
</types>
I' m trying to make a form in which a user can choose a list of users, I tried this code in the js file of the new page
ConfigurationFormWidget = [
{
name : "alfresco/forms/controls/MultiSelectInput",
config : {
label : "Select Users",
name : "prop_config_users",
optionsConfig : {
queryAttribute : "shortName",
publishTopic : "ALF_GET_FORM_CONTROL_OPTIONS",
publishPayload : {
url : page.url.context
+ "api/groups/ALFRESCO_ADMINISTRATORS/children",
resultsProperty : "options",
itemsAttribute : "data",
labelAttribute : "displayName",
valueAttribute : "shortName"
}
}
}
}];
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: "/hdp/ws/configUserSpace",
//To create the folder under document library, we need the documberLibrary nodeRef,So POST that too.
alf_destination:alfDestination
},
widgets: ConfigurationFormWidget
}
};
model.jsonModel.widgets.push(form);
/*************************************************************************************/
the issue is that the users are not being displayed in the MultiSelectInput, and I didn't find the URI to display all users not only ALFRESCO_ADMINISTRATORS.
Finally how can I make the POST request to send the data and save it in contents?
How can I change this code to make the alfDestination variable equal to companyHome , is it possible ?
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; }
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.