float z = parseFloatString(request.getParameter("z"));
float angle = parseFloatString(request.getParameter("angle"));
// Fetch the PlacemarkList from the /system/placemarks/placemarks.xml
// file.
PlacemarkList placemarkList = getPlacemarkList();
// Check to see if a name has been entered, flag an error if not
if (name == null || name.equals("") == true) {
String msg = "No name was entered for the Placemark. Cancelling.";
error(request, response, msg);
return;
}
// Check to see if the placemark already exists, flag an error if so.
if (placemarkList.getPlacemark(name) != null) {
String msg = "A Placemark named " + name + " already exists.";
error(request, response, msg);
return;
}
// Add the new placemark to the list of placemarks. Write the data
// back out to the file.
Placemark placemark = new Placemark(name, url, x, y, z, angle);
placemarkList.addPlacemark(placemark);
setPlacemarkList(placemarkList);
// Tell the config connection that we have added a new Placemark, if
// the config connection exists (it should)
Object obj = getServletContext().getAttribute(PLACEMARKS_CONN_ATTR);