chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "wentao lu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CMIS-1070) Chemistry Part does not support multi-value property
Date Sat, 12 Jan 2019 00:34:00 GMT
wentao lu created CMIS-1070:
-------------------------------

             Summary: Chemistry Part does not support multi-value property
                 Key: CMIS-1070
                 URL: https://issues.apache.org/jira/browse/CMIS-1070
             Project: Chemistry
          Issue Type: Bug
          Components: chemistry-parts
            Reporter: wentao lu
         Attachments: cmis.js.txt

When try Chemistry Part javascript to create a document with multi-value properties, it does
not work. After some digging, it appears the "_setProps" function in cmis.js does not support
this feature.

So I modified the function as below 

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++;

                                               
}

                };

 

After the change, user can use an array as input for multi-value properties, i.e.

var properties = {

                                               
'multiProp1': ['Personal','Privileged']

                }

 

I have attached the new cmis.js for reference.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
Mime
View raw message