Package org.zanata.webtrans.shared.model

Examples of org.zanata.webtrans.shared.model.TransMemoryDetails


        List<HTextFlow> textFlows = textFlowDAO.findByIdList(textFlowIds);
        ArrayList<TransMemoryDetails> items =
                new ArrayList<TransMemoryDetails>(textFlows.size());

        for (HTextFlow tf : textFlows) {
            TransMemoryDetails memoryDetails =
                    translationMemoryServiceImpl.getTransMemoryDetail(hLocale,
                            tf);
            items.add(memoryDetails);
        }
View Full Code Here


        String doc = "";
        String lastModifiedBy = "";
        Date lastModifiedDate = null;

        if (selected >= 0) {
            TransMemoryDetails item = tmDetails.getItems().get(selected);
            sourceComment = item.getSourceComment();
            targetComment = item.getTargetComment();
            project = item.getProjectName();
            iteration = item.getIterationName();
            doc = item.getDocId();
            lastModifiedBy = item.getLastModifiedBy();
            lastModifiedDate = item.getLastModifiedDate();
            display.setState(item.getState());
        }

        display.setSourceComment(sourceComment);
        display.setTargetComment(targetComment);
        display.setProjectName(project);
View Full Code Here

        String username = null;
        if (tft.getLastModifiedBy() != null
                && tft.getLastModifiedBy().hasAccount()) {
            username = tft.getLastModifiedBy().getAccount().getUsername();
        }
        return new TransMemoryDetails(HSimpleComment.toString(tf.getComment()),
                HSimpleComment.toString(tft.getComment()), projectName,
                iterationName, tf.getDocument().getDocId(), tf.getResId(),
                msgContext, tft.getState(), username, tft.getLastChanged());
    }
View Full Code Here

        hTextFlow.setPotEntryData(potEntryData);
        hTextFlow.getTargets().put(sourceLocale.getId(),
                addHTextFlowTarget(sourceLocale, hTextFlow, "admin"));
        setProjectAndIterationSlug(hTextFlow, "project", "master");

        TransMemoryDetails detail =
                service.getTransMemoryDetail(sourceLocale, hTextFlow);

        assertThat(detail.getMsgContext()).isEqualTo("msgContext");
        assertThat(detail.getProjectName()).isEqualTo("project");
        assertThat(detail.getIterationName()).isEqualTo("master");
        assertThat(detail.getDocId()).isEqualTo(
                hTextFlow.getDocument().getDocId());
        assertThat(detail.getLastModifiedBy()).isEqualTo("admin");
    }
View Full Code Here

    public void execute() {
        Log.info("ENTER DummyGetTransMemoryDetailsCommand.execute()");
        ArrayList<TransMemoryDetails> items =
                new ArrayList<TransMemoryDetails>();
        for (int i = 0; i < 4; i++) {
            items.add(new TransMemoryDetails("source " + i + " comment",
                    "target " + i + " comment", "workspace " + i, "iteration "
                            + i, "doc id:" + +i, "resId", "msgContext",
                    ContentState.Approved, "Bob", new Date()));
        }
View Full Code Here

        resultItem.addSourceId(sourceId);
        return resultItem;
    }

    private static TransMemoryDetails tmDetail() {
        return new TransMemoryDetails("", "", "project a", "master",
                "pot/msg.pot", "resId", null, null, null, null);
    }
View Full Code Here

        AbstractAsyncCallback<TransMemoryDetailsList> callback =
                resultCaptor.getValue();

        Date lastModifiedDate = new Date();
        // testing on callback success
        TransMemoryDetails details =
                new TransMemoryDetails("source comment", "target comment",
                        "project", "iteration", "docId", "resId", "msgContext",
                        ContentState.Approved, "admin", lastModifiedDate);
        callback.onSuccess(new TransMemoryDetailsList(Lists
                .newArrayList(details)));
View Full Code Here

    @Test
    public void testOnDocumentListBoxChanged() throws Exception {
        Date lastModifiedDate = new Date();
        // Given: two details
        TransMemoryDetails details1 =
                new TransMemoryDetails("source comment1", "target comment1",
                        "project", "1", "docId1", "resId", "msgContext",
                        ContentState.Approved, "admin", lastModifiedDate);
        TransMemoryDetails details2 =
                new TransMemoryDetails("source comment2", "target comment2",
                        "project", "2", "docId2", "resId", "msgContext",
                        ContentState.Approved, null, lastModifiedDate);
        presenter.setStatForTesting(new TransMemoryDetailsList(Lists
                .newArrayList(details1, details2)));
View Full Code Here

                percent);
    }

    private static TransMemoryDetails tmDetail(String projectName,
            String docId, String resId, String msgContext) {
        return new TransMemoryDetails(null, null, projectName, null, docId,
                resId, msgContext, null, null, null);
    }
View Full Code Here

        assertThat(result, equalTo(ContentState.NeedReview));
    }

    @Test
    public void differentResIdAndOptionIsFuzzy() {
        TransMemoryDetails tmDetail =
                tmDetail(projectName, docId, "different res id", msgContext);
        action = mergeTMActionWhenResIdIsDifferent(MergeRule.FUZZY);
        assertThat(resolver.decideStatus(action, textFlow, tmDetail,
                tmResultWithSimilarity(100), null),
                equalTo(ContentState.NeedReview));
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.model.TransMemoryDetails

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.