[
https://issues.apache.org/jira/browse/CMIS-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13956631#comment-13956631
]
Florian Müller commented on CMIS-776:
-------------------------------------
I've tweaked the JSON extension code a bit to collate extensions with the same
name on the same level into an array. That doesn't match exactly the other
bindings, but doesn't lose extensions anymore. Maybe it helps.
> ObjectType#getExtensions() can't handle List<CmisExtensionElement> when using
> browser binding
> ---------------------------------------------------------------------------------------------
>
> Key: CMIS-776
> URL: https://issues.apache.org/jira/browse/CMIS-776
> Project: Chemistry
> Issue Type: Bug
> Components: opencmis-server
> Affects Versions: OpenCMIS 0.10.0
> Reporter: Sergey Shcherbovich
> Assignee: Florian Müller
>
> We need to transfer List<CmisExtensionElement> with several
> CmisExtensionElement elements.
> Xxml-based bindigs (e.g. AtomPub) handles List<CmisExtensionElement> like:
> {noformat}
> <e1:mandatoryAspects xmlns:e1="myNamespace">
> <e1:mandatoryAspect>P:sys:localized</e1:mandatoryAspect>
> <e1:mandatoryAspect>P:cm:generalclassifiable</e1:mandatoryAspect>
> <e1:mandatoryAspect>P:cm:author</e1:mandatoryAspect>
> </e1:mandatoryAspects>
> {noformat}
> it can handle and transfer multiple entries with same
> CmisExtensionElement.getName().
> But present JSON-based bindig implementation can't transfer multiple entries
> with same key (JSONObject uses CmisExtensionElement.getName as a key):
> {noformat}
> "mandatoryAspects": {
> "mandatoryAspect":"P:cm:author"
> }
> {noformat}
> Assuming issue is around here:
> {code:title=org.apache.chemistry.opencmis.commons.impl.JSONConverter.convertExtensionList}
> for (CmisExtensionElement ext : extensionList) {
> if (ext == null) {
> continue;
> }
> if (ext.getChildren() != null && !ext.getChildren().isEmpty()) {
> result.put(ext.getName(),
> convertExtensionList(ext.getChildren()));
> } else {
> result.put(ext.getName(), ext.getValue()); // line 2647
> }
> }
> {code}
> Out software uses both bindings to service repository. But we can't transfer
> List<CmisExtensionElement> objects correctly. We use 0.10.0 library.
--
This message was sent by Atlassian JIRA
(v6.2#6252)