Package org.zanata.webtrans.shared.model

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


        FilterConstraints filterConstraints = FilterConstraints.builder().build();

        List<HTextFlow> textFlows =
                textFlowDAO.getNavigationByDocumentId(
                        new DocumentId(document.getId(), document.getDocId()),
                        hLocale, resultTransformer, filterConstraints);

        List<TransUnitStatus> statusList =
                Lists.newArrayListWithExpectedSize(textFlows.size());
View Full Code Here


                serviceLocator.getInstance(TransUnitTransformer.class);
        TransUnit transUnit =
                transUnitTransformer.transform(textFlow, target,
                        target.getLocale());

        DocumentId documentId =
                new DocumentId(document.getId(), document.getDocId());
        int wordCount = textFlow.getWordCount().intValue();

        TransUnitUpdateInfo updateInfo =
                createTransUnitUpdateInfo(transUnit, documentId, wordCount,
                        previousVersionNum, previousState);
View Full Code Here

                        "baked?docId=" + hDoc.getDocId());
            }

            DocumentInfo doc =
                    new DocumentInfo(
                            new DocumentId(hDoc.getId(), hDoc.getDocId()),
                            hDoc.getName(),
                            hDoc.getPath(),
                            hDoc.getLocale().getLocaleId(),
                            null,
                            new AuditInfo(hDoc.getLastChanged(), lastModifiedBy),
View Full Code Here

    @Override
    public void onDocumentSelected(DocumentSelectionEvent event) {
        // match bookmarked selection, but prevent selection feedback loop
        // from history
        DocumentId current =
                currentDocument == null ? null : currentDocument.getId();
        if (!Objects.equal(event.getDocumentId(), current)) {
            setSelection(event.getDocumentId());
        }
View Full Code Here

                .setFilterByTranslated(newHistoryToken.isFilterTranslated());
        configHolder.setFilterByApproved(newHistoryToken.isFilterApproved());
        configHolder.setFilterByRejected(newHistoryToken.isFilterRejected());
        configHolder.setFilterByHasError(newHistoryToken.isFilterHasError());

        DocumentId documentId =
                documentListPresenter.getDocumentId(newHistoryToken
                        .getDocumentPath());
        EditorFilter editorFilter = getEditorFilterFromToken(newHistoryToken);
        if (!getTransUnitActionContextHolder.isContextInitialized()
                && documentId != null) {
View Full Code Here

    @Test
    public void testExecute() throws Exception {
        List<TransUnitUpdateInfo> updatesToRevert =
                Lists.newArrayList(new TransUnitUpdateInfo(true, true,
                        new DocumentId(new Long(1), ""), TestFixture
                                .makeTransUnit(1), 0, 0, ContentState.Approved));
        RevertTransUnitUpdates action =
                new RevertTransUnitUpdates(updatesToRevert);
        action.setWorkspaceId(new WorkspaceId(new ProjectIterationId("", "",
                ProjectType.File), LocaleId.EN_US));
View Full Code Here

    }

    @Override
    public void execute() {
        Log.info("ENTER DummyGetTransUnitCommand.execute()");
        DocumentId documentId = action.getDocumentId();
        int count = action.getCount();
        int offset = action.getOffset();
        int totalCount = count * 5;

        ArrayList<TransUnit> data =
View Full Code Here

    private ArrayList<DocumentInfo> generateTransUnitSampleData() {
        HashMap<String, String> extensions = new HashMap<String, String>();
        extensions.put(".po", "");

        ArrayList<DocumentInfo> names = new ArrayList<DocumentInfo>();
        names.add(new DocumentInfo(new DocumentId(new Long(0), ""), "name0",
                "", LocaleId.EN_US, newStats(0), new AuditInfo(new Date(),
                        "Translator"), extensions, new AuditInfo(new Date(),
                        "last translator")));
        names.add(new DocumentInfo(new DocumentId(new Long(1), ""),
                "path1name1", "path/1", LocaleId.EN_US, newStats(1),
                new AuditInfo(new Date(), "Translator"), extensions,
                new AuditInfo(new Date(), "last translator")));
        names.add(new DocumentInfo(new DocumentId(new Long(2), ""),
                "path1name2", "path/1", LocaleId.EN_US, newStats(2),
                new AuditInfo(new Date(), "Translator"), extensions,
                new AuditInfo(new Date(), "last translator")));
        names.add(new DocumentInfo(new DocumentId(new Long(3), ""),
                "path2name1", "path/2", LocaleId.EN_US, newStats(3),
                new AuditInfo(new Date(), "Translator"), extensions,
                new AuditInfo(new Date(), "last translator")));
        names.add(new DocumentInfo(new DocumentId(new Long(4), ""),
                "path2name2", "path/2", LocaleId.EN_US, newStats(4),
                new AuditInfo(new Date(), "Translator"), extensions,
                new AuditInfo(new Date(), "last translator")));
        names.add(new DocumentInfo(new DocumentId(new Long(5), ""), "name2",
                "", LocaleId.EN_US, newStats(5), new AuditInfo(new Date(),
                        "Translator"), extensions, new AuditInfo(new Date(),
                        "last translator")));
        names.add(new DocumentInfo(new DocumentId(new Long(6), ""), "name1",
                "", LocaleId.EN_US, newStats(6), new AuditInfo(new Date(),
                        "Translator"), extensions, new AuditInfo(new Date(),
                        "last translator")));
        names.add(new DocumentInfo(
                new DocumentId(new Long(7), ""),
                "long name, a name which is really quite long, too wide to be displayed without scrolling (in most cases)",
                "", LocaleId.EN_US, newStats(7), new AuditInfo(new Date(),
                        "Translator"), extensions, new AuditInfo(new Date(),
                        "last translator")));
        names.add(new DocumentInfo(
                new DocumentId(new Long(8), ""),
                "another long name, a name which is really quite long, too wide to be displayed without scrolling (in most cases)",
                "long path, a path which is, again, really quite long, and also too wide to be displayed without scrolling (in most cases)",
                LocaleId.EN_US, newStats(8), new AuditInfo(new Date(),
                        "Translator"), extensions, new AuditInfo(new Date(),
                        "last translator")));
        for (int n = 0; n < 100; n++) {
            // two digit numbers, to make sorting happier
            names.add(new DocumentInfo(new DocumentId(new Long(n), ""), "multi"
                    + n, "", LocaleId.EN_US, newStats(n), new AuditInfo(
                    new Date(), "Translator"), extensions, new AuditInfo(
                    new Date(), "last translator")));
        }
        return names;
View Full Code Here

        Long documentId = new Long("100");
        LocaleId testLocaleId = LocaleId.DE;
        TranslationStateCacheImpl.DocumentLocaleKey key =
                new DocumentLocaleKey(documentId, testLocaleId);
        DocumentStatus docStats =
                new DocumentStatus(new DocumentId(documentId, ""), new Date(),
                        "");

        // When:
        when(docStatsLoader.load(key)).thenReturn(docStats);
View Full Code Here

                        .setId(firstTu.getTransUnitId().getId())
                        .setVerNum(firstTu.getBaseTranslationVersion() + 1)
                        .setResId("dummyRestId").setLocaleId(LocaleId.EN_US)
                        .setSources(firstTu.getNewContents()).build();
        TransUnitUpdateInfo updateInfo =
                new TransUnitUpdateInfo(true, true, new DocumentId(new Long(0),
                        ""), tu, 5, firstTu.getBaseTranslationVersion(),
                        ContentState.NeedReview);
        UpdateTransUnitResult result = new UpdateTransUnitResult(updateInfo);
        callback.onSuccess(result);
        Log.info("EXIT DummyUpdateTransUnitCommand.execute()");
View Full Code Here

TOP

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

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.