use of com.autentia.tnt.businessobject.Interaction in project TNTConcept by autentia.
the class OfferBean method editInteractions.
/**
* Create a new empty instance of the one-to-many field
*
* @return forward to the same page
*/
public String editInteractions() {
UIData table = (UIData) FacesUtils.getComponent("offer:interactions");
InteractionBean iB = (InteractionBean) FacesUtils.getBean("interactionBean");
Interaction interactionSelectedInOfferEdit = (Interaction) table.getRowData();
if (interactionSelectedInOfferEdit.getId() != null) {
Interaction interaction = InteractionManager.getDefault().getEntityById(interactionSelectedInOfferEdit.getId());
iB.setInteractionFromOffer(interaction);
iB.setSelectedOrganization(interaction.getProject().getClient());
} else {
iB.setInteractionFromOffer(interactionSelectedInOfferEdit);
}
return NavigationResults.OFFER_CREATE_INTERACTION;
}
use of com.autentia.tnt.businessobject.Interaction in project TNTConcept by autentia.
the class OfferBean method getInteractionss.
/**
* Get the list of all interactionss
*
* @return the list of all interactionss
*/
public List<SelectItem> getInteractionss() {
List<Interaction> refs = InteractionManager.getDefault().getAllEntities(null, new SortCriteria("creationDate"));
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
for (Interaction ref : refs) {
ret.add(new SelectItem(ref, ref.getDescription()));
}
return ret;
}
use of com.autentia.tnt.businessobject.Interaction in project TNTConcept by autentia.
the class OfferBean method createInteractions.
/**
* Create a new empty instance of the one-to-many field
*
* @return forward to the same page
*/
public String createInteractions() {
Interaction item = new Interaction();
item.setOffer(offer);
if (item.getUser() == null) {
item.setUser(SpringUtils.getPrincipal().getUser());
}
item.setCreationDate(new Date());
InteractionBean iB = (InteractionBean) FacesUtils.getBean("interactionBean");
iB.setInteractionFromOffer(item);
iB.setSelectedOrganization(OrganizationManager.getDefault().getMyOrganization());
if (offer.getInteractions() == null) {
offer.setInteractions(new HashSet());
}
offer.getInteractions().add(item);
return NavigationResults.OFFER_CREATE_INTERACTION;
}
Aggregations