Examples of ProjectFeature


Examples of org.focusns.model.core.ProjectFeature

        return (ProjectFeature) webRequest.getAttribute("feature", WebRequest.SCOPE_SESSION);
    }

    public static String getRedirectPath(WebRequest webRequest) {
        Project project = getProject(webRequest);
        ProjectFeature feature = getProjectFeature(webRequest);
        return getRedirectPath(project, feature);
    }
View Full Code Here

Examples of org.focusns.model.core.ProjectFeature

        projectTemplate.setDescription(DomUtils.getTextValue(descriptionEle));
        // project features
        Element featuresEle = DomUtils.getChildElementByTagName(projectEle, "features");
        List<Element> featureEles = DomUtils.getChildElementsByTagName(featuresEle, "feature");
        for(Element featureEle : featureEles) {
            ProjectFeature projectFeature = new ProjectFeature();
            projectFeature.setCode(featureEle.getAttribute("code"));
            projectFeature.setLabel(featureEle.getAttribute("label"));
            projectFeature.setEnabled(true);
            String level = featureEle.getAttribute("level");
            if(StringUtils.hasText(level)) {
                projectFeature.setLevel(Integer.parseInt(level));
            }
            projectTemplate.addProjectFeature(projectFeature);
        }
        // project attributes
        Element attributesEle = DomUtils.getChildElementByTagName(projectEle, "attributes");
View Full Code Here

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

    List<ProjectFeature> modules = CollectionUtil.newArrayList();
    String[] featureStrs = StringUtils.split(featuresStr, "\r\n");
    for(String featureStr : featureStrs) {
      int index = ArrayUtils.indexOf(featureStrs, featureStr);
      if(StringUtils.isNotBlank(featureStr)) {
        ProjectFeature module = new ProjectFeature();
        featureStr = StringUtils.substringBetween(featureStr, "[", "]");
        String[] strs = StringUtils.split(featureStr, ",");
        for(String str : strs) {
          String key = StringUtils.substringBefore(str, "=");
          String value = StringUtils.substringAfter(str, "=");
          if(StringUtils.equals("label", key)) {
            module.setLabel(value);
          } else if(StringUtils.equals("code", key)) {
            module.setCode(value);
          } else if(StringUtils.equals("show", key)) {
            module.setShow(StringUtils.equals("true", value));
          } else if(StringUtils.equals("role", key)) {
            module.setRoleCode(value);
          }
        }
        module.setLevel(index);
        modules.add(module);
      }
    }
    return modules;
  }
View Full Code Here

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

  public String doFeaturesForm(@PrefParam String templateCode,
      @RequestAttr Project project, Model model) {
    Template template = templateService.getTemplate(project.getCategoryId(), templateCode);
    List<ProjectFeature> features = ModuleUtil.parseToModules(template.getContent());
    for(ProjectFeature feature : features) {
      ProjectFeature tmp = featureService.getProjectFeature(feature.getCode(), project.getId());
      if(tmp!=null) {
        feature.setId(tmp.getId());
        feature.setLabel(tmp.getLabel());
        feature.setShow(tmp.getShow());
        if(tmp.getLevel()!=null) {
          feature.setLevel(tmp.getLevel());
        }
        feature.setRoleId(tmp.getRoleId());
        feature.setProjectId(project.getId());
      } else {
        Role role = roleService.getRole(feature.getRoleCode(), project.getCategoryId());
        feature.setRole(role);
        feature.setProject(project);
View Full Code Here

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

  @RequestMapping("/features/form-action")
  public String doFeaturesAction(@RequestParam Long[] ids,
      @RequestParam Long[] roleIds, @RequestParam Integer[] levels,
      @RequestParam Boolean[] shows, @RequestParam String[] labels, @RequestAttr Project project) {
    for(int i=0; i<ids.length; i++) {
      ProjectFeature feature = featureService.getProjectFeature(ids[i]);
      feature.setLabel(labels[i]);
      feature.setLevel(levels[i]);
      feature.setShow(shows[i]);
      feature.setRoleId(roleIds[i]);
      feature.setProjectId(project.getId());
      featureService.updateProjectFeature(feature);
    }
    return String.format("redirect:/%s/admin/features/form", project.getUniqueId());
  }
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.