throws DbOperationFailedException, SessionExpiredException {
try {
return saveAs(sessionId, name, xViewModel);
} catch (OperationFailedException e) {
UserSession userSession = getUserSession(sessionId);
throw new DbOperationFailedException(userSession.translate("couldNotSave", xViewModel.getName(),
e.getLocalizedMessage()),
e);
} catch (Throwable t) {
t.printStackTrace();
if (t.getMessage() != null && t.getMessage().toLowerCase().indexOf("not enough rights") != -1) {
return null;
}
UserSession userSession = getUserSession(sessionId);
throw new DbOperationFailedException(userSession.translate("couldNotSave", xViewModel.getName(),
t.getLocalizedMessage()),
t);
}
}