-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 12999 delete content types #13214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
* @param container Container with the new changes to be persisted | ||
*/ | ||
private void saveContainerStructures (ActionRequest req, Container currentContainer, Container container) | ||
throws DotDataException, DotSecurityException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic on this code can be optimized keeping a map for oldContainerStructures, then filter to exclude newContainerStructures (https://www.mkyong.com/java8/java-8-filter-a-map-examples/). With the resulting map you can delete in batch. I think it's a faster and less verbose implementation
} | ||
|
||
@NotNull | ||
private static MultiTree getMultiTreeFields(Map<String, String> map) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A MultitreeTransformer can be implemented instead. Take a look at https://github.com/dotCMS/core/blob/master/dotCMS/src/main/java/com/dotmarketing/portlets/templates/transform/FolderTransformer.java
No description provided.