Search in sources :

Example 1 with BusinessEventLogViewerOutDto

use of org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerOutDto in project jaffa-framework by jaffa-projects.

the class BusinessEventLogViewerTx method read.

// .//GEN-END:_destroy_2_be
// .//GEN-BEGIN:_read_1_be
/**
 * Returns the details for BusinessEventLog.
 * @param input The criteria based on which an object will be retrieved.
 * @throws ApplicationExceptions This will be thrown if the criteria contains invalid data.
 * @throws FrameworkException Indicates some system error.
 * @return The object details. A null indicates, the object was not found.
 */
public BusinessEventLogViewerOutDto read(BusinessEventLogViewerInDto input) throws FrameworkException, ApplicationExceptions {
    UOW uow = null;
    try {
        // Print Debug Information for the input
        if (log.isDebugEnabled()) {
            log.debug("Input: " + (input != null ? input.toString() : null));
        }
        // create the UOW
        uow = new UOW();
        // Build the Criteria Object
        Criteria criteria = buildCriteria(input, uow);
        // .//GEN-END:_read_1_be
        // Add custom code before the query//GEN-FIRST:_read_1
        // .//GEN-LAST:_read_1
        // .//GEN-BEGIN:_read_2_be
        // Execute The Query
        Collection results = uow.query(criteria);
        // .//GEN-END:_read_2_be
        // Add custom code after the query//GEN-FIRST:_read_2
        // .//GEN-LAST:_read_2
        // .//GEN-BEGIN:_read_3_be
        // Convert the domain objects into the outbound dto
        BusinessEventLogViewerOutDto output = buildDto(uow, results);
        // Print Debug Information for the output
        if (log.isDebugEnabled()) {
            log.debug("Output: " + (output != null ? output.toString() : null));
        }
        return output;
    } finally {
        if (uow != null)
            uow.rollback();
    }
}
Also used : BusinessEventLogViewerOutDto(org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerOutDto) Criteria(org.jaffa.persistence.Criteria) UOW(org.jaffa.persistence.UOW)

Example 2 with BusinessEventLogViewerOutDto

use of org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerOutDto in project jaffa-framework by jaffa-projects.

the class BusinessEventLogViewerTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private BusinessEventLogViewerOutDto buildDto(UOW uow, Collection results) throws UOWException {
    BusinessEventLogViewerOutDto output = null;
    Iterator itr = results.iterator();
    if (itr.hasNext()) {
        // just return the details for the 1st record retrieved.
        BusinessEventLog businessEventLog = (BusinessEventLog) itr.next();
        output = new BusinessEventLogViewerOutDto();
        // .//GEN-END:_buildDto_1_be
        // Add custom code before all the setters//GEN-FIRST:_buildDto_1
        // .//GEN-LAST:_buildDto_1
        // .//GEN-BEGIN:_buildDto_LogId_1_be
        output.setLogId(businessEventLog.getLogId());
        // .//GEN-END:_buildDto_LogId_1_be
        // .//GEN-BEGIN:_buildDto_CorrelationType_1_be
        output.setCorrelationType(businessEventLog.getCorrelationType());
        // .//GEN-END:_buildDto_CorrelationType_1_be
        // .//GEN-BEGIN:_buildDto_CorrelationKey1_1_be
        output.setCorrelationKey1(businessEventLog.getCorrelationKey1());
        // .//GEN-END:_buildDto_CorrelationKey1_1_be
        // .//GEN-BEGIN:_buildDto_CorrelationKey2_1_be
        output.setCorrelationKey2(businessEventLog.getCorrelationKey2());
        // .//GEN-END:_buildDto_CorrelationKey2_1_be
        // .//GEN-BEGIN:_buildDto_CorrelationKey3_1_be
        output.setCorrelationKey3(businessEventLog.getCorrelationKey3());
        // .//GEN-END:_buildDto_CorrelationKey3_1_be
        // .//GEN-BEGIN:_buildDto_ScheduledTaskId_1_be
        output.setScheduledTaskId(businessEventLog.getScheduledTaskId());
        // .//GEN-END:_buildDto_ScheduledTaskId_1_be
        // .//GEN-BEGIN:_buildDto_MessageId_1_be
        output.setMessageId(businessEventLog.getMessageId());
        // .//GEN-END:_buildDto_MessageId_1_be
        // .//GEN-BEGIN:_buildDto_LoggedOn_1_be
        output.setLoggedOn(businessEventLog.getLoggedOn());
        // .//GEN-END:_buildDto_LoggedOn_1_be
        // .//GEN-BEGIN:_buildDto_LoggedBy_1_be
        output.setLoggedBy(businessEventLog.getLoggedBy());
        // .//GEN-END:_buildDto_LoggedBy_1_be
        // .//GEN-BEGIN:_buildDto_ProcessName_1_be
        output.setProcessName(businessEventLog.getProcessName());
        // .//GEN-END:_buildDto_ProcessName_1_be
        // .//GEN-BEGIN:_buildDto_SubProcessName_1_be
        output.setSubProcessName(businessEventLog.getSubProcessName());
        // .//GEN-END:_buildDto_SubProcessName_1_be
        // .//GEN-BEGIN:_buildDto_MessageType_1_be
        output.setMessageType(businessEventLog.getMessageType());
        // .//GEN-END:_buildDto_MessageType_1_be
        // .//GEN-BEGIN:_buildDto_MessageText_1_be
        output.setMessageText(businessEventLog.getMessageText());
        // .//GEN-END:_buildDto_MessageText_1_be
        // .//GEN-BEGIN:_buildDto_SourceClass_1_be
        output.setSourceClass(businessEventLog.getSourceClass());
        // .//GEN-END:_buildDto_SourceClass_1_be
        // .//GEN-BEGIN:_buildDto_SourceMethod_1_be
        output.setSourceMethod(businessEventLog.getSourceMethod());
        // .//GEN-END:_buildDto_SourceMethod_1_be
        // .//GEN-BEGIN:_buildDto_SourceLine_1_be
        output.setSourceLine(businessEventLog.getSourceLine());
        // .//GEN-END:_buildDto_SourceLine_1_be
        // .//GEN-BEGIN:_buildDto_StackTrace_1_be
        output.setStackTrace(businessEventLog.getStackTrace());
        // .//GEN-END:_buildDto_StackTrace_1_be
        // .//GEN-BEGIN:_buildDto_2_be
        // Add related objects, if required
        addRelatedDtos(uow, output, businessEventLog);
    // .//GEN-END:_buildDto_2_be
    // Add custom code to pass values to the dto//GEN-FIRST:_buildDto_2
    // .//GEN-LAST:_buildDto_2
    // .//GEN-BEGIN:_buildDto_3_be
    }
    return output;
}
Also used : BusinessEventLog(org.jaffa.modules.messaging.domain.BusinessEventLog) BusinessEventLogViewerOutDto(org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerOutDto)

Example 3 with BusinessEventLogViewerOutDto

use of org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerOutDto in project jaffa-framework by jaffa-projects.

the class BusinessEventLogViewerForm method populateRelatedAttachment.

private void populateRelatedAttachment(GridModel rows) {
    rows.clearRows();
    BusinessEventLogViewerOutDto outputDto = ((BusinessEventLogViewerComponent) getComponent()).getBusinessEventLogViewerOutDto();
    if (outputDto != null) {
        GridModelRow row = null;
        AttachmentDto[] attachment = outputDto.getAttachment();
        for (int i = 0; i < attachment.length; i++) {
            AttachmentDto rowDto = attachment[i];
            row = rows.newRow();
            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:RelatedAttachment_1_be
        // Add custom code for the row //GEN-FIRST:RelatedAttachment_1
        // .//GEN-LAST:RelatedAttachment_1
        // .//GEN-BEGIN:RelatedAttachment_2_be
        }
    }
}
Also used : AttachmentDto(org.jaffa.modules.messaging.components.businesseventlogviewer.dto.AttachmentDto) BusinessEventLogViewerOutDto(org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerOutDto) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Aggregations

BusinessEventLogViewerOutDto (org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerOutDto)3 AttachmentDto (org.jaffa.modules.messaging.components.businesseventlogviewer.dto.AttachmentDto)1 BusinessEventLog (org.jaffa.modules.messaging.domain.BusinessEventLog)1 Criteria (org.jaffa.persistence.Criteria)1 UOW (org.jaffa.persistence.UOW)1 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)1