Sivaraman created CMIS-1109:
-------------------------------

             Summary: Getting Exception when Saving and retrieving the files 
that contains document properties with multi choices
                 Key: CMIS-1109
                 URL: https://issues.apache.org/jira/browse/CMIS-1109
             Project: Chemistry
          Issue Type: Bug
          Components: portcmis
    Affects Versions: PortCMIS 0.3.0
            Reporter: Sivaraman


When Saving and retrieving the files that contains document properties with 
multi choices we are getting an below exception

{color:#de350b}"The given key 'value' was not present in the dictionary."{color}

*{color:#00875a}Please be kind enough to provide a urgent fix to resolve this 
issue with a Nuget package.{color}*

+*Analysis and temporary fix which we are suggesting*+

After deeper analysis into CMIS client library, We found that "*value*" key 
attribute is missing (sample choice is given below (it's a nested choice)),  In 
that scenario of saving and retrieving the files that contains document 
properties with multi choices.

PortCMIS library mandatorily expects the "value" key to be present for all 
"choice" elements present in the metadata. But it is missing (highlighted in 
red).


"choice":{
 {
 "displayName":"Certificate Items",

{color:#de350b}*"value":[choice value],*{color}

"choice":[
 \{"displayName":"Certificate","value":"Certificate"},
 \{"displayName":"EE Certificate","value":"EE Certificate"},¬¬
 \{"displayName":"DP Certificate","value":"DP Certificate"}
 ]
 }
}

For the above issue, Temporarily, below highlighted code has been added as 
condition to ensure choice list with no values in json string are skipped

+_File Name  :PortCMIS\binding\browser\BrowserConverter.cs_+

*{color:#de350b}if 
(choiceJson.ContainsKey(BrowserConstants.JsonPropertyTypeChoiceValue)){color}*
 *{color:#de350b}{{color}* 
 object choiceValue = choiceJson[BrowserConstants.JsonPropertyTypeChoiceValue];
 List<string> values = new List<string>();
 if (choiceValue is JsonArray)
 {
 foreach (object value in (JsonArray)choiceValue)
 {
 values.Add((string)GetCmisValue(value, PropertyType.String));
 }
 }
 else
 {
 values.Add((string)GetCmisValue(choiceValue, PropertyType.String));
 }
 choice.Value = values;
 *{color:#de350b}}{color}*

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to