Search in sources :

Example 26 with GridModel

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

the class BusinessEventLogViewerForm method getRelatedAttachmentWM.

// .//GEN-END:_2_be
// .//GEN-BEGIN:RelatedAttachment_1_be
/**
 * Getter for property Attachment. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * This gets the current data from the component.
 * @return Value of property attachment.
 */
public GridModel getRelatedAttachmentWM() {
    GridModel rows = (GridModel) getWidgetCache().getModel("relatedAttachment");
    if (rows == null) {
        rows = new GridModel();
        populateRelatedAttachment(rows);
        getWidgetCache().addModel("relatedAttachment", rows);
    }
    return rows;
}
Also used : GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel)

Example 27 with GridModel

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

the class MessageViewerForm method getHeadersWM.

/**
 * Getter for property headers. This is invoked by the custom tag, when the jsp is rendered, to get the current value.
 * This gets the current data from the component.
 * @return Value of property businessEventLog.
 */
public GridModel getHeadersWM() {
    GridModel rows = (GridModel) getWidgetCache().getModel("headers");
    if (rows == null) {
        rows = new GridModel();
        populateHeaders(rows);
        getWidgetCache().addModel("headers", rows);
    }
    return rows;
}
Also used : GridModel(org.jaffa.presentation.portlet.widgets.model.GridModel)

Example 28 with GridModel

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

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

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

Aggregations

GridModel (org.jaffa.presentation.portlet.widgets.model.GridModel)135 GridModelRow (org.jaffa.presentation.portlet.widgets.model.GridModelRow)113 FormKey (org.jaffa.presentation.portlet.FormKey)106 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)104 FrameworkException (org.jaffa.exceptions.FrameworkException)101 CheckBoxModel (org.jaffa.presentation.portlet.widgets.model.CheckBoxModel)6 EditBoxModel (org.jaffa.presentation.portlet.widgets.model.EditBoxModel)6 DateTime (org.jaffa.datatypes.DateTime)3 DateTimeModel (org.jaffa.presentation.portlet.widgets.model.DateTimeModel)3 DropDownModel (org.jaffa.presentation.portlet.widgets.model.DropDownModel)3 Method (java.lang.reflect.Method)2 FormSelectionException (org.jaffa.modules.printing.components.formselectionmaintenance.FormSelectionException)2 FormSelectionMaintenanceOutDto (org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutDto)2 FormSelectionMaintenanceOutRowDto (org.jaffa.modules.printing.components.formselectionmaintenance.dto.FormSelectionMaintenanceOutRowDto)2 ImageModel (org.jaffa.presentation.portlet.widgets.model.ImageModel)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Enumeration (java.util.Enumeration)1