Package org.zanata.service

Examples of org.zanata.service.VersionLocaleKey


    public DisplayUnit getStatisticFigureForProjectWithLocale(
            SortingType.SortOption sortOption, LocaleId localeId,
            Long projectIterationId) {
        WordStatistic statistic =
                statisticMap.get(new VersionLocaleKey(projectIterationId,
                        localeId));
        return getDisplayUnit(sortOption, statistic, null);
    }
View Full Code Here


        }
        return projectStats.get(projectIterationId);
    }

    public WordStatistic getSelectedLocaleStatistic(Long projectIterationId) {
        return statisticMap.get(new VersionLocaleKey(projectIterationId,
                selectedLocale.getLocaleId()));
    }
View Full Code Here

        return statisticMap.get(new VersionLocaleKey(projectIterationId,
                selectedLocale.getLocaleId()));
    }

    public WordStatistic getSelectedVersionStatistic(LocaleId localeId) {
        return statisticMap.get(new VersionLocaleKey(selectedVersion.getId(),
                localeId));
    }
View Full Code Here

                if (selectedVersionId == null) {
                    wordStatistic1 = getStatisticsForLocale(o1.getLocaleId());
                    wordStatistic2 = getStatisticsForLocale(o2.getLocaleId());
                } else {
                    wordStatistic1 =
                            statisticMap.get(new VersionLocaleKey(
                                    selectedVersionId, o1.getLocaleId()));
                    wordStatistic2 =
                            statisticMap.get(new VersionLocaleKey(
                                    selectedVersionId, o2.getLocaleId()));
                }
                switch (selectedSortOption) {
                case PERCENTAGE:
                    return Double.compare(
View Full Code Here

            if (!selectedSortOption.equals(SortingType.SortOption.ALPHABETICAL)) {
                WordStatistic wordStatistic1;
                WordStatistic wordStatistic2;
                if (selectedLocaleId != null) {
                    wordStatistic1 =
                            statisticMap.get(new VersionLocaleKey(o1.getId(),
                                    selectedLocaleId));
                    wordStatistic2 =
                            statisticMap.get(new VersionLocaleKey(o2.getId(),
                                    selectedLocaleId));
                } else {
                    wordStatistic1 = getStatisticForProject(o1.getId());
                    wordStatistic2 = getStatisticForProject(o2.getId());
                }
View Full Code Here

    }

    @Observer(TextFlowTargetStateEvent.EVENT_NAME)
    @Override
    public void textFlowStateUpdated(TextFlowTargetStateEvent event) {
        VersionLocaleKey key =
                new VersionLocaleKey(event.getProjectIterationId(),
                        event.getLocaleId());
        WordStatistic stats = versionStatisticCache.get(key);
        if (stats != null) {
            TextFlowDAO textFlowDAO = serviceLocator.getInstance(TextFlowDAO.class);
            HTextFlow textFlow = textFlowDAO.findById(event.getTextFlowId());
View Full Code Here

    }

    @Override
    public WordStatistic getVersionStatistics(Long projectIterationId,
        LocaleId localeId) {
        return versionStatisticCache.getWithLoader(new VersionLocaleKey(
                projectIterationId, localeId));
    }
View Full Code Here

    @Override
    public void clearVersionStatsCache(Long versionId) {
        LocaleDAO localeDAO = serviceLocator.getInstance(LocaleDAO.class);
        for (HLocale locale : localeDAO.findAll()) {
            VersionLocaleKey key =
                    new VersionLocaleKey(versionId, locale.getLocaleId());
            versionStatisticCache.remove(key);
        }
    }
View Full Code Here

                                version.getId(), localeId);
                statistic.setRemainingHours(StatisticsUtil
                        .getRemainingHours(statistic));

                statisticMap.put(
                        new VersionLocaleKey(version.getId(), localeId),
                        statistic);
            }
        }

        return statisticMap;
View Full Code Here

    public void getStatisticTest() throws Exception {

        Long projectIterationId = 1L;
        LocaleId localeId = LocaleId.EN_US;
        VersionLocaleKey key = new VersionLocaleKey(projectIterationId, localeId);

        WordStatistic wordStatistic = new WordStatistic(0, 11, 100, 4, 500);

        // When:
        when(versionStatisticLoader.load(key)).thenReturn(wordStatistic);
View Full Code Here

TOP

Related Classes of org.zanata.service.VersionLocaleKey

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.