Search in sources :

Example 66 with ApplicationExceptions

use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.

the class FormDefinitionMaintenanceComponent method initDropDownCodes.

// .//GEN-END:_doPrevalidateUpdate_3_be
// .//GEN-BEGIN:_initDropDownCodes_1_be
/**
 * This will retrieve the set of codes for dropdowns, if any are required
 */
protected void initDropDownCodes() throws ApplicationExceptions, FrameworkException {
    ApplicationExceptions appExps = null;
    CodeHelperInDto input = null;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions)

Example 67 with ApplicationExceptions

use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.

the class FormDefinitionViewerComponent method doInquiry.

// .//GEN-END:_display_2_be
// .//GEN-BEGIN:_inquiry_1_be
private void doInquiry() throws ApplicationExceptions, FrameworkException {
    FormDefinitionViewerInDto inputDto = new FormDefinitionViewerInDto();
    // .//GEN-END:_inquiry_1_be
    // Add custom code before building the input dto//GEN-FIRST:_inquiry_1
    // .//GEN-LAST:_inquiry_1
    // .//GEN-BEGIN:_inquiry_2_be
    inputDto.setFormId(m_formId);
    inputDto.setHeaderDto(createHeaderDto());
    // create the Tx
    if (m_tx == null)
        m_tx = (IFormDefinitionViewer) Factory.createObject(IFormDefinitionViewer.class);
    // .//GEN-END:_inquiry_2_be
    // Add custom code before invoking the Tx//GEN-FIRST:_inquiry_2
    // .//GEN-LAST:_inquiry_2
    // .//GEN-BEGIN:_inquiry_3_be
    // now get the details
    m_outputDto = m_tx.read(inputDto);
    // uncache the widgets
    getUserSession().getWidgetCache(getComponentId()).clear();
    // throw an exception if the output is null
    if (m_outputDto == null) {
        ApplicationExceptions appExps = new ApplicationExceptions();
        appExps.add(new DomainObjectNotFoundException(FormDefinitionMeta.getLabelToken()));
        throw appExps;
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) DomainObjectNotFoundException(org.jaffa.exceptions.DomainObjectNotFoundException) FormDefinitionViewerInDto(org.jaffa.modules.printing.components.formdefinitionviewer.dto.FormDefinitionViewerInDto) IFormDefinitionViewer(org.jaffa.modules.printing.components.formdefinitionviewer.IFormDefinitionViewer)

Example 68 with ApplicationExceptions

use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.

the class FormDefinitionViewerComponent method display.

// .//GEN-END:_FormDefinitionViewerOutDto_1_be
// .//GEN-BEGIN:_display_1_be
/**
 * This retrieves the details for the FormDefinition.
 * @throws ApplicationExceptions This will be thrown in case any invalid data has been set, or if no data has been set.
 * @throws FrameworkException Indicates some system error.
 * @return The FormKey for the View screen.
 */
public FormKey display() throws ApplicationExceptions, FrameworkException {
    ApplicationExceptions appExps = null;
    // .//GEN-BEGIN:_display_2_be
    if (getFormId() == null) {
        if (appExps == null)
            appExps = new ApplicationExceptions();
        appExps.add(new MandatoryFieldException(FormDefinitionMeta.META_FORM_ID.getLabelToken()));
    }
    if (appExps != null && appExps.size() > 0)
        throw appExps;
    doInquiry();
    return getViewerFormKey();
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) MandatoryFieldException(org.jaffa.datatypes.exceptions.MandatoryFieldException)

Example 69 with ApplicationExceptions

use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.

the class BusinessEventLogViewerAction method do_RelatedAttachment_View_Clicked.

/**
 * Invokes the viewAttachment() method on the component.
 * @param rowNum The selected row on the Grid.
 * @return The FormKey for the View screen of the Attachment object.
 */
public FormKey do_RelatedAttachment_View_Clicked(String rowNum) {
    FormKey fk = null;
    // .//GEN-END:do_RelatedAttachment_View_Clicked_1_be
    // Add custom code before processing the action//GEN-FIRST:do_RelatedAttachment_View_Clicked_1
    // .//GEN-LAST:do_RelatedAttachment_View_Clicked_1
    // .//GEN-BEGIN:do_RelatedAttachment_View_Clicked_2_be
    BusinessEventLogViewerForm myForm = (BusinessEventLogViewerForm) form;
    BusinessEventLogViewerComponent myComp = (BusinessEventLogViewerComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRelatedAttachmentWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            // .//GEN-END:do_RelatedAttachment_View_Clicked_2_be
            // Add custom code before invoking the component//GEN-FIRST:do_RelatedAttachment_View_Clicked_2
            // .//GEN-LAST:do_RelatedAttachment_View_Clicked_2
            // .//GEN-BEGIN:do_RelatedAttachment_View_Clicked_3_be
            fk = myComp.viewAttachment((java.lang.String) selectedRow.get("attachmentId"));
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Viewer Failed");
            myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
        } catch (FrameworkException e) {
            log.error(null, e);
            myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
        }
    }
    // .//GEN-END:do_RelatedAttachment_View_Clicked_3_be
    // Add custom code before returning//GEN-FIRST:do_RelatedAttachment_View_Clicked_3
    // .//GEN-LAST:do_RelatedAttachment_View_Clicked_3
    // .//GEN-BEGIN:do_RelatedAttachment_View_Clicked_4_be
    // The Viewer will be rendered in a new window
    // We don't want to see the existing HistoryNav in that window
    // Hence, initialize the HistoryNav
    HistoryNav.initializeHistoryNav(request);
    // Direct User back to current form
    if (fk == null)
        fk = new FormKey(myForm.NAME, myComp.getComponentId());
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 70 with ApplicationExceptions

use of org.jaffa.exceptions.ApplicationExceptions in project jaffa-framework by jaffa-projects.

the class BusinessEventLogViewerComponent method doInquiry.

// .//GEN-END:_display_2_be
// .//GEN-BEGIN:_inquiry_1_be
private void doInquiry() throws ApplicationExceptions, FrameworkException {
    BusinessEventLogViewerInDto inputDto = new BusinessEventLogViewerInDto();
    // .//GEN-END:_inquiry_1_be
    // Add custom code before building the input dto //GEN-FIRST:_inquiry_1
    // .//GEN-LAST:_inquiry_1
    // .//GEN-BEGIN:_inquiry_2_be
    inputDto.setLogId(m_logId);
    inputDto.setHeaderDto(createHeaderDto());
    // create the Tx
    if (m_tx == null)
        m_tx = (IBusinessEventLogViewer) Factory.createObject(IBusinessEventLogViewer.class);
    // .//GEN-END:_inquiry_2_be
    // Add custom code before invoking the Tx //GEN-FIRST:_inquiry_2
    // .//GEN-LAST:_inquiry_2
    // .//GEN-BEGIN:_inquiry_3_be
    // now get the details
    m_outputDto = m_tx.read(inputDto);
    // uncache the widgets
    getUserSession().getWidgetCache(getComponentId()).clear();
    // throw an exception if the output is null
    if (m_outputDto == null) {
        ApplicationExceptions appExps = new ApplicationExceptions();
        appExps.add(new DomainObjectNotFoundException(BusinessEventLogMeta.getLabelToken()));
        throw appExps;
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) BusinessEventLogViewerInDto(org.jaffa.modules.messaging.components.businesseventlogviewer.dto.BusinessEventLogViewerInDto) DomainObjectNotFoundException(org.jaffa.exceptions.DomainObjectNotFoundException) IBusinessEventLogViewer(org.jaffa.modules.messaging.components.businesseventlogviewer.IBusinessEventLogViewer)

Aggregations

ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)575 FrameworkException (org.jaffa.exceptions.FrameworkException)307 FormKey (org.jaffa.presentation.portlet.FormKey)205 ApplicationException (org.jaffa.exceptions.ApplicationException)116 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)104 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)103 UOW (org.jaffa.persistence.UOW)82 Criteria (org.jaffa.persistence.Criteria)66 DomainObjectNotFoundException (org.jaffa.exceptions.DomainObjectNotFoundException)59 MandatoryFieldException (org.jaffa.datatypes.exceptions.MandatoryFieldException)23 ValidationException (org.jaffa.datatypes.ValidationException)21 Iterator (java.util.Iterator)16 InvocationTargetException (java.lang.reflect.InvocationTargetException)15 Method (java.lang.reflect.Method)15 FormTemplate (org.jaffa.modules.printing.domain.FormTemplate)15 DuplicateKeyException (org.jaffa.exceptions.DuplicateKeyException)14 OutputCommand (org.jaffa.modules.printing.domain.OutputCommand)11 MalformedURLException (java.net.MalformedURLException)10 UserRequest (org.jaffa.applications.jaffa.modules.user.domain.UserRequest)10 PrinterDefinition (org.jaffa.modules.printing.domain.PrinterDefinition)10