$wfsConfObj = $ajaxResponse->getParameter("wfsConf"); $wfsConf = WfsConfiguration::createFromObject($wfsConfObj); $success = WfsConfiguration::updateInDb($wfsConf); $ajaxResponse->setSuccess($success); $message = "The WFS configuration has been updated in the database."; if (!$success) { $message = "An error occured when updating the WFS configuration in the database."; } $ajaxResponse->setMessage($message); $ajaxResponse->send(); break; case "insertWfsConf": $wfsConfObj = $ajaxResponse->getParameter("wfsConf"); $wfsConf = WfsConfiguration::createFromObject($wfsConfObj); $success = false; $id = WfsConfiguration::insertIntoDb($wfsConf); if ($id === null) { $success = false; $message = "An error occured when inserting the WFS configuration into the database."; } else { $success = true; $message = "The WFS configuration has been inserted into the database. Go to 'Assign WFS conf to application' and assign the new conf to an application."; $ajaxResponse->setResult("id", $id); } $ajaxResponse->setSuccess($success); $ajaxResponse->setMessage($message); $ajaxResponse->send(); break; } // If no response is sent previously, send an error message $ajaxResponse->setMessage("Invalid command.");