Package org.zanata.dao

Examples of org.zanata.dao.ProjectDAO


        @Override
        protected List<HProject> fetchRecords(int start, int max,
                String filter) {
            ServiceLocator serviceLocator = ServiceLocator.instance();
            ProjectDAO projectDAO =
                    serviceLocator.getInstance(ProjectDAO.class);
            HAccount authenticatedAccount =
                    serviceLocator
                            .getInstance(JpaIdentityStore.AUTHENTICATED_USER,
                                    HAccount.class);
            return projectDAO.getProjectsForMaintainer(
                    authenticatedAccount.getPerson(), filter, start, max);
        }
View Full Code Here


        }

        @Override
        protected long fetchTotalRecords(String filter) {
            ServiceLocator serviceLocator = ServiceLocator.instance();
            ProjectDAO projectDAO =
                    serviceLocator.getInstance(ProjectDAO.class);
            HAccount authenticatedAccount =
                    serviceLocator
                            .getInstance(JpaIdentityStore.AUTHENTICATED_USER,
                                    HAccount.class);
            return projectDAO.getMaintainedProjectCount(
                    authenticatedAccount.getPerson(), filter);
        }
View Full Code Here

        this.filterObsolete = filterObsolete;
    }

    @Override
    public DataPage<HProject> fetchPage(int startRow, int pageSize) {
        ProjectDAO projectDAO =
                ServiceLocator.instance().getInstance(ProjectDAO.class);
        List<HProject> proj =
                projectDAO.getOffsetListOrderByName(startRow, pageSize,
                        filterActive, filterReadOnly, filterObsolete);

        int projectSize =
                projectDAO.getFilterProjectSize(filterActive, filterReadOnly,
                        filterObsolete);

        return new DataPage<HProject>(projectSize, startRow, proj);
    }
View Full Code Here

        setPageSize(pageSize);
    }

    @Override
    public DataPage<HProject> fetchPage(int startRow, int pageSize) {
        ProjectDAO projectDAO =
                ServiceLocator.instance().getInstance(ProjectDAO.class);

        try {
            List<HProject> proj =
                    projectDAO.searchProjects(query, pageSize, startRow,
                            includeObsolete);

            int projectSize =
                    projectDAO.getQueryProjectSize(query, includeObsolete);

            return new DataPage<HProject>(projectSize, startRow, proj);

        } catch (ParseException e) {
            return null;
View Full Code Here

        SeamAutowire.instance().reset();
    }

    @Test
    public void autowireSession() {
        ProjectDAO dao =
                SeamAutowire.instance().ignoreNonResolvable()
                        .use("session", getSession())
                        .autowire(ProjectDAO.class);

        int t = dao.getTotalProjectCount();
        // System.out.println("Total Projects: " + t);
    }
View Full Code Here

        // System.out.println("Total Projects: " + t);
    }

    @Test
    public void autowireProvided() {
        ProjectDAO dao = new ProjectDAO();
        dao =
                SeamAutowire.instance().ignoreNonResolvable()
                        .use("session", getSession()).autowire(dao);

        int t = dao.getTotalProjectCount();
        // System.out.println("Total Projects: " + t);
    }
View Full Code Here

    @Test
    public void ignoreTranslationsFromObsoleteProjectAndVersion()
            throws Exception {
        ProjectIterationDAO projectIterationDAO =
                seam.autowire(ProjectIterationDAO.class);
        ProjectDAO projectDAO = seam.autowire(ProjectDAO.class);

        // Make versions and projects obsolete
        HProjectIteration version =
                projectIterationDAO.getBySlug("same-project", "same-version");
        assert version != null;
        version.setStatus(EntityStatus.OBSOLETE);
        projectIterationDAO.makePersistent(version);

        HProject project = projectDAO.getBySlug("different-project");
        assert project != null;
        project.setStatus(EntityStatus.OBSOLETE);
        projectDAO.makePersistent(project);

        // Run the copy trans scenario (very liberal, but nothing should be
        // translated)
        CopyTransExecution execution =
                new CopyTransExecution(IGNORE, IGNORE, IGNORE, true, true,
View Full Code Here

        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);
View Full Code Here

TOP

Related Classes of org.zanata.dao.ProjectDAO

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.