Search in sources :

Example 31 with FormKey

use of org.jaffa.presentation.portlet.FormKey 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 32 with FormKey

use of org.jaffa.presentation.portlet.FormKey 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 33 with FormKey

use of org.jaffa.presentation.portlet.FormKey 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)

Example 34 with FormKey

use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.

the class QueueViewerAction method do_RelatedQueueHeader_View_Clicked.

public FormKey do_RelatedQueueHeader_View_Clicked(String rowNum) {
    FormKey fk = null;
    QueueViewerForm myForm = (QueueViewerForm) form;
    QueueViewerComponent myComp = (QueueViewerComponent) myForm.getComponent();
    try {
        GridModel model = (GridModel) myForm.getRelatedQueueHeaderWM();
        GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
        if (selectedRow != null)
            fk = myComp.viewMessage((java.lang.String) selectedRow.get("messageId"));
    } catch (ApplicationExceptions e) {
        if (log.isDebugEnabled())
            log.debug("RelatedQueueHeader_View Failed");
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
    } catch (FrameworkException e) {
        log.error(null, e);
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
    }
    // 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 = 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)

Example 35 with FormKey

use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.

the class DefaultValueEditorAction method do_Save_Clicked.

/**
 * Clicked event handler for the field Save.
 * @return The FormKey.
 */
public FormKey do_Save_Clicked() {
    FormKey fk = null;
    DefaultValueEditorForm myForm = (DefaultValueEditorForm) form;
    DefaultValueEditorComponent myComp = (DefaultValueEditorComponent) myForm.getComponent();
    try {
        if (invokeDoValidateForScreen(myComp.getCurrentScreenCounter())) {
            myComp.saveDefaultValues();
        }
    } catch (FrameworkException e) {
        log.error(null, e);
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
    }
    fk = myComp.determineFormKey();
    return fk;
}
Also used : FrameworkException(org.jaffa.exceptions.FrameworkException) FormKey(org.jaffa.presentation.portlet.FormKey)

Aggregations

FormKey (org.jaffa.presentation.portlet.FormKey)231 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)205 FrameworkException (org.jaffa.exceptions.FrameworkException)205 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)106 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)104 ApplicationException (org.jaffa.exceptions.ApplicationException)4 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)4 File (java.io.File)3 IOException (java.io.IOException)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 Method (java.lang.reflect.Method)2 Iterator (java.util.Iterator)2 FormSelectionException (org.jaffa.modules.printing.components.formselectionmaintenance.FormSelectionException)2 FormSelectionMaintenanceOutRowDto (org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutRowDto)2 Component (org.jaffa.presentation.portlet.component.Component)2 BufferedOutputStream (java.io.BufferedOutputStream)1 FileOutputStream (java.io.FileOutputStream)1 OutputStream (java.io.OutputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 AccessControlException (java.security.AccessControlException)1