コード例 #1
0
  public void test() throws Exception {
    DefaultXmlFileLoader loader = new DefaultXmlFileLoader();
    TaskInfoNode load =
        loader.load(
            new File(
                "F:/zh-private/gree/workspace/origin-gm/webroot/config/test_docInfo_config.xml"));

    assertEquals("4A44F49F", load.getBosType());
    assertEquals("费用报销单", load.getBosTypeName());
    assertEquals("fuKuan", load.getDefaultView());

    List<ViewNode> viewNodes = load.getViewNodes();
    assertEquals(4, viewNodes.size());

    SimpleViewNode sv = (SimpleViewNode) viewNodes.get(0);
    assertEquals(2, sv.getTables().size());

    GridViewNode gv = (GridViewNode) viewNodes.get(1);
    assertEquals(5, gv.getCellNodes().size());

    gv = (GridViewNode) viewNodes.get(2);
    assertEquals(4, gv.getCellNodes().size());
    assertEquals(3, gv.getSubGridViews().size());

    gv = (GridViewNode) viewNodes.get(3);
    assertEquals(3, gv.getCellNodes().size());
    assertEquals(1, gv.getSubGridViews().size());
  }
コード例 #2
0
  private SimpleViewNode buildSimpleViewNode() {
    SimpleViewNode simpleViewNode = new SimpleViewNode();
    simpleViewNode.setTitle("随机");
    simpleViewNode.setViewName("随机");
    GroupTableNode table = new GroupTableNode();
    RowItemNode item = new RowItemNode();
    item.setTitle("标题一");
    item.setPropName("prop1");
    table.addItem(item);
    item = new RowItemNode();
    item.setTitle("标题二");
    item.setPropName("prop2");
    table.addItem(item);
    item = new RowItemNode();
    item.setTitle("标题三");
    item.setPropName("prop3");
    table.addItem(item);
    simpleViewNode.addTable(table);

    ListTableNode listTableNode = new ListTableNode();
    listTableNode.setPropName("prop1");
    item = new RowItemNode();
    item.setTitle("标题一");
    item.setPropName("prop1");
    listTableNode.addItem(item);
    item = new RowItemNode();
    item.setTitle("标题二");
    item.setPropName("prop2");
    listTableNode.addItem(item);
    item = new RowItemNode();
    item.setTitle("标题三");
    item.setPropName("prop3");
    listTableNode.addItem(item);
    simpleViewNode.addTable(listTableNode);
    return simpleViewNode;
  }