Search in sources :

Example 56 with GridModelRow

use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.

the class TaskFinderAction method do_Rows_Update_Clicked.

/**
 * Invokes the updateObject() method on the component.
 * @param rowNum The selected row on the Results screen.
 * @return The FormKey for the Update screen.
 */
public FormKey do_Rows_Update_Clicked(String rowNum) {
    FormKey fk = null;
    TaskFinderForm myForm = (TaskFinderForm) form;
    TaskFinderComponent myComp = (TaskFinderComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRowsWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            fk = myComp.updateObject((java.lang.String) selectedRow.get("scheduledTaskId"));
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Update 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) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 57 with GridModelRow

use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.

the class TaskFinderAction method do_Rows_Inactivate_Clicked.

/**
 * Invokes the inactivateTask() method on the component.
 * @param rowNum The selected row on the Results screen.
 * @return The FormKey for the Update screen.
 */
public FormKey do_Rows_Inactivate_Clicked(String rowNum) {
    FormKey fk = null;
    TaskFinderForm myForm = (TaskFinderForm) form;
    TaskFinderComponent myComp = (TaskFinderComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRowsWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            myComp.inactivateTask((java.lang.String) selectedRow.get("scheduledTaskId"));
            fk = myComp.displayResults();
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Inactivate Task 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) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 58 with GridModelRow

use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.

the class TaskFinderAction method do_Rows_ViewFailedTasks_Clicked.

/**
 * Invokes the viewFailedTasks() method on the component.
 * @param rowNum The selected row on the Results screen.
 * @return The FormKey for the QueueViewer screen.
 */
public FormKey do_Rows_ViewFailedTasks_Clicked(String rowNum) {
    FormKey fk = null;
    TaskFinderForm myForm = (TaskFinderForm) form;
    TaskFinderComponent myComp = (TaskFinderComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRowsWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            fk = myComp.viewFailedTasks((java.lang.String) selectedRow.get("scheduledTaskId"), selectedRow.get("businessObject"));
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("QueueViewer 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.getResultsFormKey();
    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 59 with GridModelRow

use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.

the class TaskFinderAction method do_Rows_View_Clicked.

/**
 * Invokes the viewObject() method on the component.
 * @param rowNum The selected row on the Results screen.
 * @return The FormKey for the View screen.
 */
public FormKey do_Rows_View_Clicked(String rowNum) {
    FormKey fk = null;
    TaskFinderForm myForm = (TaskFinderForm) form;
    TaskFinderComponent myComp = (TaskFinderComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRowsWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            fk = myComp.viewObject((java.lang.String) selectedRow.get("scheduledTaskId"));
        } 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");
        }
    }
    // 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.getResultsFormKey();
    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 60 with GridModelRow

use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.

the class TaskFinderAction method do_Rows_Delete_Clicked.

/**
 * Invokes the deleteObject() method on the component.
 * @param rowNum The selected row on the Results screen.
 * @return The FormKey for the Update screen.
 */
public FormKey do_Rows_Delete_Clicked(String rowNum) {
    FormKey fk = null;
    TaskFinderForm myForm = (TaskFinderForm) form;
    TaskFinderComponent myComp = (TaskFinderComponent) myForm.getComponent();
    GridModel model = (GridModel) myForm.getRowsWM();
    GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
    if (selectedRow != null) {
        try {
            fk = myComp.deleteObject((java.lang.String) selectedRow.get("scheduledTaskId"));
        } catch (ApplicationExceptions e) {
            if (log.isDebugEnabled())
                log.debug("Update 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) GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) FormKey(org.jaffa.presentation.portlet.FormKey) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Aggregations

GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)136 GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)113 FormKey (org.jaffa.presentation.portlet.FormKey)104 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)103 FrameworkException (org.jaffa.exceptions.FrameworkException)100 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)9 EditBoxModel (org.jaffa.presentation.portlet.widgets.model.EditBoxModel)8 Iterator (java.util.Iterator)6 SimpleWidgetModel (org.jaffa.presentation.portlet.widgets.model.SimpleWidgetModel)4 DateTime (org.jaffa.datatypes.DateTime)3 MessageViewerOutDto (org.jaffa.modules.messaging.components.messageviewer.dto.MessageViewerOutDto)3 DateTimeModel (org.jaffa.presentation.portlet.widgets.model.DateTimeModel)3 DropDownModel (org.jaffa.presentation.portlet.widgets.model.DropDownModel)3 File (java.io.File)2 IOException (java.io.IOException)2 Method (java.lang.reflect.Method)2 BusinessEventLogFinderOutDto (org.jaffa.modules.messaging.components.businesseventlogfinder.dto.BusinessEventLogFinderOutDto)2 BusinessEventLogFinderOutRowDto (org.jaffa.modules.messaging.components.businesseventlogfinder.dto.BusinessEventLogFinderOutRowDto)2 HeaderElementDto (org.jaffa.modules.messaging.components.messageviewer.dto.HeaderElementDto)2 FormSelectionException (org.jaffa.modules.printing.components.formselectionmaintenance.FormSelectionException)2