掲示板

LP 5.2.3 - "open" Organization

15年前 に Stan M によって更新されました。

LP 5.2.3 - "open" Organization

Regular Member 投稿: 208 参加年月日: 08/01/28 最新の投稿
LP 5.2.3 Tomcat

I want (or planning) to convert my Communities to Organizations because I want the hierarchical functionality that Organizations provide. Most of the communties are open, where users can simply join without confirmation from Administrator. They can join via the Summary portlet, supposed to be , or in the My Communities portlet.

Similar to Communities, users can join the organization via the Summary portet. However, a request is sent to the Administrator of the Organization. The admin would have to confirm using the Request portlet. I like to remove this confirmation step.

I am staring at /wol/summary/portlet/SummaryPortlet.java, and it contains this code :


        public void joinOrganization(
                        ActionRequest actionRequest, ActionResponse actionResponse)
                throws Exception {

                ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
                        WebKeys.THEME_DISPLAY);

                Group group = GroupLocalServiceUtil.getGroup(
                        themeDisplay.getScopeGroupId());

                Organization organization =
                        OrganizationLocalServiceUtil.getOrganization(group.getClassPK());

                Role role = RoleLocalServiceUtil.getRole(
                        themeDisplay.getCompanyId(), "Organization Administrator");

                LinkedHashMap<string, object> userParams =
                        new LinkedHashMap<string, object>();

                userParams.put(
                        "userGroupRole",
                        new Long[] {new Long(group.getGroupId()),
                        new Long(role.getRoleId())});

                List<user> users = UserLocalServiceUtil.search(
                        themeDisplay.getCompanyId(), null, Boolean.TRUE, userParams,
                        QueryUtil.ALL_POS, QueryUtil.ALL_POS, (OrderByComparator) null);

                for (User user : users) {
                        SocialRequestLocalServiceUtil.addRequest(
                                themeDisplay.getUserId(), 0, Organization.class.getName(),
                                organization.getOrganizationId(), MembersRequestKeys.ADD_MEMBER,
                                StringPool.BLANK, user.getUserId());
                }
        }
</user></string,></string,>


I think I need to somehow use SocialRequestLocalServiceUtil.updateRequest with a confirm in that code.
thumbnail
15年前 に Amos Fong によって更新されました。

RE: LP 5.2.3 - "open" Organization

Liferay Legend 投稿: 2047 参加年月日: 08/10/07 最新の投稿
Hey Stan,

Look at membersrequestinterpreter.java in the WOL portlet. I think you want to go straight to the code in doProcessConfirmation and skip the whole request creating process.