001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.enterpriseadmin.util;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.util.OrderByComparator;
020    import com.liferay.portal.model.Address;
021    import com.liferay.portal.model.EmailAddress;
022    import com.liferay.portal.model.Group;
023    import com.liferay.portal.model.OrgLabor;
024    import com.liferay.portal.model.Organization;
025    import com.liferay.portal.model.Phone;
026    import com.liferay.portal.model.Role;
027    import com.liferay.portal.model.User;
028    import com.liferay.portal.model.UserGroup;
029    import com.liferay.portal.model.UserGroupRole;
030    import com.liferay.portal.model.Website;
031    import com.liferay.portal.security.permission.PermissionChecker;
032    
033    import java.util.List;
034    
035    import javax.portlet.ActionRequest;
036    import javax.portlet.PortletRequest;
037    import javax.portlet.RenderResponse;
038    
039    import javax.servlet.http.HttpServletRequest;
040    
041    /**
042     * @author Brian Wing Shun Chan
043     * @author Jorge Ferrer
044     * @author Julio Camarero
045     */
046    public interface EnterpriseAdmin {
047    
048            public static final String CUSTOM_QUESTION = "write-my-own-question";
049    
050            public void addPortletBreadcrumbEntries(
051                            Organization organization, HttpServletRequest request,
052                            RenderResponse renderResponse)
053                    throws Exception;
054    
055            public String getCssClassName(Role role);
056    
057            public long[] addRequiredRoles(long userId, long[] roleIds)
058                    throws PortalException, SystemException;
059    
060            public long[] addRequiredRoles(User user, long[] roleIds)
061                    throws PortalException, SystemException;
062    
063            public List<Role> filterGroupRoles(
064                            PermissionChecker permissionChecker, long groupId, List<Role> roles)
065                    throws PortalException, SystemException;
066    
067            public List<Group> filterGroups(
068                            PermissionChecker permissionChecker, List<Group> groups)
069                    throws PortalException, SystemException;
070    
071            public List<Organization> filterOrganizations(
072                            PermissionChecker permissionChecker,
073                            List<Organization> organizations)
074                    throws PortalException, SystemException;
075    
076            public List<Role> filterRoles(
077                    PermissionChecker permissionChecker, List<Role> roles);
078    
079            public List<UserGroupRole> filterUserGroupRoles(
080                            PermissionChecker permissionChecker,
081                            List<UserGroupRole> userGroupRoles)
082                    throws PortalException, SystemException;
083    
084            public List<UserGroup> filterUserGroups(
085                    PermissionChecker permissionChecker, List<UserGroup> userGroups);
086    
087            public List<Address> getAddresses(ActionRequest actionRequest);
088    
089            public List<EmailAddress> getEmailAddresses(ActionRequest actionRequest);
090    
091            public OrderByComparator getGroupOrderByComparator(
092                    String orderByCol, String orderByType);
093    
094            public Long[][] getLeftAndRightOrganizationIds(long organizationId)
095                    throws PortalException, SystemException;
096    
097            public Long[][] getLeftAndRightOrganizationIds(Organization organization);
098    
099            public Long[][] getLeftAndRightOrganizationIds(
100                    List<Organization> organizations);
101    
102            public Long[] getOrganizationIds(List<Organization> organizations);
103    
104            public OrderByComparator getOrganizationOrderByComparator(
105                    String orderByCol, String orderByType);
106    
107            public List<OrgLabor> getOrgLabors(ActionRequest actionRequest);
108    
109            public OrderByComparator getPasswordPolicyOrderByComparator(
110                    String orderByCol, String orderByType);
111    
112            public List<Phone> getPhones(ActionRequest actionRequest);
113    
114            public OrderByComparator getRoleOrderByComparator(
115                    String orderByCol, String orderByType);
116    
117            public OrderByComparator getUserGroupOrderByComparator(
118                    String orderByCol, String orderByType);
119    
120            public List<UserGroupRole> getUserGroupRoles(PortletRequest portletRequest)
121                    throws SystemException, PortalException;
122    
123            public OrderByComparator getUserOrderByComparator(
124                    String orderByCol, String orderByType);
125    
126            public List<Website> getWebsites(ActionRequest actionRequest);
127    
128            public boolean hasUpdateEmailAddress(
129                            PermissionChecker permissionChecker, User user)
130                    throws PortalException, SystemException;
131    
132            public boolean hasUpdateScreenName(
133                            PermissionChecker permissionChecker, User user)
134                    throws PortalException, SystemException;
135    
136            public long[] removeRequiredRoles(long userId, long[] roleIds)
137                    throws PortalException, SystemException;
138    
139            public long[] removeRequiredRoles(User user, long[] roleIds)
140                    throws PortalException, SystemException;
141    
142            public void updateAddresses(
143                            String className, long classPK, List<Address> addresses)
144                    throws PortalException, SystemException;
145    
146            public void updateEmailAddresses(
147                            String className, long classPK, List<EmailAddress> emailAddresses)
148                    throws PortalException, SystemException;
149    
150            public void updateOrgLabors(long classPK, List<OrgLabor> orgLabors)
151                    throws PortalException, SystemException;
152    
153            public void updatePhones(String className, long classPK, List<Phone> phones)
154                    throws PortalException, SystemException;
155    
156            public void updateWebsites(
157                            String className, long classPK, List<Website> websites)
158                    throws PortalException, SystemException;
159    
160    }