Package org.zanata.rest.dto.stats.contribution

Examples of org.zanata.rest.dto.stats.contribution.LocaleStatistics


            }
        } catch (IllegalArgumentException e) {
            throw new InvalidDateParamException(dateRangeParam);
        }

        LocaleStatistics localeStatistics = new LocaleStatistics();

        List<Object[]> data =
                textFlowTargetHistoryDAO.getUserTranslationHistoryInVersion(
                        version.getId(), person.getId(), fromDate, toDate);

        for (Object[] entry : data) {
            int count = ((BigDecimal) entry[0]).intValue();
            ContentState state = ContentState.values()[(int) entry[1]];
            LocaleId localeId = new LocaleId(entry[2].toString());

            BaseTranslationCount stats;
            if (localeStatistics.containsKey(localeId)) {
                stats = localeStatistics.get(localeId);
            } else {
                stats = new BaseTranslationCount(0,0,0,0,0);
            }
            stats.set(state, count);
            localeStatistics.put(localeId, stats);
        }

        ContributionStatistics result = new ContributionStatistics();
        result.put(username, localeStatistics);
View Full Code Here


    }

    private LocaleStatistics buildStats(LocaleId localeId, int untranslated,
            int needReview, int translated, int approved, int rejected) {
        LocaleStatistics localeStatistics = new LocaleStatistics();

        localeStatistics.put(localeId, new TransUnitCount(approved, needReview,
                untranslated, translated, rejected));

        return localeStatistics;
    }
View Full Code Here

TOP

Related Classes of org.zanata.rest.dto.stats.contribution.LocaleStatistics

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.