Throw error in CMS

Within the CMS we have a lot of document types within each multiple fields where you can link to another document. What we wish to do is have it that based around documents within a certain path throw an error when the documents under those path link to a document outside of that path or when documents outside that path link to documents within that path.

I know it is possible to to do this with a validator but the only way I know to make this work would involve going through every single document type and adding the validator to every single field that could possibly link to a seperate document.

Is there a way either via validator, event or other that would simplify this process? or can we just block documents to link to under a certain path?

One option is to add the validator programmatically with an updater script.

You could probably use Open UI, which may be the best solution

I wouldn’t recommend the following, but it may be the most flexible solution.
You could override the MirrorTemplatePlugin. I’ve done for manipulating some of the settings, but you may have to go further than that and also have to override some of the dialogs involved. You could also write your own plugin from scratch. If you go this route you need to be comfortable with wicket. Additionally, in some unknown future, if we ever decide move away from wicket you’d need to find another solution, but that can be years from now if ever. Don’t do this unless you already have an idea on how to do this.

I should have mentioned this in the original post but we are using version 12 so unfortunately Open UI is not an option for us.

I would recommend a validator then. You can add them to existing fields with an updater.

Otherwise if you are feeling adventurous dive in to the exciting world of wicket development. However, be aware of the cost in maintenance. Also realize that this isn’t exactly a supported extension point, meaning that we can change things in upgrades without regard to customer implementations.