Search in sources :

Example 1 with FormDefinitionViewerOutDto

use of org.jaffa.modules.printing.components.formdefinitionviewer.dto.FormDefinitionViewerOutDto in project jaffa-framework by jaffa-projects.

the class FormDefinitionViewerTx method read.

// .//GEN-END:_destroy_2_be
// .//GEN-BEGIN:_read_1_be
/**
 * Returns the details for FormDefinition.
 * @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 FormDefinitionViewerOutDto read(FormDefinitionViewerInDto 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
        FormDefinitionViewerOutDto 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 : FormDefinitionViewerOutDto(org.jaffa.modules.printing.components.formdefinitionviewer.dto.FormDefinitionViewerOutDto) Criteria(org.jaffa.persistence.Criteria) UOW(org.jaffa.persistence.UOW)

Example 2 with FormDefinitionViewerOutDto

use of org.jaffa.modules.printing.components.formdefinitionviewer.dto.FormDefinitionViewerOutDto in project jaffa-framework by jaffa-projects.

the class FormDefinitionViewerTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private FormDefinitionViewerOutDto buildDto(UOW uow, Collection results) throws UOWException {
    FormDefinitionViewerOutDto output = null;
    Iterator itr = results.iterator();
    if (itr.hasNext()) {
        // just return the details for the 1st record retrieved.
        FormDefinition formDefinition = (FormDefinition) itr.next();
        output = new FormDefinitionViewerOutDto();
        // .//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
        output.setFormId(formDefinition.getFormId());
        // .//GEN-END:_buildDto_FormId_1_be
        // .//GEN-BEGIN:_buildDto_FormName_1_be
        output.setFormName(formDefinition.getFormName());
        // .//GEN-END:_buildDto_FormName_1_be
        // .//GEN-BEGIN:_buildDto_FormAlternate_1_be
        output.setFormAlternate(formDefinition.getFormAlternate());
        // .//GEN-END:_buildDto_FormAlternate_1_be
        // .//GEN-BEGIN:_buildDto_FormVariation_1_be
        output.setFormVariation(formDefinition.getFormVariation());
        // .//GEN-END:_buildDto_FormVariation_1_be
        // .//GEN-BEGIN:_buildDto_Description_1_be
        output.setDescription(formDefinition.getDescription());
        // .//GEN-END:_buildDto_Description_1_be
        // .//GEN-BEGIN:_buildDto_Remarks_1_be
        output.setRemarks(formDefinition.getRemarks());
        // .//GEN-END:_buildDto_Remarks_1_be
        // .//GEN-BEGIN:_buildDto_OutputType_1_be
        output.setOutputType(formDefinition.getOutputType());
        // .//GEN-END:_buildDto_OutputType_1_be
        // .//GEN-BEGIN:_buildDto_FollowOnFormName_1_be
        output.setFollowOnFormName(formDefinition.getFollowOnFormName());
        // .//GEN-END:_buildDto_FollowOnFormName_1_be
        // .//GEN-BEGIN:_buildDto_FormTemplate_1_be
        output.setFormTemplate(formDefinition.getFormTemplate());
        // .//GEN-END:_buildDto_FormTemplate_1_be
        // .//GEN-BEGIN:_buildDto_FieldLayout_1_be
        output.setFieldLayout(formDefinition.getFieldLayout());
        // .//GEN-END:_buildDto_FieldLayout_1_be
        // .//GEN-BEGIN:_buildDto_DomClass_1_be
        output.setDomClass(formDefinition.getDomClass());
        // .//GEN-END:_buildDto_DomClass_1_be
        // .//GEN-BEGIN:_buildDto_DomKey1_1_be
        output.setDomKey1(formDefinition.getDomKey1());
        // .//GEN-END:_buildDto_DomKey1_1_be
        // .//GEN-BEGIN:_buildDto_DomKey2_1_be
        output.setDomKey2(formDefinition.getDomKey2());
        // .//GEN-END:_buildDto_DomKey2_1_be
        // .//GEN-BEGIN:_buildDto_DomKey3_1_be
        output.setDomKey3(formDefinition.getDomKey3());
        // .//GEN-END:_buildDto_DomKey3_1_be
        // .//GEN-BEGIN:_buildDto_DomKey4_1_be
        output.setDomKey4(formDefinition.getDomKey4());
        // .//GEN-END:_buildDto_DomKey4_1_be
        // .//GEN-BEGIN:_buildDto_DomKey5_1_be
        output.setDomKey5(formDefinition.getDomKey5());
        // .//GEN-END:_buildDto_DomKey5_1_be
        // .//GEN-BEGIN:_buildDto_DomKey6_1_be
        output.setDomKey6(formDefinition.getDomKey6());
        // .//GEN-END:_buildDto_DomKey6_1_be
        // .//GEN-BEGIN:_buildDto_DomFactory_1_be
        output.setDomFactory(formDefinition.getDomFactory());
        // .//GEN-END:_buildDto_DomFactory_1_be
        // .//GEN-BEGIN:_buildDto_AdditionalDataComponent_1_be
        output.setAdditionalDataComponent(formDefinition.getAdditionalDataComponent());
        // .//GEN-END:_buildDto_AdditionalDataComponent_1_be
        // .//GEN-BEGIN:_buildDto_FollowOnFormAlternate_1_be
        output.setFollowOnFormAlternate(formDefinition.getFollowOnFormAlternate());
        // .//GEN-END:_buildDto_FollowOnFormAlternate_1_be
        // .//GEN-BEGIN:_buildDto_2_be
        // Add related objects, if required
        addRelatedDtos(uow, output, formDefinition);
    // .//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 : FormDefinitionViewerOutDto(org.jaffa.modules.printing.components.formdefinitionviewer.dto.FormDefinitionViewerOutDto) FormDefinition(org.jaffa.modules.printing.domain.FormDefinition)

Aggregations

FormDefinitionViewerOutDto (org.jaffa.modules.printing.components.formdefinitionviewer.dto.FormDefinitionViewerOutDto)2 FormDefinition (org.jaffa.modules.printing.domain.FormDefinition)1 Criteria (org.jaffa.persistence.Criteria)1 UOW (org.jaffa.persistence.UOW)1