Search in sources :

Example 1 with InteractionType

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

the class DuplicateOfferTest method insertOfferInteraction.

/**
 * Inserta una interaccion en la oferta
 */
private void insertOfferInteraction() {
    final Set<Interaction> interactions = new LinkedHashSet<Interaction>(1);
    final InteractionTypeDAO interactionTypeDAO = (InteractionTypeDAO) SpringUtilsForTesting.getSpringBean("daoInteractionType");
    final InteractionType interactionType = new InteractionType();
    interactionType.setName("interaccion");
    interactionTypeDAO.insert(interactionType);
    final Interaction interaction = new Interaction();
    interaction.setProject(project);
    interaction.setUser(user);
    interaction.setType(interactionType);
    interaction.setOffer(offer);
    interaction.setCreationDate(new Date());
    interaction.setInterest(InteractionInterest.MEDIUM);
    interaction.setDescription("descripcion de la interaccion");
    interactions.add(interaction);
    offer.setInteractions(interactions);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) InteractionType(com.autentia.tnt.businessobject.InteractionType) Interaction(com.autentia.tnt.businessobject.Interaction) Date(java.util.Date) InteractionTypeDAO(com.autentia.tnt.dao.hibernate.InteractionTypeDAO)

Example 2 with InteractionType

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

the class InteractionBean method getTypes.

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

Aggregations

InteractionType (com.autentia.tnt.businessobject.InteractionType)2 Interaction (com.autentia.tnt.businessobject.Interaction)1 SortCriteria (com.autentia.tnt.dao.SortCriteria)1 InteractionTypeDAO (com.autentia.tnt.dao.hibernate.InteractionTypeDAO)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 LinkedHashSet (java.util.LinkedHashSet)1 SelectItem (javax.faces.model.SelectItem)1