Class PerspectiveHandler
- java.lang.Object
-
- com.orchestranetworks.ui.perspective.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Perspective>getActivatedPerspectives()Returns all activated perspectives.PerspectivegetAdvancedPerspective()Returns the advanced perspective.List<Perspective>getAllPerspectives()Returns a list of all defined perspectives.PerspectivegetCurrentPerspective(boolean lookupInParentSession)Returns the perspective applied in the current session, or recursively in parent if lookupInParentSession is true.PerspectivegetFavoritePerspective(UserReference aUser)Returns the favorite perspective for a given user.PerspectivegetPerspective(String aPerspectiveName)Returns the perspective for the given name.List<Perspective>getPerspectives(Profile aProfile)Returns all activated and allowed perspectives for a given profile.PerspectivegetPerspectiveToApply(UserReference aUser)Returns the perspective to apply.PerspectivegetRecommendedPerspective(UserReference aUser)Returns the recommended perspective for a given user.static PerspectiveHandlernewInstance(Repository repository, Session aSession)Returns a new instance of the perspective handler.
-
-
-
Method Detail
-
newInstance
public static PerspectiveHandler newInstance(Repository repository, Session aSession)
Returns a new instance of the perspective handler.
-
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. Returnsnullif:- 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. Returnsnullif:- 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.
-
getPerspectiveToApply
public Perspective getPerspectiveToApply(UserReference aUser)
Returns the perspective to apply.- Returns the favorite perspective for a given user.
- If the user has no favorite perspective, returns the recommended perspective.
- If there is no recommended perspective for a given user, returns the first available perspective for the given user.
- Parameters:
aUser- identifies a specific user.- See Also:
getRecommendedPerspective(UserReference),getFavoritePerspective(UserReference),getPerspectives(Profile)
-
getAdvancedPerspective
public Perspective getAdvancedPerspective()
Returns the advanced perspective.
-
getPerspective
public Perspective getPerspective(String aPerspectiveName)
Returns the perspective for the given name. Returnsnullif 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.
- If the current session is a sub session and lookupInParentSession is true, always returns a perspective.
- If the current session is a sub-session and
lookupInParentSessionis false, may returnnull.
-
-