Doc names with special characters

In the PathSegmentServiceDefault class the method generatePathSegment has some logic to replace a doc name composed entirely of special characters (e.g. -.,;?!:'-.,;?!:'-.,;?!:') with a random number, but then it allows the doc to be created anyway with the name as originally provided. Is there any particular reason one should preserve this functionality if overriding the default path segment service?

0 votes

1 answers

595 views

ANSWER

What do you mean by then it allows the doc to be created anyway with the name as originally provided? The idea here is to generate the path segment only (visible in the url or in the database as the "name" column, and unique per folder). This service does nothing about changing the document's title.
07/20/2017

I guess what I'm asking is - if I save a document "FOO" the name field in the hierarchy table is "FOO" but if I save a document called (odd name from above) then the name field in the hierarchy table is "123523452345425764"… So the question is - am I in peril if I modify this behavior
07/20/2017



No there's no danger in changing this behavior. Nuxeo only does it to avoid ugly URLs with lots of escaped characters in the rare cases where documents have strange names without alphanumeric parts.

0 votes