Ejemplo n.º 1
0
  private GridViewNode buildGridViewNode(boolean isTop) {
    GridViewNode gridViewNode = new GridViewNode();
    gridViewNode.setTitle("随机");
    gridViewNode.setViewName("随机");
    PropCellNode propCellNode = new PropCellNode();
    propCellNode.setTitle("标题一");
    propCellNode.setPropName("prop1");
    gridViewNode.addCellNode(propCellNode);

    propCellNode = new PropCellNode();
    propCellNode.setTitle("标题二");
    propCellNode.setPropName("prop2");
    gridViewNode.addCellNode(propCellNode);

    RowCellNode rowCellNode = new RowCellNode();
    propCellNode = new PropCellNode();
    propCellNode.setTitle("标题一");
    propCellNode.setPropName("prop1");
    rowCellNode.addPropCellNode(propCellNode);
    propCellNode = new PropCellNode();
    propCellNode.setTitle("标题二");
    propCellNode.setPropName("prop2");
    rowCellNode.addPropCellNode(propCellNode);
    gridViewNode.addCellNode(rowCellNode);

    propCellNode = new PropCellNode();
    propCellNode.setTitle("标题三");
    propCellNode.setPropName("prop3");
    gridViewNode.addCellNode(propCellNode);

    IteratorCellNode iteratorCellNode = new IteratorCellNode();
    propCellNode = new PropCellNode();
    propCellNode.setTitle("标题一");
    propCellNode.setPropName("prop1");
    iteratorCellNode.addPropCellNode(propCellNode);
    propCellNode = new PropCellNode();
    propCellNode.setTitle("标题二");
    propCellNode.setPropName("prop2");
    iteratorCellNode.addPropCellNode(propCellNode);
    gridViewNode.addCellNode(iteratorCellNode);

    if (isTop) {
      gridViewNode.initSubGridViews();
      gridViewNode.addSubGridView(buildGridViewNode(false));
      gridViewNode.addSubGridView(buildGridViewNode(false));
    }

    return gridViewNode;
  }
Ejemplo n.º 2
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());
  }