Class PerspectiveHandler


  • public final class PerspectiveHandler
    extends Object
    An instance of this class offers methods to retrieve the perspectives defined in the current repository.
    Since:
    6.0.0
    • Method Detail

      • getAllPerspectives

        public List<Perspective> getAllPerspectives()
        Returns a list of all defined perspectives.
        • If session's locale exists, the list will be sorted by localized label.
        • If session's locale is null, returns a non-sorted list.
      • getActivatedPerspectives

        public List<Perspective> getActivatedPerspectives()
        Returns all activated perspectives.
      • getPerspectives

        public List<Perspective> getPerspectives​(Profile aProfile)
        Returns all activated and allowed perspectives for a given profile.
        Parameters:
        aProfile - identifies a user profile.
      • getRecommendedPerspective

        public Perspective getRecommendedPerspective​(UserReference aUser)
        Returns the recommended perspective for a given user. Returns null if:
        • The user has no recommended perspective.
        • The recommended perspective is disabled for the user.
        • The recommended perspective is not allowed for the user's profile.
        Parameters:
        aUser - identifies a specific user.
      • getFavoritePerspective

        public Perspective getFavoritePerspective​(UserReference aUser)
        Returns the favorite perspective for a given user. Returns null if:
        • The user has no favorite perspective.
        • the user's favorite perspective is disabled.
        • the user's favorite perspective is not allowed for their profile.
        Parameters:
        aUser - identifies a specific user.
      • getAdvancedPerspective

        public Perspective getAdvancedPerspective()
        Returns the advanced perspective.
      • getPerspective

        public Perspective getPerspective​(String aPerspectiveName)
        Returns the perspective for the given name. Returns null if no perspective is found.
      • getCurrentPerspective

        public Perspective getCurrentPerspective​(boolean lookupInParentSession)
        Returns the perspective applied in the current session, or recursively in parent if lookupInParentSession is true.
        • If the current session is the root session, always returns a perspective. As a last resort, the advanced perspective may be returned even if the user is not allowed to access it.
        • If the current session is a sub session and lookupInParentSession is true, always returns a perspective. As a last resort, the advanced perspective may be returned even if the user is not allowed to access it.
        • If the current session is a sub-session and lookupInParentSession is false, may return null.