-
Notifications
You must be signed in to change notification settings - Fork 34
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
Page resolving: add flag to resolve empty regions in Content API #10214
Conversation
ashklianko
commented
Jul 18, 2023
•
edited
Loading
edited
- Introduced xp.content config variable resolveEmptyRegions (set to 'false' by default) that allows to switch between previous content page resolving behavior that forces injection of all descriptor's regions into page/layout and new one where content's page object is returned as it is
- Updated core-content classes to read config variable and build page object according to it
- Updated portal-impl classes to read descriptor and inject empty regions into page if it is not being made by content api, and not to read and inject regions if it is done by content api
@@ -4,6 +4,7 @@ | |||
|
|||
import com.enonic.xp.content.ImportContentParams; | |||
import com.enonic.xp.content.ImportContentResult; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note
@@ -9,6 +9,7 @@ | |||
import com.enonic.xp.content.Content; | |||
import com.enonic.xp.content.CreateContentParams; | |||
import com.enonic.xp.content.CreateMediaParams; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note
@@ -24,6 +24,7 @@ | |||
import com.enonic.xp.content.processor.ProcessCreateParams; | |||
import com.enonic.xp.content.processor.ProcessCreateResult; | |||
import com.enonic.xp.context.ContextAccessor; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note
@@ -7,6 +7,7 @@ | |||
import com.enonic.xp.content.RenameContentParams; | |||
import com.enonic.xp.content.UpdateContentParams; | |||
import com.enonic.xp.content.ValidationErrors; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note
import com.enonic.xp.project.ProjectService; | ||
import com.enonic.xp.region.LayoutDescriptorService; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.region.LayoutDescriptorService. Note
import com.enonic.xp.project.ProjectService; | ||
import com.enonic.xp.region.LayoutDescriptorService; | ||
import com.enonic.xp.region.PartDescriptorService; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.region.PartDescriptorService. Note
import com.enonic.xp.event.EventPublisher; | ||
import com.enonic.xp.node.NodeService; | ||
import com.enonic.xp.page.PageDescriptorService; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.page.PageDescriptorService. Note
@@ -8,9 +8,13 @@ | |||
import com.enonic.xp.content.ProjectSyncParams; | |||
import com.enonic.xp.content.ResetContentInheritParams; | |||
import com.enonic.xp.content.SyncContentService; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note
@@ -10,6 +10,7 @@ | |||
import com.enonic.xp.content.Media; | |||
import com.enonic.xp.content.ReprocessContentParams; | |||
import com.enonic.xp.content.UpdateMediaParams; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note
@@ -34,6 +34,7 @@ | |||
import com.enonic.xp.content.processor.ContentProcessor; | |||
import com.enonic.xp.content.processor.ProcessUpdateParams; | |||
import com.enonic.xp.content.processor.ProcessUpdateResult; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #10214 +/- ##
============================================
+ Coverage 84.34% 84.41% +0.07%
- Complexity 19418 19450 +32
============================================
Files 2595 2598 +3
Lines 67678 67720 +42
Branches 5390 5394 +4
============================================
+ Hits 57083 57166 +83
+ Misses 7982 7936 -46
- Partials 2613 2618 +5
☔ View full report in Codecov by Sentry. |
...tent/src/main/java/com/enonic/xp/core/impl/content/page/region/GetComponentByKeyCommand.java
Outdated
Show resolved
Hide resolved
...re/core-content/src/main/java/com/enonic/xp/core/impl/content/FullContentNodeTranslator.java
Outdated
Show resolved
Hide resolved
...ain/java/com/enonic/xp/core/impl/content/serializer/FullComponentDataSerializerProvider.java
Outdated
Show resolved
Hide resolved
...s/portal/portal-impl/src/main/java/com/enonic/xp/portal/impl/rendering/FragmentRenderer.java
Show resolved
Hide resolved
...es/core/core-content/src/main/java/com/enonic/xp/core/impl/content/CreateContentCommand.java
Show resolved
Hide resolved
...nt/src/main/java/com/enonic/xp/core/impl/content/ContentOutboundDependenciesIdsResolver.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/enonic/xp/core/impl/content/serializer/ComponentDataSerializerProvider.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/enonic/xp/core/impl/content/serializer/ComponentDataSerializerProvider.java
Outdated
Show resolved
Hide resolved
|
||
private PageDescriptorService pageDescriptorService; | ||
|
||
private LayoutDescriptorService layoutDescriptorService; |
Check warning
Code scanning / Pmd (reported by Codacy)
Perhaps 'layoutDescriptorService' could be replaced by a local variable. Warning test
|
||
private FullLayoutComponentDataSerializer componentDataSerializer; | ||
|
||
private RegionDataSerializer regionDataSerializer; |
Check warning
Code scanning / Pmd (reported by Codacy)
Perhaps 'regionDataSerializer' could be replaced by a local variable. Warning test
|
||
import static com.enonic.xp.content.ContentPropertyNames.PAGE; | ||
import static com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.COMPONENTS; | ||
import static com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.PATH; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.PATH. Note test
import static com.enonic.xp.content.ContentPropertyNames.PAGE; | ||
import static com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.COMPONENTS; | ||
import static com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.PATH; | ||
import static com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.TYPE; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.TYPE. Note test
import com.enonic.xp.region.RegionDescriptors; | ||
|
||
import static com.enonic.xp.content.ContentPropertyNames.PAGE; | ||
import static com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.COMPONENTS; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.COMPONENTS. Note test
import com.enonic.xp.data.PropertyTree; | ||
import com.enonic.xp.form.Form; | ||
import com.enonic.xp.page.DescriptorKey; | ||
import com.enonic.xp.region.ComponentPath; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.region.ComponentPath. Note test
import static com.enonic.xp.core.impl.content.serializer.ComponentDataSerializer.TYPE; | ||
import static com.enonic.xp.core.impl.content.serializer.DescriptorBasedComponentDataSerializer.DESCRIPTOR; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - org.junit.jupiter.api.Assertions.assertTrue. Note test
import com.enonic.xp.region.RegionDescriptor; | ||
import com.enonic.xp.region.RegionDescriptors; | ||
|
||
import static com.enonic.xp.content.ContentPropertyNames.PAGE; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.content.ContentPropertyNames.PAGE. Note test
@@ -14,6 +14,7 @@ | |||
import com.enonic.xp.content.Contents; | |||
import com.enonic.xp.content.ExtraData; | |||
import com.enonic.xp.content.ExtraDatas; | |||
import com.enonic.xp.core.impl.content.serializer.ContentDataSerializer; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - com.enonic.xp.core.impl.content.serializer.ContentDataSerializer. Note test
30d9382
to
513f6e5
Compare
import static org.junit.jupiter.api.Assertions.assertSame; | ||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.mockito.ArgumentMatchers.any; |
Check notice
Code scanning / Checkstyle (reported by Codacy)
Unused import - org.mockito.ArgumentMatchers.any. Note test
- Introduced xp.content config variable resolveEmptyRegions (set to 'false' by default) that allows to switch between previous content page resolving behavior that forces injection of all descriptor's regions into page/layout and new one where content's page object is returned as it is - Updated core-content classes to read config variable and build page object according to it - Updated portal-impl classes to read descriptor and inject empty regions into page if it is not being made by content api, and not to read and inject regions if it is done by content api
… (#10214) - Introduced xp.content config variable resolveEmptyRegions (set to 'false' by default) that allows to switch between previous content page resolving behavior that forces injection of all descriptor's regions into page/layout and new one where content's page object is returned as it is - Updated core-content classes to read config variable and build page object according to it - Updated portal-impl classes to read descriptor and inject empty regions into page if it is not being made by content api, and not to read and inject regions if it is done by content api (cherry picked from commit c4b556f)