Esempio n. 1
0
 protected final ArrayList<PageNode> buildNodes() {
   ArrayList<PageNode> nodes = new ArrayList<PageNode>();
   for (NodeBuilder node : this.nodes) {
     nodes.add(node.build());
   }
   return nodes;
 }
Esempio n. 2
0
  @Override
  protected void initChildren() {
    List<OrderItem> orderItems =
        FacadeContext.getOrderItemFacade().findBy(getOrder(), OrderItemType.first);
    for (OrderItem orderItem : orderItems) {
      AOrderNode node =
          nodeBuilder.build(
              OrderItemNode.class,
              MapUtils.putAll(
                  new HashMap<String, Object>(), new Object[] {"orderItem", orderItem}));
      add(node);
    }
    orderItems = FacadeContext.getOrderItemFacade().findBy(getOrder(), OrderItemType.common);
    for (OrderItem orderItem : orderItems) {
      if (orderItem.getSource() == null) {
        AOrderNode node =
            nodeBuilder.build(
                OrderItemNode.class,
                MapUtils.putAll(
                    new HashMap<String, Object>(), new Object[] {"orderItem", orderItem}));
        add(node);
      }
    }

    if (getOrder() instanceof Order) {
      add(
          nodeBuilder.build(
              TemplatesNode.class,
              MapUtils.putAll(
                  new HashMap<String, Object>(), new Object[] {"nodeBuilder", nodeBuilder})));
      add(nodeBuilder.build(AGTFacadeNode.class, MapUtils.EMPTY_MAP));
      add(nodeBuilder.build(ZFacadeNode.class, MapUtils.EMPTY_MAP));
    } else if (getOrder() instanceof TemplateOrder) {
      add(nodeBuilder.build(TemplateFacadeNode.class, MapUtils.EMPTY_MAP));
    }
  }