use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.
the class TaskMaintenanceForm method populateRelatedBusinessEventLog.
private void populateRelatedBusinessEventLog(GridModel rows) {
rows.clearRows();
BusinessEventLogFinderOutDto businessEventLogOutDto = ((TaskMaintenanceComponent) getComponent()).getBusinessEventLog();
if (businessEventLogOutDto != null) {
for (int i = 0; i < businessEventLogOutDto.getRowsCount(); i++) {
BusinessEventLogFinderOutRowDto rowDto = businessEventLogOutDto.getRows(i);
GridModelRow row = rows.newRow();
row.addElement("logId", rowDto.getLogId());
row.addElement("messageId", rowDto.getMessageId());
row.addElement("loggedOn", rowDto.getLoggedOn());
row.addElement("processName", rowDto.getProcessName());
row.addElement("subProcessName", rowDto.getSubProcessName());
row.addElement("messageType", rowDto.getMessageType());
row.addElement("messageText", rowDto.getMessageText());
}
}
}
use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.
the class TaskMaintenanceForm method populateMonthlyMonths.
private void populateMonthlyMonths(GridModel model) {
model.clearRows();
// Get current list of months
Recurrence r = ((TaskMaintenanceComponent) getComponent()).getRecurrence();
Recurrence.Month[] months = r != null && r instanceof Recurrence.Monthly ? ((Recurrence.Monthly) r).getMonths() : null;
if (months != null)
Arrays.sort(months);
// Get all possible months
Recurrence.Month[] allMonths = Recurrence.Month.values();
// Create rows, such that the labels appear vertically-sorted.. like a newspaper !!
// To begin with, select all the months
int noOfRows = allMonths.length % MONTHS_GRID_COLUMNS == 0 ? allMonths.length / MONTHS_GRID_COLUMNS : (allMonths.length / MONTHS_GRID_COLUMNS) + 1;
for (int i = 0; i < MONTHS_GRID_COLUMNS; i++) {
for (int j = 0; j < noOfRows; j++) {
int index = (i * noOfRows) + j;
if (index >= allMonths.length)
break;
Recurrence.Month month = allMonths[index];
Boolean selected = months == null ? Boolean.TRUE : Arrays.binarySearch(months, month) >= 0;
GridModelRow row = (i == 0) ? model.newRow() : model.getRow(j);
row.addElement("label" + i, "label.Jaffa.Scheduler.ScheduledTask.Recurrence.MONTHLY.Month." + month);
row.addElement("value" + i, month);
row.addElement("selected" + i, new SimpleWidgetModel(selected));
}
}
}
use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.
the class UserFinderAction method do_Rows_View_Clicked.
// .//GEN-END:_do_CreateFromResults_Clicked_4_be
// .//GEN-BEGIN:_do_Rows_View_Clicked_1_be
/**
* 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;
// .//GEN-END:_do_Rows_View_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_Rows_View_Clicked_1
// .//GEN-LAST:_do_Rows_View_Clicked_1
// .//GEN-BEGIN:_do_Rows_View_Clicked_2_be
UserFinderForm myForm = (UserFinderForm) form;
UserFinderComponent myComp = (UserFinderComponent) myForm.getComponent();
GridModel model = (GridModel) myForm.getRowsWM();
GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
if (selectedRow != null) {
try {
// .//GEN-END:_do_Rows_View_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_Rows_View_Clicked_2
// .//GEN-LAST:_do_Rows_View_Clicked_2
// .//GEN-BEGIN:_do_Rows_View_Clicked_3_be
fk = myComp.viewObject((java.lang.String) selectedRow.get("userName"));
} 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");
}
}
// .//GEN-END:_do_Rows_View_Clicked_3_be
// Add custom code after returning from the component //GEN-FIRST:_do_Rows_View_Clicked_3
// .//GEN-LAST:_do_Rows_View_Clicked_3
// .//GEN-BEGIN:_do_Rows_View_Clicked_4_be
// 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;
}
use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.
the class UserLookupAction method do_Rows_View_Clicked.
// .//GEN-END:_do_CreateFromResults_Clicked_4_be
// .//GEN-BEGIN:_do_Rows_View_Clicked_1_be
/**
* 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;
// .//GEN-END:_do_Rows_View_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_Rows_View_Clicked_1
// .//GEN-LAST:_do_Rows_View_Clicked_1
// .//GEN-BEGIN:_do_Rows_View_Clicked_2_be
UserLookupForm myForm = (UserLookupForm) form;
UserLookupComponent myComp = (UserLookupComponent) myForm.getComponent();
GridModel model = (GridModel) myForm.getRowsWM();
GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
if (selectedRow != null) {
try {
// .//GEN-END:_do_Rows_View_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_Rows_View_Clicked_2
// .//GEN-LAST:_do_Rows_View_Clicked_2
// .//GEN-BEGIN:_do_Rows_View_Clicked_3_be
fk = myComp.viewObject((java.lang.String) selectedRow.get("userName"));
} 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");
}
}
// .//GEN-END:_do_Rows_View_Clicked_3_be
// Add custom code after returning from the component //GEN-FIRST:_do_Rows_View_Clicked_3
// .//GEN-LAST:_do_Rows_View_Clicked_3
// .//GEN-BEGIN:_do_Rows_View_Clicked_4_be
// 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;
}
use of org.jaffa.presentation.portlet.widgets.model.GridModelRow in project jaffa-framework by jaffa-projects.
the class UserLookupAction method do_Rows_Delete_Clicked.
// .//GEN-END:_do_Rows_Update_Clicked_4_be
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_1_be
/**
* Invokes the deleteObject() method on the component.
* @param rowNum The selected row on the Results screen.
* @return The FormKey for the Delete screen.
*/
public FormKey do_Rows_Delete_Clicked(String rowNum) {
FormKey fk = null;
// .//GEN-END:_do_Rows_Delete_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_Rows_Delete_Clicked_1
// .//GEN-LAST:_do_Rows_Delete_Clicked_1
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_2_be
UserLookupForm myForm = (UserLookupForm) form;
UserLookupComponent myComp = (UserLookupComponent) myForm.getComponent();
try {
// This will stop double submits
performTokenValidation(request);
GridModel model = (GridModel) myForm.getRowsWM();
GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
if (selectedRow != null) {
// .//GEN-END:_do_Rows_Delete_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_Rows_Delete_Clicked_2
// .//GEN-LAST:_do_Rows_Delete_Clicked_2
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_3_be
fk = myComp.deleteObject((java.lang.String) selectedRow.get("userName"));
}
} catch (ApplicationExceptions e) {
if (log.isDebugEnabled())
log.debug("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.getResultsFormKey();
return fk;
}
Aggregations