[
https://issues.apache.org/jira/browse/SLING-8243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17325729#comment-17325729
]
Konrad Windszus commented on SLING-8243:
----------------------------------------
The behaviour differs between JSON and XML:
# XML is only influenced through flag {{overwrite}}. This actually means
"replace"
(https://github.com/apache/sling-org-apache-sling-jcr-contentloader/blob/79957492ebda588b3a6e03d6a8642048b448b855/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentImporter.java#L141).
The flags {{merge}}, {{mergeProperties}} and {{overwriteProperties}} are not
considered at all!
# JSON also deletes the existing node when {{overwrite}} is set to true
(https://github.com/apache/sling-org-apache-sling-jcr-contentloader/blob/79957492ebda588b3a6e03d6a8642048b448b855/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java#L248).
So to me it seems that
- {{merge}} and {{mergeProperties}} only makes a difference if {{overwrite}} =
{{false}}
- {{merge}} is only implemented for JSON
(https://github.com/apache/sling-org-apache-sling-jcr-contentloader/blob/79957492ebda588b3a6e03d6a8642048b448b855/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java#L966)
- {{merge}} has the same effect as {{overwrite}}, but the former removes the
old child nodes at the end, while the latter removes the old entry node in the
beginning. The effect should be the same though.
- {{mergeProperties}} is different, as it will overwrite existing properties
with the same name but keeps others. That only makes a difference if the node
does exist already
(https://github.com/apache/sling-org-apache-sling-jcr-contentloader/blob/79957492ebda588b3a6e03d6a8642048b448b855/src/main/java/org/apache/sling/jcr/contentloader/internal/DefaultContentCreator.java#L686)
> Content Loader - support merge of properties and child nodes
> ------------------------------------------------------------
>
> Key: SLING-8243
> URL: https://issues.apache.org/jira/browse/SLING-8243
> Project: Sling
> Issue Type: New Feature
> Reporter: Jason E Bailey
> Assignee: Jason E Bailey
> Priority: Major
> Fix For: JCR ContentLoader 2.4.0
>
>
> Currently the Content Loader doesn't support a merge feature, a merge feature
> would provide the ability for the an import to update existing properties and
> nodes, and additionally delete the specific properties and nodes that aren't
> imported.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)