Search in sources :

Example 1 with IFormTemplateFinder

use of org.jaffa.modules.printing.components.formtemplatefinder.IFormTemplateFinder in project jaffa-framework by jaffa-projects.

the class FormTemplateFinderComponent method doInquiry.

// .//GEN-END:layoutData_1_be
// .//GEN-BEGIN:_doInquiry_1_be
/**
 * This performs the actual query to obtain the FinderOutDto.
 * @throws ApplicationExceptions This will be thrown in case any invalid data has been set.
 * @throws FrameworkException Indicates some system error.
 * @return the FinderOutDto object.
 */
protected FinderOutDto doInquiry() throws ApplicationExceptions, FrameworkException {
    ApplicationExceptions appExps = null;
    FormTemplateFinderInDto inputDto = new FormTemplateFinderInDto();
    // .//GEN-END:_doInquiry_1_be
    // Add custom code before processing the method //GEN-FIRST:_doInquiry_1
    // .//GEN-LAST:_doInquiry_1
    // .//GEN-BEGIN:_doInquiry_2_be
    inputDto.setMaxRecords(getMaxRecords());
    try {
        if (getFormId() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getFormIdDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getFormIdDd()))
            inputDto.setFormId(IntegerCriteriaField.getIntegerCriteriaField(getFormIdDd(), getFormId(), (IntegerFieldMetaData) FormTemplateMeta.META_FORM_ID));
    } catch (ValidationException e) {
        if (appExps == null)
            appExps = new ApplicationExceptions();
        appExps.add(e);
    }
    if (getTemplateData() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getTemplateDataDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getTemplateDataDd()))
        inputDto.setTemplateData(RawCriteriaField.getRawCriteriaField(getTemplateDataDd(), getTemplateData(), null));
    if (getLayoutData() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getLayoutDataDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getLayoutDataDd()))
        inputDto.setLayoutData(RawCriteriaField.getRawCriteriaField(getLayoutDataDd(), getLayoutData(), null));
    // throw ApplicationExceptions, if any parsing errors occured
    if (appExps != null && appExps.size() > 0)
        throw appExps;
    inputDto.setHeaderDto(getHeaderDto());
    addSortCriteria(inputDto);
    // perform the inquiry
    if (m_tx == null)
        m_tx = (IFormTemplateFinder) Factory.createObject(IFormTemplateFinder.class);
    FinderOutDto finderOutDto = m_tx.find(inputDto);
    // .//GEN-BEGIN:_doInquiry_3_be
    return finderOutDto;
}
Also used : FormTemplateFinderInDto(org.jaffa.modules.printing.components.formtemplatefinder.dto.FormTemplateFinderInDto) ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FormTemplateFinderOutDto(org.jaffa.modules.printing.components.formtemplatefinder.dto.FormTemplateFinderOutDto) IFormTemplateFinder(org.jaffa.modules.printing.components.formtemplatefinder.IFormTemplateFinder)

Aggregations

ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)1 IFormTemplateFinder (org.jaffa.modules.printing.components.formtemplatefinder.IFormTemplateFinder)1 FormTemplateFinderInDto (org.jaffa.modules.printing.components.formtemplatefinder.dto.FormTemplateFinderInDto)1 FormTemplateFinderOutDto (org.jaffa.modules.printing.components.formtemplatefinder.dto.FormTemplateFinderOutDto)1