Package org.zanata.model

Examples of org.zanata.model.HTextFlowTargetHistory


        target.setContents("a", "b");
        return target;
    }

    private static HTextFlowTargetHistory createHistory(HTextFlowTarget target) {
        HTextFlowTargetHistory targetHistory =
                new HTextFlowTargetHistory(target);
        targetHistory.setContents(target.getContents());
        return targetHistory;
    }
View Full Code Here


                log.debug(
                        "about to revert hTextFlowTarget version {} to TransUnit version {}",
                        versionNum, info.getTransUnit().getVerNum());
                if (versionNum.equals(info.getTransUnit().getVerNum())) {
                    // look up replaced version
                    HTextFlowTargetHistory oldTarget =
                            hTextFlowTarget.getHistory().get(
                                    info.getPreviousVersionNum());
                    if (oldTarget != null) {
                        // generate request
                        List<String> oldContents = oldTarget.getContents();
                        ContentState oldState = oldTarget.getState();
                        TransUnitUpdateRequest request =
                                new TransUnitUpdateRequest(tuId, oldContents,
                                        oldState, versionNum);
                        // add to list
                        updateRequests.add(request);
View Full Code Here

        assertThat(newComment.getTargetVersion()).isEqualTo(
                newTarget.getVersionNum());

        for (Map.Entry<Integer, HTextFlowTargetHistory> entry : existingTarget
                .getHistory().entrySet()) {
            HTextFlowTargetHistory existingHistory = entry.getValue();
            HTextFlowTargetHistory newHistory =
                    newTarget.getHistory().get(entry.getKey());
            assertThat(newHistory.getTextFlowTarget()).isEqualTo(newTarget);
            assertThat(newHistory.getContents()).isEqualTo(
                    existingHistory.getContents());
            assertThat(newHistory.getLastModifiedBy()).isEqualTo(
                    existingHistory.getLastModifiedBy());
            assertThat(newHistory.getTextFlowRevision()).isEqualTo(
                    existingHistory.getTextFlowRevision());
            assertThat(newHistory.getState()).isEqualTo(
                    existingHistory.getState());
            assertThat(newHistory.getVersionNum()).isEqualTo(
                    existingHistory.getVersionNum());
        }
    }
View Full Code Here

            copy.addReviewComment(comment.getComment(), comment.getCommenter());
        }

        // copy history
        for (HTextFlowTargetHistory history : tft.getHistory().values()) {
            HTextFlowTargetHistory newHistory =
                    JPACopier.<HTextFlowTargetHistory> copyBean(history,
                            "textFlowTarget");
            newHistory.setTextFlowTarget(copy);
            copy.getHistory().put(newHistory.getVersionNum(), newHistory);
        }
        return copy;
    }
View Full Code Here

TOP

Related Classes of org.zanata.model.HTextFlowTargetHistory

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.