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

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


    private static CompositeDataProxy cdp = CompositeDataProxy.getInstance();

    public ScenarioAction() {}

    public void saveDescription() throws EasyJException {
        Description description = (Description) object;
        if (description.getDescriptionId() == null) {
            dp.create(description);
            returnMessage = "descriptionId=" + description.getDescriptionId()
                    + "<message>保存成功";
        } else {
            description.setUseState("Y");
            dp.update(description);
            returnMessage = "保存成功";
        }
    }
View Full Code Here


        Remark remark = (Remark) object;
        dp.delete(remark);
    }

    public void saveDescriptionVersion() throws EasyJException {
        Description description = (Description) object;
        description.setRoleId(userCache.getUser().getUserId());
        Scenario scenario = new Scenario();
        scenario.setScenarioId(description.getScenarioId());
        String datas = "", participants = "", observers = "", communicators = "", descriptions = "";
        scenario = (Scenario) cdp.get(scenario);
        ArrayList dataList = scenario.getDatas();
        ArrayList roleList = scenario.getRoles();
        ArrayList descriptionList = scenario.getDescriptions();
        for (int i = 0; i < dataList.size(); i++) {
            ScenarioDataRelation data = (ScenarioDataRelation) dataList.get(i);
            if (i != dataList.size() - 1)
                datas += data.getDataId() + ",";
            else
                datas += data.getDataId();
        }
        for (int i = 0; i < descriptionList.size(); i++) {
            Description descriptionVersion = (Description) descriptionList
                    .get(i);
            if (i != dataList.size() - 1)
                descriptions += descriptionVersion.getDescriptionId() + ",";
            else
                descriptions += descriptionVersion.getDescriptionId();
        }

        for (int i = 0; i < roleList.size(); i++) {
            ScenarioRoleRelation role = (ScenarioRoleRelation) roleList.get(i);
            if ("participant".equals(role.getRoleType()))
                participants += role.getRoleId() + ",";
            if ("observer".equals(role.getRoleType()))
                observers += role.getRoleId() + ",";
            if ("communicator".equals(role.getRoleType()))
                communicators += role.getRoleId() + ",";
        }

        ScenarioVersion version = new ScenarioVersion();
        version.setScenarioId(description.getScenarioId());
        version.setCommunicators(communicators);
        version.setParticipants(participants);
        version.setObservers(observers);
        version.setDatas(datas);
        version.setCreatorId(userId);
        version.setDescriptions(descriptions);
        version.setBuildTime(new java.sql.Date(System.currentTimeMillis()));
        version.setUpdateTime(new java.sql.Date(System.currentTimeMillis()));
        version.setModifyMark("description");

        dp.create(version);

        String changeContent = description.getDescriptionContent();
        String oriDescriptionContent = request.getParameter("cleanContent");

        description.setDescriptionContent(oriDescriptionContent);
        if (description.getDescriptionId() == null) {
            dp.create(description);
            returnMessage = "descriptionId=" + description.getDescriptionId()
                    + "<message>保存成功";
        } else {
            dp.update(description);
            returnMessage = "保存成功";
        }
        DescriptionVersion descriptionVersion = new DescriptionVersion();
        descriptionVersion.setBuildTime(new java.sql.Date(System
                .currentTimeMillis()));
        descriptionVersion.setUpdateTime(new java.sql.Date(System
                .currentTimeMillis()));
        descriptionVersion.setCreatorId(userId);
        descriptionVersion.setScenarioVersionId(version.getScenarioVersionId());
        descriptionVersion.setDescriptionId(description.getDescriptionId());
        descriptionVersion.setDescriptionVersionContent(changeContent);
        dp.create(descriptionVersion);
    }
View Full Code Here

                if ("participant".equals(role.getRoleType())) {
                    participants = participants + role.getRoleId() + ",";
                }
            }
            for (int i = 0; i < descriptions.size(); i++) {
                Description description = (Description) descriptions.get(i);
                if (participants.indexOf("," + description.getRoleId() + ",") >= 0) {
                    String content = HtmlTransformer
                            .getGraphSourceString(description
                                    .getDescriptionContent());
                    content = content.replaceAll("\u00a0", " ");
                    buffer.append(description.getRoleName() + "\n" + content
                            + "\n");
                    buffer.append(HtmlTransformer.SWIMLANE_SEP + "\n");
                }
            }
            System.out.println(buffer.toString());
View Full Code Here

TOP

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

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.