Search in sources :

Example 1 with IFormDefinitionFinder

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

the class FormDefinitionFinderComponent method doInquiry.

// .//GEN-END:formTemplate_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;
    FormDefinitionFinderInDto inputDto = new FormDefinitionFinderInDto();
    // .//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) FormDefinitionMeta.META_FORM_ID));
    } catch (ValidationException e) {
        if (appExps == null)
            appExps = new ApplicationExceptions();
        appExps.add(e);
    }
    if (getFormName() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getFormNameDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getFormNameDd()))
        inputDto.setFormName(StringCriteriaField.getStringCriteriaField(getFormNameDd(), getFormName(), null));
    if (getFormAlternate() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getFormAlternateDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getFormAlternateDd()))
        inputDto.setFormAlternate(StringCriteriaField.getStringCriteriaField(getFormAlternateDd(), getFormAlternate(), null));
    if (getFormVariation() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getFormVariationDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getFormVariationDd()))
        inputDto.setFormVariation(StringCriteriaField.getStringCriteriaField(getFormVariationDd(), getFormVariation(), null));
    if (getOutputType() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getOutputTypeDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getOutputTypeDd()))
        inputDto.setOutputType(StringCriteriaField.getStringCriteriaField(getOutputTypeDd(), getOutputType(), null));
    if (getFormTemplate() != null || CriteriaField.RELATIONAL_IS_NULL.equals(getFormTemplateDd()) || CriteriaField.RELATIONAL_IS_NOT_NULL.equals(getFormTemplateDd()))
        inputDto.setFormTemplate(StringCriteriaField.getStringCriteriaField(getFormTemplateDd(), getFormTemplate(), 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 = (IFormDefinitionFinder) Factory.createObject(IFormDefinitionFinder.class);
    FinderOutDto finderOutDto = m_tx.find(inputDto);
    // .//GEN-BEGIN:_doInquiry_3_be
    return finderOutDto;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) IFormDefinitionFinder(org.jaffa.modules.printing.components.formdefinitionfinder.IFormDefinitionFinder) FormDefinitionFinderOutDto(org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutDto) FormDefinitionFinderInDto(org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderInDto)

Aggregations

ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)1 IFormDefinitionFinder (org.jaffa.modules.printing.components.formdefinitionfinder.IFormDefinitionFinder)1 FormDefinitionFinderInDto (org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderInDto)1 FormDefinitionFinderOutDto (org.jaffa.modules.printing.components.formdefinitionfinder.dto.FormDefinitionFinderOutDto)1