Package org.zanata.dao

Examples of org.zanata.dao.LocaleDAO


                projectIterationId, localeId));
    }

    @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


    @SlowTest
    public void testCopyTrans(CopyTransExecution execution) {
        // Prepare Execution
        ProjectIterationDAO iterationDAO =
                seam.autowire(ProjectIterationDAO.class);
        LocaleDAO localeDAO = seam.autowire(LocaleDAO.class);

        // Get the project iteration
        HProjectIteration projectIteration;
        if (execution.projectMatches) {
            projectIteration =
                    iterationDAO.getBySlug("same-project", "different-version");
        } else {
            projectIteration =
                    iterationDAO.getBySlug("different-project",
                            "different-version");
        }
        assert projectIteration != null;

        // Set require translation review
        projectIteration
                .setRequireTranslationReview(execution.requireTranslationReview);

        // Change all targets to have the execution's match state
        for (HDocument doc : projectIteration.getDocuments().values()) {
            for (HTextFlow tf : doc.getAllTextFlows().values()) {
                for (HTextFlowTarget tft : tf.getTargets().values()) {
                    tft.setState(execution.matchState);
                }
            }
        }

        // Create the document
        HDocument doc = new HDocument();
        doc.setContentType(ContentType.TextPlain);
        doc.setLocale(localeDAO.findByLocaleId(LocaleId.EN_US));
        doc.setProjectIteration(projectIteration);
        if (execution.documentMatches) {
            doc.setFullPath("/same/document");
        } else {
            doc.setFullPath("/different/document");
View Full Code Here

                existingVersionSlug, existingDocId);
    }

    private int insertTextFlowAndTargetToDoc(HDocument doc, int tfSize,
            boolean insertTargets) {
        LocaleDAO localeDAO = new LocaleDAO(getSession());
        List<HLocale> localeList = localeDAO.findAll();

        for (int i = 0; i < tfSize; i++) {
            HTextFlow tf =
                    new HTextFlowBuilder().withDocument(doc).withResId(
                            "testResId:" + i)
View Full Code Here

                .use("entityManagerFactory", getEmf())
                .use("session", new FullTextSessionImpl(getSession()))
                .useImpl(IndexingServiceImpl.class)
                .ignoreNonResolvable();
        seam.autowire(SearchIndexManager.class).reindex(true, true, false);
        LocaleDAO localeDAO = seam.autowire(LocaleDAO.class);

        sourceLocale = localeDAO.findByLocaleId(LocaleId.EN_US);
    }
View Full Code Here

                        .use("session", new FullTextSessionImpl(getSession()))
                        .useImpl(IndexingServiceImpl.class)
                        .ignoreNonResolvable()
                        .autowire(TranslationMemoryServiceImpl.class);
        seam.autowire(SearchIndexManager.class).reindex(true, true, false);
        LocaleDAO localeDAO = seam.autowire(LocaleDAO.class);

        sourceLocale = localeDAO.findByLocaleId(LocaleId.EN_US);
        targetLocale = localeDAO.findByLocaleId(LocaleId.DE);
    }
View Full Code Here

    HLocale en_US;
    HLocale de_DE;

    @BeforeMethod(firstTimeOnly = true)
    public void beforeMethod() {
        localeDAO = new LocaleDAO((Session) em.getDelegate());
        historyDAO = new TextFlowTargetHistoryDAO((Session) em.getDelegate());
        en_US = localeDAO.findByLocaleId(LocaleId.EN_US);
        de_DE = localeDAO.findByLocaleId(new LocaleId("de"));
    }
View Full Code Here

        Identity.setSecurityEnabled(false);
    }

    @BeforeMethod(firstTimeOnly = true)
    public void beforeMethod() {
        localeDAO = new LocaleDAO((Session) em.getDelegate());
        en_US = localeDAO.findByLocaleId(LocaleId.EN_US);
        de_DE = localeDAO.findByLocaleId(new LocaleId("de"));
    }
View Full Code Here

                DatabaseOperation.DELETE_ALL));
    }

    @BeforeMethod(firstTimeOnly = true)
    public void beforeMethod() {
        localeDAO = new LocaleDAO((Session) em.getDelegate());
        projectIterationDAO =
                new ProjectIterationDAO((Session) em.getDelegate());
        en_US = localeDAO.findByLocaleId(LocaleId.EN_US);
    }
View Full Code Here

    private LocaleDAO localeDAO;
    HLocale en_US;

    @BeforeMethod(firstTimeOnly = true)
    public void beforeMethod() {
        localeDAO = new LocaleDAO((Session) em.getDelegate());
        en_US = localeDAO.findByLocaleId(LocaleId.EN_US);
    }
View Full Code Here

    private LocaleDAO localeDAO;
    HLocale de_DE;

    @BeforeMethod(firstTimeOnly = true)
    public void beforeMethod() {
        localeDAO = new LocaleDAO((Session) em.getDelegate());
        de_DE = localeDAO.findByLocaleId(new LocaleId("de"));
    }
View Full Code Here

TOP

Related Classes of org.zanata.dao.LocaleDAO

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.