Package org.zanata.dao

Examples of org.zanata.dao.DocumentDAO


    @Test
    public void reuseTranslationsFromObsoleteDocuments() throws Exception {
        ProjectIterationDAO projectIterationDAO =
                seam.autowire(ProjectIterationDAO.class);
        DocumentDAO documentDAO = seam.autowire(DocumentDAO.class);

        // Make all documents obsolete
        HProjectIteration version =
                projectIterationDAO.getBySlug("same-project", "same-version");
        assert version != null;
        for (HDocument doc : version.getDocuments().values()) {
            doc.setObsolete(true);
            documentDAO.makePersistent(doc);
        }

        ProjectDAO projectDAO = seam.autowire(ProjectDAO.class);
        HProject project = projectDAO.getBySlug("different-project");
        assert project != null;
        for (HProjectIteration it : project.getProjectIterations()) {
            for (HDocument doc : it.getDocuments().values()) {
                doc.setObsolete(true);
                documentDAO.makePersistent(doc);
            }
        }

        // Run the copy trans scenario
        CopyTransExecution execution =
View Full Code Here


        when(identity.getCredentials()).thenReturn(credentials);
        when(credentials.getUsername()).thenReturn("mock user");

        projectIterationDAO = new ProjectIterationDAO(getSession());
        documentDAO = new DocumentDAO(getSession());
        textFlowTargetDAO = new TextFlowTargetDAO(getSession());
        textFlowDAO = new TextFlowDAO(getSession());
        rawDocumentDAO = new RawDocumentDAO((getSession()));

        service = seam.reset()
View Full Code Here

    @BeforeMethod
    public void initializeSeam() {
        seam.reset().use("activityDAO", new ActivityDAO(getSession()))
                .use("textFlowTargetDAO", new TextFlowTargetDAO(getSession()))
                .use("documentDAO", new DocumentDAO(getSession()))
                .use("session", getSession()).ignoreNonResolvable();

        activityService = seam.autowire(ActivityServiceImpl.class);
    }
View Full Code Here

    public void beforeMethod() {
        MockitoAnnotations.initMocks(this);
        // @formatter:off
        seam.reset()
            .use("localeServiceImpl", localeService)
            .use("documentDAO", new DocumentDAO(getSession()))
            .use("projectIterationDAO", new ProjectIterationDAO(getSession()))
            .use("entityManager", new FullTextEntityManagerImpl(getEm()))
            .use("session", new FullTextSessionImpl(getSession()));
        // @formatter:on
        jaHLocale = getEm().find(HLocale.class, 3L);
View Full Code Here

        TransUnitTransformer transUnitTransformer =
            seam.reset().use("resourceUtils", resourceUtils)
                .autowire(TransUnitTransformer.class);

            seam.use("localeServiceImpl", localeService)
                        .use("documentDAO", new DocumentDAO(getSession()))
                        .use("projectIterationDAO",
                                new ProjectIterationDAO(getSession()))
                        .use("entityManager",
                                new FullTextEntityManagerImpl(getEm()))
                        .use("session", new FullTextSessionImpl(getSession()))
View Full Code Here

            return ServiceLocator.instance().getInstance(DocumentDAO.class);
        }

        @Override
        public DocumentStatus load(DocumentLocaleKey key) throws Exception {
            DocumentDAO documentDAO = getDocumentDAO();
            HTextFlowTarget target =
                    documentDAO.getLastTranslatedTarget(key.getDocumentId(),
                            key.getLocaleId());
            DocumentStatus documentStatus = new DocumentStatus();

            return updateDocumentStatus(documentDAO, documentStatus,
                    key.getDocumentId(), target);
View Full Code Here

TOP

Related Classes of org.zanata.dao.DocumentDAO

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.