Search in sources :

Example 6 with Contact

use of com.autentia.tnt.businessobject.Contact 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;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) Contact(com.autentia.tnt.businessobject.Contact)

Example 7 with Contact

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

the class OfferBean method getContactsBySelectedOrganization.

/**
 * Selected organization *
 */
public List<SelectItem> getContactsBySelectedOrganization() {
    ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
    ContactSearch cs = new ContactSearch();
    cs.setOrganization(getOrganization());
    List<Contact> refs = ContactManager.getDefault().getAllEntities(cs, new SortCriteria("name"));
    for (Contact ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    // AƱadiendo el campo vacio
    ret.add(0, new SelectItem(""));
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) ContactSearch(com.autentia.tnt.dao.search.ContactSearch) Contact(com.autentia.tnt.businessobject.Contact)

Example 8 with Contact

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

the class TagBean method createContactTags.

// Getters to list possible values of enum fields
// Methods to create/remove instances of one-to-many entities (slave
// entities)
/**
 * Create a new empty instance of the one-to-many field
 *
 * @return forward to the same page
 */
public String createContactTags() {
    Contact item = new Contact();
    if (tag.getContactTags() == null) {
        tag.setContactTags(new HashSet());
    }
    tag.getContactTags().add(item);
    return null;
}
Also used : Contact(com.autentia.tnt.businessobject.Contact) HashSet(java.util.HashSet)

Example 9 with Contact

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

the class TagBean method deleteContact.

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

Example 10 with Contact

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

the class OfferBean 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>();
    for (Contact ref : refs) {
        ret.add(new SelectItem(ref, ref.getName()));
    }
    return ret;
}
Also used : SortCriteria(com.autentia.tnt.dao.SortCriteria) SelectItem(javax.faces.model.SelectItem) ArrayList(java.util.ArrayList) Contact(com.autentia.tnt.businessobject.Contact)

Aggregations

Contact (com.autentia.tnt.businessobject.Contact)15 ArrayList (java.util.ArrayList)7 SelectItem (javax.faces.model.SelectItem)6 SortCriteria (com.autentia.tnt.dao.SortCriteria)5 EntityChange (com.autentia.tnt.tracking.EntityChange)2 HashSet (java.util.HashSet)2 Tag (com.autentia.tnt.businessobject.Tag)1 ContactSearch (com.autentia.tnt.dao.search.ContactSearch)1 UIData (javax.faces.component.UIData)1