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