New contrib extension repository - Wiki initializer application

Hi everyone,

I would like to propose the creation of a new contrib extension repository for an application that would be used to automatically initialize wikis and sub-wikis.

Note that, by “initializing”, I am referring to the fact of performing the first request to these wikis / sub-wikis. The end goal of this application is to make sure that the first user who accesses XWiki gets directly to the requested page, without having to go through the “XWiki is initializing …” page.

Thanks,
Clément

1 Like

I’m curious how that app would work. Is it a crontab you set? Is it a standalone java app with some thread? How different is it from xinit which has this feature too?

Thanks

Hei hei,

The goal is to have this as an XWiki extension, so that it can be either bundled within a custom WAR, or installed through the extension manager.

Right now, I have a working PoC that uses an event listener on ApplicationStartedEvent for initializing the main wiki. The listener will basically craft stub requests to initialize the context and the wiki.

ServletEnvironment servletEnvironment = (ServletEnvironment) environment;
XWikiEngineContext engineContext = new XWikiServletContext(servletEnvironment.getServletContext());

XWikiContext context = Utils.prepareContext(ACTION, new XWikiServletRequestStub(),
    new XWikiServletResponseStub(), engineContext);
context.setMode(XWikiContext.MODE_SERVLET);

containerInitializer.initializeRequest(context.getRequest().getHttpServletRequest(), context);
containerInitializer.initializeResponse(context.getResponse());
containerInitializer.initializeSession(context.getRequest().getHttpServletRequest());

XWiki.getXWiki(false, context);

Right now, this solution works great for the initialization of local XWiki instances, but I need to check how the URLFactories get initialized.

Thanks,

Hi everyone,

I’ve created the GitHub repository and the JIRA project ; here are the links :

Thanks