Example #1
0
  public void testLoadM() throws Exception {
    Database database = _category.getDatabase();

    database.begin();
    M m = (M) database.load(M.class, new Integer(1));
    database.commit();

    assertNotNull(m);
    assertEquals(1, m.getId());
    assertEquals("m1", m.getName());

    Collection ns = m.getNs();
    assertNotNull(ns);
    assertEquals(2, ns.size());

    database.close();
  }
Example #2
0
  private ZTree convertToZtree(M m, boolean open, boolean onlyCheckLeaf) {
    ZTree<ID> zTree = new ZTree<ID>();
    zTree.setId(m.getId());
    zTree.setpId(m.getParentId());
    zTree.setName(m.getName());
    zTree.setIconSkin(m.getIcon());
    zTree.setOpen(open);
    zTree.setRoot(m.isRoot());
    zTree.setIsParent(m.isHasChildren());

    if (onlyCheckLeaf && zTree.isIsParent()) {
      zTree.setNocheck(true);
    } else {
      zTree.setNocheck(false);
    }

    return zTree;
  }
 private boolean isNameUnique() {
   return overallModel.isNameUnique(pageModel.getName().getText());
 }
 private boolean isNameDefined() {
   return !pageModel.getName().isEmpty();
 }