String fEmployee = (String) session.getAttribute("FromEmployee");
if (request.getParameter(FileConstantKeys.TYPEOFOPERATION).equals(FileConstantKeys.EDIT)) {
fileName = this.getFileInfo();
if (fileName == null || fileName.trim().length() == 0) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "File Name"));
}
} else if (file != null) {
fileName = file.getFileName();
if (fileName == null || fileName.trim().length() == 0) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "File Name"));
}
} else {
if (fEmployee != null && !fEmployee.equals("EmployeeHandbook")) {
if (fileName == null || fileName.trim().length() == 0) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "File Name"));
}
}
}
if (fEmployee != null && !fEmployee.equals("EmployeeHandbook")) {
if (this.getUploadfoldername() == null || this.getUploadfoldername().trim().length() == 0) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Folder Name"));
}
}
// title
if (this.getTitle() == null || this.getTitle().trim().length() == 0) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Title"));
}
// description
if (this.getDescription() == null || this.getDescription().trim().length() == 0) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.general.requiredField", "Description"));
}
// redirect to jsp if errors present
if (!errors.isEmpty()) {
request.setAttribute("bodycontent", "editdetailfile");