Search in sources :

Example 1 with FormDefinitionFinderOutRowDto

use of org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class FormDefinitionFinderTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private FormDefinitionFinderOutDto buildDto(UOW uow, Collection results, FormDefinitionFinderInDto input) throws UOWException {
    FormDefinitionFinderOutDto output = new FormDefinitionFinderOutDto();
    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;
        }
        FormDefinitionFinderOutRowDto row = new FormDefinitionFinderOutRowDto();
        FormDefinition formDefinition = (FormDefinition) 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_FormId_1_be
        row.setFormId(formDefinition.getFormId());
        // .//GEN-END:_buildDto_FormId_1_be
        // .//GEN-BEGIN:_buildDto_FormName_1_be
        row.setFormName(formDefinition.getFormName());
        // .//GEN-END:_buildDto_FormName_1_be
        // .//GEN-BEGIN:_buildDto_FormAlternate_1_be
        row.setFormAlternate(formDefinition.getFormAlternate());
        // .//GEN-END:_buildDto_FormAlternate_1_be
        // .//GEN-BEGIN:_buildDto_FormVariation_1_be
        row.setFormVariation(formDefinition.getFormVariation());
        // .//GEN-END:_buildDto_FormVariation_1_be
        // .//GEN-BEGIN:_buildDto_Description_1_be
        row.setDescription(formDefinition.getDescription());
        // .//GEN-END:_buildDto_Description_1_be
        // .//GEN-BEGIN:_buildDto_FormTemplate_1_be
        row.setFormTemplate(formDefinition.getFormTemplate());
        // .//GEN-END:_buildDto_FormTemplate_1_be
        // .//GEN-BEGIN:_buildDto_OutputType_1_be
        row.setOutputType(formDefinition.getOutputType());
        // .//GEN-END:_buildDto_OutputType_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 : FormDefinitionFinderOutRowDto(org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutRowDto) FormDefinition(org.jaffa.modules.printing.domain.FormDefinition) FormDefinitionFinderOutDto(org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutDto)

Example 2 with FormDefinitionFinderOutRowDto

use of org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class FormDefinitionFinderForm 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();
    FormDefinitionFinderOutDto outputDto = (FormDefinitionFinderOutDto) ((FormDefinitionFinderComponent) getComponent()).getFinderOutDto();
    if (outputDto != null) {
        GridModelRow row;
        for (int i = 0; i < outputDto.getRowsCount(); i++) {
            FormDefinitionFinderOutRowDto rowDto = outputDto.getRows(i);
            row = rows.newRow();
            row.addElement("formId", rowDto.getFormId());
            row.addElement("formName", rowDto.getFormName());
            row.addElement("formAlternate", rowDto.getFormAlternate());
            row.addElement("formVariation", rowDto.getFormVariation());
            row.addElement("description", rowDto.getDescription());
            row.addElement("formTemplate", rowDto.getFormTemplate());
            row.addElement("outputType", rowDto.getOutputType());
        // .//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 : FormDefinitionFinderOutRowDto(org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutRowDto) FormDefinitionFinderOutDto(org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutDto)

Aggregations

FormDefinitionFinderOutDto (org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutDto)2 FormDefinitionFinderOutRowDto (org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutRowDto)2 FormDefinition (org.jaffa.modules.printing.domain.FormDefinition)1