001 /** 002 * Copyright (c) 2000-present 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.portal.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 022 import com.liferay.portal.kernel.security.access.control.AccessControlled; 023 import com.liferay.portal.kernel.transaction.Isolation; 024 import com.liferay.portal.kernel.transaction.Propagation; 025 import com.liferay.portal.kernel.transaction.Transactional; 026 027 /** 028 * Provides the remote service interface for Organization. Methods of this 029 * service are expected to have security checks based on the propagated JAAS 030 * credentials because this service can be accessed remotely. 031 * 032 * @author Brian Wing Shun Chan 033 * @see OrganizationServiceUtil 034 * @see com.liferay.portal.service.base.OrganizationServiceBaseImpl 035 * @see com.liferay.portal.service.impl.OrganizationServiceImpl 036 * @generated 037 */ 038 @AccessControlled 039 @JSONWebService 040 @ProviderType 041 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 042 PortalException.class, SystemException.class}) 043 public interface OrganizationService extends BaseService { 044 /* 045 * NOTE FOR DEVELOPERS: 046 * 047 * Never modify or reference this interface directly. Always use {@link OrganizationServiceUtil} to access the organization remote service. Add custom service methods to {@link com.liferay.portal.service.impl.OrganizationServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 048 */ 049 050 /** 051 * Adds the organizations to the group. 052 * 053 * @param groupId the primary key of the group 054 * @param organizationIds the primary keys of the organizations 055 */ 056 public void addGroupOrganizations(long groupId, long[] organizationIds) 057 throws PortalException; 058 059 /** 060 * Adds an organization with additional parameters. 061 * 062 * <p> 063 * This method handles the creation and bookkeeping of the organization 064 * including its resources, metadata, and internal data structures. 065 * </p> 066 * 067 * @param parentOrganizationId the primary key of the organization's parent 068 organization 069 * @param name the organization's name 070 * @param type the organization's type 071 * @param regionId the primary key of the organization's region 072 * @param countryId the primary key of the organization's country 073 * @param statusId the organization's workflow status 074 * @param comments the comments about the organization 075 * @param site whether the organization is to be associated with a main 076 site 077 * @param addresses the organization's addresses 078 * @param emailAddresses the organization's email addresses 079 * @param orgLabors the organization's hours of operation 080 * @param phones the organization's phone numbers 081 * @param websites the organization's websites 082 * @param serviceContext the service context to be applied (optionally 083 <code>null</code>). Can set asset category IDs, asset tag names, 084 and expando bridge attributes for the organization. 085 * @return the organization 086 */ 087 public com.liferay.portal.model.Organization addOrganization( 088 long parentOrganizationId, java.lang.String name, 089 java.lang.String type, long regionId, long countryId, long statusId, 090 java.lang.String comments, boolean site, 091 java.util.List<com.liferay.portal.model.Address> addresses, 092 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 093 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors, 094 java.util.List<com.liferay.portal.model.Phone> phones, 095 java.util.List<com.liferay.portal.model.Website> websites, 096 com.liferay.portal.service.ServiceContext serviceContext) 097 throws PortalException; 098 099 /** 100 * Adds an organization. 101 * 102 * <p> 103 * This method handles the creation and bookkeeping of the organization 104 * including its resources, metadata, and internal data structures. 105 * </p> 106 * 107 * @param parentOrganizationId the primary key of the organization's parent 108 organization 109 * @param name the organization's name 110 * @param type the organization's type 111 * @param regionId the primary key of the organization's region 112 * @param countryId the primary key of the organization's country 113 * @param statusId the organization's workflow status 114 * @param comments the comments about the organization 115 * @param site whether the organization is to be associated with a main 116 site 117 * @param serviceContext the service context to be applied (optionally 118 <code>null</code>). Can set asset category IDs, asset tag names, 119 and expando bridge attributes for the organization. 120 * @return the organization 121 */ 122 public com.liferay.portal.model.Organization addOrganization( 123 long parentOrganizationId, java.lang.String name, 124 java.lang.String type, long regionId, long countryId, long statusId, 125 java.lang.String comments, boolean site, 126 com.liferay.portal.service.ServiceContext serviceContext) 127 throws PortalException; 128 129 /** 130 * Assigns the password policy to the organizations, removing any other 131 * currently assigned password policies. 132 * 133 * @param passwordPolicyId the primary key of the password policy 134 * @param organizationIds the primary keys of the organizations 135 */ 136 public void addPasswordPolicyOrganizations(long passwordPolicyId, 137 long[] organizationIds) throws PortalException; 138 139 /** 140 * Deletes the organization's logo. 141 * 142 * @param organizationId the primary key of the organization 143 */ 144 public void deleteLogo(long organizationId) throws PortalException; 145 146 /** 147 * Deletes the organization. The organization's associated resources and 148 * assets are also deleted. 149 * 150 * @param organizationId the primary key of the organization 151 */ 152 public void deleteOrganization(long organizationId) 153 throws PortalException; 154 155 /** 156 * Returns the organization with the primary key. 157 * 158 * @param organizationId the primary key of the organization 159 * @return the organization with the primary key, or <code>null</code> if an 160 organization with the primary key could not be found or if the 161 user did not have permission to view the organization 162 */ 163 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 164 public com.liferay.portal.model.Organization fetchOrganization( 165 long organizationId) throws PortalException; 166 167 /** 168 * Returns the OSGi service identifier. 169 * 170 * @return the OSGi service identifier 171 */ 172 public java.lang.String getOSGiServiceIdentifier(); 173 174 /** 175 * Returns the organization with the primary key. 176 * 177 * @param organizationId the primary key of the organization 178 * @return the organization with the primary key 179 */ 180 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 181 public com.liferay.portal.model.Organization getOrganization( 182 long organizationId) throws PortalException; 183 184 /** 185 * Returns the primary key of the organization with the name. 186 * 187 * @param companyId the primary key of the organization's company 188 * @param name the organization's name 189 * @return the primary key of the organization with the name, or 190 <code>0</code> if the organization could not be found 191 */ 192 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 193 public long getOrganizationId(long companyId, java.lang.String name) 194 throws PortalException; 195 196 /** 197 * Returns all the organizations belonging to the parent organization. 198 * 199 * @param companyId the primary key of the organizations' company 200 * @param parentOrganizationId the primary key of the organizations' parent 201 organization 202 * @return the organizations belonging to the parent organization 203 */ 204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 205 public java.util.List<com.liferay.portal.model.Organization> getOrganizations( 206 long companyId, long parentOrganizationId); 207 208 /** 209 * Returns a range of all the organizations belonging to the parent 210 * organization. 211 * 212 * <p> 213 * Useful when paginating results. Returns a maximum of <code>end - 214 * start</code> instances. <code>start</code> and <code>end</code> are not 215 * primary keys, they are indexes in the result set. Thus, <code>0</code> 216 * refers to the first result in the set. Setting both <code>start</code> 217 * and <code>end</code> to {@link 218 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 219 * result set. 220 * </p> 221 * 222 * @param companyId the primary key of the organizations' company 223 * @param parentOrganizationId the primary key of the organizations' parent 224 organization 225 * @param start the lower bound of the range of organizations to return 226 * @param end the upper bound of the range of organizations to return (not 227 inclusive) 228 * @return the range of organizations belonging to the parent organization 229 */ 230 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 231 public java.util.List<com.liferay.portal.model.Organization> getOrganizations( 232 long companyId, long parentOrganizationId, int start, int end); 233 234 /** 235 * Returns the number of organizations belonging to the parent organization. 236 * 237 * @param companyId the primary key of the organizations' company 238 * @param parentOrganizationId the primary key of the organizations' parent 239 organization 240 * @return the number of organizations belonging to the parent organization 241 */ 242 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 243 public int getOrganizationsCount(long companyId, long parentOrganizationId); 244 245 /** 246 * Returns all the organizations with which the user is explicitly 247 * associated. 248 * 249 * <p> 250 * A user is considered to be <i>explicitly</i> associated with an 251 * organization if his account is individually created within the 252 * organization or if the user is later added as a member. 253 * </p> 254 * 255 * @param userId the primary key of the user 256 * @return the organizations with which the user is explicitly associated 257 */ 258 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 259 public java.util.List<com.liferay.portal.model.Organization> getUserOrganizations( 260 long userId) throws PortalException; 261 262 /** 263 * Sets the organizations in the group, removing and adding organizations to 264 * the group as necessary. 265 * 266 * @param groupId the primary key of the group 267 * @param organizationIds the primary keys of the organizations 268 */ 269 public void setGroupOrganizations(long groupId, long[] organizationIds) 270 throws PortalException; 271 272 /** 273 * Removes the organizations from the group. 274 * 275 * @param groupId the primary key of the group 276 * @param organizationIds the primary keys of the organizations 277 */ 278 public void unsetGroupOrganizations(long groupId, long[] organizationIds) 279 throws PortalException; 280 281 /** 282 * Removes the organizations from the password policy. 283 * 284 * @param passwordPolicyId the primary key of the password policy 285 * @param organizationIds the primary keys of the organizations 286 */ 287 public void unsetPasswordPolicyOrganizations(long passwordPolicyId, 288 long[] organizationIds) throws PortalException; 289 290 /** 291 * Updates the organization with additional parameters. 292 * 293 * @param organizationId the primary key of the organization 294 * @param parentOrganizationId the primary key of the organization's parent 295 organization 296 * @param name the organization's name 297 * @param type the organization's type 298 * @param regionId the primary key of the organization's region 299 * @param countryId the primary key of the organization's country 300 * @param statusId the organization's workflow status 301 * @param comments the comments about the organization 302 * @param logo whether to update the ogranization's logo 303 * @param logoBytes the new logo image data 304 * @param site whether the organization is to be associated with a main 305 site 306 * @param addresses the organization's addresses 307 * @param emailAddresses the organization's email addresses 308 * @param orgLabors the organization's hours of operation 309 * @param phones the organization's phone numbers 310 * @param websites the organization's websites 311 * @param serviceContext the service context to be applied (optionally 312 <code>null</code>). Can set asset category IDs and asset tag 313 names for the organization, and merge expando bridge attributes 314 for the organization. 315 * @return the organization 316 */ 317 public com.liferay.portal.model.Organization updateOrganization( 318 long organizationId, long parentOrganizationId, java.lang.String name, 319 java.lang.String type, long regionId, long countryId, long statusId, 320 java.lang.String comments, boolean logo, byte[] logoBytes, 321 boolean site, 322 java.util.List<com.liferay.portal.model.Address> addresses, 323 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 324 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors, 325 java.util.List<com.liferay.portal.model.Phone> phones, 326 java.util.List<com.liferay.portal.model.Website> websites, 327 com.liferay.portal.service.ServiceContext serviceContext) 328 throws PortalException; 329 330 /** 331 * Updates the organization with additional parameters. 332 * 333 * @param organizationId the primary key of the organization 334 * @param parentOrganizationId the primary key of the organization's 335 parent organization 336 * @param name the organization's name 337 * @param type the organization's type 338 * @param regionId the primary key of the organization's region 339 * @param countryId the primary key of the organization's country 340 * @param statusId the organization's workflow status 341 * @param comments the comments about the organization 342 * @param site whether the organization is to be associated with a main 343 site 344 * @param addresses the organization's addresses 345 * @param emailAddresses the organization's email addresses 346 * @param orgLabors the organization's hours of operation 347 * @param phones the organization's phone numbers 348 * @param websites the organization's websites 349 * @param serviceContext the service context to be applied (optionally 350 <code>null</code>). Can set asset category IDs and asset tag 351 names for the organization, and merge expando bridge 352 attributes for the organization. 353 * @return the organization 354 * @deprecated As of 7.0.0, replaced by {@link #updateOrganization(long, 355 long, String, String, long, long, long, String, boolean, 356 byte[], boolean, List, List, List, List, List, 357 ServiceContext)} 358 */ 359 @java.lang.Deprecated 360 public com.liferay.portal.model.Organization updateOrganization( 361 long organizationId, long parentOrganizationId, java.lang.String name, 362 java.lang.String type, long regionId, long countryId, long statusId, 363 java.lang.String comments, boolean site, 364 java.util.List<com.liferay.portal.model.Address> addresses, 365 java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses, 366 java.util.List<com.liferay.portal.model.OrgLabor> orgLabors, 367 java.util.List<com.liferay.portal.model.Phone> phones, 368 java.util.List<com.liferay.portal.model.Website> websites, 369 com.liferay.portal.service.ServiceContext serviceContext) 370 throws PortalException; 371 372 /** 373 * Updates the organization. 374 * 375 * @param organizationId the primary key of the organization 376 * @param parentOrganizationId the primary key of the organization's parent 377 organization 378 * @param name the organization's name 379 * @param type the organization's type 380 * @param regionId the primary key of the organization's region 381 * @param countryId the primary key of the organization's country 382 * @param statusId the organization's workflow status 383 * @param comments the comments about the organization 384 * @param site whether the organization is to be associated with a main 385 site 386 * @param serviceContext the service context to be applied (optionally 387 <code>null</code>). Can set asset category IDs and asset tag 388 names for the organization, and merge expando bridge attributes 389 for the organization. 390 * @return the organization 391 */ 392 public com.liferay.portal.model.Organization updateOrganization( 393 long organizationId, long parentOrganizationId, java.lang.String name, 394 java.lang.String type, long regionId, long countryId, long statusId, 395 java.lang.String comments, boolean site, 396 com.liferay.portal.service.ServiceContext serviceContext) 397 throws PortalException; 398 }