sk.iway.iwcm.admin.layout.AuditDto Maven / Gradle / Ivy
package sk.iway.iwcm.admin.layout;
import sk.iway.iwcm.AdminlogBean;
import sk.iway.iwcm.DB;
import sk.iway.iwcm.Tools;
import sk.iway.iwcm.i18n.Prop;
import sk.iway.iwcm.users.UserDetails;
import sk.iway.iwcm.users.UsersDB;
public class AuditDto {
private String type;
private String description;
private String date;
private int createdByUserId;
private String createdByUserName;
private String createdByUserLogin;
public AuditDto(AdminlogBean adminlog) {
type = Prop.getInstance().getText("components.adminlog." + adminlog.getLogType());
description = DB.prepareString(adminlog.getDescription(), 100);
date = Tools.formatDateTime(adminlog.getCreateDate());
createdByUserId = adminlog.getUserId();
UserDetails user = UsersDB.getUser(createdByUserId);
if (user != null) {
createdByUserName = user.getFullName();
createdByUserLogin = user.getLogin();
}
}
public String getType() {
return this.type;
}
public String getDescription() {
return this.description;
}
public String getDate() {
return this.date;
}
public int getCreatedByUserId() {
return this.createdByUserId;
}
public String getCreatedByUserName() {
return this.createdByUserName;
}
public String getCreatedByUserLogin() {
return this.createdByUserLogin;
}
public void setType(final String type) {
this.type = type;
}
public void setDescription(final String description) {
this.description = description;
}
public void setDate(final String date) {
this.date = date;
}
public void setCreatedByUserId(final int createdByUserId) {
this.createdByUserId = createdByUserId;
}
public void setCreatedByUserName(final String createdByUserName) {
this.createdByUserName = createdByUserName;
}
public void setCreatedByUserLogin(final String createdByUserLogin) {
this.createdByUserLogin = createdByUserLogin;
}
}