if (element.getAttribute("labelfield") != null && element.getAttribute("labelfield").isEmpty())
{
throw new MolgenisModelException("labelfield is missing for tree screen '" + name + "'");
}
Tree tree = new Tree(name, parent, element.getAttribute("parentfield"),
element.getAttribute("idfield"), element.getAttribute("labelfield"));
tree.setLabel(label);
tree.setGroup(group);
tree.setGroupRead(groupRead);
if (group != null && groupRead != null && group.equals(groupRead))
{
throw new MolgenisModelException(
"You cannot assign both read/write and read rights on a single tree");
}
tree.setNamespace(namespace);
new_parent = tree;
// READONLY
tree.setReadOnly(true);
String readonly = element.getAttribute("readonly");
if (readonly != null)
{
tree.setReadOnly(Boolean.parseBoolean(readonly));
}
// ENTITY
// TODO: whould have expected this in the constructor!
DBSchema entity = model.getDatabase().getChild(element.getAttribute("entity"));
if (entity == null)
{
throw new MolgenisModelException("Could not find the specified entity '"
+ element.getAttribute("entity") + "'");
}
tree.setRecord((Record) entity);
}
else if (element.getTagName().equals("plugin"))
{
if (element.getAttribute("type") != null && element.getAttribute("type").isEmpty())
{