As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
GET http://192.168.100.38/share/service/components/form?itemKind=node&itemId=workspace://SpacesStore/5252128f-85be-4c4d-a9c4-7a02fa7fc5c0&destination={destination}&mode=edit&submitType=json&formId=doclib-simple-metadata&showCancelButton=true&htmlid=template_x002e_documentlist_x002e_documentlibrary-editDetails
<#include "../form/form.get.head.ftl">
<script type="text/javascript"> function formTest() { var myForm = new Alfresco.FormUI( } </script> <div class="dashlet"> <div class="title">${msg("dashlet.title")}</div> <div class="body scrollableList"> <a href="javascript:formTest();">formTest()</a> </div> </div>
// Intercept before dialog show var doBeforeDialogShow = function my_doBeforeDialogShow(p_form, p_dialog) { Dom.get(p_dialog.id + "-dialogTitle").innerHTML = "My Title"; Dom.get(p_dialog.id + "-dialogHeader").innerHTML = "My Header"; }; … removed for readability … myDialog.setOptions( { width: "33em", templateUrl: templateUrl, actionUrl: null, destroyOnHide: true, doBeforeDialogShow: { fn: doBeforeDialogShow, scope: this }, … removed for readability …
Alfresco.util.populateHTML( [ p_dialog.id + "-dialogTitle", "My Title" ] );
Internal Form Error: form with id of 'page_x002e_component-2-1_x002e_user_x007e_zbennett_x007e_dashboard-myDialog-form' could not be located, ensure the form is created after the form element is available.
// Test Code function runTest() { var destination = "workspace://SpacesStore/7373e717-212e-4bf7-979f-3680f7c52b53"; // Intercept before dialog show - not functional yet! var doBeforeDialogShow = function my_doBeforeDialogShow(p_form, p_dialog) { Alfresco.util.populateHTML( [ p_dialog.id + "-dialogHeader", "My Header" ] ); }; var templateUrl = YAHOO.lang.substitute(Alfresco.constants.URL_SERVICECONTEXT + "components/form?itemKind={itemKind}&itemId={itemId}&destination={destination}&mode={mode}&submitType={submitType}&showCancelButton=true", { itemKind: "type", itemId: "eagle:project", //itemId: "cm:folder", destination: destination, mode: "create", submitType: "json" }); // Using Forms Service, so always create new instance var myDialog = new Alfresco.module.SimpleDialog("${args.htmlid}-myDialog"); myDialog.setOptions( { width: "40em", templateUrl: templateUrl, actionUrl: null, destroyOnHide: true, doBeforeDialogShow: { fn: doBeforeDialogShow, scope: this }, onSuccess: { fn: function myDialog_success(response) { Alfresco.util.PopupManager.displayMessage( { text: "Success!" }); }, scope: this }, onFailure: { fn: function myDialog_failure(response) { if (response) { Alfresco.util.PopupManager.displayMessage( { text: "Failed to complete task." }); } else { Alfresco.util.PopupManager.displayMessage( { text: "Failed to communicate with server…or something" }); } }, scope: this } }).show();
<?xml version="1.0" encoding="UTF-8"?> <model name="eagle:hiearchy" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <description>Eagle Hierarchy</description> <author>Zach Bennett</author> <version>1.0</version> <!– Imports are required to allow references to definitions in other models –> <imports> <!– Import Alfresco Dictionary Definitions –> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/> <!– Import Alfresco Content Domain Model Definitions –> <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/> </imports> <namespaces> <namespace uri="eagle.hiearchy" prefix="eagle"/> </namespaces> <!– Type and Aspect definitions go here –> <types> <type name="eagle:project"> <title>Eagle Project Folder</title> <parent>cm:folder</parent> <properties> <property name="cm:name"> <type>d:text</type> </property> <property name="cm:title"> <type>d:text</type> </property> <property name="cm:description"> <type>d:text</type> </property> <property name="eagle:status"> <type>d:text</type> </property> <property name="eagle:projectorid"> <type>d:text</type> </property> <property name="eagle:startDate"> <type>d:datetime</type> </property> <property name="eagle:endDate"> <type>d:datetime</type> </property> </properties> </type> </types> </model>
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– Registration of new models –> <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap"> <property name="models"> <list> <value>alfresco/extension/eagle-model.xml</value> </list> </property> </bean> </beans>
<!– eagle:project type (creating nodes) –> <config evaluator="model-type" condition="eagle:project"> <forms> <!– Document Library Common form –> <form> <field-visibility> <show id="cm:name" /> <show id="cm:title" force="true" /> <show id="cm:description" force="true" /> <show id="eagle:status" /> <show id="eagle:projectorid" /> <show id="eagle:startDate" /> <show id="eagle:endDate" /> </field-visibility> <appearance> <field id="cm:title"> <control template="/org/alfresco/components/form/controls/textfield.ftl" /> </field> <field id="cm:name"> <control template="/org/alfresco/components/form/controls/textfield.ftl" /> </field> <field id="cm:description"> <control template="/org/alfresco/components/form/controls/textarea.ftl" /> </field> <field id="eagle:status"> <control template="/org/alfresco/components/form/controls/textfield.ftl" /> </field> <field id="eagle:projectorid"> <control template="/org/alfresco/components/form/controls/textfield.ftl" /> </field> <field id="eagle:startDate"> <control template="/org/alfresco/components/form/controls/date.ftl" /> </field> <field id="eagle:endDate"> <control template="/org/alfresco/components/form/controls/date.ftl" /> </field> </appearance> </form> </forms> </config>
ERROR [scripts.forms.FormUIGet] org.alfresco.service.namespace.NamespaceException: Namespace prefix eagle is not mapped to a namespace URI