Kentico: Limiting number of contacts to load in contact application - kentico

is it possible to load only recent 10000 contacts in Kentico contact application? Right now, the number of entries in om_contact has more than a million and Contact application won't load.
Is there any other way as all of the contacts are important to us.
One of they way could be to archive table data and delete old one but users won't be able to work on them from Admin UI.

Related

How Should I check if someone is in a certain location when Database Updates

I'm currently trying to build something similar to Amber Alerts where whenever a database table is updated, I check if users are in a certain area.
For example, let's say a user makes a report that they found a wallet at their current location. The database is updated where a new row is created with the latitude and longitude of that report location, and then I want to check which users are in a 5 mile radius of that lat-long.
I have every user's phone number but that's about it. I am successfully able to get the location of the report (my frontend provides that in the request data to the backend) but I'm unsure on how to get the location of other users.
How would I do this?
I am using Node JS for my backend and React Native for my frontend.
Thanks!

When is the ideal time to store user session data for e-commerce platforms such as products viewed?

We have a an ecommerce platform where we need to store user session data in a database such as products viewed and products liked. When is the right time to call an API to store this data?
I don't want to call an API every time they open a new product.
I've experimented with DOM methods such as visibilitychange but on our website, every product is opened in a new tab so it's not ideal.
Should we use some background scripts such as service workers?

How can I show list of groups with count of the group's participants with the groups in social media app?

I am working on a social media react-native app with Node JS in the backend having approx 1 million users.
I have to show a list of suggested groups to the user with the total members in the group.
Currently, I am using a count query that is taking time to calculate the total members each time.
What should I do to optimize this API or scenario?
That's a good Question. First approach is add a column in each table. 2nd approach is create a new table of count. In count table save all the counts of the app. 3rd approach is using the DB cache or backend cache.

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!

Finding available Rooms for an specific Site and create Room reservation from XPages interface

I need to create a mobile application where users can book a Room and send Calendar invite to selected users.
I want to create an interface where users will:
Select a Site
Select a Date and Time
Find Available Rooms
Choose a Room
Select attendees
Create Room Reservation and Calendar Invite
Can somebody point me in the right direction?
I found this link, but, I'm still confused on how to get started with Rooms and Calendar API.
Any help will be highly appreciated.
ENVIRONMENT:
I'm running 9.0.1 with embedded Extension Library; I'm not using a version from openNTF
There are a number of steps you have to do to get there. The calendar API currently (to my best knowledge) doesn't expose rooms and resources. So you have to find them yourself. Steps:
Loop through the ($Rooms) view in names.nsf to get a list of available rooms
Get the server name, the NSF name, so together with "($Reservations)" you can construct the view name where all reservations are for that room
Keep the room name, capacity and the site, so you can show them in your UI
The Freetime lookup is not exposed in the API, nor is the find rooms. There's a freetime lookup service you can use
Iterate through the rooms on the site to see what's free (of course you can disect the mail template)
Then you can create an entry using the Calendar API. Yes it is messy

Resources