use of org.jaffa.applications.test.modules.time.components.usertimeentryfinder.dto.UserTimeEntryFinderOutRowDto in project jaffa-framework by jaffa-projects.
the class UserTimeEntryFinderForm method populateRows.
// .//GEN-END:_doValidate_2_be
// .//GEN-BEGIN:_populateRows_1_be
/**
* 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();
UserTimeEntryFinderOutDto outputDto = (UserTimeEntryFinderOutDto) ((UserTimeEntryFinderComponent) getComponent()).getFinderOutDto();
if (outputDto != null) {
GridModelRow row;
for (int i = 0; i < outputDto.getRowsCount(); i++) {
UserTimeEntryFinderOutRowDto rowDto = outputDto.getRows(i);
row = rows.newRow();
row.addElement("userName", rowDto.getUserName());
row.addElement("projectCode", rowDto.getProjectCode());
row.addElement("activity", rowDto.getActivity());
row.addElement("task", rowDto.getTask());
row.addElement("periodStart", rowDto.getPeriodStart());
row.addElement("periodEnd", rowDto.getPeriodEnd());
// .//GEN-END:_populateRows_1_be
// Add custom code for the row //GEN-FIRST:_populateRows_1
// .//GEN-LAST:_populateRows_1
// .//GEN-BEGIN:_populateRows_2_be
}
}
}
use of org.jaffa.applications.test.modules.time.components.usertimeentryfinder.dto.UserTimeEntryFinderOutRowDto in project jaffa-framework by jaffa-projects.
the class UserTimeEntryFinderTx method buildDto.
// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private UserTimeEntryFinderOutDto buildDto(UOW uow, Collection results, UserTimeEntryFinderInDto input) throws UOWException {
UserTimeEntryFinderOutDto output = new UserTimeEntryFinderOutDto();
int maxRecords = input.getMaxRecords() != null ? input.getMaxRecords().intValue() : 0;
int counter = 0;
for (Iterator i = results.iterator(); i.hasNext(); ) {
if (++counter > maxRecords && maxRecords > 0) {
output.setMoreRecordsExist(Boolean.TRUE);
break;
}
UserTimeEntryFinderOutRowDto row = new UserTimeEntryFinderOutRowDto();
UserTimeEntry userTimeEntry = (UserTimeEntry) i.next();
// .//GEN-END:_buildDto_1_be
// Add custom code before all the setters //GEN-FIRST:_buildDto_1
// .//GEN-LAST:_buildDto_1
// .//GEN-BEGIN:_buildDto_UserName_1_be
row.setUserName(userTimeEntry.getUserName());
// .//GEN-END:_buildDto_UserName_1_be
// .//GEN-BEGIN:_buildDto_ProjectCode_1_be
row.setProjectCode(userTimeEntry.getProjectCode());
// .//GEN-END:_buildDto_ProjectCode_1_be
// .//GEN-BEGIN:_buildDto_Activity_1_be
row.setActivity(userTimeEntry.getActivity());
// .//GEN-END:_buildDto_Activity_1_be
// .//GEN-BEGIN:_buildDto_Task_1_be
row.setTask(userTimeEntry.getTask());
// .//GEN-END:_buildDto_Task_1_be
// .//GEN-BEGIN:_buildDto_PeriodStart_1_be
row.setPeriodStart(userTimeEntry.getPeriodStart());
// .//GEN-END:_buildDto_PeriodStart_1_be
// .//GEN-BEGIN:_buildDto_PeriodEnd_1_be
row.setPeriodEnd(userTimeEntry.getPeriodEnd());
// .//GEN-END:_buildDto_PeriodEnd_1_be
// Add custom code to pass values to the dto //GEN-FIRST:_buildDto_2
// .//GEN-LAST:_buildDto_2
// .//GEN-BEGIN:_buildDto_3_be
output.addRows(row);
}
return output;
}
Aggregations