use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class TeamSynchronizer method notifyPM.
protected void notifyPM(Project project, List<Employee> closedEmployees, List<Employee> newEmployees) throws MessagingException {
Map<String, Object> params = new HashMap<>();
params.put("managedProject", project);
params.put("newEmployees", newEmployees);
params.put("closedEmployees", closedEmployees);
params.put("appUrl", settings.getApplicationBaseUrl());
String body = mailTemplateManager.getTemplateText(MailTemplate.TEAM_SYNCHRONIZATION_BODY.getFileName(), params);
String subject = mailTemplateManager.getTemplateText(MailTemplate.TEAM_SYNCHRONIZATION_SUBJECT.getFileName(), params);
Mail mail = new Mail(subject, body);
for (Employee manager : project.getManagers()) {
mailingEngine.send(manager.getEmail(), mail);
}
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class LdapAdapter method getEmployees.
public List<Employee> getEmployees() {
Filter filter = new Filter(employeeFilter, new Object[] {});
List<Employee> employees = listEmployees(filter);
employees.sort(Employee.NAME_COMPARATOR);
return employees;
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class LdapAdapter method findEmployee.
public Employee findEmployee(String userName) {
if (StringUtils.isNotBlank(userFilter)) {
Filter filter = new Filter(userFilter, new Object[] { userName });
List<Employee> employees = listEmployees(filter);
return (employees.isEmpty()) ? null : employees.get(0);
}
return null;
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class LdapAdapter method listEmployeesByTeamCodes.
List<Employee> listEmployeesByTeamCodes(String teamCodes) {
Set<Employee> team = new HashSet<Employee>();
List<String> codes = (!StringUtils.isEmpty(teamCodes)) ? splitTeamCodeString(teamCodes) : Collections.<String>emptyList();
for (String code : codes) {
Filter filter = new Filter(groupMemberFilter, new Object[] { code });
team.addAll(listEmployees(filter));
}
return new ArrayList<Employee>(team);
}
use of com.artezio.arttime.datamodel.Employee in project ART-TIME by Artezio.
the class LdapAdapter method createEmployee.
protected Employee createEmployee(Attributes attrs) throws NamingException, IllegalAccessException, InvocationTargetException {
Employee employee = new Employee();
for (Entry<String, String> item : attributeMapping.entrySet()) {
Attribute attr = attrs.get(item.getKey());
String value = parseAttribute(attr);
BeanUtils.setProperty(employee, item.getValue(), value);
}
employee.castDepartmentToNameCase();
WorkdaysCalendar calendar = workdaysCalendarRepository.findDefaultCalendar(employee);
employee.setCalendar(calendar);
return employee;
}
Aggregations