Remove or legacify the parentchild relationship feature

Hi devs,

We still document the ability to configure XWiki to use parent-child relationships (instead of nested pages), see the following on https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/ContentOrganization/NestedPagesMigration/#HExecutiveSummary :

Even though it’s hidden you can still turn it back on if you need it while you migrate your content to use Nested Spaces: set the core.hierarchyMode property to parentchild in the xwiki.properties configuration file.

I’d like to consider “removing the feature” for the following reasons:

  1. It’s now old and we need to remove cruft at some point. This feature was deprecated on XWiki 7.2+ (i.e. 10 years ago).
  2. The feature is not tested well apparently and is broken since https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/PageEditing/?viewer=changes&rev1=337.18&rev2=338.1& is not working anymore and I doubt we want to invest to fix it. I’ve tested it locally on XS 16.10.8 and clicking the “hierarchy” icon doesn’t do anything anymore.

Now we can discuss what “removing the feature” could mean.

For me the best option I see is:

  1. Delete the UI code to set the parent when editing pages. Also delete the associated doc on xwiki.org.
  2. Delete the Java code using the parent field (unless it can be legacified, but I doubt it), except for the parent field in the XWikiDocument class + the getter/setter (and basically any API that is required to continue having the Nested Migrator App working). This means keeping the parent column in the DB too.
  3. Legacify the parent field + getter/setter in the XWikiDocument class by moving them to aspects. Ideally we would do that for the DB schema column too but we don’t have a way to do that AFAIK. Ideally also legacify the code that reads the core.hierarchyMode property from xwiki.properties if we can.
  4. Remove the entry in xwiki.properties to stop advertising for it at xwiki-platform/xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.properties.vm at f3dd2fd01379574707b636d5011c832d0ce4dae3 · xwiki/xwiki-platform · GitHub

Another option is to be more radical and stop supporting the Nested Pages migrator and remove everything related to parent-child relationship, and in the even that someone needs to convert an old XWiki instance (<7.2), someone will need to write some SQL scripts to convert to nested pages (that we would document on https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/ContentOrganization/NestedPagesMigration).

WDYT?

Thx

PS: Right now we (@elenicojocariu , @paulinebessoles and me) will remove https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/PageEditing/#HSettingthepageparent in anticipation as we’re rewriting the doc and it’s not working anymore. We can always revert if that’s needed.

Done, see https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/PageEditing/?viewer=changes&rev1=337.18&rev2=338.1&

+1 in general for “continue having the Nested Migrator App working”, but we cannot move XWikiDocument#getParent() and XWikiDocument#setParent(), as indicated in the javadoc.

Yep, that’s why I mentioned:

+1, thanks

But you also mentionned

But, again, we cannot do that.

+1 as well.

Thanks,
Marius

ah ok I hadn’t understood from your comments that you were talking about the aspect move.

I checked the javadoc and didn’t see a mention about aspects but I guess the issue is that the schema contains the “parent” field and thus Hibernate will look for get/setParent() when the aspects are not weaved in and it’ll fail. We’d need to have 2 schema versions basically. Maybe that’s possible.

Moving something to legacy is a remove from tests point of view.