Interface ProjectVisibilityHolder

  • All Known Implementing Classes:
    ProjectVisibilityHolderImpl

    public interface ProjectVisibilityHolder
    Created by Andrey Titov on 1/10/17.
    • Method Detail

      • getKnownProjects

        @NotNull
        Collection<String> getKnownProjects()
        Returns:
        A collection of project internal ids which were shown or hidden by the user. The list is not ordered by user preferences.
      • getKnownVisibleProjects

        @NotNull
        Collection<String> getKnownVisibleProjects()
        Returns:
        A collection of project internal ids which were explicitly shown by the user. The list is ordered by user preferences.
      • getVisibleAndUnknownProjects

        @NotNull
        List<String> getVisibleAndUnknownProjects()
        Returns:
        A list of project internal ids which were explicitly shown by the user or are new. The list is ordered by user preferences.
      • getAllProjects

        @NotNull
        List<String> getAllProjects()
        Returns:
        A list of projects ordered projects accessible to the user ordered by user preferences.
      • getProjectsOrder

        @NotNull
        List<String> getProjectsOrder()
        Returns:
        The order of projects configured by the user
      • setProjectsOrder

        void setProjectsOrder​(@NotNull
                              List<String> projectsOrder)

        Store projects order for user`s Overview page

        Parameters:
        projectsOrder - a list of project internal ids. Projects in this list will be ordered, other projects will appear after them in system order.
      • showProjects

        void showProjects​(@NotNull
                          String... projectIds)

        Set projects to be visible on the user`s Overview page. Doesn't affect other projects visibility. Doesn't affect projects ordering.

        Parameters:
        projectId -
      • setVisibleProjects

        void setVisibleProjects​(@NotNull
                                Collection<String> visibleProjects)

        Set projects to be visible on the user`s Overview page. Overrides old data. Doesn't affect projects ordering.

        Parameters:
        projectId -
      • hideProjects

        void hideProjects​(@NotNull
                          String... projectId)

        Set projects to be hidden on the user`s Overview page. Doesn't affect other projects visibility. Doesn't affect projects ordering.

        Parameters:
        projectId -
      • isHasHiddenProjects

        boolean isHasHiddenProjects()
        Returns:
        true if the user has at least one hidden project.
      • isConfiguredVisibleProjects

        boolean isConfiguredVisibleProjects()
        Returns:
        true if the user has at least one configured project visibility state (hidden or visible).
      • getFilteredVisibleBuildTypes

        @NotNull
        SortedMap<SProject,​List<SBuildType>> getFilteredVisibleBuildTypes​(@Nullable
                                                                                BuildTypeFilter filter)
        Parameters:
        filter -
        Returns:
        filtered with BuildTypeFilter map containing all non-hidden build types grouped by their projects. Empty projects are included to the map. The map is ordered by user preferences.
      • getOrderedBuildTypes

        @NotNull
        List<SBuildType> getOrderedBuildTypes​(@Nullable
                                              SProject project)
        Parameters:
        project -
        Returns:
        a list of non-hidden build types in the provided SProject. All non-hidden build types if null. Build types are ordered by user preferences. 'Unknown' build types are placed in the end of the list.
      • getAllBuildTypesOrdered

        @NotNull
        List<SBuildType> getAllBuildTypesOrdered​(@Nullable
                                                 SProject project)
        Parameters:
        project -
        Returns:
        a list of build types in the provided SProject. All build types if null. Build types are ordered by user preferences. Hidden build types and 'unknown' build types are placed in the end of the list.
      • setBuildTypesOrder

        void setBuildTypesOrder​(@NotNull
                                SProject project,
                                @NotNull
                                List<SBuildType> visible,
                                @NotNull
                                List<SBuildType> invisible)

        Store build types order for user`s Overview page in the provided SProject

        Parameters:
        project -
        visible - build types to reorder
        invisible - build type hide
      • getBuildTypesOrder

        @NotNull
        Collection<SBuildType> getBuildTypesOrder​(@NotNull
                                                  SProject project)
        Parameters:
        project -
        Returns:
        a collection of visible build types ordered by user preferences
      • resetBuildTypesOrder

        void resetBuildTypesOrder​(@NotNull
                                  SProject project)

        Reset build types order in the provided SProject

        Parameters:
        project -
      • getNewProjects

        @NotNull
        Collection<String> getNewProjects()
        Returns:
        a collection of projects which are new to the user - the user didn't show or hide them.
      • isProjectNew

        boolean isProjectNew​(@NotNull
                             String projectId)
      • getAllProjectsOrdered

        @NotNull
        List<SProject> getAllProjectsOrdered()

        Projects will be ordered hierarchically, then respecting user project visibility (so that projects in visible list (see getKnownVisibleProjects()) will precede others - and also projects containing a child in visible list will precede others), and finally system order.

        Returns:
        a list of projects ordered with user preferences, system projects order and hierarchy
      • isTooManyVisibleProjectsToShowOnOverviewByDefault

        boolean isTooManyVisibleProjectsToShowOnOverviewByDefault()
      • isProjectVisible

        boolean isProjectVisible​(@NotNull
                                 String internalId)
      • resetCaches

        void resetCaches()