Search in sources :

Example 21 with Organization

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

the class CollaboratorBean method getOrganizations.

/**
 * Get the list of all organizations
 * @return the list of all organizations
 */
public List<SelectItem> getOrganizations() {
    List<Organization> refs = OrganizationManager.getDefault().getAllEntities(null, new SortCriteria("name"));
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    ret.add(new SelectItem(null, ""));
    for (Organization ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) Organization(com.autentia.tnt.businessobject.Organization) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList)

Example 22 with Organization

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

the class OrganizationManager method getProvidersAndClients.

public List<Organization> getProvidersAndClients() {
    OrganizationTypeDAO orgTypeDao = OrganizationTypeDAO.getDefault();
    OrganizationType provider = orgTypeDao.loadById(ConfigurationUtil.getDefault().getOrganizationTypeProvider());
    OrganizationType providerCient = orgTypeDao.loadById(ConfigurationUtil.getDefault().getOrganizationTypeProviderAndClient());
    List<Organization> lista = new ArrayList<Organization>();
    List<Organization> orgs = organizationDAO.searchByOrganizationTypes(new SortCriteria("name"), provider, providerCient);
    for (Organization org : orgs) {
        lista.add(org);
    }
    return lista;
}
Also used : OrganizationTypeDAO(com.autentia.tnt.dao.hibernate.OrganizationTypeDAO) SortCriteria(com.autentia.tnt.dao.SortCriteria) Organization(com.autentia.tnt.businessobject.Organization) ArrayList(java.util.ArrayList) OrganizationType(com.autentia.tnt.businessobject.OrganizationType)

Example 23 with Organization

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

the class OrganizationManager method getEntityById.

/**
 * Get organization by primary key.
 * @return organization selected by id.
 */
public Organization getEntityById(int id) {
    final Organization organization = organizationDAO.loadById(id);
    organization.initChanges();
    return organization;
}
Also used : Organization(com.autentia.tnt.businessobject.Organization)

Example 24 with Organization

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

the class OccupationBean method onSelectedOrganizationSearchChanged.

public void onSelectedOrganizationSearchChanged(ValueChangeEvent event) {
    Organization now = (Organization) event.getNewValue();
    if (now == null)
        return;
    setSearchProjectValid(true);
    setSelectedOrganization(now);
    FacesUtils.renderResponse();
}
Also used : Organization(com.autentia.tnt.businessobject.Organization)

Aggregations

Organization (com.autentia.tnt.businessobject.Organization)24 ArrayList (java.util.ArrayList)17 SelectItem (javax.faces.model.SelectItem)16 SortCriteria (com.autentia.tnt.dao.SortCriteria)15 Project (com.autentia.tnt.businessobject.Project)2 HashSet (java.util.HashSet)2 Department (com.autentia.tnt.businessobject.Department)1 OrganizationType (com.autentia.tnt.businessobject.OrganizationType)1 ProjectRole (com.autentia.tnt.businessobject.ProjectRole)1 OrganizationTypeDAO (com.autentia.tnt.dao.hibernate.OrganizationTypeDAO)1 DepartmentSearch (com.autentia.tnt.dao.search.DepartmentSearch)1 HashMap (java.util.HashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 UIData (javax.faces.component.UIData)1