public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, CommunicationException, NamingException
{
String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
AppSettingsHome appHome = (AppSettingsHome)CVUtility.getHomeObject("com.centraview.administration.applicationsettings.AppSettingsHome", "AppSettings");
try {
String returnStatus = "";
String button = request.getParameter("buttonpress").toString();
String setting = request.getParameter("setting").toString();
String submodule = request.getParameter("submodule").toString();
request.setAttribute("typeofsubmodule", submodule);
HttpSession session = request.getSession();
UserObject userObject = (UserObject) session.getAttribute("userobject");
int IndividualId = userObject.getIndividualID();
DynaActionForm dynaform = (DynaActionForm) form;
String[] optionValues = (String[]) dynaform.get("valueList");
String[] optionIDs = (String[]) dynaform.get("valueIds");
ArrayList vecOption = new ArrayList();
//To Make sure we don't go out of bounds.
int arrayLength = (optionIDs.length < optionValues.length) ? optionIDs.length : optionValues.length;
for (int i = 0; i < arrayLength; i++) {
DDNameValue tempDDNameValue =
new DDNameValue(Integer.parseInt(optionIDs[i]), optionValues[i]);
vecOption.add(tempDDNameValue);
}
AppSettings appRemote = appHome.create();
appRemote.setDataSource(dataSource);
appRemote.addMasterDataSettings(setting, (Collection) vecOption);
GlobalMasterLists.refreshGlobalMasterList(dataSource);
ProjectsHelperList.refreshProjectsHelperList();