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());
}
}
}
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;
}
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;
}
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);
}
}
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);
}
Aggregations