use of com.autentia.tnt.businessobject.User in project TNTConcept by autentia.
the class ContactBean method sendMail.
/**
* Send e-mail message to contact to notify him about his inclussion in our
* archive of contacts
*
* @return
*/
public String sendMail() {
User actualUser = authManager.getCurrentPrincipal().getUser();
List<String> to = new ArrayList<String>();
to.add(contact.getName() + " <" + contact.getEmail() + ">");
SendMailBean sendMail = (SendMailBean) FacesUtils.getBean("sendMailBean");
sendMail.setFrom(actualUser.getName() + " <" + actualUser.getEmail() + ">");
sendMail.setTo(to);
sendMail.setSubject(FacesUtils.formatMessage("editContact.sendMailSubject"));
sendMail.setMessage(FacesUtils.formatMessage("editContact.sendMailMessage", contact.getName(), actualUser.getName()));
sendMail.addSendMailBeanListener(this);
return OUTCOME_NOTIFY;
}
use of com.autentia.tnt.businessobject.User in project TNTConcept by autentia.
the class InteractionBean method getUsers.
/**
* Get the list of all users
* @return the list of all users
*/
public List<SelectItem> getUsers() {
List<User> refs = UserManager.getDefault().getAllEntities(null, new SortCriteria("name"));
ArrayList<SelectItem> ret = new ArrayList<SelectItem>();
for (User ref : refs) {
ret.add(new SelectItem(ref, ref.getName()));
}
return ret;
}
use of com.autentia.tnt.businessobject.User in project TNTConcept by autentia.
the class CommissioningBean method deleteReviser.
public String deleteReviser() {
final UIData table = (UIData) FacesUtils.getComponent("commissioning:revisers");
final User toDelete = (User) table.getRowData();
commissioning.getRevisers().remove(toDelete);
return NavigationResults.EDIT;
}
use of com.autentia.tnt.businessobject.User in project TNTConcept by autentia.
the class CommissioningBean method createObjetives.
private void createObjetives() {
for (final User user : commissioning.getRevisers()) {
final Objective objective = new Objective();
objective.setUser(user);
objective.setProject(commissioning.getProject());
objective.setStartDate(commissioning.getRequestDate());
objective.setEndDate(commissioning.getDeliveryDate());
objective.setState(ObjectiveState.PENDING);
objective.setName(FacesUtils.formatMessage("commissioning.automaticObjectiveName", commissioning.getName()));
objectiveManager.insertEntity(objective);
}
FacesUtils.addInfoMessage(null, "commissioning.info.objectiveCreated");
}
use of com.autentia.tnt.businessobject.User in project TNTConcept by autentia.
the class CommissioningBean method create.
/**
* Go to create page
*
* @return forward to CREATE page
*/
public String create() {
commissioning = new Commissioning();
// when we create a new commissioning status is created
// and default reviser is actual user
commissioning.setStatus(CommissioningStatus.CREATED);
commissioning.setRequestDate(new Date());
final Set<User> revisers = new HashSet<User>();
revisers.add(authManager.getCurrentPrincipal().getUser());
commissioning.setRevisers(revisers);
return NavigationResults.CREATE;
}
Aggregations