Get List of users who viewed blog in liferay - liferay

I want the list of users who viewed blog in liferay . I am able to get no of views from AssetEntry table . but I want list of users who visited the blog .
Is there any solution for that problem ?

There is no direct solution/configuration for your requirement.
One solution:
You may override struts-action(/blogs/view_entry) using plugin-hook.
In your custom struts-action class, you can store user detail with blog-id in custom database table(using service builder).
Later, you can fetch user detail who viewed blog using service API.

Related

Is it possible through the REST api to retreive which sites a specific user is following in Sharepoint?

Using the SharePoint REST api or search API, is it possible to retrieve a full list of all the sites a specific user is following? All I can find in the documentation is https://<sharepoint>/_api/social.following/my/followed(types=4) which only works for the current logged in user.
I don't think this is possible. The below are the only available endpoints:
Follow
StopFollowing
IsFollowed
My
My/FollowedDocumentsUri
My/FollowedSitesUri
My/Followed
My/FollowedCount
My/Followers
My/Suggestions
GetMySuggestions
IsMyPeopleListPublic
AmIFollowedBy
GetPeopleFollowedBy
GetFollowersFor
Reference

Liferay database table work flow?

I am new to Liferay. Now I need to create the flow chart which has the Liferay table work flow in following scenarios,
1) What are the list of table will reflect/update if we create the site admin?
2) What are the list of table will reflect/update if we create the site?
I tried by opening database tables and noticed that USER_, CONTACT_ will reflect, But I need list of all the related tables which will reflect when we create the site and siteadmin? I am using Liferay 6.2 version.
Thanks in advance.
When you want to know the internals of any system it is always best to check the relevant source-code. So in this case you can check the source-code for those classes which are used for CRUD operations on User and Site.
1) What are the list of table will reflect/update if we create the site admin?
Site-administrator is a Role, which can be applied to a User created in Liferay.
So if you want all the tables that are created from User-creation till User is assigned the Site-administrator role for a particular site, there here are some which I can recollect:
User_ (Obvious)
Contact_ (not so obvious :-) )
Group_ (Users are also created as a record in this table since Users have public and private pages)
Address (if you add an address)
Phone (if you add a Phone)
Users_Roles (Power user role is assigned by default)
UserGroupRole (user and site-role relationship, Site-administrator is a Site-role)
Users_Groups (user and site relationship)
For others you should refer the source-code for UserLocalServiceImpl, RoleLocalServiceImpl and GroupLocalServiceImpl, check the relevant methods prefixed add, update etc.
The corresponding service.xml for these module would reveal the database tables being used.
2) What are the list of table will reflect/update if we create the site?
Sites are nothing but Groups in Liferay. So its obvious Group_ table is playing a big role.
Other tables also depend upon what configuration you are doing while creating a Site.
Then there would be other tables like Layout when you start creating pages for a Site.
I would strongly encourage to go ahead and explore the source code for the classes and you would understand the flow - when and what tables are affected.
Here is some convention which might help you traverse the source-code, almost every *LocalServiceImpl is associated with a *Model like UserLocalServiceImpl with UserModel and almost every *Model has a corresponding database table with the same name.
Also the name of the functionality would in most cases hints at what service classes are being used to connect to database, like adding a User would hint at using UserLocalServiceImpl.
Hope I have understood your question and have been able to give some proper direction.
If you want to know this because you also want to write to these tables: Don't go there! You should purely use the API to change the data that Liferay stores. Otherwise you will run into disasters some time in the future - promised.
For just getting the SQL commands that Liferay actually uses, configure portal-ext.properties and change this default value:
hibernate.show_sql=false
Then go to "Server Administration/Log Levels" and add a new category "org.hibernate.SQL", configure it to the level DEBUG. Then the results show up in the logs. Note that this log configuration is transient and will be reverted on next server start. If you want the setting to be persistent, you'll need to go into Liferay's log4j configuration files.
Remember: You don't want to write to the tables ever. Promise!

Get all the twitter account in sharepoint

In SharePoint 2013 we have a about me for all the employees that work at our company.
I would like to get for example all the employees that have filled in a twitter account in their ABOUT ME page in SP2013.
So I could do something with their twitter account, all be storing it in a array.
Im using a sharepoint hosted app, so the preffered programing language is jscript.
The question is how to get this data out of the about me for all employees?
The "About Me" page in SharePoint is really just a UI layer for data specific to the User whose page you're on; for the data you describe, it sounds like your users have the ability to add to their User Profile their Twitter handle.
If that's the case, it's fairly straightforward to query data from the User Profile Service using the JSOM (JavaScript Object Model). This MSDN article should be more than enough to get you started: http://msdn.microsoft.com/en-us/library/office/jj920104%28v=office.15%29.aspx
A note of guidance; if your users are instead putting their Twitter handle inside some block of multi-line text, like say a "Summary" property on their User Profile, I would strongly recommend updating your User Profiles to include a custom property for storing their Twitter handle (reference here). SharePoint makes it fairly easy to add custom User Profile properties and so having to otherwise parse something like a Twitter handle out of a block of text would be unnecessarily complicated & likely perform worse.

Displaying Sharepoint User profile information and creating custom search

I have to display user profiles along with their properties in a gridview in a Sharepoint application. Post that it should display results based on the search criteria being made.
I have tried using foreach loop using UserProfileeManager, but it seems very slow when a search is made for 3000 user profiles.
Is there any way to store all the user profile information somewhere in SQL database, or If any webservice can be used.
Kindly help!
Instead of going for seperate SQL DB.
Get the user profile details and store it in SharePoint list on your site.
Perform the search on that list so that it will increase the performance.
To display in gridview you can do it in lot of ways if the data in SharePoint List.
Hope it helps.
don't understand your platform clearly,since you already known store the info in DB,just store it,such as MySQL of windows,*nix and SQLite for android and iOS.Good luck. u wanna do some search,then if it is simple find ,the use sql 'select xxx,yyy from table where ....';that's ok.Good Luck.

Set field via URL

Is it possible to have a field in the current item be changed by clicking a URL? The field would be a choice field with predefined choices.
Such as if the item field is currently:
Status: 2
If a user clicks the link, the field would now be:
Status: 3
If not, is there any other way for a user to easily change a field in the current item without actually haveing to visit the item?
Thanks!
Not Out Of The Box (OOTB) - but you've a few options.
Write an ASPX page to do what you want
Use something like SPServices and javascript to update the list item via the web services.
Use the Client Object Model (2010 only)
By the way - changing stuff on a 'get' can be dangerous as you can do malicious things - for example imagine you have a page that deletes the users account without any prompting (exact example doesn't matter) - what if someone clicks on that link by mistake or even worse what about an email sent with an image with that page as source URL - simply viewing the email could delete the users account.
It's not possible by using a GET request, but SharePoint 2010 is offering a RESTful API to manage ListItems from any client
The REST API is located within the virtual WebServices folgder under each SharePoint Site.
http://YourSharePointSite/_vti_bin/ListData.svc.
To perform an update on SharePoint ListItems you have to create a PUT Request. For more information on SharePoints REST API you should have a look at this MSDN site, there are also a lot of samples linked from this article.
Thorsten

Resources