try
{
DynaActionForm dynaForm = (DynaActionForm)form;
HttpSession session = request.getSession(true);
String typeOfSave = "save";
int individualID = 0;
UserObject userObject = (UserObject)session.getAttribute("userobject");
UserPrefererences userPrefererences = userObject.getUserPref();
// no need to check for null on userobjectd here, because if it is null
// we should fail now! instead of making an EJB call with bogus info.
individualID = userObject.getIndividualID();
if (request.getParameter("buttonpress") != null)
{
typeOfSave = request.getParameter("buttonpress");
String minutes = (String) (dynaForm.get("minutes"));
String seconds = (String) (dynaForm.get("seconds"));
Vector vec = new Vector();
PreferenceVO pvo1 = new PreferenceVO();
PreferenceVO pvo2 = new PreferenceVO();
PreferenceVO pvo3 = new PreferenceVO();
pvo1.setModuleId(4);
pvo1.setPreferenceName("calendarrefreshmin");
pvo1.setPreferenceValue(minutes);
pvo2.setModuleId(4);
pvo2.setPreferenceName("calendarrefreshsec");
pvo2.setPreferenceValue(seconds);
pvo3.setModuleId(4);
pvo3.setPreferenceName("caldefaultview");
pvo3.setPreferenceValue((String) (dynaForm.get("radio")));
if(minutes != null && !minutes.equals("") && !minutes.equals("null")
&& seconds != null && !seconds.equals("") && !seconds.equals("null"))
{
userPrefererences.setCalendarRefreshMin(minutes);
userPrefererences.setCalendarRefreshSec(seconds);
userObject.setUserPref(userPrefererences);
session.setAttribute("userobject",userObject);
}
if(dynaForm.get("radio") != null)
{
userPrefererences.setCalendarDefaultView((String) dynaForm.get("radio"));
userObject.setUserPref(userPrefererences);
session.setAttribute("userobject",userObject);
}
vec.addElement(pvo1);
vec.addElement(pvo2);
vec.addElement(pvo3);
PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
Preference prefRemote = prefHome.create();
prefRemote.setDataSource(dataSource);
prefRemote.updateUserPreference(individualID, vec);
FORWARD_final = FORWARD_save;
request.setAttribute("TYPEOFOPERATION", "EDIT");
session.setAttribute("userobject", userObject);
}
request.setAttribute(AdminConstantKeys.PREFERENCEPAGE, "CALENDAR");
FORWARD_final = FORWARD_save;