public ActionForward save(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// get the basicProject service
ProjectService projectService = CoreObjectFactory.getProjectService();
// get the form
BasicProjectForm basicProjectForm = (BasicProjectForm) form;
// Save or update the BasicProject
Errors errors = null;
if (basicProjectForm.getPersistanceId() == 0) {
// get the current user from the session
User user = (User) request.getSession().getAttribute("user");
// add
errors = projectService.add(basicProjectForm.getCode(),
basicProjectForm.getName(), user.getPersistanceId());
} else {
// update
errors = projectService.update(basicProjectForm
.getPersistanceId(), basicProjectForm.getCode(),
basicProjectForm.getName(), basicProjectForm
.getPersistanceVersion());
}