For the parameters: location - The XWiki document reference or URL to redirect to. The URL can be absolute or relative. delay - expressed in seconds (optional: default is 0) visible - whether to display a redirect notice box (optional: defaults is “true”)
I suggest we call this extension simply “redirect-macro”.
If it’s OK for everyone, is it possible to create a contrib repository and a jira project?
For consistency, i’d use reference and/or page instead of location for the parameter since this is what we use in other macros (include, display, etc).
If you want to use the same parameter for both a reference and a URL you could have some problems since in theory a page can be named “http://somedomain”. In this case you may want to use the same strategy than we use for the xwiki/2.1 link syntax, see the explanations at the bottom of https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/?syntax=2.1§ion=Links (you may even be able to reuse the same code for resolving link references). A simpler option (but maybe less nice for users would be to allow both reference and url parameters for the macro, at least it would less magical).
Note: redirect is using a pretty broad namespace. I’m hesitating with some more restrictive name like page-redirect. However, if I don’t get any negative feedback for redirect in the coming 10mn, I’ll go with it.
Better use reference, yes (also this field should probably be a org.xwiki.rendering.listener.reference.ResourceReference given its description). page does not make much sense, since it might not be a page at all.
That’s what we use in the Office Viewer macro (but more importantly, it’s what represent the reference of a link in the XDOM, so it should fit your use case well), for example @ppantiru if you want to take a look.