RE: Need info about the javascript function

Mohammed Sulaiman, modified 6 Years ago. New Member Posts: 18 Join Date: 7/7/17 Recent Posts
I was going through the source code of usergroup admin portlet's view.jsp, where we have javascript function to get the user's count of user group.

function <portlet:namespace />getUsersCount(className, ids, status, callback) {
        
        AUI.$.ajax(
            '<%= themeDisplay.getPathMain() %>/user_groups_admin/get_users_count',
            {
                data: {
                    className: className,
                    ids: ids,
                    status: status
                },
            }
        );
    } 


 but iam unable to understand this line  "<%=themeDisplay.getPathMain() %>/user_groups_admin/get_users_count ".
Is this a json web service or just invocation of method which returns a count number.

Thanks.
thumbnail
Nader Jafari, modified 6 Years ago. Junior Member Posts: 84 Join Date: 8/24/11 Recent Posts
Hi
Search this path in struts-config.xml file.
This is like a json action.
Mohammed Sulaiman, modified 6 Years ago. New Member Posts: 18 Join Date: 7/7/17 Recent Posts
Sorry,I couldn't find this path in struct-config.xml file
thumbnail
Nader Jafari, modified 6 Years ago. Junior Member Posts: 84 Join Date: 8/24/11 Recent Posts
I just find get_users_count  mvc command in this class : com.liferay.users.admin.web.internal.portlet.action.GetUsersCountMVCResourceCommand.
you can found this class in this path : modules\apps\users-admin\users-admin-web\src\main\java\com\liferay\users\admin\web\internal\portlet\action
Mohammed Sulaiman, modified 6 Years ago. New Member Posts: 18 Join Date: 7/7/17 Recent Posts
Thank you so much for your reply.
But  in the view.jsp, resource url  has "themeDisplay.getPathMain()" is appended which in turn returns "/c" ,
but in the GetUsersCountMVCResourceCommand.java class we have component property
"mvc.command.name=/users_admin/get_users_count" in which we dont have any  "/c",
so why "/c" is added and what does it convey's here ?.

Once again thanks for help @Nader Jafari.
thumbnail
Nader Jafari, modified 6 Years ago. Junior Member Posts: 84 Join Date: 8/24/11 Recent Posts
This is a url pattern that you can find in liferay-web.xml and handled with com.liferay.portal.servlet.filters.secure.SecureFilter .
in a simple word : The user needs to be logged on to the portal first to see these URls.
Mohammed Sulaiman, modified 6 Years ago. New Member Posts: 18 Join Date: 7/7/17 Recent Posts
Thank you once again @Nader Jafari.