Skip to content

Commit

Permalink
Issue 16843 deleting content containers (#16856)
Browse files Browse the repository at this point in the history
* #16252 format source. Introduce format checker on build. Alter style … (#16288)

* #16252 format source. Introduce format checker on build. Alter style files

* #16252 remove unwanted file

* #16252 remove unwanted file

* Updating commit reference for src/main/enterprise

* try different location for checkstyle.xml

* Revert "#16252 format source. Introduce format checker on build. Alter style … (#16288)" (#16291)

This reverts commit 05f9082.

* Updating commit reference for src/main/enterprise

* #16843 now on delete all content, it is being save
  • Loading branch information
jdotcms authored and jgambarios committed Jul 16, 2019
1 parent b5d7b3c commit 786dd98
Showing 1 changed file with 19 additions and 15 deletions.
Expand Up @@ -84,22 +84,26 @@ public void saveContent(final String pageId, final List<PageContainerForm.Contai
for (final PageContainerForm.ContainerEntry containerEntry : containerEntries) {
int i = 0;
final List<String> contentIds = containerEntry.getContentIds();
final String personalization = UtilMethods.isSet(containerEntry.getPersonaTag()) ?
Persona.DOT_PERSONA_PREFIX_SCHEME + StringPool.COLON + containerEntry.getPersonaTag() :
MultiTree.DOT_PERSONALIZATION_DEFAULT;

if (UtilMethods.isSet(contentIds)) {
for (final String contentletId : contentIds) {
final MultiTree multiTree = new MultiTree().setContainer(containerEntry.getContainerId())
.setContentlet(contentletId)
.setInstanceId(containerEntry.getContainerUUID())
.setTreeOrder(i++)
.setHtmlPage(pageId);

CollectionsUtils.computeSubValueIfAbsent(
multiTreesMap, personalization, MultiTree.personalized(multiTree, personalization),
CollectionsUtils::add,
(String key, MultiTree multitree) -> CollectionsUtils.list(multitree));
}
} else {

for (final String contentletId : contentIds) {
final MultiTree multiTree = new MultiTree().setContainer(containerEntry.getContainerId())
.setContentlet(contentletId)
.setInstanceId(containerEntry.getContainerUUID())
.setTreeOrder(i++)
.setHtmlPage(pageId);

final String personalization = UtilMethods.isSet(containerEntry.getPersonaTag())?
Persona.DOT_PERSONA_PREFIX_SCHEME + StringPool.COLON + containerEntry.getPersonaTag():
MultiTree.DOT_PERSONALIZATION_DEFAULT;

CollectionsUtils.computeSubValueIfAbsent(
multiTreesMap, personalization, MultiTree.personalized(multiTree, personalization),
CollectionsUtils::add,
(String key, MultiTree multitree)-> CollectionsUtils.list(multitree));
multiTreesMap.computeIfAbsent(personalization, key -> new ArrayList<>());
}
}

Expand Down

0 comments on commit 786dd98

Please sign in to comment.