How to find user's and groups accociated to a particular Content in ektron? - ektron

Am am working on ektron 9.0.
Suppose i have a content in workarea, and had permissions to some users and groups.
How can i find the user's and groups associated with that particular content by ektron api?
Any help on this..
Thanks in advance

Try this
var permissionManager = new PermissionManager(ApiAccessMode.Admin);
var criteria = new PermissionCriteria();
criteria.AddFilter(PermissionProperty.ContentId, CriteriaFilterOperator.EqualTo, contentId);
List<UserPermissionData> permissionDataList = permissionManager.GetList(criteria);
The list of UserPermissionData objects contains a UserId property so you can see what users have permission to that content item. More info can be found in Ektron's documentation.

Related

How to search users in groups and return display names using graph API?

Net core application. I have search box in web application where user can search user belongs to specific group. I am trying as below to search users
var members = await graphClient.Groups["0001b29c-fd90-4ae9-a5a1-h8afe65777e9"].Request().Expand("members").GetAsync();
var usersInGroup = members.Members.ToList();
In the above code I want to apply filter also to list users name starting with. I am struggling to apply filter. Can someone help me to add filters here. Any help would be greatly appreciated. thank you
Please try below API to search users in groups
https://graph.microsoft.com/beta/groups/groupid/members/microsoft.graph.user?$count=true&$orderby=displayName&$search="displayName:sr"&$select=displayName,id
ConsistencyLevel: eventual

Get BlogPost based on Taxonomy

I'm trying to create a custom Blog post rotator for a homepage. It shows the 5 newest posts (Title, summary, date, and link) this works with the following code
var posts = App.WorkWith().BlogPosts().Publihed().Get().OrderByDescending(p => p.PublicationDate).Take(5)ToList();
But I only want to get posts with specific Tags. I'm able to get the Guid associated with a specific tag
TaxonomyManager taxmanager = TaxonomyManager.GetManager();
var taxonGuidId = taxmanager.GetTaxa<FlatTaxon>().Where(t => t.Name == "SpecificTag").Single().Id;
I can foreach through every post and see lots of information but cannot figure out how to determine if the specific Guid is attached to that post. Or take the post and get a list of Taxon; something like
var postTaxon = GetTaxon(BlogPost)
Is there a reason you need to use a custom widget? I would recommend using the standard list widget for blogs select the tag you want to show and then limit it to 5. Once you do that you can then us your JavaScript to create the rotator from the default classes or modify the template to have custom classes.

how to use sessions in my project to store project id and how to match sessions in code

i want to store selected project's project_id in session and check it for the current user who are logged in... and match it in _shared.html.erb file.
how can i write condition in _shared file and how can i match them in controller??\
i am selecting project from dropdown list.
Jquery is needed to do... i got id of selected project in dropdown list but not able to list activity...
#project = Project.find(params[:id])
session[:project_id] = #project.id
is this works to store session?
i want to list all activity acording to project select from dropdown list and make session until i select next project.
all activity should change for the project to my dashboard. and same for other links that also works for it.
if you have any best and understandable ajax video or tutorial link then pls suggest to me....
thanks in advance.. :)
This is the way u can store in sessions.
#project = Project.find(params[:id])
session[:project_id] = #project.id
you are going in right direction. and access this session using
session[:project_id]
where u needed.

Get the current user Liferay using a simple Java code

I'm working with : Liferay 6.0.6 with JBoss 5.1 and Struts2.
My question is, how to get the current user in Liferay once logged in, using a Java code.
In your doView/processAction method do following
User user = (User) request.getAttribute(WebKeys.USER);
or use the ThemeDisplay object. It contains another information like companyId, groupId, ...
ThemeDisplay td =(ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
User user = td.getUser();
Classes ThemeDisplay, User nad WebKeys are part of portal-service.jar.
If you need just some id to identify current user you can also use
String userId = request.getRemoteUser();
This solution is not Liferay specific and should be portable among jsr-286 portals.
Liferay provides Util class
com.liferay.portal.util.PortalUtil
This class contains all utility methods to get the frequently used attributes.
Try using PortalUtil.getUser(PortletRequest portletRequest) method to avoid creating new objects and references.
This is an other possible way to do it :
private LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();
User currentUser=liferayFacesContext.getUser()

Retrieving Interest/Page information out of facebook

Im wondering if there is anyway to interogate facebook data on user interests. i.e. Retrieve the following data sets:
What are the most like interests/Pages on facebook?
Retreive the current users facebook interest and also their friends interests?
Really want to know if we can get facebook global interest/like data and than also if the user connects their facebook account to the site than we can also retrieve their interest data.
Thanks in advance
So you want to implement something like http://www.socialbakers.com/ ?
To get 1) you'd have to periodically poll the API for the public fan count of a known set of page IDs to see the current fan counts ( i think this is what socialbakers do)
To get 2, get the user_likes and friend_likes extended permissions from your users and access the /likes connection of the users whose likes you want to read
Yes you can retrieve user interests from facebook. You just need to include the user_interests permission required in your jsp page.
https://developers.facebook.com/tools/explorer/
If you are using spring social you can generate your own url for /me/interests:
URIBuilder uriBuilder1 = URIBuilder.fromUri(facebook.GRAPH_API_URL + "me" +"/interests");
String s = facebook.restOperations().getForObject(uriBuilder1.build(), String.class);