Example #1
0
 public String addNonHumanCategory(NonHumanCategory c) {
   if (isDataEditable(ResUnit.NonHumanCategory)) {
     String newID = getDataSource(ResUnit.NonHumanCategory).insert(c);
     if (!hasDefaultDataSource(ResUnit.NonHumanCategory)) c.setID(newID);
     putNonHumanCategory(c);
     return newID;
   } else return fail("External NonHumanCategory dataset is read-only");
 }
Example #2
0
 public void fromXNode(XNode node) {
   setID(node.getAttributeValue("id"));
   setName(node.getChildText("name"));
   setDescription(node.getChildText("description"));
   setNotes(node.getChildText("notes"));
   XNode subNode = node.getChild("subCategories");
   for (XNode subCatNode : subNode.getChildren()) {
     addSubCategory(new NonHumanSubCategory(subCatNode));
   }
 }