コード例 #1
0
ファイル: BlogAdminWidget.java プロジェクト: hacxer/focusns
 public String editPost(Map<String, Object> model, @RequestParam Long id, Project project) {
   //
   List<BlogCategory> blogCategories = categoryService.getBlogCategories(project.getId());
   model.put("blogCategories", blogCategories);
   //
   return "modules/admin/blog/post-edit";
 }
コード例 #2
0
 @OnEvent(Event.MODIFIED)
 public void onProjectModified(EventContext taskContext) {
   log.info("event triggered!");
   //
   Project project = taskContext.getParameter("project", Project.class);
   //
   ProjectHistory projectHistory = new ProjectHistory();
   projectHistory.setCreateAt(new Date());
   projectHistory.setContent("Project modified!");
   projectHistory.setTargetId(project.getId());
   projectHistory.setTargetType(Project.class.getName());
   projectHistory.setProjectId(project.getId());
   projectHistory.setCreateById(project.getModifyById());
   //
   projectHistoryService.createProjectHistory(projectHistory);
 }
コード例 #3
0
ファイル: BlogAdminWidget.java プロジェクト: hacxer/focusns
 public String editCategory(Map<String, Object> model, Project project) {
   //
   List<BlogCategory> blogCategories = categoryService.getBlogCategories(project.getId());
   model.put("blogCategories", blogCategories);
   //
   return "modules/admin/blog/category-edit";
 }
コード例 #4
0
 @RequestMapping(value = "/member-list", method = GET)
 public String doList(
     @RequestParam(defaultValue = "0") Long roleId,
     @RequestParam(defaultValue = "1") Integer pageNo,
     @WidgetAttribute Project project,
     @WidgetPref(defaultValue = "12") Integer pageSize,
     Model model) {
   //
   List<ProjectRole> projectRoles = projectRoleService.listProjectRoles(project.getId());
   model.addAttribute("projectRoles", projectRoles);
   //
   Page<TeamMember> teamMemberPage = new Page<TeamMember>(pageSize);
   teamMemberPage.setPageNo(pageNo);
   teamMemberPage = teamMemberService.fetchPage(teamMemberPage, project.getId(), roleId);
   model.addAttribute("teamMemberPage", teamMemberPage);
   //
   return "modules/team/member-list";
 }
コード例 #5
0
 @RequestMapping(value = "/member-edit", method = GET)
 public String doEdit(
     @RequestParam(defaultValue = "users") String tab,
     @RequestParam(defaultValue = "1") Integer pageNo,
     @WidgetAttribute Project project,
     @WidgetPref(defaultValue = "12") Integer pageSize,
     Model model) {
   //
   if ("users".equals(tab)) {
     Page<TeamMember> teamMemberPage = new Page<TeamMember>(pageSize);
     teamMemberPage.setPageNo(pageNo);
     teamMemberPage = teamMemberService.fetchPagePotentially(teamMemberPage);
     model.addAttribute("teamMemberPage", teamMemberPage);
   }
   if ("link1".equals(tab)) {
     Page<ProjectLink> linkPage = new Page<ProjectLink>(pageSize);
     linkPage.setPageNo(pageNo);
     linkPage =
         projectLinkService.fetchPageByFromProjectId(
             linkPage, project.getId(), project.getCategory().getCode());
     model.addAttribute("linkPage", linkPage);
   }
   if ("link2".equals(tab)) {
     Page<ProjectLink> reversedLinkPage = new Page<ProjectLink>(pageSize);
     reversedLinkPage.setPageNo(pageNo);
     reversedLinkPage =
         projectLinkService.fetchPageByToProjectId(
             reversedLinkPage, project.getId(), project.getCategory().getCode());
     model.addAttribute("reversedLinkPage", reversedLinkPage);
   }
   //
   List<ProjectRole> projectRoles = projectRoleService.listProjectRoles(project.getId());
   model.addAttribute("projectRoles", projectRoles);
   //
   return "modules/team/member-edit";
 }