Package org.zanata.search

Examples of org.zanata.search.FilterConstraints$Builder


        }

        TextFlowResultTransformer resultTransformer =
                new TextFlowResultTransformer(hLocale);

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

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


            // project (consider performance).
            return new GetProjectTransUnitListsResult(action, docPaths,
                    matchingTUs);
        }

        FilterConstraints filterConstraints =
                FilterConstraints.builder().filterBy(action.getSearchString())
                        .caseSensitive(action.isCaseSensitive())
                        .checkInSource(action.isSearchInSource())
                        .checkInTarget(action.isSearchInTarget()).build();
View Full Code Here

        log.info("action: {}", action);
        int targetOffset = action.getOffset();
        int targetPageIndex = targetOffset / action.getCount();
        GetTransUnitsNavigationResult navigationResult = null;
        EditorFilter editorFilter = action.getEditorFilter();
        FilterConstraints constraints =
                FilterConstraints
                        .builder()
                        .filterBy(editorFilter.getTextInContent())
                        .lastModifiedBy(editorFilter.getLastModifiedByUser())
                        .targetChangedBefore(
View Full Code Here

        // When: search in target only and case sensitive
        GetProjectTransUnitListsResult result = handler.execute(action, null);

        verify(identity).checkLoggedIn();
        FilterConstraints constraints = constraintCaptor.getValue();
        assertThat(constraints.isSearchInSource(), Matchers.equalTo(true));
        assertThat(constraints.isSearchInTarget(), Matchers.equalTo(true));
        assertThat(constraints.isCaseSensitive(), Matchers.equalTo(true));
        assertThat(result.getDocumentIds(), Matchers.contains(DOC_ID));
        assertThat(TestFixture.asIds(result.getUnits(DOC_ID)),
                Matchers.contains(1, 2, 3, 4));
    }
View Full Code Here

        // When: search in source and target and case sensitive
        GetProjectTransUnitListsResult result = handler.execute(action, null);

        verify(identity).checkLoggedIn();
        FilterConstraints constraints = constraintCaptor.getValue();
        assertThat(constraints.isSearchInSource(), Matchers.equalTo(true));
        assertThat(constraints.isSearchInTarget(), Matchers.equalTo(true));
        assertThat(constraints.isCaseSensitive(), Matchers.equalTo(true));
        assertThat(result.getDocumentIds(), Matchers.contains(DOC_ID));
        assertThat(TestFixture.asIds(result.getUnits(DOC_ID)),
                Matchers.contains(2, 3));
    }
View Full Code Here

        // When: search in source only and case insensitive
        GetProjectTransUnitListsResult result = handler.execute(action, null);

        verify(identity).checkLoggedIn();
        FilterConstraints constraints = constraintCaptor.getValue();
        assertThat(constraints.isSearchInSource(), Matchers.equalTo(true));
        assertThat(constraints.isSearchInTarget(), Matchers.equalTo(false));
        assertThat(constraints.isCaseSensitive(), Matchers.equalTo(false));
        assertThat(result.getDocumentIds(), Matchers.contains(DOC_ID));
        assertThat(TestFixture.asIds(result.getUnits(DOC_ID)),
                Matchers.contains(1, 3));
    }
View Full Code Here

    @Test
    public void canGetAllUntranslatedTextFlowForADocument() {
        HLocale deLocale = getEm().find(HLocale.class, 3L);
        log.info("locale: {}", deLocale);

        FilterConstraints untranslated =
                FilterConstraints.builder().keepAll().excludeFuzzy()
                        .excludeTranslated().build();
        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(new DocumentId(1L,
                        ""), deLocale, untranslated, 0, 10);
View Full Code Here

    @Test
    public void canGetTextFlowWithNullTarget() {
        HLocale deLocale = getEm().find(HLocale.class, 3L);

        FilterConstraints untranslated =
                FilterConstraints.builder().keepAll().excludeFuzzy()
                        .excludeTranslated().build();
        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(new DocumentId(4L,
                        ""), deLocale, untranslated, 0, 10);
View Full Code Here

    @Test
    public void canGetTextFlowsByStatusNotFuzzy() {
        // frLocale new in this document
        DocumentId documentId = new DocumentId(1L, "");
        HLocale frLocale = getEm().find(HLocale.class, 6L);
        FilterConstraints notFuzzy =
                FilterConstraints.builder().keepAll().excludeFuzzy().build();

        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(documentId,
                        frLocale, notFuzzy, 0, 10);
View Full Code Here

    @Test
    public void canGetTextFlowsByStatusNotTranslatedNotNew() {
        // esLocale fuzzy in this document
        DocumentId documentId = new DocumentId(1L, "");
        HLocale esLocale = getEm().find(HLocale.class, 5L);
        FilterConstraints notNewOrTranslated =
                FilterConstraints.builder().keepAll().excludeTranslated()
                        .excludeNew().build();

        List<HTextFlow> result =
                dao.getTextFlowByDocumentIdWithConstraints(documentId,
View Full Code Here

TOP

Related Classes of org.zanata.search.FilterConstraints$Builder

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.