Examples of ProjectCategory


Examples of org.focusns.model.core.ProjectCategory

    @Autowired
    private ProjectCategoryDao categoryDao;

    @Test
    public void setup() {
        ProjectCategory category = new ProjectCategory();
        category.setCode("People");
        int count = categoryDao.insert(category);
        Assert.assertEquals(1, count);
    }
View Full Code Here

Examples of org.focusns.model.core.ProjectCategory

        Assert.assertEquals(1, count);
    }

    @Test
    public void testInsert() {
        ProjectCategory category = categoryDao.selectByCode("People");
        Assert.assertNotNull(category);
        //
        Date now = new Date();
        //
        Project project = new Project();
View Full Code Here

Examples of org.focusns.model.core.ProjectCategory

        Assert.assertEquals(1, count);
    }

    @Test
    public void destroy() {
        ProjectCategory category = categoryDao.selectByCode("People");
        int count = categoryDao.delete(category.getId());
        Assert.assertEquals(1, count);
    }
View Full Code Here

Examples of org.focusns.model.core.ProjectCategory

    @Autowired
    private ProjectCategoryService projectCategoryService;

    @Test
    public void testCreateProject() {
        ProjectCategory category = new ProjectCategory();
        category.setCode("People");
        category.setLabel("人员");
        projectCategoryService.createCategory(category);
        //
        ProjectUser user = new ProjectUser();
        user.setUsername("haozhonghu");
        user.setPassword("123456");
        user.setEmail("haozhonghu@hotmail.com");
        projectUserDao.insert(user);
        //
        Date now = new Date();
        Project project = new Project();
        project.setCode("gavin");
        project.setTitle("Gavin Hu");
        project.setDescription("This is gavin's profile!");
        //
        project.setCreatedAt(now);
        project.setModifiedAt(now);
        project.setCreatedById(user.getId());
        project.setModifiedById(user.getId());
        project.setCategoryId(category.getId());
        //
        projectService.createProject(project);
    }
View Full Code Here

Examples of org.focusns.model.core.ProjectCategory

        //
        projectService.removeProject(project);
        //
        projectUserDao.delete(project.getCreatedById());
        //
        ProjectCategory category = projectCategoryService.getCategory(project.getCategoryId());
        projectCategoryService.removeCategory(category);

    }
View Full Code Here

Examples of org.focusns.model.core.ProjectCategory

        ProjectUser user = projectUserDao.selectByUsername(username);
        if (user!=null && user.getProjectId() > 0) {
            Project project = projectDao.select(user.getProjectId());
            user.setProject(project);
            //
            ProjectCategory projectCategory = projectCategoryDao.select(project.getCategoryId());
            project.setCategory(projectCategory);
        }
        //
        return user;
    }
View Full Code Here

Examples of org.focusns.model.core.ProjectCategory

    @Event(on = "CREATE_PROJECT_USER", point = Event.Point.AFTER)
    public void afterCreateProjectUser(EventContext ctx) throws Exception {
        //
        ProjectUser projectUser = (ProjectUser) ctx.getArguments()[0];
        ProjectCategory category = projectCategoryDao.selectByCode("people");
        ProjectTemplate projectTemplate = getProjectTemplate(category.getCode());
        //
        String projectCode = String.valueOf(10000000 + projectUser.getId());
        //
        Date now = new Date();
        Project project = new Project();
        project.setCode(projectCode);
        project.setTitle(projectUser.getNickname());
        project.setDescription(projectTemplate.getDescription());
        project.setCategoryId(category.getId());
        project.setCreatedAt(now);
        project.setModifiedAt(now);
        project.setCreatedById(projectUser.getId());
        project.setModifiedById(projectUser.getId());
        //
View Full Code Here

Examples of org.osforce.connect.entity.system.ProjectCategory

  @RequestMapping("/list-view")
  public String doListView(@PrefParam String categoryCode,
      @RequestAttr User user, @RequestAttr Site site,
      Page<Profile> page, Model model, WebRequest request) {
    String mode = (String) request.getAttribute("mode", WebRequest.SCOPE_REQUEST);
    ProjectCategory category = categoryService.getProjectCategory(site, categoryCode);
    if(StringUtils.isBlank(mode) && user!=null) {
      page = profileService.getProfilePage(page, user, category.getId());
    } else {
      page = profileService.getProfilePage(page, category.getId());
    }
    model.addAttribute(AttributeKeys.PAGE_KEY_READABLE, page);
    return "profile/profile-list";
  }
View Full Code Here

Examples of org.osforce.connect.entity.system.ProjectCategory

  @RequestMapping("/register-view")
  public String doRegisterView(
      @PrefParam String categoryCode, @PrefParam String templateCode,
      @ModelAttribute @Valid RegisterBean registerBean, BindingResult result,
      @RequestAttr Site site, Model model, WebRequest request) {
    ProjectCategory category = categoryService.getProjectCategory(site, categoryCode);
    //
    Template template = templateService.getTemplate(category.getId(), templateCode);
    List<ProjectFeature> modules = ModuleUtil.parseToModules(template.getContent());
    Project project = new Project();
    // set project category
    project.setCategory(category);
    // set features
    project.setFeatures(modules);
    // set default role to features
    for(ProjectFeature feature : modules) {
      Role role = roleService.getRole(feature.getRoleCode(), category.getId());
      feature.setRole(role);
    }
    request.setAttribute(AttributeKeys.PROJECT_KEY, project, WebRequest.SCOPE_SESSION);
    model.addAttribute(AttributeKeys.USER_KEY_READABLE, registerBean);
    return "system/user-register";
View Full Code Here

Examples of org.osforce.connect.entity.system.ProjectCategory

    if(handler instanceof RouteController) {
      String categoryIdStr = request.getParameter("categoryId");
      Project project = (Project) request.getAttribute(AttributeKeys.PROJECT_KEY);
      Site site = (Site) request.getAttribute(AttributeKeys.SITE_KEY);
      String categoryCode = (String) request.getAttribute("categoryCode");
      ProjectCategory currentCategory = null;
      if(StringUtils.isNotBlank(categoryIdStr)) {
        currentCategory = categoryService.getProjectCategory(NumberUtils.createLong(categoryIdStr));
      } else if(StringUtils.isNotBlank(categoryCode)) {
        currentCategory = categoryService.getProjectCategory(site, categoryCode);
      } else if(project!=null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.