Posts

Showing posts with the label group

Knowing About the layout

We can Check the page whether it is private or public page using layout object. layout.isPrivateLayout() layout.isPublicLayout() layout is an implict object in liferay By using this "layout" object we can get title , description, theme applied to that page, group, Also we can get the child page and parent page details. Forming the dynamic URL PortalUtil.getPathFriendlyURLPublic() : It retrieves "/web" PortalUtil.getPathFriendlyURLPrivateGroup() : It retrieves "/group" themeDisplay.getScopeGroup().getFriendlyURL(): It retrieves site name(ex: guest) So finally we can write as, If we want Public Page URL: PortalUtil.getPathFriendlyURLPublic()+ themeDisplay.getScopeGroup().getFriendlyURL() +StringPool.SLASH + "home"; It will be as "/web/guest/home. Also If we want Private Page URL: PortalUtil.getPathFriendlyURLPrivateGroup()+ themeDisplay.getScopeGroup().getFriendlyURL() + StringPool.SLASH...

Getting the Organization name.

We know we can get the Organization details from the OrganizationLocalServiceUtil. Also we have another option to get those details. It is from the GroupLocalServiceUtil. As we know that whenever we create the Organization it will be created in the " Group " table only. Here I am getting the " Test Organization" Organization Getting the Organization name from the group String defaultOrganizationGroupName = "Test Organization"; defaultOrganizationGroupName +=GroupLocalServiceImpl.ORGANIZATION_NAME_SUFFIX; Group group = GroupLocalServiceUtil.getGroup(companyId,defaultOrganizationGroupName);

Adding Default Roles, sites and userGroup

If we want add the default "UserGroups" , "Groups" and "Roles" to the users, we can use the following methods to add. This will ensure, when user is creating it will assign these "UserGroups" , "Groups" and "Roles" to the users If we look into this " admin.default.role.names " in the portal.properties , it has User and PowerUser added, So whenever user is created, these 2 roles are assigned. Here for admin.default.user.group.names , we have added as CoffeGroup , so this group will be assigned automatically to the newly created user. Note: Whatever value we assign to the property , this should exists in the Portal. i.e  CoffeGroup (user group)should be exist in the portal, before creation of user. 1. UserGroup     #     # Input a list of default user group names separated by \n characters that     # are associated with newly created users.     #     admin.default.user.group.names=CoffeGroup UserLoca...