Package org.zanata.webtrans.shared.rpc

Examples of org.zanata.webtrans.shared.rpc.GetTransUnitListResult


        }

        List<HTextFlow> textFlows =
                getTextFlows(action, hLocale, targetOffset, constraints);

        GetTransUnitListResult result =
                transformToTransUnits(action, hLocale, textFlows, targetOffset,
                        targetPageIndex);
        result.setNavigationIndex(navigationResult);
        return result;
    }
View Full Code Here


                gotoRow = row;
            }
        }
        // stupid GWT RPC can't handle
        // com.google.common.collect.Lists$TransformingRandomAccessList
        return new GetTransUnitListResult(action.getDocumentId(),
                Lists.newArrayList(units), gotoRow, targetOffset, targetPage);
    }
View Full Code Here

        int totalCount = count * 5;

        ArrayList<TransUnit> data =
                generateTransUnitSampleData(action.getWorkspaceId()
                        .getLocaleId(), count, offset);
        GetTransUnitListResult result =
                new GetTransUnitListResult(documentId, data, 1, offset, offset
                        / count);

        ArrayList<TransUnitId> idIndexList = new ArrayList<TransUnitId>();
        HashMap<TransUnitId, ContentState> transIdStateMap =
                new HashMap<TransUnitId, ContentState>();

        for (TransUnit tu : data) {
            idIndexList.add(tu.getId());
            transIdStateMap.put(tu.getId(), tu.getStatus());
        }

        result.setNavigationIndex(new GetTransUnitsNavigationResult(
                idIndexList, transIdStateMap));

        callback.onSuccess(result);
        Log.info("EXIT DummyGetTransUnitCommand.execute()");
    }
View Full Code Here

                GetTransUnitList.newAction(new GetTransUnitActionContext(
                        document));
        prepareActionAndMockLocaleService(action);

        long startTime = System.nanoTime();
        GetTransUnitListResult result = handler.execute(action, null);
        log.info("********** duration :{} second",
                (System.nanoTime() - startTime) / 1000000000.0);

        log.info("result: {}", result);
        assertThat(result.getDocumentId(), Matchers.equalTo(document.getId()));
        assertThat(result.getGotoRow(), Matchers.equalTo(0));
        assertThat(TestFixture.asIds(result.getUnits()),
                Matchers.contains(1, 2, 3, 4, 5));
    }
View Full Code Here

                GetTransUnitList.newAction(new GetTransUnitActionContext(
                        document).withFilterFuzzy(true)
                        .withFilterUntranslated(true));
        prepareActionAndMockLocaleService(action);

        GetTransUnitListResult result = handler.execute(action, null);

        log.info("result: {}", result);
        assertThat(result.getDocumentId(), Matchers.equalTo(document.getId()));
        assertThat(result.getGotoRow(), Matchers.equalTo(0));
        assertThat(TestFixture.asIds(result.getUnits()),
                Matchers.contains(3, 5, 6, 7, 8));
    }
View Full Code Here

        GetTransUnitList action =
                GetTransUnitList.newAction(new GetTransUnitActionContext(
                        document).withFilterHasError(true));
        prepareActionAndMockLocaleService(action);

        GetTransUnitListResult result = handler.execute(action, null);

        log.info("result: {}", result);
        assertThat(result.getDocumentId(), Matchers.equalTo(document.getId()));
        assertThat(result.getGotoRow(), Matchers.equalTo(0));
        assertThat(TestFixture.asIds(result.getUnits()),
                Matchers.contains(1, 2, 3, 4, 5));
    }
View Full Code Here

                        document).withFindMessage("FiLe").withCount(10)
                        .withOffset(1));
        prepareActionAndMockLocaleService(action);

        // When:
        GetTransUnitListResult result = handler.execute(action, null);

        // Then:
        log.info("result: {}", result);
        assertThat(result.getDocumentId(), Matchers.equalTo(document.getId()));
        assertThat(result.getGotoRow(), Matchers.equalTo(0));
        assertThat(TestFixture.asIds(result.getUnits()),
                Matchers.contains(2, 3, 4, 5, 6, 8));
    }
View Full Code Here

                                .withFilterUntranslated(true)
                                .withFilterFuzzy(true));
        prepareActionAndMockLocaleService(action);

        // When:
        GetTransUnitListResult result = handler.execute(action, null);

        // Then:
        log.info("result: {}", result);
        assertThat(result.getDocumentId(), Matchers.equalTo(document.getId()));
        assertThat(result.getGotoRow(), Matchers.equalTo(0));
        assertThat(TestFixture.asIds(result.getUnits()),
                Matchers.contains(3, 5, 6, 8));
    }
View Full Code Here

                        .withFilterUntranslated(true).withFilterFuzzy(true)
                        .withFilterHasError(true));
        prepareActionAndMockLocaleService(action);

        // When:
        GetTransUnitListResult result = handler.execute(action, null);

        // Then:
        log.info("result: {}", result);
        assertThat(result.getDocumentId(), Matchers.equalTo(document.getId()));
        assertThat(result.getGotoRow(), Matchers.equalTo(0));
        assertThat(TestFixture.asIds(result.getUnits()),
                Matchers.contains(3, 5, 6, 8));
    }
View Full Code Here

                        .withCount(countPerPage));

        prepareActionAndMockLocaleService(action);

        // When:
        GetTransUnitListResult result = handler.execute(action, null);

        assertThat(result.getTargetPageIndex(), Matchers.equalTo(3));
    }
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.rpc.GetTransUnitListResult

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.