cancel
Showing results for 
Search instead for 
Did you mean: 

Doc names with special characters

Eric_Ace
Confirmed Champ
Confirmed Champ

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?

3 REPLIES 3

Florent_Guillau
World-Class Innovator
World-Class Innovator

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.

Eric_Ace
Confirmed Champ
Confirmed Champ

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

Florent_Guillau
World-Class Innovator
World-Class Innovator

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.