Search in sources :

Example 6 with Department

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

the class TagBean method getDepartmentTagss.

/**
 * Get the list of all departmentTagss
 *
 * @return the list of all departmentTagss
 */
public List<SelectItem> getDepartmentTagss() {
    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 7 with Department

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

the class TagBean method getDepartmentTagsSelected.

/**
 * Get the list of all departmentTags selected
 *
 * @return the list of all departmentTags selected
 */
public List<SelectItem> getDepartmentTagsSelected() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    List<Department> refs = this.getDepartmentTags();
    for (Department ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : Department(com.autentia.tnt.businessobject.Department) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Example 8 with Department

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

the class ContactBean method getAllDepartmentsOfCompany.

public List<SelectItem> getAllDepartmentsOfCompany() {
    final Set<Organization> organizations = new LinkedHashSet<Organization>();
    organizations.add(this.getSelectedOrganization());
    final DepartmentSearch departmentSearch = new DepartmentSearch();
    departmentSearch.setOrganization(this.getSelectedOrganization());
    final List<Department> refs = DepartmentManager.getDefault().getAllEntities(departmentSearch, new SortCriteria("name"));
    final List<SelectItem> ret = new ArrayList<SelectItem>();
    ret.add(new SelectItem(null, FacesUtils.getMessage("contact.selectOneDepartment")));
    for (Department ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) SortCriteria(com.autentia.tnt.dao.SortCriteria) Department(com.autentia.tnt.businessobject.Department) Organization(com.autentia.tnt.businessobject.Organization) SelectItem(javax.faces.model.SelectItem) DepartmentSearch(com.autentia.tnt.dao.search.DepartmentSearch) ArrayList(java.util.ArrayList)

Example 9 with Department

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

the class TagBean method editDepartmentTags.

/**
 * Create a new empty instance of the one-to-many field
 *
 * @return forward to the same page
 */
public String editDepartmentTags() {
    Department item = new Department();
    if (tag.getDepartmentTags() == null) {
        tag.setDepartmentTags(new HashSet());
    }
    tag.getDepartmentTags().add(item);
    return null;
}
Also used : Department(com.autentia.tnt.businessobject.Department) HashSet(java.util.HashSet)

Example 10 with Department

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

the class TagBean method deleteDepartment.

public String deleteDepartment() {
    final UIData table = (UIData) FacesUtils.getComponent("tag:departments");
    final Department toDelete = (Department) table.getRowData();
    tag.getDepartmentTags().remove(toDelete);
    return NavigationResults.EDIT;
}
Also used : Department(com.autentia.tnt.businessobject.Department) UIData(javax.faces.component.UIData)

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