String uid;
this.error = true;
this.items = Lists.newArrayList();
try {
Definition def = Aura.getDefinitionService().getDefinition(cmpname,
DefType.COMPONENT, DefType.APPLICATION);
if (def == null) {
this.title = "Unable to find component for input "
+ AuraTextUtil.escapeForHTML(cmpname);
return;
}
descriptor = def.getDescriptor();
uid = mdr.getUid(null, descriptor);
sorted = Sets.newTreeSet(mdr.getDependencies(uid));
this.title = String.format("Dependencies for %s [uid=%s]",
descriptor.toString(), uid);
this.error = false;
} catch (Throwable t) {
// If we get an exception, try to tell the user what happened.
this.title = String.format(
"%s: %s : list of reached components...",
AuraTextUtil.escapeForHTML(cmpname), t.getMessage());
sorted = Sets.newTreeSet(mdr.filterRegistry(null).keySet());
}
try {
for (DefDescriptor<?> dep : sorted) {
Map<String, Object> itemData = Maps.newHashMap();
Definition def = mdr.getDef(dep);
boolean valid = false;
String hash = "------";
if (def != null) {
valid = def.isValid();
hash = String.valueOf(def.getOwnHash());
}
itemData.put("descriptor", dep.toString());
itemData.put("type", dep.getDefType());
itemData.put("uid", hash);