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 /** 020 * Provides a wrapper for {@link ResourceLocalService}. 021 * 022 * @author Brian Wing Shun Chan 023 * @see ResourceLocalService 024 * @generated 025 */ 026 @ProviderType 027 public class ResourceLocalServiceWrapper implements ResourceLocalService, 028 ServiceWrapper<ResourceLocalService> { 029 public ResourceLocalServiceWrapper( 030 ResourceLocalService resourceLocalService) { 031 _resourceLocalService = resourceLocalService; 032 } 033 034 /** 035 * Adds resources for the model, always creating a resource at the 036 * individual scope and only creating resources at the group, group 037 * template, and company scope if such resources don't already exist. 038 * 039 * <ol> 040 * <li> 041 * If the service context specifies that default group or default guest 042 * permissions are to be added, then only default permissions are added. See 043 * {@link com.liferay.portal.service.ServiceContext#setAddGroupPermissions( 044 * boolean)} and {@link 045 * com.liferay.portal.service.ServiceContext#setAddGuestPermissions( 046 * boolean)}. 047 * </li> 048 * <li> 049 * Else ... 050 * <ol> 051 * <li> 052 * If the service context specifies to derive default permissions, then 053 * default group and guest permissions are derived from the model and 054 * added. See {@link 055 * com.liferay.portal.service.ServiceContext#setDeriveDefaultPermissions( 056 * boolean)}. 057 * </li> 058 * <li> 059 * Lastly group and guest permissions from the service 060 * context are applied. See {@link 061 * com.liferay.portal.service.ServiceContext#setGroupPermissions(String[])} 062 * and {@link 063 * com.liferay.portal.service.ServiceContext#setGuestPermissions(String[])}. 064 * </li> 065 * </ol> 066 * 067 * </li> 068 * </ol> 069 * 070 * @param auditedModel the model to associate with the resources 071 * @param serviceContext the service context to apply. Can set whether to 072 add the model's default group and guest permissions, set whether 073 to derive default group and guest permissions from the model, set 074 group permissions to apply, and set guest permissions to apply. 075 * @throws PortalException if no portal actions could be found associated 076 with the model or if a portal exception occurred 077 */ 078 @Override 079 public void addModelResources( 080 com.liferay.portal.model.AuditedModel auditedModel, 081 com.liferay.portal.service.ServiceContext serviceContext) 082 throws com.liferay.portal.kernel.exception.PortalException { 083 _resourceLocalService.addModelResources(auditedModel, serviceContext); 084 } 085 086 /** 087 * Adds resources for the model with the name and primary key, always 088 * creating a resource at the individual scope and only creating resources 089 * at the group, group template, and company scope if such resources don't 090 * already exist. 091 * 092 * @param companyId the primary key of the portal instance 093 * @param groupId the primary key of the group 094 * @param userId the primary key of the user adding the resources 095 * @param name a name for the resource, typically the model's class name 096 * @param primKey the primary key of the model instance, optionally 097 <code>0</code> if no instance exists 098 * @param groupPermissions the group permissions to be applied 099 * @param guestPermissions the guest permissions to be applied 100 * @throws PortalException if no portal actions could be found associated 101 with the model or if a portal exception occurred 102 */ 103 @Override 104 public void addModelResources(long companyId, long groupId, long userId, 105 java.lang.String name, long primKey, 106 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 107 throws com.liferay.portal.kernel.exception.PortalException { 108 _resourceLocalService.addModelResources(companyId, groupId, userId, 109 name, primKey, groupPermissions, guestPermissions); 110 } 111 112 /** 113 * Adds resources for the model with the name and primary key string, always 114 * creating a resource at the individual scope and only creating resources 115 * at the group, group template, and company scope if such resources don't 116 * already exist. 117 * 118 * @param companyId the primary key of the portal instance 119 * @param groupId the primary key of the group 120 * @param userId the primary key of the user adding the resources 121 * @param name a name for the resource, typically the model's class name 122 * @param primKey the primary key string of the model instance, optionally 123 an empty string if no instance exists 124 * @param groupPermissions the group permissions to be applied 125 * @param guestPermissions the guest permissions to be applied 126 * @throws PortalException if no portal actions could be found associated 127 with the model or if a portal exception occurred 128 */ 129 @Override 130 public void addModelResources(long companyId, long groupId, long userId, 131 java.lang.String name, java.lang.String primKey, 132 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 133 throws com.liferay.portal.kernel.exception.PortalException { 134 _resourceLocalService.addModelResources(companyId, groupId, userId, 135 name, primKey, groupPermissions, guestPermissions); 136 } 137 138 /** 139 * Adds resources for the entity with the name. Use this method if the user 140 * is unknown or irrelevant and there is no current entity instance. 141 * 142 * @param companyId the primary key of the portal instance 143 * @param groupId the primary key of the group 144 * @param name a name for the resource, which should be a portlet ID if the 145 resource is a portlet or the resource's class name otherwise 146 * @param portletActions whether to associate portlet actions with the 147 resource 148 * @throws PortalException if no portal actions could be found associated 149 with the resource or if a portal exception occurred 150 */ 151 @Override 152 public void addResources(long companyId, long groupId, 153 java.lang.String name, boolean portletActions) 154 throws com.liferay.portal.kernel.exception.PortalException { 155 _resourceLocalService.addResources(companyId, groupId, name, 156 portletActions); 157 } 158 159 /** 160 * Adds resources for the entity with the name and primary key string, 161 * always creating a resource at the individual scope and only creating 162 * resources at the group, group template, and company scope if such 163 * resources don't already exist. 164 * 165 * @param companyId the primary key of the portal instance 166 * @param groupId the primary key of the group 167 * @param userId the primary key of the user adding the resources 168 * @param name a name for the resource, which should be a portlet ID if the 169 resource is a portlet or the resource's class name otherwise 170 * @param primKey the primary key string of the resource instance, 171 optionally an empty string if no instance exists 172 * @param portletActions whether to associate portlet actions with the 173 resource 174 * @param addGroupPermissions whether to add group permissions 175 * @param addGuestPermissions whether to add guest permissions 176 * @throws PortalException if no portal actions could be found associated 177 with the resource or if a portal exception occurred 178 */ 179 @Override 180 public void addResources(long companyId, long groupId, long userId, 181 java.lang.String name, java.lang.String primKey, 182 boolean portletActions, boolean addGroupPermissions, 183 boolean addGuestPermissions) 184 throws com.liferay.portal.kernel.exception.PortalException { 185 _resourceLocalService.addResources(companyId, groupId, userId, name, 186 primKey, portletActions, addGroupPermissions, addGuestPermissions); 187 } 188 189 /** 190 * Adds resources for the entity with the name and primary key, always 191 * creating a resource at the individual scope and only creating resources 192 * at the group, group template, and company scope if such resources don't 193 * already exist. 194 * 195 * @param companyId the primary key of the portal instance 196 * @param groupId the primary key of the group 197 * @param userId the primary key of the user adding the resources 198 * @param name a name for the resource, which should be a portlet ID if the 199 resource is a portlet or the resource's class name otherwise 200 * @param primKey the primary key of the resource instance, optionally 201 <code>0</code> if no instance exists 202 * @param portletActions whether to associate portlet actions with the 203 resource 204 * @param addGroupPermissions whether to add group permissions 205 * @param addGuestPermissions whether to add guest permissions 206 * @throws PortalException if no portal actions could be found associated 207 with the resource or if a portal exception occurred 208 */ 209 @Override 210 public void addResources(long companyId, long groupId, long userId, 211 java.lang.String name, long primKey, boolean portletActions, 212 boolean addGroupPermissions, boolean addGuestPermissions) 213 throws com.liferay.portal.kernel.exception.PortalException { 214 _resourceLocalService.addResources(companyId, groupId, userId, name, 215 primKey, portletActions, addGroupPermissions, addGuestPermissions); 216 } 217 218 /** 219 * Deletes the resource associated with the model at the scope. 220 * 221 * @param auditedModel the model associated with the resource 222 * @param scope the scope of the resource. For more information see {@link 223 com.liferay.portal.model.ResourceConstants}. 224 * @throws PortalException if a portal exception occurred 225 */ 226 @Override 227 public void deleteResource( 228 com.liferay.portal.model.AuditedModel auditedModel, int scope) 229 throws com.liferay.portal.kernel.exception.PortalException { 230 _resourceLocalService.deleteResource(auditedModel, scope); 231 } 232 233 /** 234 * Deletes the resource matching the primary key at the scope. 235 * 236 * @param companyId the primary key of the portal instance 237 * @param name the resource's name, which should be a portlet ID if the 238 resource is a portlet or the resource's class name otherwise 239 * @param scope the scope of the resource. For more information see {@link 240 com.liferay.portal.model.ResourceConstants}. 241 * @param primKey the primary key of the resource instance 242 * @throws PortalException if a portal exception occurred 243 */ 244 @Override 245 public void deleteResource(long companyId, java.lang.String name, 246 int scope, long primKey) 247 throws com.liferay.portal.kernel.exception.PortalException { 248 _resourceLocalService.deleteResource(companyId, name, scope, primKey); 249 } 250 251 /** 252 * Deletes the resource matching the primary key at the scope. 253 * 254 * @param companyId the primary key of the portal instance 255 * @param name the resource's name, which should be a portlet ID if the 256 resource is a portlet or the resource's class name otherwise 257 * @param scope the scope of the resource. For more information see {@link 258 com.liferay.portal.model.ResourceConstants}. 259 * @param primKey the primary key string of the resource instance 260 * @throws PortalException if a portal exception occurred 261 */ 262 @Override 263 public void deleteResource(long companyId, java.lang.String name, 264 int scope, java.lang.String primKey) 265 throws com.liferay.portal.kernel.exception.PortalException { 266 _resourceLocalService.deleteResource(companyId, name, scope, primKey); 267 } 268 269 /** 270 * Returns the Spring bean ID for this bean. 271 * 272 * @return the Spring bean ID for this bean 273 */ 274 @Override 275 public java.lang.String getBeanIdentifier() { 276 return _resourceLocalService.getBeanIdentifier(); 277 } 278 279 /** 280 * Returns a new resource with the name and primary key at the scope. 281 * 282 * @param companyId the primary key of the portal instance 283 * @param name a name for the resource, which should be a portlet ID if the 284 resource is a portlet or the resource's class name otherwise 285 * @param scope the scope of the resource. For more information see {@link 286 com.liferay.portal.model.ResourceConstants}. 287 * @param primKey the primary key string of the resource 288 * @return the new resource 289 */ 290 @Override 291 public com.liferay.portal.model.Resource getResource(long companyId, 292 java.lang.String name, int scope, java.lang.String primKey) { 293 return _resourceLocalService.getResource(companyId, name, scope, primKey); 294 } 295 296 /** 297 * Returns <code>true</code> if the roles have permission to perform the 298 * action on the resources. 299 * 300 * @param userId the primary key of the user performing the permission 301 check 302 * @param resourceId the primary key of the resource, typically the scope 303 group ID representing the scope in which the permission check is 304 being performed 305 * @param resources the resources for which permissions are to be checked 306 * @param actionId the primary key of the action to be performed on the 307 resources 308 * @param roleIds the primary keys of the roles 309 * @return <code>true</code> if the roles have permission to perform the 310 action on the resources;<code>false</code> otherwise 311 * @throws PortalException if any one of the roles with the primary keys 312 could not be found or if a resource action with the action ID 313 could not be found 314 */ 315 @Override 316 public boolean hasUserPermissions(long userId, long resourceId, 317 java.util.List<com.liferay.portal.model.Resource> resources, 318 java.lang.String actionId, long[] roleIds) 319 throws com.liferay.portal.kernel.exception.PortalException { 320 return _resourceLocalService.hasUserPermissions(userId, resourceId, 321 resources, actionId, roleIds); 322 } 323 324 /** 325 * Sets the Spring bean ID for this bean. 326 * 327 * @param beanIdentifier the Spring bean ID for this bean 328 */ 329 @Override 330 public void setBeanIdentifier(java.lang.String beanIdentifier) { 331 _resourceLocalService.setBeanIdentifier(beanIdentifier); 332 } 333 334 /** 335 * Updates the resources for the model, replacing their group and guest 336 * permissions with new ones from the service context. 337 * 338 * @param auditedModel the model associated with the resources 339 * @param serviceContext the service context to be applied. Can set group 340 and guest permissions. 341 * @throws PortalException if a portal exception occurred 342 */ 343 @Override 344 public void updateModelResources( 345 com.liferay.portal.model.AuditedModel auditedModel, 346 com.liferay.portal.service.ServiceContext serviceContext) 347 throws com.liferay.portal.kernel.exception.PortalException { 348 _resourceLocalService.updateModelResources(auditedModel, serviceContext); 349 } 350 351 /** 352 * Updates resources matching the group, name, and primary key string at the 353 * individual scope, setting new group and guest permissions. 354 * 355 * @param companyId the primary key of the portal instance 356 * @param groupId the primary key of the group 357 * @param name the resource's name, which should be a portlet ID if the 358 resource is a portlet or the resource's class name otherwise 359 * @param primKey the primary key string of the resource instance 360 * @param groupPermissions the group permissions to be applied 361 * @param guestPermissions the guest permissions to be applied 362 * @throws PortalException if a portal exception occurred 363 */ 364 @Override 365 public void updateResources(long companyId, long groupId, 366 java.lang.String name, java.lang.String primKey, 367 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 368 throws com.liferay.portal.kernel.exception.PortalException { 369 _resourceLocalService.updateResources(companyId, groupId, name, 370 primKey, groupPermissions, guestPermissions); 371 } 372 373 /** 374 * Updates resources matching the group, name, and primary key at the 375 * individual scope, setting new group and guest permissions. 376 * 377 * @param companyId the primary key of the portal instance 378 * @param groupId the primary key of the group 379 * @param name the resource's name, which should be a portlet ID if the 380 resource is a portlet or the resource's class name otherwise 381 * @param primKey the primary key of the resource instance 382 * @param groupPermissions the group permissions to be applied 383 * @param guestPermissions the guest permissions to be applied 384 * @throws PortalException if a portal exception occurred 385 */ 386 @Override 387 public void updateResources(long companyId, long groupId, 388 java.lang.String name, long primKey, 389 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 390 throws com.liferay.portal.kernel.exception.PortalException { 391 _resourceLocalService.updateResources(companyId, groupId, name, 392 primKey, groupPermissions, guestPermissions); 393 } 394 395 /** 396 * Updates resources matching the name, primary key string and scope, 397 * replacing the primary key of their resource permissions with the new 398 * primary key. 399 * 400 * @param companyId the primary key of the portal instance 401 * @param name the resource's name, which should be a portlet ID if the 402 resource is a portlet or the resource's class name otherwise 403 * @param scope the scope of the resource. For more information see {@link 404 com.liferay.portal.model.ResourceConstants}. 405 * @param primKey the primary key string of the resource instance 406 * @param newPrimKey the new primary key string of the resource 407 */ 408 @Override 409 public void updateResources(long companyId, java.lang.String name, 410 int scope, java.lang.String primKey, java.lang.String newPrimKey) { 411 _resourceLocalService.updateResources(companyId, name, scope, primKey, 412 newPrimKey); 413 } 414 415 /** 416 * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} 417 */ 418 @Deprecated 419 public ResourceLocalService getWrappedResourceLocalService() { 420 return _resourceLocalService; 421 } 422 423 /** 424 * @deprecated As of 6.1.0, replaced by {@link #setWrappedService} 425 */ 426 @Deprecated 427 public void setWrappedResourceLocalService( 428 ResourceLocalService resourceLocalService) { 429 _resourceLocalService = resourceLocalService; 430 } 431 432 @Override 433 public ResourceLocalService getWrappedService() { 434 return _resourceLocalService; 435 } 436 437 @Override 438 public void setWrappedService(ResourceLocalService resourceLocalService) { 439 _resourceLocalService = resourceLocalService; 440 } 441 442 private ResourceLocalService _resourceLocalService; 443 }