Search in sources :

Example 1 with OutputCommandFinderOutRowDto

use of org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class OutputCommandFinderTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private OutputCommandFinderOutDto buildDto(UOW uow, Collection results, OutputCommandFinderInDto input) throws UOWException {
    OutputCommandFinderOutDto output = new OutputCommandFinderOutDto();
    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;
        }
        OutputCommandFinderOutRowDto row = new OutputCommandFinderOutRowDto();
        OutputCommand outputCommand = (OutputCommand) 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_OutputCommandId_1_be
        row.setOutputCommandId(outputCommand.getOutputCommandId());
        // .//GEN-END:_buildDto_OutputCommandId_1_be
        // .//GEN-BEGIN:_buildDto_OutputType_1_be
        row.setOutputType(outputCommand.getOutputType());
        // .//GEN-END:_buildDto_OutputType_1_be
        // .//GEN-BEGIN:_buildDto_SequenceNo_1_be
        row.setSequenceNo(outputCommand.getSequenceNo());
        // .//GEN-END:_buildDto_SequenceNo_1_be
        // .//GEN-BEGIN:_buildDto_OsPattern_1_be
        row.setOsPattern(outputCommand.getOsPattern());
        // .//GEN-END:_buildDto_OsPattern_1_be
        // .//GEN-BEGIN:_buildDto_CommandLine_1_be
        row.setCommandLine(outputCommand.getCommandLine());
        // .//GEN-END:_buildDto_CommandLine_1_be
        // .//GEN-BEGIN:_buildDto_CreatedOn_1_be
        row.setCreatedOn(outputCommand.getCreatedOn());
        // .//GEN-END:_buildDto_CreatedOn_1_be
        // .//GEN-BEGIN:_buildDto_CreatedBy_1_be
        row.setCreatedBy(outputCommand.getCreatedBy());
        // .//GEN-END:_buildDto_CreatedBy_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedOn_1_be
        row.setLastChangedOn(outputCommand.getLastChangedOn());
        // .//GEN-END:_buildDto_LastChangedOn_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedBy_1_be
        row.setLastChangedBy(outputCommand.getLastChangedBy());
        // .//GEN-END:_buildDto_LastChangedBy_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 : OutputCommandFinderOutRowDto(org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutRowDto) OutputCommand(org.jaffa.modules.printing.domain.OutputCommand) OutputCommandFinderOutDto(org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutDto)

Example 2 with OutputCommandFinderOutRowDto

use of org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class OutputCommandFinderForm method populateRows.

// .//GEN-END:_doValidate_2_be
// .//GEN-BEGIN:_populateRows_1_be
/**
 * This will populate the input GridModel with the data in the finderOutDto of the Component.
 * @param rows The GridModel object to populate.
 */
public void populateRows(GridModel rows) {
    rows.clearRows();
    OutputCommandFinderOutDto outputDto = (OutputCommandFinderOutDto) ((OutputCommandFinderComponent) getComponent()).getFinderOutDto();
    if (outputDto != null) {
        GridModelRow row;
        for (int i = 0; i < outputDto.getRowsCount(); i++) {
            OutputCommandFinderOutRowDto rowDto = outputDto.getRows(i);
            row = rows.newRow();
            row.addElement("outputCommandId", rowDto.getOutputCommandId());
            row.addElement("outputType", rowDto.getOutputType());
            row.addElement("sequenceNo", rowDto.getSequenceNo());
            row.addElement("osPattern", rowDto.getOsPattern());
            row.addElement("commandLine", rowDto.getCommandLine());
            row.addElement("createdOn", rowDto.getCreatedOn());
            row.addElement("createdBy", rowDto.getCreatedBy());
            row.addElement("lastChangedOn", rowDto.getLastChangedOn());
            row.addElement("lastChangedBy", rowDto.getLastChangedBy());
        // .//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 : OutputCommandFinderOutRowDto(org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutRowDto) OutputCommandFinderOutDto(org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutDto)

Aggregations

OutputCommandFinderOutDto (org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutDto)2 OutputCommandFinderOutRowDto (org.jaffa.modules.printing.components.outputcommandfinder.dto.OutputCommandFinderOutRowDto)2 OutputCommand (org.jaffa.modules.printing.domain.OutputCommand)1