@Override public Integer saveWithSession(Milestone record, String username) { if (record.getStatus() == null) { record.setStatus(OptionI18nEnum.MilestoneStatus.InProgress.name()); } Integer recordId = super.saveWithSession(record, username); asyncEventBus.post( new CleanCacheEvent( record.getSaccountid(), new Class[] {ProjectService.class, GanttAssignmentService.class})); return recordId; }
private int saveMilestone(Milestone milestone) { MilestoneService milestoneService = ApplicationContextUtil.getSpringBean(MilestoneService.class); milestone.setProjectid(CurrentProjectVariables.getProjectId()); milestone.setSaccountid(AppContext.getAccountId()); if (milestone.getId() == null) { milestone.setCreateduser(AppContext.getUsername()); milestoneService.saveWithSession(milestone, AppContext.getUsername()); } else { milestoneService.updateWithSession(milestone, AppContext.getUsername()); } return milestone.getId(); }
@Override public Integer updateWithSession(Milestone record, String username) { int result = super.updateWithSession(record, username); asyncEventBus.post( new CleanCacheEvent( record.getSaccountid(), new Class[] {ProjectService.class, GanttAssignmentService.class})); return result; }
@Override protected void onGo(ComponentContainer container, ScreenData<?> data) { if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)) { MilestoneContainer milestoneContainer = (MilestoneContainer) container; milestoneContainer.navigateToContainer(ProjectTypeConstants.MILESTONE); milestoneContainer.removeAllComponents(); milestoneContainer.addComponent(view.getWidget()); Milestone milestone = (Milestone) data.getParams(); view.editItem(milestone); ProjectBreadcrumb breadcrumb = ViewManager.getCacheComponent(ProjectBreadcrumb.class); if (milestone.getId() == null) { breadcrumb.gotoMilestoneAdd(); } else { breadcrumb.gotoMilestoneEdit(milestone); } } else { NotificationUtil.showMessagePermissionAlert(); } }
@Override public Integer updateWithSession(Milestone record, String username) { CacheUtils.cleanCaches(record.getSaccountid(), ProjectService.class); return super.updateWithSession(record, username); }
@Override public Integer saveWithSession(Milestone record, String username) { Integer recordId = super.saveWithSession(record, username); CacheUtils.cleanCaches(record.getSaccountid(), ProjectService.class); return recordId; }