Search in sources :

Example 26 with GridModelRow

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

the class QueueListForm method populateRows.

/**
 * This will populate the input GridModel with the data in the finderOutDto of the Component.
 * @param rows The GridModel object to populate.
 */
public void populateRows(GridModel rows) {
    rows.clearRows();
    QueueListOutDto outputDto = (QueueListOutDto) ((QueueListComponent) getComponent()).getFinderOutDto();
    if (outputDto != null && outputDto.getRows() != null) {
        GridModelRow row;
        for (QueueListOutRowDto rowDto : outputDto.getRows()) {
            row = rows.newRow();
            row.addElement("queue", rowDto.getQueue());
            row.addElement("pending", rowDto.getPending());
            row.addElement("error", rowDto.getError());
            row.addElement("inProcess", rowDto.getInProcess());
            row.addElement("activeConsumer", rowDto.getActiveConsumer());
            row.addElement("started", rowDto.getStarted());
            row.addElement("stopped", rowDto.getStopped());
        }
    }
}
Also used : QueueListOutDto(org.jaffa.modules.messaging.components.queuelist.dto.QueueListOutDto) QueueListOutRowDto(org.jaffa.modules.messaging.components.queuelist.dto.QueueListOutRowDto) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow)

Example 27 with GridModelRow

use of org.jaffa.presentation.portlet.widgets.model.GridModelRow 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 28 with GridModelRow

use of org.jaffa.presentation.portlet.widgets.model.GridModelRow 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 29 with GridModelRow

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

the class FileExplorerAction method do_FileTree_Download_Clicked.

public FormKey do_FileTree_Download_Clicked(String rowId) {
    FileExplorerForm myForm = (FileExplorerForm) form;
    FileExplorerComponent myComp = (FileExplorerComponent) component;
    GridModel m = (GridModel) myForm.getWidgetCache().getModel("fileTree");
    GridModelRow row = m.getRowById(new Integer(rowId).intValue());
    File f = (File) row.get("file");
    if (f == null || !f.exists()) {
        myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "message.Jaffa.Admin.FileExplorer.fileNotFound");
        return myComp.getCurrentFormKey();
    } else {
        request.setAttribute("org.jaffa.applications.jaffa.modules.admin.components.fileexplorer", f);
        return new FormKey("jaffa_admin_fileExplorer_download", null);
    }
}
Also used : GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) GridModelRow(org.jaffa.presentation.portlet.widgets.model.GridModelRow) FormKey(org.jaffa.presentation.portlet.FormKey) File(java.io.File)

Example 30 with GridModelRow

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

the class FileExplorerForm method expandRow.

public void expandRow(String rowId) {
    GridModel m = (GridModel) getWidgetCache().getModel("fileTree");
    GridModelRow row = m.getRowById(new Integer(rowId).intValue());
    if (row.get(COL_EXPANDED) != null && ((Boolean) row.get(COL_EXPANDED)).booleanValue()) {
        if (log.isDebugEnabled())
            log.debug("Row already expanded");
        return;
    }
    row.addElement(COL_EXPANDED, new Boolean(true));
    row.addElement(COL_DISPLAYED, new Boolean(true));
    m.setTarget(row);
    int nextRowNum = m.getRowNum(row) + 1;
    int level = ((Integer) row.get(COL_LEVEL)).intValue() + 1;
    addToTree(m, (File) row.get(COL_FILE), nextRowNum, level);
}
Also used : GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel) 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