String language = null;
if (refNode.isNodeType(Constants.JAHIANT_TRANSLATION)) {
language = refNode.getProperty("jcr:language").getString();
refNode = refNode.getParent();
}
GWTJahiaNodeUsage usage = new GWTJahiaNodeUsage(refNode.getIdentifier(), refNode.getPath());
usage.setNodeName(refNode.getName());
usage.setPagePath(parent != null ? parent.getPath() : refNode.getPath());
usage.setNodeTitle(refNode.hasProperty("jcr:title") ? refNode.getPropertyAsString("jcr:title") : "");
if (parent != null) {
usage.setPageTitle(parent.getPropertyAsString("jcr:title"));
} else {
String title = refNode.getPropertyAsString("jcr:title");
if (title == null) {
title = refNode.getName();
}
title += " (" + refNode.getPrimaryNodeType().getName() + ")";
usage.setPageTitle(title);
}
usage.setLanguage(language);
usage.setType(type);
result.add(usage);
}