Automatically rename document based on some variable (parent title for instance)

Hi!
I am evaluating xwiki to replace our Confluence instalation.
In Confluence we use ScripRunner macro, to automatically rename new pages based on parent name. (actualy we use a parent tag as a variable that is the same as the parent page name).
This way we have a consistent nomenclature in all our pages. For instance for Active Directory procedures, all sub pages are named “Active Directory - procedure title” or for SQL all sub pages are named “SQL - procedure title”

I am strugling to achieve the same result in Xwiki.
I don’t find any macro that allows me to rename pages, based on variables, and also I couldn’t find a way to programaticaly rename using xwiki API, altought I have started to learn and try some velocity scripts.

If there is some easy way to achieve this, can somebody, please point me in the right direction?

Thank you in advance.

It all depends if what you are really interested in is the page title users see or the actual page name (i.e. the URL) since those can be completely different things in XWiki and changing the title is a lot easier than renaming a page (since, it actually means moving a page which will have a different URL, changing links pointing to t, etc.).

As for modifying metadata of a page at creation, this is generally done using a listener. In short, you implement a component (org.xwiki.observation.EventListener) which is automatically called right before the creation of a new document (org.xwiki.bridge.event.DocumentCreatingEvent) and you modify the title of that document.

Since the document title is actually a Velocity script, you can keep it dynamic in case the parent’s title changes, so the job of the listener would be more to inject that script as title.