biobjDAO.insertBIObject(obj, objTemp, loadParsDCClicked);
}
} else if(mod.equalsIgnoreCase(SpagoBIConstants.DETAIL_MOD)) {
BIObjectParameter biObjPar = null;
Object selectedObjParIdObj = request.getAttribute("selected_obj_par_id");
Object deleteBIObjectParameter = request.getAttribute("deleteBIObjectParameter");
if (selectedObjParIdObj != null) {
// it is requested to view another BIObjectParameter than the one visible
int selectedObjParId = helper.findBIObjParId(selectedObjParIdObj);
selectedObjParIdStr = new Integer (selectedObjParId).toString();
String saveBIObjectParameter = (String) request.getAttribute("saveBIObjectParameter");
if (saveBIObjectParameter != null && saveBIObjectParameter.equalsIgnoreCase("yes")) {
// it is requested to save the visible BIObjectParameter
ValidationCoordinator.validate("PAGE", "BIObjectParameterValidation", this);
biObjPar = helper.recoverBIObjectParameterDetails(obj.getId());
// If it's a new BIObjectParameter or if the Parameter was changed controls
// that the BIObjectParameter url name is not already in use
urlNameControl(obj.getId(), biObjPar);
helper.fillResponse(initialPath);
verifyForDependencies(biObjPar);
// if there are some validation errors into the errorHandler does not write into DB
if(!errorHandler.isOKByCategory(EMFErrorCategory.VALIDATION_ERROR)) {
helper.fillResponse(initialPath);
prepareBIObjectDetailPage(response, obj, biObjPar, biObjPar.getId().toString(), ObjectsTreeConstants.DETAIL_MOD, false, false);
return;
}
IBIObjectParameterDAO objParDAO = DAOFactory.getBIObjectParameterDAO();
objParDAO.setUserProfile(profile);
if (biObjPar.getId().intValue() == -1) {
// it is requested to insert a new BIObjectParameter
objParDAO.insertBIObjectParameter(biObjPar);
} else {
// it is requested to modify a BIObjectParameter
objParDAO.modifyBIObjectParameter(biObjPar);
}
prepareBIObjectDetailPage(response, obj, null, selectedObjParIdStr, ObjectsTreeConstants.DETAIL_MOD, false, true);
return;
} else {
helper.fillResponse(initialPath);
prepareBIObjectDetailPage(response, obj, null, selectedObjParIdStr, ObjectsTreeConstants.DETAIL_MOD, false, true);
// exits without writing into DB
return;
}
} else if (deleteBIObjectParameter != null) {
// it is requested to delete the visible BIObjectParameter
int objParId = helper.findBIObjParId(deleteBIObjectParameter);
Integer objParIdInt = new Integer(objParId);
EMFValidationError error = checkForDependancies(objParIdInt);
if (error != null) {
errorHandler.addError(error);
}
helper.fillResponse(initialPath);
// if there are some validation errors into the errorHandler does not write into DB
if(!errorHandler.isOKByCategory(EMFErrorCategory.VALIDATION_ERROR)) {
helper.fillResponse(initialPath);
prepareBIObjectDetailPage(response, obj, biObjPar, biObjPar.getId().toString(), ObjectsTreeConstants.DETAIL_MOD, false, false);
return;
}
// deletes the BIObjectParameter
IBIObjectParameterDAO objParDAO = DAOFactory.getBIObjectParameterDAO();
BIObjectParameter objPar = objParDAO.loadForDetailByObjParId(new Integer(objParId));
objParDAO.eraseBIObjectParameter(objPar);
selectedObjParIdStr = "";
prepareBIObjectDetailPage(response, obj, null, selectedObjParIdStr, ObjectsTreeConstants.DETAIL_MOD, false, true);
return;