Interface ProjectRepository

    • Field Detail

      • PROJECT_NAME_LIKE

        static final java.lang.String PROJECT_NAME_LIKE
        Sub-expressions for filtering and paging projects on different property names.
        See Also:
        Constant Field Values
      • USER_ON_PROJECT

        static final java.lang.String USER_ON_PROJECT
        Sub-expressions for filtering and paging projects on permissions (via user groups and project membership).
        See Also:
        Constant Field Values
      • PROJECT_MANAGER_PERMISSION

        static final java.lang.String PROJECT_MANAGER_PERMISSION
        See Also:
        Constant Field Values
    • Method Detail

      • findAllProjectsByNameExcludingProject

        @PreAuthorize("hasRole(\'ROLE_ADMIN\')")
        @Query("from Project p where (p.name like CONCAT(\'%\', :projectName,\'%\')) and p != :exclude")
        org.springframework.data.domain.Page<Project> findAllProjectsByNameExcludingProject​(@Param("projectName")
                                                                                            java.lang.String name,
                                                                                            @Param("exclude")
                                                                                            Project exclude,
                                                                                            org.springframework.data.domain.Pageable page)
        Load up a page of Projects, excluding the specified Project.
        Parameters:
        name - the name of the project to search for
        exclude - the project to exclude from results
        page - the page request
        Returns:
        a page of Project.
      • findManageableProjectsByName

        @Query("from Project p where (p.name like CONCAT(\'%\', :projectName,\'%\')) and p != :exclude and ((p in (select puj.project from ProjectUserJoin puj where puj.user = :forUser and puj.projectRole = ca.corefacility.bioinformatics.irida.model.enums.ProjectRole.PROJECT_OWNER)) or (p in (select ugpj.project from UserGroupJoin ugj, UserGroupProjectJoin ugpj where ugj.group = ugpj.userGroup and ugj.user = :forUser and ugpj.projectRole = ca.corefacility.bioinformatics.irida.model.enums.ProjectRole.PROJECT_OWNER)))")
        org.springframework.data.domain.Page<Project> findManageableProjectsByName​(@Param("projectName")
                                                                                   java.lang.String name,
                                                                                   @Param("exclude")
                                                                                   Project exclude,
                                                                                   @Param("forUser")
                                                                                   User user,
                                                                                   org.springframework.data.domain.Pageable page)
        Load a page of Projects for a specific User, excluding a Project.
        Parameters:
        name - the name of the project to search for
        exclude - the project to exclude from results
        user - the user account to load projects for
        page - the page request
        Returns:
        a page of Project
      • getRemoteProjects

        @Query("FROM Project p WHERE p.remoteStatus != NULL")
        java.util.List<Project> getRemoteProjects()
        Get a list of all Projects from remote sites
        Returns:
        a list of Project
      • countProjectsCreatedInTimePeriod

        @Query("select count(p.id) from Project p where p.createdDate >= ?1")
        java.lang.Long countProjectsCreatedInTimePeriod​(java.util.Date createdDate)
        Get a count of all Projects created within time period
        Parameters:
        createdDate - the minimum created date for projects
        Returns:
        a count of Projects
      • countProjectsCreatedGrouped

        @Query("select new ca.corefacility.bioinformatics.irida.ria.web.admin.dto.statistics.GenericStatModel(function(\'date_format\', p.createdDate, ?2), count(p.id))from Project p where p.createdDate >= ?1 group by function(\'date_format\', p.createdDate, ?2) order by function(\'date_format\', p.createdDate, ?2) asc")
        java.util.List<GenericStatModel> countProjectsCreatedGrouped​(java.util.Date createdDate,
                                                                     java.lang.String groupByFormat)
        Get a list of GenericStatModels for projects created in the past n time period and grouped by the format provided.
        Parameters:
        createdDate - The minimum created date for projects
        groupByFormat - The format to use for grouping the results.
        Returns:
        A list of GenericStatModels