use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.
the class CollaboratorBean method getContacts.
/**
* Get the list of all contacts
* @return the list of all contacts
*/
public List<SelectItem> getContacts() {
List<Contact> refs = ContactManager.getDefault().getAllEntities(null, new SortCriteria("name"));
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
ret.add(new SelectItem(null, ""));
for (Contact ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.
the class ContactBean method getAllPositionsOfDepartment.
public List<SelectItem> getAllPositionsOfDepartment() {
final PositionSearch positionSearch = new PositionSearch();
positionSearch.setDepartmentId(this.getSelectedDepartment().getId());
positionSearch.setDeleted(false);
final List<Position> refs = PositionManager.getDefault().getAllEntities(positionSearch, new SortCriteria("name"));
final List<SelectItem> ret = new ArrayList<SelectItem>();
ret.add(new SelectItem(null, FacesUtils.getMessage("contact.selectOnePosition")));
for (Position ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.
the class ContactBean method getAllTags.
public List<SelectItem> getAllTags() {
final List<Tag> refs = TagManager.getDefault().getAllEntities(null, new SortCriteria("id"));
final List<SelectItem> ret = new ArrayList<SelectItem>();
for (Tag ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.
the class ContactBean method getAllOrganizations.
public List<SelectItem> getAllOrganizations() {
final List<Organization> refs = OrganizationManager.getDefault().getAllEntities(null, new SortCriteria("name"));
final List<SelectItem> ret = new ArrayList<SelectItem>();
ret.add(new SelectItem(null, FacesUtils.getMessage("contact.selectOneOrganization")));
for (Organization ref : refs) {
String name = ref.getName();
if (name.length() > 97) {
name = name.substring(0, 97) + "...";
}
ret.add(new SelectItem(ref, name));
}
return ret;
}
use of com.autentia.tnt.dao.SortCriteria in project TNTConcept by autentia.
the class InteractionBean method getUsers.
/**
* Get the list of all users
* @return the list of all users
*/
public List<SelectItem> getUsers() {
List<User> refs = UserManager.getDefault().getAllEntities(null, new SortCriteria("name"));
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
for (User ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
Aggregations