Package org.osforce.connect.entity.system

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


  @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

    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

      if(StringUtils.isNotBlank(categoryCode)) {
        request.setAttribute("qualifier", categoryCode);
      }
      String categoryIdStr = request.getParameter("categoryId");
      if(StringUtils.isNotBlank(categoryIdStr)) {
        ProjectCategory category = categoryService.getProjectCategory(NumberUtils.createLong(categoryIdStr));
        request.setAttribute("qualifier", category.getCode());
      }
    }
  }
View Full Code Here

  public String doProjectForm(@PrefParam String categoryCode,
      @PrefParam String templateCode, WebRequest request,
      @ModelAttribute @Valid Project project, BindingResult result,
      @RequestAttr Site site, @RequestAttr User user, Model model, Boolean showErrors) {
    if(!showErrors) {
      ProjectCategory category = categoryService.getProjectCategory(site, categoryCode);
      project.setCategory(category);
      project.setEnteredBy(user);
      project.setModifiedBy(user);
      //
      Template template = templateService.getTemplate(category.getId(), templateCode);
      List<ProjectFeature> modules = ModuleUtil.parseToModules(template.getContent());
      request.setAttribute(AttributeKeys.PROJECT_FEATURE_LIST_KEY_READABLE, modules, WebRequest.SCOPE_SESSION);
      model.addAttribute(AttributeKeys.PROJECT_KEY_READABLE, project);
    }
    return "system/project-form";
View Full Code Here

 
  @RequestMapping(value="/list-view", method=RequestMethod.GET)
  public String doListView(Page<ProjectCategory> page, @RequestParam Long siteId,
      @RequestParam(required=false) Long parentId,  Model model) {
    if(parentId!=null) {
      ProjectCategory parent = categoryService.getProjectCategory(parentId);
      model.addAttribute(AttributeKeys.PARENT_KEY_READABLE, parent);
    }
    page = categoryService.getProjectCategoryPage(page, siteId, parentId);
    model.addAttribute(AttributeKeys.PAGE_KEY_READABLE, page);
    return "system/category-list";
View Full Code Here

    updateRole(role);
  }

  public void updateRole(Role role) {
    if(role.getCategoryId()!=null) {
      ProjectCategory category = projectCategoryDao.get(role.getCategoryId());
      role.setCategory(category);
    }
    if(role.getId()==null) {
      roleDao.save(role);
    } else {
View Full Code Here

    updateTemplate(template);
  }

  public void updateTemplate(Template template) {
    if(template.getCategoryId()!=null) {
      ProjectCategory category = projectCategoryDao.get(template.getCategoryId());
      template.setCategory(category);
    }
    if(template.getId()==null) {
      templateDao.save(template);
    } else {
View Full Code Here

    updateProject(project);
  }

  public void updateProject(Project project) {
    if(project.getCategoryId()!=null) {
      ProjectCategory category = categoryDao.get(project.getCategoryId());
      project.setCategory(category);
    }
    if(project.getSubCategoryId1()!=null) {
      ProjectCategory subCategory1 = categoryDao
          .get(project.getSubCategoryId1());
      project.setSubCategory1(subCategory1);
    }
    if(project.getSubCategoryId2()!=null) {
      ProjectCategory subCategory2 = categoryDao
          .get(project.getSubCategoryId2());
      project.setSubCategory2(subCategory2);
    }
    if(project.getSubCategoryId3()!=null) {
      ProjectCategory subCategory3 = categoryDao
          .get(project.getSubCategoryId3());
      project.setSubCategory3(subCategory3);
    }
    if(project.getEnteredId()!=null) {
      User enteredBy = userDao.get(project.getEnteredId()) ;
View Full Code Here

    if(category.getSiteId()!=null) {
      Site site = siteDao.get(category.getSiteId());
      category.setSite(site);
    }
    if(category.getParentId()!=null) {
      ProjectCategory parent = projectCategoryDao.get(category.getParentId());
      category.setParent(parent);
    }
    if(category.getId()==null) {
      projectCategoryDao.save(category);
    } else {
View Full Code Here

TOP

Related Classes of org.osforce.connect.entity.system.ProjectCategory

Copyright © 2018 www.massapicom. 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.