<?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 Re: Upload document with multiple custom property in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7601#M3466</link>
    <description>&lt;P&gt;Thanks, I had the confirmation from Alfresco support team. This is only supported on 6.2.&lt;/P&gt;&lt;P&gt;I asked for a workaround and will post it back when I get the answer.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Apr 2021 15:23:41 GMT</pubDate>
    <dc:creator>Soprasteria</dc:creator>
    <dc:date>2021-04-09T15:23:41Z</dc:date>
    <item>
      <title>Upload document with multiple custom property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7599#M3464</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Here is my configuration Alfresco 5.2.4 with ADF 3.4&lt;BR /&gt;I'm facing a problem while importing document with a custom property that can take multiple string values.&lt;/P&gt;&lt;P&gt;Here is the content-model.xml&lt;/P&gt;&lt;PRE&gt;&amp;lt;constraints&amp;gt;
	&amp;lt;constraint name="multiplePropertylist" type="this.is.my.constraints.CustomConstraint"&amp;gt;
		&amp;lt;parameter name="allowedValues"&amp;gt;
			&amp;lt;list&amp;gt;&amp;lt;/list&amp;gt;
		&amp;lt;/parameter&amp;gt;
		&amp;lt;parameter name="constraintName"&amp;gt;
			&amp;lt;value&amp;gt;MultipleProperty&amp;lt;/value&amp;gt;
		&amp;lt;/parameter&amp;gt;
	&amp;lt;/constraint&amp;gt;
&amp;lt;/constraints&amp;gt;
&amp;lt;types&amp;gt;
&amp;lt;type name="document"&amp;gt;
		&amp;lt;parent&amp;gt;cm:content&amp;lt;/parent&amp;gt;
		&amp;lt;mandatory-aspects&amp;gt;
			&amp;lt;aspect&amp;gt;custom:data&amp;lt;/aspect&amp;gt;
		&amp;lt;/mandatory-aspects&amp;gt;
	&amp;lt;/type&amp;gt;
&amp;lt;/types&amp;gt;
&amp;lt;aspects&amp;gt;
	&amp;lt;aspect name="custom:data"&amp;gt;
		...
		&amp;lt;properties&amp;gt;
			...
			&amp;lt;property name="multipleProperty"&amp;gt;
				&amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;
				&amp;lt;mandatory&amp;gt;true&amp;lt;/mandatory&amp;gt;
				&amp;lt;multiple&amp;gt;true&amp;lt;/multiple&amp;gt;
				&amp;lt;index enabled="true"&amp;gt;
					&amp;lt;facetable&amp;gt;true&amp;lt;/facetable&amp;gt;
				&amp;lt;/index&amp;gt;
				&amp;lt;constraints&amp;gt;
					&amp;lt;constraint ref="multiplePropertylist"/&amp;gt;
				&amp;lt;/constraints&amp;gt;
			&amp;lt;/property&amp;gt;
		&amp;lt;/properties&amp;gt;
		...
	&amp;lt;/aspect&amp;gt;
&amp;lt;/aspects&amp;gt;&lt;/PRE&gt;&lt;P&gt;When I upload a document, the event is stopped and a popup is opened allowing me to modify the properties :&lt;/P&gt;&lt;PRE&gt;onBeginUpload(event: UploadFilesEvent) {

    event.pauseUpload();

    let listFiles: FileModel[];
    listFiles = event.files || [];

    if (listFiles.length &amp;gt; 0) {

      const dialogUpload = this.dialog.open(DialogUploadComponent, {
        width: '1000px',
        autoFocus: false,
        data: {
          files: listFiles,
          type: 'document',
          mode: this.mode
        }
      });

      dialogUpload.afterClosed().subscribe(result =&amp;gt; {

        if (result === 'OK') {
          event.resumeUpload();
        }

      });
    }
  }&lt;/PRE&gt;&lt;P&gt;Before closing the DialogUploadComponent popup, properties are setted to all files passed to the popup in listFiles :&lt;/P&gt;&lt;PRE&gt;uploadFiles() {
      const values = this.customForm.form.values;
      this.listFiles.forEach((file: FileModel)  =&amp;gt; {
        file.options.nodeType = this.type;
        const properties = {};

        for (const key in values) {
          if (key !== AppConstants._PROPERTY_CM_NAME) {
            properties[key] = this.setValue(values[key]);
          }
        }
        file.options['properties'] = properties;
      });
		this.closeDialog('OK');
}&lt;/PRE&gt;&lt;P&gt;At that point, I can debug the process and see that multiple values are well passed to all files like this :&lt;/P&gt;&lt;PRE&gt;FileModel {status: 0, file: File, id: undefined, …}
	data: null
	errorCode: null
	extension: (...)
	file: File {…}
	id: undefined
	name: "toto.pdf"
	options:
		comment: undefined
		majorVersion: false
		newVersion: false
		nodeType: "document"
		parentId: "0f208ce6-bf7c-4e7d-8097-2f79d5a6abf8"
		path: ""
		properties:
			...
			multipleProperty: (2) ["4", "1"]
			...
	progress: {loaded: 0, total: 0, percent: 0}
	size: 15659
	status: 0&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Then the UploadFilesEvent.resumeUpload() is emitted, and the next call is made to the backend :&lt;BR /&gt;POST http://localhost:4200/alfresco/api/-default-/public/alfresco/versions/1/nodes/0f208ce6-bf7c-4e7d-8097-2f79dAAAAAaa/children?autoRename=true&amp;amp;include=allowableOperations&lt;BR /&gt;Body :&lt;/P&gt;&lt;PRE&gt;------WebKitFormBoundarybVmxBA5ta4P5neSD
Content-Disposition: form-data; name="cm:title"

toto.pdf
------WebKitFormBoundarybVmxBA5ta4P5neSD
Content-Disposition: form-data; name="multipleProperty"

4
------WebKitFormBoundarybVmxBA5ta4P5neSD
Content-Disposition: form-data; name="multipleProperty"

1
------WebKitFormBoundarybVmxBA5ta4P5neSD
Content-Disposition: form-data; name="include"

allowableOperations
...
------WebKitFormBoundarybVmxBA5ta4P5neSD
Content-Disposition: form-data; name="autoRename"

true
------WebKitFormBoundarybVmxBA5ta4P5neSD
Content-Disposition: form-data; name="nodeType"

document
------WebKitFormBoundarybVmxBA5ta4P5neSD--&lt;/PRE&gt;&lt;P&gt;As a result, the document is saved with &lt;STRONG&gt;only one of the two value for the property "multipleProperty".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;After that creation, it is possible to modify this property from the UI and add another value successfully, herre is the successful call :&lt;BR /&gt;PUT http://localhost:4200/alfresco/api/-default-/public/alfresco/versions/1/nodes/38b883ee-d5d4-4708-a797-3eb12BBBBbbb&lt;BR /&gt;Body :&lt;/P&gt;&lt;PRE&gt;{"name":"toto.pdf","properties":{"cm:title":"toto.pdf","multipleProperty":["8","1"]}}&lt;/PRE&gt;&lt;P&gt;Is it possible to pass multiple value while uploading a document ?&lt;/P&gt;&lt;P&gt;Thanks for your answers !&lt;BR /&gt;Charles REY&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 13:28:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7599#M3464</guid>
      <dc:creator>Soprasteria</dc:creator>
      <dc:date>2021-04-01T13:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Upload document with multiple custom property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7600#M3465</link>
      <description>&lt;P&gt;Seems that it works only on newer (6.2) version:&amp;nbsp;&lt;A href="https://issues.alfresco.com/jira/browse/MNT-21834" target="_blank" rel="nofollow noopener noreferrer"&gt;https://issues.alfresco.com/jira/browse/MNT-21834&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 22:38:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7600#M3465</guid>
      <dc:creator>sufo</dc:creator>
      <dc:date>2021-04-07T22:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Upload document with multiple custom property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7601#M3466</link>
      <description>&lt;P&gt;Thanks, I had the confirmation from Alfresco support team. This is only supported on 6.2.&lt;/P&gt;&lt;P&gt;I asked for a workaround and will post it back when I get the answer.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 15:23:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7601#M3466</guid>
      <dc:creator>Soprasteria</dc:creator>
      <dc:date>2021-04-09T15:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Upload document with multiple custom property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7602#M3467</link>
      <description>&lt;P&gt;Here is the complete answer :&lt;/P&gt;&lt;P&gt;I understand that you're wondering why you're unable to set a multi-valued property on creating/uploading a node when using the &lt;A href="https://api-explorer.alfresco.com/api-explorer/#/nodes/createNode" target="_blank" rel="noopener nofollow noreferrer"&gt;createNode Rest API endpoint&lt;/A&gt;. This functionality is not supported in ACS 5.2, it is only available in ACS 6.2 onward (see &lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/create-a-document-with-multi-valued-property-using-rest-api/m-p/300962/highlight/true#M20661" target="_blank" rel="noopener nofollow noreferrer"&gt;here&lt;/A&gt; and &lt;A href="https://issues.alfresco.com/jira/browse/MNT-21834" target="_blank" rel="noopener nofollow noreferrer"&gt;here&lt;/A&gt; for information on how this can be done in 6.2).&lt;/P&gt;&lt;P&gt;In 5.2, you can use the updateNode call to add the multiple-values to the property of the new node like you already mentioned (&lt;A href="https://api-explorer.alfresco.com/api-explorer/#!/nodes/updateNode" target="_blank" rel="noopener nofollow noreferrer"&gt;https://api-explorer.alfresco.com/api-explorer/#!/nodes/updateNode&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 11:22:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7602#M3467</guid>
      <dc:creator>Soprasteria</dc:creator>
      <dc:date>2021-04-13T11:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Upload document with multiple custom property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7603#M3468</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/84890"&gt;@Soprasteria&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for updating us on the workaround.&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;</description>
      <pubDate>Tue, 13 Apr 2021 12:36:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-document-with-multiple-custom-property/m-p/7603#M3468</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2021-04-13T12:36:37Z</dc:date>
    </item>
  </channel>
</rss>

