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