Session session = RepositoryUtil.getSession(this.manager, request);
DocumentFactory factory = DocumentUtil.createDocumentFactory(this.manager, session);
String webappUrl = getWebappUrl(params, objectModel);
URLInformation info = new URLInformation(webappUrl);
String pubId = info.getPublicationId();
this.rewriter = new IncomingLinkRewriter(factory.getPublication(pubId));
} catch (final Exception e) {
throw new RuntimeException(e);
}
}