0 Replies Latest reply on Dec 15, 2010 8:43 AM by Diego Gusava

    Beginner question Input Type ArrayList

    Diego Gusava Newbie

      I have smooks-config.xml, and the param "input.java" is "example.srcmodel.Order" , but i want pass a ArrayList<Order> and receive a ArrayList<OrderLine>. Its possible? If yes, how ? Thanks.

       

      <?xml version="1.0" encoding="UTF-8"?><smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd" xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
        <params>
          <param name="stream.filter.type">SAX</param>
          <param name="inputType">input.java</param>
          <param name="input.java" type="input.type.deactived">java.util.ArrayList</param>
          <param name="input.java" type="input.type.actived">example.srcmodel.Order</param>
        </params>
        <jb:bean beanId="LineOrder" class="example.target.LineOrder" createOnElement="example.srcmodel.Order">
          <jb:value data="/example.srcmodel.Order/header/customerNumber" property="customeId"/>
          <jb:value data="/example.srcmodel.Order/header/customerName" property="customerName"/>
          <jb:wiring beanIdRef="lineItems" property="lineItems" wireOnElement="/example.srcmodel.Order/orderItems"/>
          <jb:value data="/example.srcmodel.Order/header/priority" decoder="Enum" property="priority">
            <jb:decodeParam name="enumType">example.target.LineOrderPriority</jb:decodeParam>
            <jb:decodeParam name="IMPORTANT">IMPORTANT</jb:decodeParam>
            <jb:decodeParam name="NOTIMPORTANT">NOTIMPORTANT</jb:decodeParam>
            <jb:decodeParam name="VERYIMPORTANT">VERYIMPORTANT</jb:decodeParam>
          </jb:value>
        </jb:bean>
        <jb:bean beanId="lineItems" class="java.util.ArrayList" createOnElement="/example.srcmodel.Order/orderItems">
          <jb:wiring beanIdRef="LineItem" wireOnElement="/example.srcmodel.Order/orderItems"/>
        </jb:bean>
        <jb:bean beanId="LineItem" class="example.target.LineItem" createOnElement="/example.srcmodel.Order/orderItems/example.srcmodel.OrderItem">
          <jb:value data="/example.srcmodel.Order/orderItems/example.srcmodel.OrderItem/productId" property="productCode"/>
          <jb:value data="/example.srcmodel.Order/orderItems/example.srcmodel.OrderItem/price" property="unitPrice"/>
          <jb:value data="/example.srcmodel.Order/orderItems/example.srcmodel.OrderItem/quantity" property="unitQuantity"/>
        </jb:bean>
      </smooks-resource-list>