Package org.zanata.common

Examples of org.zanata.common.ContentState


        Long docId = 1L;
        Long tfId = 1L;
        Long versionId = 1L;
        LocaleId localeId = LocaleId.DE;
        int wordCount = 10;
        ContentState oldState = ContentState.New;
        ContentState newState = ContentState.Translated;

        WordStatistic stats = new WordStatistic(10, 10, 10, 10, 10);
        WordStatistic oldStats = StatisticsUtil.copyWordStatistic(stats);
        oldStats.decrement(newState, wordCount);
        oldStats.increment(oldState, wordCount);
View Full Code Here


        int wordCount1 = target1.getTextFlow().getWordCount().intValue();
        int wordCount2 = target2.getTextFlow().getWordCount().intValue();

        // new -> approved
        ContentState newState = ContentState.Approved;

        ContributionStatistics expectedStats = new ContributionStatistics();
        expectedStats.put(username, buildStats(localeId, 0, 0, 0,
                wordCount1, 0));
        target1 = executeStateChangeTest(target1, "test1",
View Full Code Here

        int wordCount1 = target1.getTextFlow().getWordCount().intValue();
        int wordCount2 = target2.getTextFlow().getWordCount().intValue();

        // needReview -> approved
        ContentState newState = ContentState.Approved;

        ContributionStatistics expectedStats = new ContributionStatistics();
        expectedStats.put(username, buildStats(target1.getLocaleId(), 0, 0, 0,
                wordCount1, 0));
        target1 = executeStateChangeTest(target1, "test1",
View Full Code Here

    }

    @Test
    public void notOneHundredMatchWillBeSetAsFuzzy() {
        action = mergeTMAction(MergeOptions.allIgnore());
        ContentState result =
                resolver.decideStatus(action, textFlow, tmDetail,
                        tmResultWithSimilarity(90), null);

        assertThat(result, equalTo(ContentState.NeedReview));
    }
View Full Code Here

                        .getDocId()
                        .equals(matchingTarget.getTextFlow()
                                .getDocument().getDocId());
            }
        };
        final ContentState copyState =
                determineContentState(contextMatches, projectMatches,
                        docIdMatches, options,
                        requireTranslationReview, matchingTarget.getState());

        boolean hasValidationError =
                validationTranslations(copyState,
                        matchingTargetProjectIteration,
                        originalTf.getContents(), matchingTarget.getContents());

        if (hasValidationError) {
            return;
        }

        HTextFlowTarget hTarget =
                textFlowTargetDAO.getOrCreateTarget(originalTf,
                        matchingTarget.getLocale());
        ContentState prevState =
                hTarget.getId() == null ? ContentState.New : hTarget.getState();
        if (shouldOverwrite(hTarget, copyState)) {
            // NB we don't touch creationDate
            hTarget.setTextFlowRevision(originalTf.getRevision());
            hTarget.setLastChanged(matchingTarget.getLastChanged());
View Full Code Here

            HLocale hLocale, Map<Long, TransUnitUpdateRequest> requestMap,
            HTextFlow hTextFlowToBeFilled, TransMemoryResultItem tmResult,
            HTextFlowTarget oldTarget) {

        Long tmSourceId = tmResult.getSourceIdList().get(0);
        ContentState statusToSet;
        String comment;
        if (tmResult.getMatchType() == TransMemoryResultItem.MatchType.Imported) {
            TransMemoryUnit tu = transMemoryUnitDAO.findById(tmSourceId);
            statusToSet =
                    TransMemoryMergeStatusResolver.newInstance().decideStatus(
View Full Code Here

TOP

Related Classes of org.zanata.common.ContentState

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.