Search in sources :

Example 71 with ApplicationExceptions

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

the class BusinessEventLogViewerComponent method display.

// .//GEN-END:_BusinessEventLogViewerOutDto_1_be
// .//GEN-BEGIN:_display_1_be
/**
 * This retrieves the details for the BusinessEventLog.
 * @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 (getLogId() == null) {
        if (appExps == null)
            appExps = new ApplicationExceptions();
        appExps.add(new MandatoryFieldException(BusinessEventLogMeta.META_LOG_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 72 with ApplicationExceptions

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

the class QueueListAction method do_Refresh_Clicked.

public FormKey do_Refresh_Clicked() {
    FormKey fk = null;
    QueueListForm myForm = (QueueListForm) form;
    QueueListComponent myComp = (QueueListComponent) myForm.getComponent();
    try {
        fk = myComp.displayResults();
    } catch (ApplicationExceptions e) {
        if (log.isDebugEnabled())
            log.debug("Refresh Failed");
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
    } catch (FrameworkException e) {
        log.error(null, e);
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
    }
    // Direct User back to current form
    if (fk == null)
        fk = myComp.getResultsFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 73 with ApplicationExceptions

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

the class QueueListComponent method viewMessages.

public FormKey viewMessages(String queue, MessageModeEnum messageMode) throws ApplicationExceptions, FrameworkException {
    QueueViewerComponent viewComponent = (QueueViewerComponent) run("Jaffa.Messaging.QueueViewer");
    viewComponent.setReturnToFormKey(getResultsFormKey());
    viewComponent.setQueue(queue);
    viewComponent.setMessageMode(messageMode);
    viewComponent.addQueueViewerListener(new IQueueViewerListener() {

        public void processDone(EventObject source) throws ApplicationExceptions, FrameworkException {
            displayResults();
        }
    });
    return viewComponent.display();
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) IQueueViewerListener(org.jaffa.modules.messaging.components.queueviewer.ui.IQueueViewerListener) FrameworkException(org.jaffa.exceptions.FrameworkException) QueueViewerComponent(org.jaffa.modules.messaging.components.queueviewer.ui.QueueViewerComponent) EventObject(java.util.EventObject)

Example 74 with ApplicationExceptions

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

the class QueueViewerAction method do_Refresh_Clicked.

public FormKey do_Refresh_Clicked() {
    FormKey fk = null;
    QueueViewerForm myForm = (QueueViewerForm) form;
    QueueViewerComponent myComp = (QueueViewerComponent) myForm.getComponent();
    try {
        if (myForm.doValidate(request))
            myComp.doInquiry();
    } catch (ApplicationExceptions e) {
        if (log.isDebugEnabled())
            log.debug("Refresh Failed");
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
    } catch (FrameworkException e) {
        log.error(null, e);
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
    }
    // Direct User back to current form
    if (fk == null)
        fk = myComp.getViewerFormKey();
    return fk;
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Example 75 with ApplicationExceptions

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

the class QueueViewerAction method do_RelatedQueueHeader_Delete_Clicked.

public FormKey do_RelatedQueueHeader_Delete_Clicked(String rowNum) {
    FormKey fk = null;
    QueueViewerForm myForm = (QueueViewerForm) form;
    QueueViewerComponent myComp = (QueueViewerComponent) myForm.getComponent();
    try {
        // This will stop double submits
        performTokenValidation(request);
        GridModel model = (GridModel) myForm.getRelatedQueueHeaderWM();
        GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
        if (selectedRow != null)
            fk = myComp.deleteMessage((java.lang.String) selectedRow.get("messageId"));
        // Invoke QueueView Listener
        myComp.invokeQueueViewerListeners();
    } catch (ApplicationExceptions e) {
        if (log.isDebugEnabled())
            log.debug("RelatedQueueHeader_Delete Failed");
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
    } catch (FrameworkException e) {
        log.error(null, e);
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
    }
    // Direct User back to current form
    if (fk == null)
        fk = myComp.getViewerFormKey();
    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)

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