Search in sources :

Example 1 with AttachmentLookupOutRowDto

use of org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutRowDto in project jaffa-framework by jaffa-projects.

the class AttachmentLookupForm 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();
    AttachmentLookupOutDto outputDto = (AttachmentLookupOutDto) ((AttachmentLookupComponent) getComponent()).getFinderOutDto();
    if (outputDto != null) {
        GridModelRow row;
        for (int i = 0; i < outputDto.getRowsCount(); i++) {
            AttachmentLookupOutRowDto rowDto = outputDto.getRows(i);
            row = rows.newRow();
            row.addElement(LookupComponent2.MULTI_SELECT_CHECKBOX, new CheckBoxModel(false));
            row.addElement("attachmentId", rowDto.getAttachmentId());
            row.addElement("serializedKey", rowDto.getSerializedKey());
            row.addElement("originalFileName", rowDto.getOriginalFileName());
            row.addElement("attachmentType", rowDto.getAttachmentType());
            row.addElement("contentType", rowDto.getContentType());
            row.addElement("description", rowDto.getDescription());
            row.addElement("remarks", rowDto.getRemarks());
            row.addElement("supercededBy", rowDto.getSupercededBy());
            row.addElement("createdOn", rowDto.getCreatedOn());
            row.addElement("createdBy", rowDto.getCreatedBy());
            row.addElement("lastChangedOn", rowDto.getLastChangedOn());
            row.addElement("lastChangedBy", rowDto.getLastChangedBy());
            row.addElement("data", rowDto.getData());
        // .//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 : AttachmentLookupOutDto(org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutDto) AttachmentLookupOutRowDto(org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutRowDto)

Example 2 with AttachmentLookupOutRowDto

use of org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutRowDto in project jaffa-framework by jaffa-projects.

the class AttachmentLookupTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private AttachmentLookupOutDto buildDto(UOW uow, Collection results, AttachmentLookupInDto input) throws UOWException {
    AttachmentLookupOutDto output = new AttachmentLookupOutDto();
    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;
        }
        AttachmentLookupOutRowDto row = new AttachmentLookupOutRowDto();
        Attachment attachment = (Attachment) 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_AttachmentId_1_be
        row.setAttachmentId(attachment.getAttachmentId());
        // .//GEN-END:_buildDto_AttachmentId_1_be
        // .//GEN-BEGIN:_buildDto_SerializedKey_1_be
        row.setSerializedKey(attachment.getSerializedKey());
        // .//GEN-END:_buildDto_SerializedKey_1_be
        // .//GEN-BEGIN:_buildDto_OriginalFileName_1_be
        row.setOriginalFileName(attachment.getOriginalFileName());
        // .//GEN-END:_buildDto_OriginalFileName_1_be
        // .//GEN-BEGIN:_buildDto_AttachmentType_1_be
        row.setAttachmentType(attachment.getAttachmentType());
        // .//GEN-END:_buildDto_AttachmentType_1_be
        // .//GEN-BEGIN:_buildDto_ContentType_1_be
        row.setContentType(attachment.getContentType());
        // .//GEN-END:_buildDto_ContentType_1_be
        // .//GEN-BEGIN:_buildDto_Description_1_be
        row.setDescription(attachment.getDescription());
        // .//GEN-END:_buildDto_Description_1_be
        // .//GEN-BEGIN:_buildDto_Remarks_1_be
        row.setRemarks(attachment.getRemarks());
        // .//GEN-END:_buildDto_Remarks_1_be
        // .//GEN-BEGIN:_buildDto_SupercededBy_1_be
        row.setSupercededBy(attachment.getSupercededBy());
        // .//GEN-END:_buildDto_SupercededBy_1_be
        // .//GEN-BEGIN:_buildDto_CreatedOn_1_be
        row.setCreatedOn(attachment.getCreatedOn());
        // .//GEN-END:_buildDto_CreatedOn_1_be
        // .//GEN-BEGIN:_buildDto_CreatedBy_1_be
        row.setCreatedBy(attachment.getCreatedBy());
        // .//GEN-END:_buildDto_CreatedBy_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedOn_1_be
        row.setLastChangedOn(attachment.getLastChangedOn());
        // .//GEN-END:_buildDto_LastChangedOn_1_be
        // .//GEN-BEGIN:_buildDto_LastChangedBy_1_be
        row.setLastChangedBy(attachment.getLastChangedBy());
        // .//GEN-END:_buildDto_LastChangedBy_1_be
        // .//GEN-BEGIN:_buildDto_Data_1_be
        row.setData(attachment.getData());
        // .//GEN-END:_buildDto_Data_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 : AttachmentLookupOutDto(org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutDto) AttachmentLookupOutRowDto(org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutRowDto) Attachment(org.jaffa.components.attachment.domain.Attachment)

Aggregations

AttachmentLookupOutDto (org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutDto)2 AttachmentLookupOutRowDto (org.jaffa.components.attachment.components.attachmentlookup.dto.AttachmentLookupOutRowDto)2 Attachment (org.jaffa.components.attachment.domain.Attachment)1