use of com.autentia.tnt.businessobject.Department in project TNTConcept by autentia.
the class TagBean method createDepartmentTags.
/**
* Create a new empty instance of the one-to-many field
*
* @return forward to the same page
*/
public String createDepartmentTags() {
Department item = new Department();
if (tag.getDepartmentTags() == null) {
tag.setDepartmentTags(new HashSet());
}
tag.getDepartmentTags().add(item);
return null;
}
use of com.autentia.tnt.businessobject.Department in project TNTConcept by autentia.
the class AdvancedSearchContactBean method getAllDepartments.
public List<SelectItem> getAllDepartments() {
List<Department> refs = DepartmentManager.getDefault().getAllEntities(null, new SortCriteria("id"));
List ret = new ArrayList();
for (Department ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.businessobject.Department in project TNTConcept by autentia.
the class SpringUtilsForTesting method createDepartmentInContext.
private static Department createDepartmentInContext() {
final Department department = new Department();
department.setName("Test Department");
department.setDescription("Test Department");
final DepartmentDAO departmentDao = (DepartmentDAO) appCtx.getBean("daoDepartment");
departmentDao.insert(department);
return department;
}
use of com.autentia.tnt.businessobject.Department in project TNTConcept by autentia.
the class ContactManager method addOrganizationDepartmentOrPositionByDefault.
public Contact addOrganizationDepartmentOrPositionByDefault(final Contact contact, final Organization organization, final Department department, final Position position) {
try {
if (organization != null) {
Department selectedDepartment = null;
Position selectedPosition = null;
if (department == null) {
final DepartmentSearch departmentSearch = new DepartmentSearch();
departmentSearch.setName("Indefinido");
selectedDepartment = DepartmentDAO.getDefault().search(departmentSearch, new SortCriteria("id")).get(0);
} else {
selectedDepartment = department;
}
if (position == null) {
final PositionSearch positionSearch = new PositionSearch();
positionSearch.setName("Indefinido");
selectedPosition = PositionDAO.getDefault().search(positionSearch, new SortCriteria("id")).get(0);
} else {
selectedPosition = position;
}
final ContactInfo contactInfo = new ContactInfo();
contactInfo.setContact(contact);
contactInfo.setOrganization(organization);
contactInfo.setDepartment(selectedDepartment);
contactInfo.setPosition(selectedPosition);
contact.addContactInfo(contactInfo);
this.updateEntity(contact);
}
} catch (Exception e) {
log.error("addOrganizationDepartmentOrPositionByDefault - Error ", e);
}
return contact;
}
use of com.autentia.tnt.businessobject.Department in project TNTConcept by autentia.
the class DepartmentBean method create.
/**
* Go to create page
* @return forward to CREATE page
*/
public String create() {
department = new Department();
// se inserta el puesto 'Indefinido' en caso de existir
final PositionSearch positionSearch = new PositionSearch();
positionSearch.setName("Indefinido");
List<Position> positions = PositionManager.getDefault().getAllEntities(positionSearch, new SortCriteria("name", true));
Set<Position> positionsSet = new HashSet<Position>();
for (Position position : positions) {
positionsSet.add(position);
}
department.setPositions(positionsSet);
return NavigationResults.CREATE;
}
Aggregations