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

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


    public StringBuffer problemsolutionReplyUpdate(
            ProblemsolutionReplyEvaluation psre, HttpServletRequest request,
            HttpServletResponse response) throws EasyJException, IOException {
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        ProblemsolutionReply psr = new ProblemsolutionReply();
        psr.setProblemsolutionReplyId(psre.getProblemsolutionReplyId());
        psr = (ProblemsolutionReply) cdp.get(psr);
        StringBuffer xml = new StringBuffer("<result>");
        if (request.getParameter("flower") != null) {
            try {
                psr.setGoodNum(new Long(psr.getGoodNum().intValue() + 1));
                cdp.update(psr);
                psre.setIsGood("Y");
                sdp.create(psre);
                xml
                        .append("<message>success</message><choose>flower</choose><problemsolutionReplyId>"
                                + psre.getProblemsolutionReplyId()
                                + "</problemsolutionReplyId></result>");
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
        }

        if (request.getParameter("badegg") != null) {
            try {
                psr.setBadNum(new Long(psr.getBadNum().intValue() + 1));
                cdp.update(psr);
                psre.setIsGood("N");
                sdp.create(psre);
                xml
                        .append("<message>success</message><choose>badegg</choose><problemsolutionReplyId>"
                                + psre.getProblemsolutionReplyId()
                                + "</problemsolutionReplyId></result>");
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
        }

        try {
            if (request.getParameter("overdue") != null) {
                Problemsolution ps = new Problemsolution();
                ps.setProblemsolutionId(psr.getProblemsolutionId());
                ps = (Problemsolution) sdp.get(ps);
                ProblemVersion problemversion = new ProblemVersion();
                problemversion.setProblemId(ps.getProblemId());
                Long problemversioncount = sdp.getCount(problemversion);
                psr.setProblemsolutionReplyOverdueVersion(problemversioncount);
                psr.setIsoverdue("Y");
                cdp.update(psr);
                xml
                        .append("<message>success</message><choose>overdue</choose><problemsolutionReplyId>"
                                + psre.getProblemsolutionReplyId()
                                + "</problemsolutionReplyId></result>");
View Full Code Here


        StringBuffer buffer = new StringBuffer();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();

        ProblemsolutionReply psr = new ProblemsolutionReply();
        ProblemreasonSolution prs = new ProblemreasonSolution();
        ProblemreasonSolution prs2 = new ProblemreasonSolution();
        buffer.append("<div class=\"bc0\" style=\"padding:0px 0pt;\">");
        String reason = "";
        problemsolution = (Problemsolution) cdp.get(problemsolution);
        prs.setProblemsolutionId(problemsolution.getProblemsolutionId());
        ArrayList prss = sdp.query(prs);
        ArrayList psrs = problemsolution.getProblemsolutionReplys();
        buffer.append("<div id=\"Lg\" ></div>");
        if (prss.size() > 0) {
            for (int j = 0; j < prss.size(); j++) {
                prs2 = (ProblemreasonSolution) prss.get(j);
                reason = reason + "," + prs2.getProblemreasonId();
            }
            buffer.append("<div id=\"Lg\" ></div>"
                    + "<div class=\"f14 p90 pl10\" class=\"answer_content\">"
                    + problemsolution.getProblemsolutionContent() + "</div>");
            buffer.append("<p></p>共有对应的原因为" + reason + "<p></p>");

        } else {
            buffer
                    .append("<div class=\"f14 p90 pl10\" class=\"answer_content\">"
                            + problemsolution.getProblemsolutionContent()
                            + "</div><div id=\"Lg\" ></div>");

        }
        // 首先显示主贴,然后显示回复,主贴需考虑solution的三个状态
        // 1。已被选择为最佳解决方案。2。正在投票中的解决方案,3。一般状态的解决方案
        // 1。需要显示三种投票结果
        // isVoting为C表示正在第三阶段投票,isVoting为Y表示正在第二阶段投票,isVoting为N表示正在第一阶段
        if (problemsolution.getIsVoting().equals("C")) {
            buffer.append("<div></div>");
            buffer.append("作为备选方案前的投票结果:");
            buffer.append("<IMG src=\"/image/flower.gif\"> (得<SPAN>"
                    + problemsolution.getGoodNum() + "</SPAN>支)");
            buffer
                    .append("<IMG height=15 src=\"/image/badegg.gif\" width=16>(得<SPAN class=orange12>"
                            + problemsolution.getBadNum() + "</SPAN>个)<br>");
            buffer.append("作为备选方案时的投票结果:");
            buffer.append("<IMG src=\"/image/flower.gif\"> (得<SPAN>"
                    + problemsolution.getVotingGoodNum() + "</SPAN>支)");
            buffer
                    .append("<IMG height=15 src=\"/image/badegg.gif\" width=16>(得<SPAN class=orange12>"
                            + problemsolution.getVotingBadNum()
                            + "</SPAN>个)<br>");

            buffer.append(getContent(userId, problemsolution, null, "C"));
        } else if (problemsolution.getIsVoting().equals("Y")) {
            buffer
                    .append("<A class=brown12 href=\"javascript:Problemsolution.problemsolutionVoting("
                            + problemsolution.getProblemsolutionId()
                            + ",'best')\" > 选择为最佳解决方案</A><br>");
            buffer.append("作为备选方案前的投票结果:");
            buffer.append("<IMG src=\"/image/flower.gif\"> (得<SPAN>"
                    + problemsolution.getGoodNum() + "</SPAN>支)");
            buffer
                    .append("<IMG height=15 src=\"/image/badegg.gif\" width=16>(得<SPAN class=orange12>"
                            + problemsolution.getBadNum() + "</SPAN>个)<br>");

            buffer.append(getContent(userId, problemsolution, null, "Y"));

        } else if (problemsolution.getIsVoting().equals("N")) {
            buffer
                    .append("<p></p><A class=brown12 href=\"javascript:Problemsolution.problemsolutionVoting("
                            + problemsolution.getProblemsolutionId()
                            + ",'voting')\")>选择为备选方案</A><p></p>");
            buffer.append(getContent(userId, problemsolution, null, "N"));
        }
        // 取得回帖的信息
        for (int i = psrs.size() - 1; i >= 0; i--) {
            psr = (ProblemsolutionReply) psrs.get(i);
            buffer.append("<div id=\"Lg\" ></div>"
                    + "<div class=\"f14 p90 pl10\" class=\"answer_content\">"
                    + psr.getProblemsolutionReplyContent() + "</div>");
            buffer.append(getContent(userId, null, psr, null));
        }

        return buffer.toString();
    }
View Full Code Here

                            + ",'"
                            + "sub"
                            + "')\">回复</A>");
            if (psr.getProblemsoltuionReplyReferenceId() != null) {
                Long replyRefreneId = psr.getProblemsoltuionReplyReferenceId();
                ProblemsolutionReply problemsolutionreply = new ProblemsolutionReply();
                problemsolutionreply.setProblemsolutionReplyId(replyRefreneId);
                problemsolutionreply = (ProblemsolutionReply) sdp
                        .get(problemsolutionreply);
                buffer.append("<p></p>您回复了:<p></p>");
                buffer.append(problemsolutionreply
                        .getProblemsolutionReplyContent());
            }

        }
        return buffer.toString();
View Full Code Here

    public void creatingReply() throws EasyJException, IOException {
        ProblemSolutionImpl targetObject = new ProblemSolutionImpl();
        ProblemSolutionInterface problemsolutionInterface = null;
        Object proxy = ProblemSolutionProxyFactory.getProxy(targetObject);
        problemsolutionInterface = (ProblemSolutionInterface) proxy;
        ProblemsolutionReply psr = new ProblemsolutionReply();
        psr = (ProblemsolutionReply) object;
        returnMessage = problemsolutionInterface.creatingReply(psr,
                this.request, response);

    }
View Full Code Here

TOP

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

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.