Overriding URI Encoding

Hello, I am trying to think through a requirement I have.

We want the ability to change/verify the name of a new document a user creates in the interface, actually more to the point, the URL field that is being shown to the user as they enter the name. This is so we can control the name of the document against our own SEO rules. These rules differ from the encoder class that is being used now.

I know the logic behind that field is actually using the logic found here: Node name encoding - Bloomreach Experience Manager (PaaS/Self-Hosted) - The Fast and Flexible Headless CMS

I am thinking this could be achieved in two ways, but not sure it makes sense to do it one way or the other:

  1. Override the UriEncoding class in such a way that it calls an external rest service that will take in the current filename and return the cleansed/standardized representation.
  2. Using the Workflow Event process, on a document creation event, I make the same rest service call and modify the URI of the document within the repository at that point.

Does anyone have any other ideas? Or does anyone see any issues with the two approaches above? Any preferences?

Hi,

As you’ve found you can use your own uri encoding class. This should be the preffered way of working. The main issue I see is making a call to an external service. An external service can be unavailable. You will need to be able to return something if the external service is unavailable. Additionally, this will likely take some time to timeout. This may cause issues with the wicket application leading to strange UI behavior.

I wouldn’t do this in the workflow event process.