enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
201 stars 34 forks source link

Flattened page structure - Dump migration #6653

Closed aro closed 5 years ago

aro commented 5 years ago

Create an upgrade script to upgrade content nodes created with 6.x that used the tree structure for the page. They should be converted to the new flattened page structure.

TODO: Describe how to do this @GlennRicaud

GlennRicaud commented 5 years ago

Explanations in: https://github.com/enonic/xp/issues/6697 Code present both in epic-6649 and issue-6697

GlennRicaud commented 5 years ago

For the following page screen shot 2018-11-28 at 10 10 48

Here is the Node data part of the VersionNode before and after nodedata-aftermod.json.txt nodedata-beforemod.json.txt

GlennRicaud commented 5 years ago

@aro, @ashklianko : Some question regarding the new serialization:

1) The property "config" of Image components has been dropped. Is that on purpose? It has been replaced by a property "caption" with as value the property "caption" of the Image component config. 2) The property "config" of Fragment components has been dropped. Is that on purpose?

GlennRicaud commented 5 years ago

If all of this is on purpose, then I will start the dump migration tomorrow. But we will not be able to merge all of this before https://github.com/enonic/xp/pull/6781 is merged, since dump migration is sequential.

screen shot 2018-11-28 at 16 28 13 screen shot 2018-11-28 at 16 28 19

ashklianko commented 5 years ago

@aro, @ashklianko : Some question regarding the new serialization:

  1. The property "config" of Image components has been dropped. Is that on purpose? It has been replaced by a property "caption" with as value the property "caption" of the Image component config.
  2. The property "config" of Fragment components has been dropped. Is that on purpose?

Hi Glenn, I removed it on a purpose in spite of it is not mentioned in a task; Config is not needed neither for fragment or image, it is used with components that have a descriptor (layout and part) and a page itself;

sigdestad commented 5 years ago

What happens if the fragment is a part or layout?

aro commented 5 years ago

@GlennRicaud Agree with @ashklianko , image and fragment don't have config. I'm not sure about storing the caption. I guess you could say that caption is part of the image config? If we want to keep it. Not sure if it is actually used.

Fragment just points to the content of type "portal:fragment" that contains the fragment components. It doesn't matter if it is part, layout, image or text.

GlennRicaud commented 5 years ago

@aro: https://github.com/enonic/xp/blob/52101771ae9dff847ffc62e58abc473607b1930f/modules/core/core-repo/src/main/java/com/enonic/xp/repo/impl/dump/upgrade/flattenedpage/FlattenedPageDataUpgrader.java