Search in sources :

Example 1 with ItemFinderOutRowDto

use of org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class ItemFinderTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private ItemFinderOutDto buildDto(UOW uow, Collection results, ItemFinderInDto input) throws UOWException {
    ItemFinderOutDto output = new ItemFinderOutDto();
    int maxRecords = input.getMaxRecords() != null ? input.getMaxRecords().intValue() : 0;
    int counter = 0;
    for (Iterator i = results.iterator(); i.hasNext(); ) {
        if (++counter > maxRecords && maxRecords > 0) {
            output.setMoreRecordsExist(Boolean.TRUE);
            break;
        }
        ItemFinderOutRowDto row = new ItemFinderOutRowDto();
        Item item = (Item) i.next();
        // .//GEN-END:_buildDto_1_be
        // Add custom code before all the setters //GEN-FIRST:_buildDto_1
        // .//GEN-LAST:_buildDto_1
        // .//GEN-BEGIN:_buildDto_SegregationCode_1_be
        row.setSegregationCode(item.getSc());
        // .//GEN-END:_buildDto_SegregationCode_1_be
        // .//GEN-BEGIN:_buildDto_ItemId_1_be
        row.setItemId(item.getItemId());
        // .//GEN-END:_buildDto_ItemId_1_be
        // .//GEN-BEGIN:_buildDto_PartNo_1_be
        row.setPartNo(item.getPart());
        // .//GEN-END:_buildDto_PartNo_1_be
        // .//GEN-BEGIN:_buildDto_Serial_1_be
        row.setSerial(item.getSerial());
        // .//GEN-END:_buildDto_Serial_1_be
        // .//GEN-BEGIN:_buildDto_Qty_1_be
        row.setQty(item.getQty());
        // .//GEN-END:_buildDto_Qty_1_be
        // Add custom code to pass values to the dto //GEN-FIRST:_buildDto_2
        // .//GEN-LAST:_buildDto_2
        // .//GEN-BEGIN:_buildDto_3_be
        output.addRows(row);
    }
    return output;
}
Also used : ItemFinderOutDto(org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutDto) Item(org.jaffa.applications.test.modules.material.domain.Item) ItemFinderOutRowDto(org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutRowDto)

Example 2 with ItemFinderOutRowDto

use of org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class ItemFinderResultsForm method populateRows.

// .//GEN-END:_2_be
// .//GEN-BEGIN:_populateRows_1_be
private void populateRows() {
    GridModel rows = getRowsWM();
    rows.clearRows();
    ItemFinderOutDto outputDto = ((ItemFinderComponent) getComponent()).getItemFinderOutDto();
    if (outputDto != null) {
        GridModelRow row;
        for (int i = 0; i < outputDto.getRowsCount(); i++) {
            ItemFinderOutRowDto rowDto = outputDto.getRows(i);
            row = rows.newRow();
            row.addElement("segregationCode", rowDto.getSegregationCode());
            row.addElement("itemId", rowDto.getItemId());
            row.addElement("partNo", rowDto.getPartNo());
            row.addElement("serial", rowDto.getSerial());
            row.addElement("qty", rowDto.getQty());
        // .//GEN-END:_populateRows_1_be
        // Add custom code for the row //GEN-FIRST:_populateRows_1
        // .//GEN-LAST:_populateRows_1
        // .//GEN-BEGIN:_populateRows_2_be
        }
    }
}
Also used : ItemFinderOutDto(org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutDto) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) ItemFinderOutRowDto(org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutRowDto) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Aggregations

ItemFinderOutDto (org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutDto)2 ItemFinderOutRowDto (org.jaffa.applications.test.modules.material.components.itemfinder.dto.ItemFinderOutRowDto)2 Item (org.jaffa.applications.test.modules.material.domain.Item)1 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)1 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)1