掲示板

list of defined segments

thumbnail
9年前 に Pablo Zapico によって更新されました。

list of defined segments

Junior Member 投稿: 48 参加年月日: 10/06/02 最新の投稿
Hello,

How I can see from my portlet development, the list of defined segments?

Thanks
thumbnail
9年前 に Julio Camarero によって更新されました。

RE: list of defined segments (回答)

Liferay Legend 投稿: 1668 参加年月日: 08/07/15 最新の投稿
Hi Pablo,

you can see how we obtain all the values in the method populateViewContext of ContentTargetingPortlet.java

You can call the UserSegmentService to obtain the list of User Segments in a site, for example:

UserSegmentLocalServiceUtil.getUserSegments(long[] groupIds)


The groupId should consider all the parent sites and the global scope also, you can do it this way:


ContentTargetingUtil.getAncestorsAndCurrentGroupIds(themeDisplay.getScopeGroupId()


cheers!
thumbnail
9年前 に Pablo Zapico によって更新されました。

RE: list of defined segments [SOLVED]

Junior Member 投稿: 48 参加年月日: 10/06/02 最新の投稿
Thank you very much. This is great. Congratulations.

P.D: You are the best