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

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


                        + ")\"  style=\"padding:5px 10px 5px 10px!important;padding:4px 10px 4px 10px;height:1px;border:1px solid#7AA9DF;background-color:#EAF3FC;font-size:12px \">按好评升序</a>");
        buffer
                .append("<div id=\"problemreason_order22\" style=\"display:none\">false</div>");
        buffer.append("<div id=\"viewAllProblemreason\">");
        String good_num = "false";
        Problem problem = new Problem();
        problem.setProblemId(problemreason.getProblemId());
        problem = (Problem) cdp.get(problem);
        ArrayList problemreasons2 = problem.getProblemreasons();
        if (good_num.equals("true")) {
            Collections.sort(problemreasons2);
        }
        String content = "";

        content = getProblemreasonNotByGroup(userId, problemreasons2);
        buffer.append(content);
        // buffer.append("</div>");
        buffer
                .append("<div id=\"Lg\" ></div><div id=\"createProblemReasonDiscuss\"><a  id=\"order1\" href=\"javascript:Problem.createProblemReasonDiscuss("
                        + problemreason.getProblemId()
                        + ")\"  style=\"padding:5px 10px 5px 10px !important;padding:4px 10px 4px 10px;height:1px;border:1px solid #7AA9DF;background-color:#EAF3FC;font-size:12px\">发表评论</a></div>");

        buffer
                .append("<div id=\"Lg\" ></div><div class=\"pl10\"><A class=\"bluelink \" onclick=; href=\"javascript:showAllProblemreason("
                        + problem.getProblemId()
                        + ");\">查看所有关于问题原因的评论</A> </div>");

        return buffer;

    }
View Full Code Here


            }
        }
        String good_num = request.getParameter("good_num");
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        Problem problem = new Problem();
        problem.setProblemId(problemreason.getProblemId());
        problem = (Problem) cdp.get(problem);
        ArrayList problemreasons = problem.getProblemreasons();
        if (good_num.equals("true")) {
            Collections.sort(problemreasons);
        }
        String content = "";

        content = getProblemreasonNotByGroup(userId, problemreasons);

        buffer.append(content);
        if (request.getParameter("ifNewWindow") != null) {
            ifNewWindow = request.getParameter("ifNewWindow");
            if (ifNewWindow.equals("Y")) {
                buffer
                        .append("</div><div class=\"rr_4\"></div><div class=\"rr_5\"></div><div class=\"rr_1\"></div></div>");
                buffer.append("</div></div>");
                buffer.append("<TABLE><TBODY><TR>");
                buffer
                        .append("<TD align=middle><IMG onclick=\"Ajax.loadHistory('pre')\" alt=\"\" src=\"/image/arrow_left.gif\" class=\"hide_todo\">");
                buffer
                        .append("<IMG onclick=\"Ajax.loadHistory('next')\" alt=\"\" src=\"/image/arrow_right.gif\" class=\"hide_todo\">");
                buffer.append("</TD></TR></TBODY></TABLE>");
            }
        } else {
            buffer
                    .append("<div id=\"Lg\" ></div><div id=\"createProblemReasonDiscuss\"><a  id=\"order1\" href=\"javascript:Problem.createProblemReasonDiscuss("
                            + problemreason.getProblemId()
                            + ")\"  style=\"padding:5px 10px 5px 10px !important;padding:4px 10px 4px 10px;height:1px;border:1px solid #7AA9DF;background-color:#EAF3FC;font-size:12px\">发表评论</a></div>");

            buffer
                    .append("<div id=\"Lg\" ></div><div class=\"pl10\"><A class=\"bluelink \" href=\"javascript:showAllProblemreason("
                            + problem.getProblemId()
                            + ");\">查看所有关于问题原因的评论</A> </div>");

        }
        return buffer;
View Full Code Here

                .append("<link href=\"/css/scenario.css\" rel=\"stylesheet\" type=\"text/css\">");

        buffer.append("<div id=\"center2\" ><div class=\"bai\" >");
        buffer
                .append("<div class=\"mb12 bai\"  style=\"display:none\" id=\"problem_main\"> <div class=\"rg_1\"></div><div class=\"rg_2\"></div><div class=\"rg_3\"></div><div class=\"rg\" id=\"problem\">");
        Problem result = new Problem();
        // ArrayList results = cdp.query(problem);
        result = (Problem) cdp.get(problem);
        ArrayList solutions = result.getSolutions();
        if (result.getProblemStatus().equals("最终解决方案征集中")) {
            buffer
                    .append("<div class=\"t1\" id=\"question_status\"><div class=\"ico\"><div class=\"iwhy\"></div></div>问题状态:"
                            + result.getProblemStatus() + " </div>");

        } else {
            buffer
                    .append("<div class=\"t1\" id=\"question_status\"><div class=\"ico\"><div class=\"iok\"></div></div>问题状态:"
                            + result.getProblemStatus() + " </div>");

        }
        // 读取中该问题的解决方案的总数和正在投票中的解决方案的数目
        int total_num = solutions.size();
        int voting_num = 0;
        Solution solution = new Solution();
        for (int i = 0; i < solutions.size(); i++) {
            solution = (Solution) solutions.get(i);
            if (solution.getIsVoting().equals("Y")) {
                voting_num++;
            }
        }
        buffer
                .append("<div class =\"t1\" id=\"solution_status\">现共有<span style=\"color:#FF0099\">"
                        + total_num
                        + "</span>个解决方案,其中<span style=\"color:#FF0099\">"
                        + voting_num + "</span>个解决方案在投票中</div>");
        // buffer.append("<div class =\"t1\" id=\"solution_status\"><A
        // class=\"bluelink\" onclick=;
        // href=\"javascript:showProblem(<%=problemId%>);\">查看所有评论</A> </div>");
        // 取出消息的主体
        buffer.append("<div class=\"bc0\"><div class=\"p90\">");
        // 标题
        buffer
                .append("<div class=\"f14 B wr\" id=\"question_title\"> <cq>问题标题: <br>  "
                        + result.getProblemTitle() + "</cq></div>");
        // 悬赏分
        buffer
                .append("<div class=\"wr\" id=\"question_info\"><span class=\"award\"></span><span class=\"red\">悬赏分:"
                        + result.getProblemAward() + "</span> </div>");
        // 问题内容
        ProblemVersion problemversion = new ProblemVersion();
        problemversion.setProblemId(result.getProblemId());

        ArrayList problemversions = cdp.query(problemversion);
        problemversion = (ProblemVersion) problemversions.get(0);
        buffer.append("<div class=\"f14 wr\" id=\"question_content\"><cd>"
                + problemversion.getProblemContent() + "</cd></div>");
        // 嵌入两个div,modify_problem和ambiguity_list用于修改问题
        buffer.append("<div class=\"f14 wr\" id=\"modify_problem\"></div>");
        buffer.append("<div class=\"f14 wr\" id=\"ambiguity_list\"></div>");
        buffer.append("<div class=\"f14 wr\" id=\"question_sup\"></div></div>");
        // 加入修改按钮,modifyProblem,false是没有修改权限,true是有修改权限

        if (modifyProblem == true) {
            buffer
                    .append("<div align=\"left\" id=\"modify_problem_button\"><a href=\"javascript:Problem.modifyProblem("
                            + problem.getProblemId()
                            + ")\"  style=\"padding:5px 10px 5px 10px !important;padding:4px 10px 4px 10px;height:1px;border:1px solid #7AA9DF;background-color:#EAF3FC;font-size:12px\">修改问题</a></div>");
        }

        // 得到提问者
        buffer
                .append("<div align=\"right\" class=\"gray wr\" id=\"question_author\" >提问者:<a href=\"#\" target=_blank>"
                        + result.getUserName()
                        + "</a> 时间:"
                        + result.getBuildTime()
                        + "<a href=\"#\"   style=\"display:none\"  target=_blank> - 魔法师 五级</a> </div></div>");

        buffer
                .append("</div><div class=\"rg_4\"></div><div class=\"rg_5\"></div><div class=\"rg_1\"></div></div>");
        buffer.append("<div id=\"tabs\" style=\"display:none\">");
View Full Code Here

        String order = request.getParameter("order");
        String group = request.getParameter("group");
        StringBuffer buffer = new StringBuffer();
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        Problem result = new Problem();
        result = (Problem) cdp.get(problem);
        ArrayList ambiguities = result.getAmbiguitiys();
        if (order.equals("time")) {
            // 原本就是按照时间排序的
        } else {
            Collections.sort(ambiguities);
        }
View Full Code Here

    public String newProblem(Problem problem, DataProxy dp,
            HttpServletRequest request) throws EasyJException {
        String problemContent = request.getParameter("problemContent");
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Problem newProblem = new Problem();

        Long userId = userCache.getUser().getUserId();
        problem.setCreatorId(userId);
        Short a;
        a = 0;
View Full Code Here

        buffer
                .append("<div id=\"problemvalue_order22\" style=\"display:none\">false</div>");
        buffer.append("<div id=\"viewAllProblemvalue\">");
        String group = "false";
        String good_num = "false";
        Problem problem = new Problem();
        problem.setProblemId(problemvalue.getProblemId());
        problem = (Problem) cdp.get(problem);
        ArrayList problemvalues2 = problem.getProblemvalues();
        if (good_num.equals("true")) {
            Collections.sort(problemvalues2);
        }
        String content = "";
        if (group.equals("true")) {
            content = getProblemvalueByGroup(userId, problemvalues2);
        } else {
            content = getProblemvalueNotByGroup(userId, problemvalues2);
        }
        buffer.append(content);
        // buffer.append("</div>");
        buffer
                .append("<div id=\"Lg\" ></div><div id=\"createProblemValueDiscuss\"><a  id=\"order1\" href=\"javascript:Problem.createProblemValueDiscuss("
                        + problemvalue.getProblemId()
                        + ")\"  style=\"padding:5px 10px 5px 10px !important;padding:4px 10px 4px 10px;height:1px;border:1px solid #7AA9DF;background-color:#EAF3FC;font-size:12px\">发表评论</a></div>");

        buffer
                .append("<div id=\"Lg\" ></div><div class=\"pl10\"><A class=\"bluelink \" onclick=; href=\"javascript:showAllProblemvalue("
                        + problem.getProblemId()
                        + ");\">查看所有关于问题价值的评论</A> </div>");

        return buffer;

    }
View Full Code Here

            }
        }
        String group = request.getParameter("group");
        String good_num = request.getParameter("good_num");
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        Problem problem = new Problem();
        problem.setProblemId(problemvalue.getProblemId());
        problem = (Problem) cdp.get(problem);
        ArrayList problemvalues = problem.getProblemvalues();
        if (good_num.equals("true")) {
            Collections.sort(problemvalues);
        }
        String content = "";
        if (group.equals("true")) {
            content = getProblemvalueByGroup(userId, problemvalues);
        } else {
            content = getProblemvalueNotByGroup(userId, problemvalues);
        }
        buffer.append(content);
        if (request.getParameter("ifNewWindow") != null) {
            ifNewWindow = request.getParameter("ifNewWindow");
            if (ifNewWindow.equals("Y")) {
                buffer
                        .append("</div><div class=\"rr_4\"></div><div class=\"rr_5\"></div><div class=\"rr_1\"></div></div>");
                buffer.append("</div></div>");
                buffer.append("<TABLE><TBODY><TR>");
                buffer
                        .append("<TD align=middle><IMG onclick=\"Ajax.loadHistory('pre')\" alt=\"\" src=\"/image/arrow_left.gif\" class=\"hide_todo\">");
                buffer
                        .append("<IMG onclick=\"Ajax.loadHistory('next')\" alt=\"\" src=\"/image/arrow_right.gif\" class=\"hide_todo\">");
                buffer.append("</TD></TR></TBODY></TABLE>");
            }
        } else {
            buffer
                    .append("<div id=\"Lg\" ></div><div id=\"createProblemValueDiscuss\"><a  id=\"order1\" href=\"javascript:Problem.createProblemValueDiscuss("
                            + problemvalue.getProblemId()
                            + ")\"  style=\"padding:5px 10px 5px 10px !important;padding:4px 10px 4px 10px;height:1px;border:1px solid #7AA9DF;background-color:#EAF3FC;font-size:12px\">发表评论</a></div>");

            buffer
                    .append("<div id=\"Lg\" ></div><div class=\"pl10\"><A class=\"bluelink \" onclick=; href=\"javascript:showAllProblemvalue("
                            + problem.getProblemId()
                            + ");\">查看所有关于问题价值的评论</A> </div>");

        }

        return buffer;
View Full Code Here

    private static int i = 0;

    public boolean[] judgeProblem(Problem problem) throws EasyJException {
        boolean[] judgeresult = new boolean[2];
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        Problem result = new Problem();
        result = (Problem) cdp.get(problem);
        ArrayList solutions = result.getSolutions();
        // 0为判断是否有修改问题的权限,即判定是不是有正在投票的solution,目前是有问题正在投票就没有修改权限,false是没有修改权限,true是有修改权限
        judgeresult[0] = true;
        Solution solution = new Solution();
        if (solutions.size() > 0) {
            int i = 0;
View Full Code Here

        // js文件待改
        buffer
                .append("<a  id=\"\"  href=\"javascript:createNewSolution("
                        + problemsolution.getProblemId()
                        + ")\"  style=\"padding:5px 10px 5px 10px!important;padding:4px 10px 4px 10px;height:1px;border:1px solid#7AA9DF;background-color:#EAF3FC;font-size:12px \">发表新的解决方案</a></div>");
        Problem problem = new Problem();
        problem.setProblemId(problemsolution.getProblemId());
        problem = (Problem) cdp.get(problem);
        // 找到正式的解决方案
        Problemsolution temp1 = new Problemsolution();
        temp1.setProblemId(problem.getProblemId());
        temp1.setIsVoting("C");
        ArrayList finalsolutions = cdp.query(temp1);
        // 找到正在投票的解决方案
        Problemsolution temp2 = new Problemsolution();
        temp2.setProblemId(problem.getProblemId());
        temp2.setIsVoting("Y");
        // 找到所有的解决方案
        ArrayList votingsolutions = cdp.query(temp2);
        Problemsolution temp3 = new Problemsolution();
        temp3.setProblemId(problem.getProblemId());
        ArrayList allsolutions = cdp.query(temp3);

        // 处理最终解决方案情况
        if (finalsolution_count >= 0) {
            buffer
View Full Code Here

        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        String name[] = request.getParameterValues("choose_reason");
        String solutionContent = request.getParameter("solutionContent");
        Problem problem = new Problem();
        Problemsolution ps = new Problemsolution();
        ProblemreasonSolution psr = new ProblemreasonSolution();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        problem.setProblemId(problemsolution.getProblemId());
        Long version = new Long(cdp.getCount(problem));
        Problemsolution ps2 = new Problemsolution();
        try {
            // 需要创建新的problemsolution
            ps.setProblemId(problemsolution.getProblemId());
View Full Code Here

TOP

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

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.