Package cn.edu.pku.dr.requirement.elicitation.data

Examples of cn.edu.pku.dr.requirement.elicitation.data.Project


import elicitation.utils.Utils;

public class ProjectAction extends SingleDataAction {
  public void showFeatureModel() throws EasyJException,SQLException{
    System.out.println("Come into ProjectAction#showFeatureModel()");
    Project project = (Project)object;
    // 从context 中取出 project 的id .
    SysUserCache userCache = (SysUserCache) request.getSession()
        .getAttribute(Globals.SYS_USER_CACHE);
    Long id = userCache.getContext().getProjectId();
    project.setProjectId(id);
    project = (Project)dp.get(project);
    Long domainId = project.getDomainId()
 
    returnMessage +=
    "<div align=center><applet code=\"applet.MainApplet\" archive =\"jars/FMTool_Web.jar,"+
    "jars/swing-layout.jar, jars/swing-worker.jar, " +
    "jars/swingx-0.9.4.jar,   jars/swingx.jar,   " +
View Full Code Here


  /**
   * URL 参数中有 projectId 一项.
   * @throws EasyJException
   */
    public void view() throws EasyJException {
        Project project = (Project) object;
        project = (Project) dp.get(project);
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Context context = new Context();
        context.setProjectId(project.getProjectId());
        context.setProjectName(project.getProjectName());
        // 下面的程序用来确定此用户在此project中的角色

        // 1.首先确定是不是owner。
        if (project.getCreatorId().longValue() == user.getUserId().longValue()) {
            context.setProjectRole(DictionaryConstant.OWNER);
        } else {
            // 2.判断用户是否是参与了当前项目
            UserProjectRelation relation = new UserProjectRelation();
            relation.setUserId(user.getUserId());
            relation.setProjectId(project.getProjectId());
            ArrayList relationList = dp.query(relation);
            // 如果不存在数据,说明没有加入;否则根据状态来确定。
            if (relationList.size() == 0) {
                context.setProjectRole(DictionaryConstant.OTHER);
            } else {
                relation = (UserProjectRelation) relationList.get(0);
                int applyState = relation.getUserProjectStateRelatedValue()
                        .intValue();
                // 此状态请参见表dictionary中的PROJECT_APPLY_STATE 对应的related value部分。
                switch (applyState) {
                    case 2:
                        context.setProjectRole(DictionaryConstant.GROUP);
                        break;
                    default:
                        context.setProjectRole(DictionaryConstant.OTHER);
                        break;
                }
            }
        }

        userCache.setContext(context);

        HashMap<String,String> roles = context.getRoles();
        roles.clear();
       
        //将此项目所拥有的角色加入环境当中
        Role role = new Role();
        role.setProjectId(project.getProjectId());
        ArrayList list = dp.query(role);
        int size = list.size();
        for(int i=0; i<size; i++) {
            role = (Role)list.get(i);
            roles.put(role.getRoleId().toString(),role.getRoleName());
View Full Code Here

            returnMessage = "请登录";
            return;
        }

        dp.setContext(null);
        Project project = (Project) object;
        UserProjectRelation relation = new UserProjectRelation();
        relation.setProjectId(project.getProjectId());
        relation.setUserId(userId);
        ArrayList relations = dp.query(relation);
        Long userProjectStateId = DictionaryProxy.getIdByRelatedValue(
                "PROJECT_APPLY_STATE", new Long(DictionaryConstant.APPLYING));
View Full Code Here

        super.query();
    }

    public void queryByOwner() throws EasyJException {
        dp.setContext(null);
        Project project = new Project();
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        project.setCreatorId(userCache.getUser().getUserId());
        ArrayList list = dp.query(project);
        StringBuffer result = HtmlClientComponentService.getObjectListHtml(
                list, this.getClass().getName(), "domainName", "projectName",
                "", 4);
        if (result != null) {
View Full Code Here

        }
    }

    public void mainPage() throws EasyJException {
        dp.setContext(null);
        Project project = new Project();
        OrderRule rule = new OrderRule();
        rule.setOrderColumn("domainName");
        rule.setOrderDirection(OrderDirection.ASC);
        OrderRule orderRules[] = {
            rule
View Full Code Here

    par.setAlignment(1);
    document.add(par);

    CompositeDataProxy cdp = CompositeDataProxy.getInstance();
    SingleDataProxy sdp = SingleDataProxy.getInstance();
    Project p = new Project();
    p.setProjectName(projectName);
    p = (Project) sdp.get(p);
    // 得到该项目的所有的场景
    Scenario s = new Scenario();
    s.setProjectId(p.getProjectId());
    scenarios = cdp.query(s);
    if (scenarios.size() > 0) {
      for (int i = 0; i < scenarios.size(); i++) {
        s = (Scenario) scenarios.get(i);
        document.add(new Paragraph(""));
View Full Code Here

import easyJ.system.data.SysUserCache;
import easyJ.system.service.HtmlClientComponentService;

public class ProjectAction extends SingleDataAction {
    public void view() throws EasyJException {
        Project project = (Project) object;
        project = (Project) dp.get(project);
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Context context = new Context();
        context.setProjectId(project.getProjectId());
        context.setProjectName(project.getProjectName());
        // 下面的程序用来确定此用户在此project中的角色

        // 1.首先确定是不是owner。
        if (project.getCreatorId().longValue() == user.getUserId().longValue()) {
            context.setProjectRole(DictionaryConstant.OWNER);
        } else {
            // 2.判断用户是否是参与了当前项目
            UserProjectRelation relation = new UserProjectRelation();
            relation.setUserId(user.getUserId());
            relation.setProjectId(project.getProjectId());
            ArrayList relationList = dp.query(relation);
            // 如果不存在数据,说明没有加入;否则根据状态来确定。
            if (relationList.size() == 0) {
                context.setProjectRole(DictionaryConstant.OTHER);
            } else {
                relation = (UserProjectRelation) relationList.get(0);
                int applyState = relation.getUserProjectStateRelatedValue()
                        .intValue();
                // 此状态请参见表dictionary中的PROJECT_APPLY_STATE 对应的related value部分。
                switch (applyState) {
                    case 2:
                        context.setProjectRole(DictionaryConstant.GROUP);
                        break;
                    default:
                        context.setProjectRole(DictionaryConstant.OTHER);
                        break;
                }
            }
        }

        userCache.setContext(context);

        HashMap<String,String> roles = context.getRoles();
        roles.clear();
       
        //将此项目所拥有的角色加入环境当中
        Role role = new Role();
        role.setProjectId(project.getProjectId());
        ArrayList list = dp.query(role);
        int size = list.size();
        for(int i=0; i<size; i++) {
            role = (Role)list.get(i);
            roles.put(role.getRoleId().toString(),role.getRoleName());
View Full Code Here

            returnMessage = "请登录";
            return;
        }

        dp.setContext(null);
        Project project = (Project) object;
        UserProjectRelation relation = new UserProjectRelation();
        relation.setProjectId(project.getProjectId());
        relation.setUserId(userId);
        ArrayList relations = dp.query(relation);
        Long userProjectStateId = DictionaryProxy.getIdByRelatedValue(
                "PROJECT_APPLY_STATE", new Long(DictionaryConstant.APPLYING));
View Full Code Here

        super.query();
    }

    public void queryByOwner() throws EasyJException {
        dp.setContext(null);
        Project project = new Project();
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        project.setCreatorId(userCache.getUser().getUserId());
        ArrayList list = dp.query(project);
        StringBuffer result = HtmlClientComponentService.getObjectListHtml(
                list, this.getClass().getName(), "domainName", "projectName",
                "", 4);
        if (result != null) {
View Full Code Here

        }
    }

    public void mainPage() throws EasyJException {
        dp.setContext(null);
        Project project = new Project();
        OrderRule rule = new OrderRule();
        rule.setOrderColumn("domainName");
        rule.setOrderDirection(OrderDirection.ASC);
        OrderRule orderRules[] = {
            rule
View Full Code Here

TOP

Related Classes of cn.edu.pku.dr.requirement.elicitation.data.Project

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.