DocumentBuilder builder = publication.getDocumentBuilder();
String url = builder.buildCanonicalUrl(publication, area, childId, language);
Document childDocument = builder.buildDocument(publication, url);
if (!childDocument.existsInAnyLanguage()) {
throw new NoChildDocumentExistException("The document " + childId + " does not exist. Check sitetree, it might need to be reloaded.");
}
List availableLanguages = Arrays.asList(childDocument.getLanguages());
if (availableLanguages.contains(language)) {
return Collections.unmodifiableMap(Collections.EMPTY_MAP);
}
} else {
throw new NoChildDocumentExistException("This document has no children. Check sitetree, it might need to be reloaded.");
}
return null;
}