How To Rename an AWM

Hi there,

I’d like to rename an AWM (both XClass and XObjects) and see three options:

  • Export the AWM use Find/Replace in the text editor
  • Re-create the AWM wit the new name/path and write a groovy script that uses the old XObjects as templates to create the new XObjects
  • Try and do the change directly on the database level.

What would you recommend? Any hints?

Thanks
Guido

This should work but you also need to update the paths within the XAR. For instance if you rename the page A.B.C in X.Y.Z then you need to rename/move the file A/B/C.xml into X/Y/Z.xml within the XAR. And you probably have to update the XAR package descriptor (pacakge.xml).

Could work, but might not be that easy. Depends on your groovy skills and how well you know the XWiki API.

That’s a bit dangerous. I don’t recommend this.

Hope this helps,
Marius

Thank you, Marius.

I’ll use Idea to do the find and replace. Seems to work for me, when replacing

([>."'])OldName( ?(|Class|Sheet|Template|Template ?Provider|Translations)[<."'_])

with

$1NewName$2