public String execute(){
if(getGreeting().getName() == null || "".equalsIgnoreCase(getGreeting().getName())){
addActionError("Name is required");
}
Greeting greeting;
if(getGreeting().getId() == null || "".equalsIgnoreCase(getGreeting().getId())){
greeting = new Greeting();
logInfo = new LogInformation();
logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
} else {
greeting = (Greeting) manager.getById(Greeting.class, getGreeting().getId());
logInfo = greeting.getLogInformation();
}
logInfo.setActiveFlag(getActive());
logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
greeting.setLogInformation(logInfo);
greeting.setName(getGreeting().getName());
greeting.setFirstNameOnly(getGreeting().getFirstNameOnly());
greeting.setPdefault(getGreeting().getPdefault());
manager.save(greeting);
setGreeting(greeting);
return SUCCESS;
}