Interface HiddenApplicationService
public interface HiddenApplicationService
Lets each user hide, for themselves only and on every device, a page
application window that allows it, then show it again. The window types are
contributed by
HiddenApplicationPlugin
beans.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMessage code of the refusal to hide a window that doesn't allow it -
Method Summary
Modifier and TypeMethodDescriptionvoidclearHiddenChoices(String type, String name) Shows a window again to every user who hid it, called when its editor turns its option off.voidcopyHiddenChoices(String type, String fromName, String toName) Hides a window for every user who hid another one, keeping the order they hid it in: called when a window's settings are copied under a new name that the window will carry, so that its users' choices follow it.getHiddenApplications(String username, String language) voidHides a window from its page for one userbooleanbooleanisHideAllowed(String type, String name) voidsetHideAllowed(String type, String name, boolean allowed) Stores whether a window allows each user to hide it, for an application type that keeps no such option of its own.voidShows again, for one user, a window this user hid
-
Field Details
-
HIDE_NOT_ALLOWED
Message code of the refusal to hide a window that doesn't allow it- See Also:
-
-
Method Details
-
hide
void hide(String type, String name, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException Hides a window from its page for one user- Parameters:
type- application typename- window nameusername- user name- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the type or the window doesn't exist, or the user can't view the windowIllegalArgumentException- withHIDE_NOT_ALLOWEDwhen the window doesn't allow hiding
-
show
-
isHidden
-
getHiddenApplications
- Parameters:
username- user namelanguage- language of the returned titles and site labels- Returns:
- the windows the user hid which still allow hiding, are still visible to the user and, for a window on a page, are still on that page, in the order they were hidden. A window that fails to resolve is left out and logged.
-
clearHiddenChoices
-
copyHiddenChoices
Hides a window for every user who hid another one, keeping the order they hid it in: called when a window's settings are copied under a new name that the window will carry, so that its users' choices follow it. It checks nothing: the caller checks that the acting user may read the source, and the target is a window whose settings the caller has just created under that name. The users are read page after page by offset, from a query with no order: a user who shows the source again while the copy runs can shift a later user out of it, whose choice is then not copied.- Parameters:
type- application typefromName- name of the window the users hidtoName- name of the window to hide for them
-
setHideAllowed
Stores whether a window allows each user to hide it, for an application type that keeps no such option of its own. Turning it off shows the window again to every user who hid it: the choices are cleared first and the option removed last, so that a failed clear leaves it on and saving it off again clears the rest. The caller checks that the user may edit the window. A hide that read the option on before it was turned off may still write its choice after the clear; it hides the window again once the option is turned back on.- Parameters:
type- application typename- window nameallowed- whether the window allows hiding
-
isHideAllowed
- Parameters:
type- application typename- window name- Returns:
- the option stored with
setHideAllowed(String, String, boolean), false when never stored
-