Search in sources :

Example 16 with Department

use of com.autentia.tnt.businessobject.Department in project TNTConcept by autentia.

the class DepartmentBean method getParents.

// Getters to list possible values of related entities
/**
 * Get the list of all parents
 * @return the list of all parents
 */
public List<SelectItem> getParents() {
    List<Department> refs = DepartmentManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    for (Department ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) Department(com.autentia.tnt.businessobject.Department) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Example 17 with Department

use of com.autentia.tnt.businessobject.Department in project TNTConcept by autentia.

the class DepartmentBean method getParentsWithoutMe.

/* Department - generated by stajanov (do not edit/delete) */
/**
 * Get the list of all parents
 * @return the list of all parents
 */
public List<SelectItem> getParentsWithoutMe() {
    List<Department> refs = null;
    if (department != null && department.getId() != null) {
        search.setIdDifferentFrom(department.getId());
        refs = manager.getAllEntities(search, new SortCriteria("name"));
        search.unsetIdDifferentFrom();
    } else {
        refs = manager.getAllEntities(null, new SortCriteria("name"));
    }
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    ret.add(new SelectItem("", "-- Ninguno --"));
    for (Department ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) Department(com.autentia.tnt.businessobject.Department) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Aggregations

Department (com.autentia.tnt.businessobject.Department)17 SortCriteria (com.autentia.tnt.dao.SortCriteria)9 ArrayList (java.util.ArrayList)8 SelectItem (javax.faces.model.SelectItem)8 DepartmentDAO (com.autentia.tnt.dao.hibernate.DepartmentDAO)3 HashSet (java.util.HashSet)3 Position (com.autentia.tnt.businessobject.Position)2 DepartmentSearch (com.autentia.tnt.dao.search.DepartmentSearch)2 PositionSearch (com.autentia.tnt.dao.search.PositionSearch)2 ContactInfo (com.autentia.tnt.businessobject.ContactInfo)1 OfferRole (com.autentia.tnt.businessobject.OfferRole)1 Organization (com.autentia.tnt.businessobject.Organization)1 Role (com.autentia.tnt.businessobject.Role)1 UserCategory (com.autentia.tnt.businessobject.UserCategory)1 WorkingAgreement (com.autentia.tnt.businessobject.WorkingAgreement)1 ContactDAO (com.autentia.tnt.dao.hibernate.ContactDAO)1 OfferDAO (com.autentia.tnt.dao.hibernate.OfferDAO)1 OrganizationDAO (com.autentia.tnt.dao.hibernate.OrganizationDAO)1 ProjectDAO (com.autentia.tnt.dao.hibernate.ProjectDAO)1 RoleDAO (com.autentia.tnt.dao.hibernate.RoleDAO)1