chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lu, Wentao" <Wentao...@bchydro.com>
Subject RE: How to set multi-value properties on Chemistry Part
Date Wed, 02 Jan 2019 21:11:22 GMT
Hi,

After some digging, I doubt Chemistry part may not support this so I modified the cmis.js
source code for "_setProps" function as below and it works.


                var _setProps = function(properties, options) {
                                                var i = 0;
                                                for ( var id in properties) {
                                                                options['propertyId[' + i
+ ']'] = id;
                                                                if (Array.isArray(properties[id])){
                                                                                var len =
properties[id].length;
                                                                                var j=0;
                                                                                for (j=0;j<len;j++){
                                                                                         
      options['propertyValue[' + i + ']'+'['+j+']'] = properties[id][j];
                                                                                }
                                                                } else {
                                                                                options['propertyValue['
+ i + ']'] = properties[id];
                                                                }
                                                                i++;
                                                }
                };

                //sample properties with a multi-values property using an array.
var properties = {
                                                'multiProp1': ['Personal','Privileged']
                }

Please let me know if that's the appropriate way to achieve this.

Thanks
Wentao

From: Lu, Wentao
Sent: Wednesday, January 02, 2019 11:35 AM
To: dev@chemistry.apache.org
Subject: How to set multi-value properties on Chemistry Part

Hi,

We'll trying to use Chemistry Part javascript api to create a document, the document has some
multi-value properties, could you help to provide a sample code on how to set a multi-value
properties using Chemistry Part?

Looks like we need submit below format but not sure how to do it on Chemistry Part and if
Chemistry Part even support it or not.


<input name="propertyId[0]"       type="hidden" value="my:countries" />
<input name="propertyValue[0][0]" type="text"   value="Germany" />
<input name="propertyValue[0][1]" type="text"   value="United States" />
<input name="propertyValue[0][2]" type="text"   value="France" />
<input name="propertyValue[0][3]" type="text"   value="United Kingdom" />
<input name="propertyValue[0][4]" type="text"   value="Switzerland" />

Thanks
Wentao
________________________________
This email and its attachments are intended solely for the personal use of the individual
or entity named above. Any use of this communication by an unintended recipient is strictly
prohibited. If you have received this email in error, any publication, use, reproduction,
disclosure or dissemination of its contents is strictly prohibited. Please immediately delete
this message and its attachments from your computer and servers. We would also appreciate
if you would contact us by a collect call or return email to notify us of this error. Thank
you for your cooperation.
-BCHydroDisclaimerID5.2.8.1541

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message