Search in sources :

Example 1 with UserFinderOutRowDto

use of org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class UserFinderTx method buildDto.

// .//GEN-END:_buildCriteria_3_be
// .//GEN-BEGIN:_buildDto_1_be
private UserFinderOutDto buildDto(UOW uow, Collection results, UserFinderInDto input) throws UOWException {
    UserFinderOutDto output = new UserFinderOutDto();
    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;
        }
        UserFinderOutRowDto row = new UserFinderOutRowDto();
        User user = (User) 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(user.getUserName());
        // .//GEN-END:_buildDto_UserName_1_be
        // .//GEN-BEGIN:_buildDto_FirstName_1_be
        row.setFirstName(user.getFirstName());
        // .//GEN-END:_buildDto_FirstName_1_be
        // .//GEN-BEGIN:_buildDto_LastName_1_be
        row.setLastName(user.getLastName());
        // .//GEN-END:_buildDto_LastName_1_be
        // .//GEN-BEGIN:_buildDto_Status_1_be
        row.setStatus(user.getStatus());
        // .//GEN-END:_buildDto_Status_1_be
        // .//GEN-BEGIN:_buildDto_StatusDescription_1_be
        row.setStatusDescription(user.getStatus());
        // .//GEN-END:_buildDto_StatusDescription_1_be
        // .//GEN-BEGIN:_buildDto_EMailAddress_1_be
        row.setEMailAddress(user.getEMailAddress());
        // .//GEN-END:_buildDto_EMailAddress_1_be
        // .//GEN-BEGIN:_buildDto_CreatedOn_1_be
        row.setCreatedOn(user.getCreatedOn());
        // .//GEN-END:_buildDto_CreatedOn_1_be
        // .//GEN-BEGIN:_buildDto_CreatedBy_1_be
        row.setCreatedBy(user.getCreatedBy());
        // .//GEN-END:_buildDto_CreatedBy_1_be
        // .//GEN-BEGIN:_buildDto_LastUpdatedOn_1_be
        row.setLastUpdatedOn(user.getLastUpdatedOn());
        // .//GEN-END:_buildDto_LastUpdatedOn_1_be
        // .//GEN-BEGIN:_buildDto_LastUpdatedBy_1_be
        row.setLastUpdatedBy(user.getLastUpdatedBy());
        // .//GEN-END:_buildDto_LastUpdatedBy_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;
}
Also used : User(org.jaffa.applications.jaffa.modules.admin.domain.User) UserFinderOutRowDto(org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutRowDto) UserFinderOutDto(org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutDto)

Example 2 with UserFinderOutRowDto

use of org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutRowDto in project jaffa-framework by jaffa-projects.

the class UserFinderForm 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();
    UserFinderOutDto outputDto = (UserFinderOutDto) ((UserFinderComponent) getComponent()).getFinderOutDto();
    if (outputDto != null) {
        GridModelRow row;
        for (int i = 0; i < outputDto.getRowsCount(); i++) {
            UserFinderOutRowDto rowDto = outputDto.getRows(i);
            row = rows.newRow();
            row.addElement("userName", rowDto.getUserName());
            row.addElement("firstName", rowDto.getFirstName());
            row.addElement("lastName", rowDto.getLastName());
            row.addElement("status", rowDto.getStatus());
            row.addElement("statusDescription", rowDto.getStatusDescription());
            row.addElement("eMailAddress", rowDto.getEMailAddress());
            row.addElement("createdOn", rowDto.getCreatedOn());
            row.addElement("createdBy", rowDto.getCreatedBy());
            row.addElement("lastUpdatedOn", rowDto.getLastUpdatedOn());
            row.addElement("lastUpdatedBy", rowDto.getLastUpdatedBy());
            // Add custom code for the row //GEN-FIRST:_populateRows_1
            if (rowDto.getStatus() != null)
                row.addElement("statusDescription", "[label.Jaffa.Admin.User.Status." + rowDto.getStatus() + ']');
        // .//GEN-LAST:_populateRows_1
        // .//GEN-BEGIN:_populateRows_2_be
        }
    }
}
Also used : UserFinderOutRowDto(org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutRowDto) UserFinderOutDto(org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutDto)

Aggregations

UserFinderOutDto (org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutDto)2 UserFinderOutRowDto (org.jaffa.applications.jaffa.modules.admin.components.userfinder.dto.UserFinderOutRowDto)2 User (org.jaffa.applications.jaffa.modules.admin.domain.User)1