Package org.ametys.web.clientsideelement
Class LivePageClientSideElement
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.ui.StaticFileImportsClientSideElement
-
- org.ametys.core.ui.StaticClientSideElement
-
- org.ametys.web.clientsideelement.AbstractPageClientSideElement
-
- org.ametys.web.clientsideelement.LivePageClientSideElement
-
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
public class LivePageClientSideElement extends AbstractPageClientSideElement
ThisClientSideElement
creates a button that will be enabled if page and its hierarchy is valid.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
-
Field Summary
Fields Modifier and Type Field Description private GroupManager
_foGroupsManager
TheGroupManager
for front-end groupsprivate UserManager
_foUsersManager
TheUserManager
for front-end usersprivate I18nUtils
_i18nUtils
TheI18nUtils
private UserHelper
_userHelper
private UserManager
_userManager
TheUserManager
-
Fields inherited from class org.ametys.web.clientsideelement.AbstractPageClientSideElement
_resolver, _synchronizeComponent
-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description LivePageClientSideElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String
_getBody(User sender, User user, Page page, String comment)
Get the email bodyprivate Set<User>
_getDistinctUsers(List<UserIdentity> userIdentities, List<GroupIdentity> groupIdentities)
private String
_getSender(User sender, Page page)
Get the email senderprivate String
_getSubject(User sender, Page page)
Get the email subjectboolean
sendOnlineNotification(List<String> pageIds, List<Map<String,String>> users, List<Map<String,String>> groups, String comment)
Send a notification for online pages.void
service(ServiceManager smanager)
-
Methods inherited from class org.ametys.web.clientsideelement.AbstractPageClientSideElement
getAllRightPageDescription, getNoModifiablePageDescription, getNoRightPageDescription, getPageDefaultParameters, hasRight
-
Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureClass, _configureParameters, _configureScript, configureInitialParameters
-
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, configure, getDependencies, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_userManager
private UserManager _userManager
TheUserManager
-
_foUsersManager
private UserManager _foUsersManager
TheUserManager
for front-end users
-
_foGroupsManager
private GroupManager _foGroupsManager
TheGroupManager
for front-end groups
-
_i18nUtils
private I18nUtils _i18nUtils
TheI18nUtils
-
_userHelper
private UserHelper _userHelper
-
-
Constructor Detail
-
LivePageClientSideElement
public LivePageClientSideElement()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractPageClientSideElement
- Throws:
ServiceException
-
sendOnlineNotification
public boolean sendOnlineNotification(List<String> pageIds, List<Map<String,String>> users, List<Map<String,String>> groups, String comment)
Send a notification for online pages.- Parameters:
pageIds
- the ids of the pagesusers
- the users that will be notifiedgroups
- the groups that will be notifiedcomment
- the comment of the notifier- Returns:
- true
-
_getSender
private String _getSender(User sender, Page page)
Get the email sender- Parameters:
sender
- The user responsible for the actionpage
- The published page- Returns:
- The sender
-
_getSubject
private String _getSubject(User sender, Page page)
Get the email subject- Parameters:
sender
- The user responsible for the notificationpage
- The published page- Returns:
- The email subject
-
_getBody
private String _getBody(User sender, User user, Page page, String comment)
Get the email body- Parameters:
sender
- The user responsible for the notificationuser
- The recipient of the notificationpage
- The published pagecomment
- The user's comment. Can be empty or null.- Returns:
- The email body
-
_getDistinctUsers
private Set<User> _getDistinctUsers(List<UserIdentity> userIdentities, List<GroupIdentity> groupIdentities)
-
-