DEVCON 2026    |    2-5 November 2026 – QEII Centre – London, UK    |    Register now! 

Blogs

Announcements/Alerts to a particular user

Auditya manikanta Vadrevu
Auditya manikanta Vadrevu
Lesen in unter einer Minute

Announcements/Alerts portlet

Through this portlet we can send Announcements/alerts to different types  such as Guests, Organisations, Communities, User Groups, Roles and General (already known and existing).

Now, we can send Announcements/alerts to a particular user only (whether he may a part of community or organisation) based on screen names by adding a new type in Distribution scope of Announcements/alerts known as "Users".

 

here in the distribution scope, "Auditya" is a user screen name .

Add the following code to enable it

                    <optgroup label="<liferay-ui:message key="users" />">
     <%
     int nbrUser = UserLocalServiceUtil.getUsersCount();
     List<User> allUSers = UserLocalServiceUtil.search(company.getCompanyId(),null, null, null, 0, nbrUser, null); 

                        for (User totalusers : allUSers) {

                                <option <%= (classPK == totalusers.getUserId()) ? "selected" : "" %> value="<%= PortalUtil.getClassNameId(User.class) %><%= StringPool.COMMA %><%= totalusers.getUserId() %>"><%= totalusers.getScreenName() %></option>

                                                <%
                                                }
                                                %>       

                                        </optgroup>

in

edit_entry.jsp & view.jsp in /html/portlet/announcments folder

Seitenkommentare

Related Assets...

Keine Ergebnisse gefunden

More Blog Entries...