<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Aikau form to upload content with metadata in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/aikau-form-to-upload-content-with-metadata/m-p/21216#M9359</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create a Aikau form that can upload a content with some metadata. When I tried to modify simple-page.get.js provided by alfresco sdk 3.0 like below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var site = page.url.templateArgs.site;&lt;BR /&gt;var alfDestination = null;&lt;BR /&gt;var result = remote.call("slingshot/doclib/container/" + site + "/documentLibrary");&lt;BR /&gt;if(result.status.code == status.STATUS_OK){&lt;BR /&gt;&amp;nbsp; &amp;nbsp;alfDestination = JSON.parse(result).container.nodeRef;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var formWidgets = [ &lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;name: "alfresco/forms/controls/DojoValidationTextBox",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;config: {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; label: "Document No",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: "prop_xyz_docNo"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;name: "alfresco/forms/controls/DojoValidationTextBox",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;config: {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; label: "Mandatory",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: "prop_xyz_mandatory"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;name: "alfresco/forms/controls/DojoValidationTextBox",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;config: {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; label: "Action",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: "prop_xyz_action" &lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;id : "FILE_SELECT",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;name: "alfresco/forms/controls/FileSelect",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;config:{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; label: "Upload File...",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; name: "uploadFile"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;BR /&gt; ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Create the form here&lt;BR /&gt;var form = {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;name: "alfresco/forms/Form",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;config: {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; showOkButton: true,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; okButtonLabel: "Save", &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; showCancelButton: true,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; cancelButtonLabel: "Cancel",&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;okButtonPublishTopic: "ALF_CRUD_CREATE",&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;okButtonPublishGlobal: true, &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; okButtonPublishPayload: {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;url: "sample/uploadTest",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//To create the folder under document library, we need the documberLibrary nodeRer,So POST that too.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alf_destination:alfDestination &lt;BR /&gt; },&lt;BR /&gt; &lt;BR /&gt; widgets: formWidgets&lt;BR /&gt; }&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;//Add the form and services to the JSON MODEL&lt;BR /&gt;model.jsonModel = { &lt;BR /&gt;&amp;nbsp; &amp;nbsp;widgets: [ form ],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;services: [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "alfresco/services/CrudService",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "alfresco/services/UploadService",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "alfresco/services/DialogService",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "alfresco/services/ActionService",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "alfresco/services/DocumentService",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "alfresco/services/SiteService",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "alfresco/services/NotificationService"&lt;BR /&gt;&amp;nbsp; &amp;nbsp;] &lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After accessing the page, put the all fields and submit the data, got error in browser console,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Uncaught TypeError: Failed to construct 'File': 2 arguments required, but only 0 present.&lt;BR /&gt; at Object.clone (e919c032ca8754596233687dde088f8b.js:3155)&lt;BR /&gt; at clone (e919c032ca8754596233687dde088f8b.js:3146)&lt;BR /&gt; at Object._mixin (e919c032ca8754596233687dde088f8b.js:2731)&lt;BR /&gt; at Object.clone (e919c032ca8754596233687dde088f8b.js:3157)&lt;BR /&gt; at Object.alfresco_core_Core__alfCleanFrameworkAttributes [as alfCleanFrameworkAttributes] (e919c032ca8754596233687dde088f8b.js:12539)&lt;BR /&gt; at Object.alfresco_services_CrudService__clonePayload [as clonePayload] (e919c032ca8754596233687dde088f8b.js:30254)&lt;BR /&gt; at Object.alfresco_services_CrudService__onCreate [as onCreate] (e919c032ca8754596233687dde088f8b.js:30345)&lt;BR /&gt; at Evented.&amp;lt;anonymous&amp;gt; (e919c032ca8754596233687dde088f8b.js:3026)&lt;BR /&gt; at Evented.dispatcher [as onALF_CRUD_CREATE] (e919c032ca8754596233687dde088f8b.js:5192)&lt;BR /&gt; at Function.on.emit (e919c032ca8754596233687dde088f8b.js:6036)&lt;BR /&gt;clone @ e919c032ca8754596233687dde088f8b.js:3155&lt;BR /&gt;clone @ e919c032ca8754596233687dde088f8b.js:3146&lt;BR /&gt;_mixin @ e919c032ca8754596233687dde088f8b.js:2731&lt;BR /&gt;clone @ e919c032ca8754596233687dde088f8b.js:3157&lt;BR /&gt;alfresco_core_Core__alfCleanFrameworkAttributes @ e919c032ca8754596233687dde088f8b.js:12539&lt;BR /&gt;alfresco_services_CrudService__clonePayload @ e919c032ca8754596233687dde088f8b.js:30254&lt;BR /&gt;alfresco_services_CrudService__onCreate @ e919c032ca8754596233687dde088f8b.js:30345&lt;BR /&gt;(anonymous) @ e919c032ca8754596233687dde088f8b.js:3026&lt;BR /&gt;dispatcher @ e919c032ca8754596233687dde088f8b.js:5192&lt;BR /&gt;on.emit @ e919c032ca8754596233687dde088f8b.js:6036&lt;BR /&gt;on.emit @ e919c032ca8754596233687dde088f8b.js:6077&lt;BR /&gt;emit @ e919c032ca8754596233687dde088f8b.js:6362&lt;BR /&gt;publish @ e919c032ca8754596233687dde088f8b.js:6315&lt;BR /&gt;alfresco_core_PubQueue__publish @ e919c032ca8754596233687dde088f8b.js:13882&lt;BR /&gt;(anonymous) @ e919c032ca8754596233687dde088f8b.js:12647&lt;BR /&gt;forEach @ e919c032ca8754596233687dde088f8b.js:3588&lt;BR /&gt;alfresco_core_Core__alfPublish @ e919c032ca8754596233687dde088f8b.js:12600&lt;BR /&gt;alfresco_buttons_AlfButton__onClick @ e919c032ca8754596233687dde088f8b.js:35430&lt;BR /&gt;_onClick @ e919c032ca8754596233687dde088f8b.js:35949&lt;BR /&gt;(anonymous) @ e919c032ca8754596233687dde088f8b.js:3024&lt;BR /&gt;__onClick @ e919c032ca8754596233687dde088f8b.js:35936&lt;BR /&gt;(anonymous) @ e919c032ca8754596233687dde088f8b.js:3024&lt;BR /&gt;on.emit @ e919c032ca8754596233687dde088f8b.js:6075&lt;BR /&gt;(anonymous) @ touch.js:172&lt;BR /&gt;setTimeout (async)&lt;BR /&gt;(anonymous) @ touch.js:171&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought I needed to pass some parameter before publishing ALF_CRUD_CREATE but don't know how.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Aug 2017 04:18:32 GMT</pubDate>
    <dc:creator>mocaruru</dc:creator>
    <dc:date>2017-08-27T04:18:32Z</dc:date>
    <item>
      <title>Aikau form to upload content with metadata</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/aikau-form-to-upload-content-with-metadata/m-p/21216#M9359</link>
      <description>Hi,I would like to create a Aikau form that can upload a content with some metadata. When I tried to modify simple-page.get.js provided by alfresco sdk 3.0 like below,var site = page.url.templateArgs.site;var alfDestination = null;var result = remote.call("slingshot/doclib/container/" + site + "/doc</description>
      <pubDate>Sun, 27 Aug 2017 04:18:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/aikau-form-to-upload-content-with-metadata/m-p/21216#M9359</guid>
      <dc:creator>mocaruru</dc:creator>
      <dc:date>2017-08-27T04:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Aikau form to upload content with metadata</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/aikau-form-to-upload-content-with-metadata/m-p/21217#M9360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message does not point to an error in your JSON - it displays a problem with a core Aikau function (&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;alfresco_core_Core__alfCleanFrameworkAttributes)&amp;nbsp;&lt;/SPAN&gt;when used together with native data structures (in this case a File object). It stands to reason thatthe AlfCrudService itself cannot handle form data that includes files. Aikau has a special service for handling file updloads, the UploadService, though that service cannot handle metadata. For your requested interaction it might be necessary to create a composition of the regular Crud and the Upload service, and use a cutom service to handle the pubSub-flow, i.e. by processing the upload first and then immediately post the update of the metadata.&lt;/P&gt;&lt;P&gt;Unfortunately, that is not something you can do by simple configuration in the JSON model - you will have to write Aikau client-side JavaScript for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 08:33:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/aikau-form-to-upload-content-with-metadata/m-p/21217#M9360</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-08-28T08:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Aikau form to upload content with metadata</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/aikau-form-to-upload-content-with-metadata/m-p/21218#M9361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;B&gt;Yoshihiko Aochi&lt;/B&gt;‌&amp;nbsp;&amp;nbsp;I had the same problem I would be grateful if you told me if you have any answer to that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:12:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/aikau-form-to-upload-content-with-metadata/m-p/21218#M9361</guid>
      <dc:creator>adelohb</dc:creator>
      <dc:date>2018-10-02T16:12:04Z</dc:date>
    </item>
  </channel>
</rss>

