As users
mostly see titles in the current XWiki version, it should not matter to them what happens
to the page name.
Implementation idea:
* Offer an extension point in the create page UI to allow plugging some cleaning
algorithm
* Provide the \ and / cleaning algorithm by default
* Handle backward compat. Find ways to not break existing users who are having / and \ in
page names. For example we could imagine a property in xwiki.properties that we would set
to point to the hint of the / and \ cleaner component. Thus existing users would need to
voluntarily upgrade their xwiki.properties to have it if they want it. We would need to
provide some script to convert existing pages with / and \ too probably.
WDYT?
About backwards compatibility, I do not get the point. What will break for
users who have already existing pages?
As long as the cleaning algorithm only runs on newly created pages there should not be
any bw/compat problem.
Yes you’re right. But what’s important is to not change the
behavior: if they were using “/“ and “\” in page name we shouldn’t break them and they
should continue to do so unless they choose not to. However for new users we can configure
them to filter page names by default.
Hence my proposal about the new config property in xwiki.properties. When you uprgade
you’ll decide if you want to merge it or not and if not you’ll continue to get the same
behavior as before.
If they really want no cleaning, we can provide
them with a property which contains the characters to be scrapped from the name with a
default value of '/\', and if they do not want this, they can set this property to
an empty value.
I prefer the implementation that I mentioned based on a component
role and provide the hint in the config. It not allows the 2 use cases mentioned above but
also any other type of custom use cases (other characters to strip, different logic, like
force all creations under a given page, etc). The idea would be to take the reference as
input and clean it and generate another reference as output (and display the cleaned
version to the user somehow so that there’s no surprise - display the value that’ll be
used as a form field hint for ex).
Maybe one can have both: the property for the hint to configure the component, and a
property for the preinstalled component with the characters it removed from the page name.
If the hint points to that component, it can be further customized with the latter
property.