String spaceUri =
UriBuilder.fromUri(uriInfo.getBaseUri()).path(SpaceResource.class).build(wikiName, spaceName)
.toString();
spaceLink.setHref(spaceUri);
searchResult.getLinks().add(spaceLink);
<BUG>String webHomePageId = Utils.getPageId(wikiName, spaceName, "WebHome");
if (Utils.getXWikiApi(componentManager).exists(webHomePageId)
&& Utils.getXWikiApi(componentManager).hasAccessLevel("view", webHomePageId)) {</BUG>
String pageUri =
UriBuilder.fromUri(uriInfo.getBaseUri()).path(PageResource.class)

String spaceUri =
UriBuilder.fromUri(uriInfo.getBaseUri()).path(SpaceResource.class).build(wikiName, spaceName)
.toString();
spaceLink.setHref(spaceUri);
searchResult.getLinks().add(spaceLink);
String webHomePageId = Utils.getPageId(wikiName, spaceName, "WebHome");
if (xwikiApi.exists(webHomePageId) && xwikiApi.hasAccessLevel("view", webHomePageId)) {
String pageUri =
UriBuilder.fromUri(uriInfo.getBaseUri()).path(PageResource.class)
