Page Naming Strategies API not work propertly!?

Hello!

I try to use Character Replacement Strategy for replace cyrillic symbols to latin.

this is ok for case: A->a, Б->b, В->v, Г->g etc.
but is no propertly work for case when inserting rules for replace special chars, for example “space”->"_", and next attempt to insert a new rule breaks the data structure, see screenshot:

What’s going on? Where is a problem?
Windows Server + Tomacat 9 + Postgree 11(Encoding: UTF-8, collation:Russian_Russia.1251, character type:Russian_Russia.1251)

There are other ways to convert Cyrillic to Latin for URLs?

Hi,

which version of XWiki are you using?
Best is probably to open a JIRA ticket, it’s clearly a bug: https://jira.xwiki.org.

There are other ways to convert Cyrillic to Latin for URLs?

You could check the “Preformatted names strategy” instead of the character replacement one, as a workaround for now:

v.12.10.4

This case work only for latin, not for cirillyc symbols:
“remove any special characters: only the latin alphabet (26 letters) without accents, the numbers and the character “-” (dash) are accepted.”

Hmm that’s right. Do you have an idea how we could improve that? That would be probably a good idea to have a “Preformatted names” strategy that would work for cyrillic symbols.

Yes! “Preformatted names strategy for cyrillic alfabet” is the best solution for my case.

With next actions: Convert cyrillic alfabet into latin alfabet, and remove any special characters and without accents, the numbers and the character “-” (dash) are accepted, " " (space) convert to “_” (underscore).

I create new Jira issues:

New future: https://jira.xwiki.org/browse/XWIKI-18365
Bug report: https://jira.xwiki.org/browse/XWIKI-18364

Thanx!

Where is stored data of custom converting rules?
DB?ObjectClass?ObjectProperties? I can edit this rules on low-level withouth web-interface?

Thanks for creating those!

So the specific data of the Character replacement strategy are stored in the xobject of page XWiki.EntityNameValidation.Configuration, you can try to perform changes directly there.

Now if you want to create a new completely different rule, it’s a Java component you have to write, see: https://extensions.xwiki.org/xwiki/bin/view/Extension/Name%20Strategies%20Module/#HCreateaNameStrategyComponent.

Thanx, gime me please example, how i can do it.

This is very hard way for me. ((

Hi @DenisF

so I actually investigated on this issue, and apparently the issue is not at all related to the cyrillic alphabet but to empty values. From what I see on your first message, on image 4 you create a replacement strategy from ~ to “None” (empty value), and to my knowledge that’s what messes up your character replacement strategy.
I’m providing a fix for that for both next stable and LTS versions of XWiki.

Thanks!