Package easyJ.business.proxy

Examples of easyJ.business.proxy.CompositeDataProxy


    par.add(new RtfTableOfContents("如想查看目录,单击右键选择\"更新域\""));
    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(""));
        // 加场景名
        document.add(new Paragraph("场景" + (i + 1) + ": "
            + s.getScenarioName().toString(),
            RtfParagraphStyle.STYLE_HEADING_1));
        // TODO 加用况
        UseCase uc = new UseCase();
        uc.setScenarioId(s.getScenarioId());
        ArrayList ucs = cdp.query(uc);
        if (ucs.size() > 0) {
          for (int j = 0; j < ucs.size(); j++) {

            uc = (UseCase) ucs.get(j);
            document.add(new Paragraph(""));
            document.add(new Paragraph("用况" + (i + 1) + "."
                + (j + 1) + ": "
                + uc.getUseCaseName().toString(),
                RtfParagraphStyle.STYLE_HEADING_2));

            RtfBorderGroup normal = new RtfBorderGroup(
                Rectangle.BOX, RtfBorder.BORDER_SINGLE, 1,
                new Color(0, 0, 0));

            Paragraph title = new Paragraph();
            title.add(new Chunk(uc.getUseCaseName().trim()));
            title.setAlignment(1);
            document.add(title);

            RtfCell useCaseID = new RtfCell("用况编号:");
            useCaseID.setBorders(normal);

            RtfCell useCaseIDC = new RtfCell(uc.getUseCaseId()
                .toString());
            useCaseIDC.setBorders(normal);

            RtfCell useCaseName = new RtfCell("用况名称:");
            useCaseName.setBorders(normal);

            RtfCell useCaseNameC = new RtfCell(uc.getUseCaseName());
            useCaseNameC.setBorders(normal);

            RtfCell useCaseDescription = new RtfCell("用况描述:");
            useCaseDescription.setBorders(normal);

            RtfCell useCaseDescriptionC = new RtfCell(uc
                .getUseCaseDescription());
            useCaseDescriptionC.setBorders(normal);

            RtfCell useCasePriority = new RtfCell("用况优先级:");
            useCasePriority.setBorders(normal);

            RtfCell useCasePriorityC = null;

            if (uc.getUseCasePriority() != null) {
              useCasePriorityC = new RtfCell(uc
                  .getUseCasePriority().toString());
            } else {
              useCasePriorityC = new RtfCell("");
            }

            useCasePriorityC.setBorders(normal);

            RtfCell specialRequirement = new RtfCell("特殊要求:");
            specialRequirement.setBorders(normal);

            RtfCell specialRequirementC = new RtfCell(uc
                .getUseCaseSpecialRequirement());
            specialRequirementC.setColspan(3);
            specialRequirementC.setBorders(normal);

            RtfCell preCondition = new RtfCell("前置条件:");
            preCondition.setBorders(normal);

            RtfCell preConditionC = new RtfCell(uc
                .getUseCasePreconditions());
            preConditionC.setColspan(3);
            preConditionC.setBorders(normal);

            RtfCell fireCondition = new RtfCell("触发条件:");
            fireCondition.setBorders(normal);

            RtfCell fireConditionC = new RtfCell(uc
                .getUseCaseTrigger());
            fireConditionC.setColspan(3);
            fireConditionC.setBorders(normal);

            RtfCell postCondition = new RtfCell("后置条件:");
            postCondition.setBorders(normal);

            RtfCell postConditionC = new RtfCell(uc
                .getUseCasePostConditions());
            postConditionC.setColspan(3);
            postConditionC.setBorders(normal);

            RtfCell failedEndCondition = new RtfCell("失败情况:");
            failedEndCondition.setBorders(normal);

            RtfCell failedEndConditionC = new RtfCell(uc
                .getUseCaseFailedEndCondition());
            failedEndConditionC.setColspan(3);
            failedEndConditionC.setBorders(normal);

            Table table = new Table(4);
            table.addCell(useCaseID);
            table.addCell(useCaseIDC);
            table.addCell(useCaseName);
            table.addCell(useCaseNameC);
            table.addCell(useCaseDescription);
            table.addCell(useCaseDescriptionC);
            table.addCell(useCasePriority);
            table.addCell(useCasePriorityC);
           
            table.addCell(fireCondition);
            table.addCell(fireConditionC);
            table.addCell(preCondition);
            table.addCell(preConditionC);
            table.addCell(failedEndCondition);
            table.addCell(failedEndConditionC);
            table.addCell(postCondition);
            table.addCell(postConditionC);         
            table.addCell(specialRequirement);
            table.addCell(specialRequirementC);

            // 生成Use Case具体描述的标题

            RtfCell userOperation = new RtfCell("用户操作");
            userOperation.setBorders(normal);

            RtfCell systemOperation = new RtfCell("系统操作");
            systemOperation.setBorders(normal);

            RtfCell systemOutput = new RtfCell("系统输出");
            systemOutput.setBorders(normal);

            Table table2 = new Table(3);
            table2.addCell(userOperation);
            table2.addCell(systemOperation);
            table2.addCell(systemOutput);

            // 生成Use Case具体描述的内容
            ArrayList ucis = new ArrayList();

            UseCaseInteraction uci = new UseCaseInteraction();
            uci.setUseCaseId(uc.getUseCaseId());
            OrderRule orderule = new OrderRule();
            orderule.setOrderColumn("sequence");
            orderule.setOrderDirection(OrderDirection.ASC);
            OrderRule[] orderRules = { orderule };
            String temp;
            ucis = cdp.query(uci, orderRules);
            if (ucis.size() > 0) {
              for (int k = 0; k < ucis.size(); k++) {
                temp = ((UseCaseInteraction) ucis.get(k))
                    .getOperatorAction();
                temp = removeHtml(temp);
View Full Code Here


                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();

        // 这个方法输出问题的价值界面
        StringBuffer buffer = new StringBuffer();
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        ArrayList problemsolutions = cdp.query(problemsolution);
        Finalsolution finalsolution = new Finalsolution();
        finalsolution.setProblemId(problemsolution.getProblemId());
        int finalsolution_count = sdp.getCount(finalsolution).intValue();
        int solution_count = sdp.getCount(problemsolution).intValue();
        problemsolution.setIsVoting("Y");
        problemsolution.setIsoverdue("N");
        int voting_count = sdp.getCount(problemsolution).intValue();
        // 标题
        buffer
                .append("<div class=\"t1\"><div class=\"ico\"><div class=\"ibest\"></div></div>问题解决方案讨论页面</div>");
        buffer.append("<div class=\"t1\">现共有<span style=\"color:#FF0000\">"
                + solution_count
                + "</span>个解决方案,<span style=\"color:#FF0000\">" + voting_count
                + "</span>个解决方案正在投票,<span style=\"color:#FF0000\">"
                + finalsolution_count + "</span>个最终解决方案</div>");
        // 下面是用户讨论的页面
        buffer
                .append("<div class=\"bc0\" style=\"padding:0px 0pt;\"><div class=\"t2\">");
        // 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
                    .append("<div class=\"t2\" onclick=\"Problemsolution.showHide('finalSolution')\" style=\"cursor:pointer\">最终解决方案:</div>");
View Full Code Here

            throws EasyJException, IOException {
        SysUserCache userCache = (SysUserCache) request.getSession()
                .getAttribute(Globals.SYS_USER_CACHE);
        Long userId = userCache.getUser().getUserId();
        pse.setCreatorId(userId);
        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        SingleDataProxy sdp = SingleDataProxy.getInstance();
        Problemsolution ps = new Problemsolution();
        ps.setProblemsolutionId(pse.getProblemsolutionId());
        ps = (Problemsolution) cdp.get(ps);
        StringBuffer xml = new StringBuffer("<result>");
        if (request.getParameter("flower") != null) {
            try {
                if (request.getParameter("useState").equals("C")) {
                    Finalsolution finalsolution = new Finalsolution();
                    finalsolution.setProblemsolutionId(pse
                            .getProblemsolutionId());
                    finalsolution = (Finalsolution) sdp.get(finalsolution);
                    finalsolution.setFinalgoodNum(new Long(finalsolution
                            .getFinalgoodNum().intValue() + 1));
                    sdp.update(finalsolution);
                    FinalsolutionEvaluation fse = new FinalsolutionEvaluation();
                    fse.setFinalsolutionId(finalsolution.getFinalsolutionId());
                    fse.setIsGood("Y");
                    sdp.create(fse);
                    xml
                            .append("<message>success</message><choose>flower</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("Y")) {
                    ps.setVotingGoodNum((new Long(ps.getVotingGoodNum()
                            .intValue() + 1)));
                    cdp.update(ps);
                    pse.setStage(2);
                    pse.setIsGood("Y");
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>flower</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("N")) {
                    ps.setGoodNum(new Long(ps.getGoodNum().intValue() + 1));
                    cdp.update(ps);
                    pse.setIsGood("Y");
                    pse.setStage(2);
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>flower</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
        }

        if (request.getParameter("badegg") != null) {
            try {
                if (request.getParameter("useState").equals("C")) {
                    Finalsolution finalsolution = new Finalsolution();
                    finalsolution.setProblemsolutionId(pse
                            .getProblemsolutionId());
                    finalsolution = (Finalsolution) sdp.get(finalsolution);
                    finalsolution.setFinalbadNum(new Long(finalsolution
                            .getFinalbadNum().intValue() + 1));
                    sdp.update(finalsolution);
                    FinalsolutionEvaluation fse = new FinalsolutionEvaluation();
                    fse.setFinalsolutionId(finalsolution.getFinalsolutionId());
                    fse.setIsGood("N");
                    sdp.create(fse);
                    xml
                            .append("<message>success</message><choose>badegg</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("Y")) {
                    ps.setVotingBadNum((new Long(ps.getVotingBadNum()
                            .intValue() + 1)));
                    cdp.update(ps);
                    pse.setIsGood("N");
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>badegg</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }
            try {
                if (request.getParameter("useState").equals("N")) {
                    ps.setBadNum(new Long(ps.getBadNum().intValue() + 1));
                    cdp.update(ps);
                    pse.setIsGood("N");
                    sdp.create(pse);
                    xml
                            .append("<message>success</message><choose>badegg</choose><problemsolutionId>"
                                    + pse.getProblemsolutionId()
                                    + "</problemsolutionId></result>");
                }
            } catch (EasyJException e) {
                xml.append("<message>failure</message></result>");
            }

        }

        try {
            if (request.getParameter("overdue") != null) {
                ProblemVersion problemversion = new ProblemVersion();
                problemversion.setProblemId(ps.getProblemId());
                Long problemversioncount = sdp.getCount(problemversion);
                ps.setProblemsolutionOverdueVersion(problemversioncount);
                ps.setIsoverdue("Y");
                cdp.update(ps);
                xml
                        .append("<message>success</message><choose>overdue</choose><problemsolutionId>"
                                + pse.getProblemsolutionId()
                                + "</problemsolutionId></result>");
View Full Code Here

    }

    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

        buffer
                .append("<div class=\"mb12 bai\" id=\"value_more\"><div class=\"rr_1\"></div><div class=\"rr_2\"></div><div class=\"rr_3\"></div><div class=\"rr\">");
        buffer
                .append("<div class=\"t1\"><div class=\"ico\"><div class=\"icomment\"></div></div>解决方案详细情况</div><div class=\"bc0\" style=\"padding: 0px 0pt;\"><div id=\"detailedSolution\">");

        CompositeDataProxy cdp = CompositeDataProxy.getInstance();
        String content = "";
        content = getDetailedSolution(userId, problemsolution);
        buffer.append(content);
        buffer.append("<div id=\"Lg\"></div>");
        // 00代表没有回复别人的贴
View Full Code Here

    public String getDetailedSolution(Long userId,
            Problemsolution problemsolution) throws EasyJException {

        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) {
View Full Code Here

        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());
            ps.setProblemsolutionContent(solutionContent);
View Full Code Here

public class ProjectDetailAction extends SingleDataAction {

  public void getloginProjectsDetails() throws EasyJException {

    CompositeDataProxy cdp = CompositeDataProxy.getInstance();
    UserProjectRelation upr = new UserProjectRelation();
    user = (SysUser) object;
    String resp = "";
    upr.setUserName(user.getUserName());
    Project project = new Project();
    project.setProjectId(upr.getProjectId());
    ArrayList projects = new ArrayList();
    projects = cdp.query(project);
    if (projects.size() > 0) {
      for (int i = 0; i < projects.size(); i++) {
        resp = resp + ((Project) projects.get(i)).getProjectName()
            + ",";
      }
View Full Code Here

TOP

Related Classes of easyJ.business.proxy.CompositeDataProxy

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.