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 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.util.ReferenceRegistry; 019 020 /** 021 * The utility for the resource local service. This utility wraps {@link com.liferay.portal.service.impl.ResourceLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server. 022 * 023 * <p> 024 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see ResourceLocalService 029 * @see com.liferay.portal.service.base.ResourceLocalServiceBaseImpl 030 * @see com.liferay.portal.service.impl.ResourceLocalServiceImpl 031 * @generated 032 */ 033 public class ResourceLocalServiceUtil { 034 /* 035 * NOTE FOR DEVELOPERS: 036 * 037 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 038 */ 039 040 /** 041 * Adds the resource to the database. Also notifies the appropriate model listeners. 042 * 043 * @param resource the resource 044 * @return the resource that was added 045 * @throws SystemException if a system exception occurred 046 */ 047 public static com.liferay.portal.model.Resource addResource( 048 com.liferay.portal.model.Resource resource) 049 throws com.liferay.portal.kernel.exception.SystemException { 050 return getService().addResource(resource); 051 } 052 053 /** 054 * Creates a new resource with the primary key. Does not add the resource to the database. 055 * 056 * @param resourceId the primary key for the new resource 057 * @return the new resource 058 */ 059 public static com.liferay.portal.model.Resource createResource( 060 long resourceId) { 061 return getService().createResource(resourceId); 062 } 063 064 /** 065 * Deletes the resource with the primary key from the database. Also notifies the appropriate model listeners. 066 * 067 * @param resourceId the primary key of the resource 068 * @return the resource that was removed 069 * @throws PortalException if a resource with the primary key could not be found 070 * @throws SystemException if a system exception occurred 071 */ 072 public static com.liferay.portal.model.Resource deleteResource( 073 long resourceId) 074 throws com.liferay.portal.kernel.exception.PortalException, 075 com.liferay.portal.kernel.exception.SystemException { 076 return getService().deleteResource(resourceId); 077 } 078 079 /** 080 * Deletes the resource from the database. Also notifies the appropriate model listeners. 081 * 082 * @param resource the resource 083 * @return the resource that was removed 084 * @throws SystemException if a system exception occurred 085 */ 086 public static com.liferay.portal.model.Resource deleteResource( 087 com.liferay.portal.model.Resource resource) 088 throws com.liferay.portal.kernel.exception.SystemException { 089 return getService().deleteResource(resource); 090 } 091 092 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 093 return getService().dynamicQuery(); 094 } 095 096 /** 097 * Performs a dynamic query on the database and returns the matching rows. 098 * 099 * @param dynamicQuery the dynamic query 100 * @return the matching rows 101 * @throws SystemException if a system exception occurred 102 */ 103 @SuppressWarnings("rawtypes") 104 public static java.util.List dynamicQuery( 105 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 106 throws com.liferay.portal.kernel.exception.SystemException { 107 return getService().dynamicQuery(dynamicQuery); 108 } 109 110 /** 111 * Performs a dynamic query on the database and returns a range of the matching rows. 112 * 113 * <p> 114 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 115 * </p> 116 * 117 * @param dynamicQuery the dynamic query 118 * @param start the lower bound of the range of model instances 119 * @param end the upper bound of the range of model instances (not inclusive) 120 * @return the range of matching rows 121 * @throws SystemException if a system exception occurred 122 */ 123 @SuppressWarnings("rawtypes") 124 public static java.util.List dynamicQuery( 125 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 126 int end) throws com.liferay.portal.kernel.exception.SystemException { 127 return getService().dynamicQuery(dynamicQuery, start, end); 128 } 129 130 /** 131 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 132 * 133 * <p> 134 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 135 * </p> 136 * 137 * @param dynamicQuery the dynamic query 138 * @param start the lower bound of the range of model instances 139 * @param end the upper bound of the range of model instances (not inclusive) 140 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 141 * @return the ordered range of matching rows 142 * @throws SystemException if a system exception occurred 143 */ 144 @SuppressWarnings("rawtypes") 145 public static java.util.List dynamicQuery( 146 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 147 int end, 148 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 149 throws com.liferay.portal.kernel.exception.SystemException { 150 return getService() 151 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 152 } 153 154 /** 155 * Returns the number of rows that match the dynamic query. 156 * 157 * @param dynamicQuery the dynamic query 158 * @return the number of rows that match the dynamic query 159 * @throws SystemException if a system exception occurred 160 */ 161 public static long dynamicQueryCount( 162 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 163 throws com.liferay.portal.kernel.exception.SystemException { 164 return getService().dynamicQueryCount(dynamicQuery); 165 } 166 167 public static com.liferay.portal.model.Resource fetchResource( 168 long resourceId) 169 throws com.liferay.portal.kernel.exception.SystemException { 170 return getService().fetchResource(resourceId); 171 } 172 173 /** 174 * Returns the resource with the primary key. 175 * 176 * @param resourceId the primary key of the resource 177 * @return the resource 178 * @throws PortalException if a resource with the primary key could not be found 179 * @throws SystemException if a system exception occurred 180 */ 181 public static com.liferay.portal.model.Resource getResource(long resourceId) 182 throws com.liferay.portal.kernel.exception.PortalException, 183 com.liferay.portal.kernel.exception.SystemException { 184 return getService().getResource(resourceId); 185 } 186 187 public static com.liferay.portal.model.PersistedModel getPersistedModel( 188 java.io.Serializable primaryKeyObj) 189 throws com.liferay.portal.kernel.exception.PortalException, 190 com.liferay.portal.kernel.exception.SystemException { 191 return getService().getPersistedModel(primaryKeyObj); 192 } 193 194 /** 195 * Returns a range of all the resources. 196 * 197 * <p> 198 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 199 * </p> 200 * 201 * @param start the lower bound of the range of resources 202 * @param end the upper bound of the range of resources (not inclusive) 203 * @return the range of resources 204 * @throws SystemException if a system exception occurred 205 */ 206 public static java.util.List<com.liferay.portal.model.Resource> getResources( 207 int start, int end) 208 throws com.liferay.portal.kernel.exception.SystemException { 209 return getService().getResources(start, end); 210 } 211 212 /** 213 * Returns the number of resources. 214 * 215 * @return the number of resources 216 * @throws SystemException if a system exception occurred 217 */ 218 public static int getResourcesCount() 219 throws com.liferay.portal.kernel.exception.SystemException { 220 return getService().getResourcesCount(); 221 } 222 223 /** 224 * Updates the resource in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 225 * 226 * @param resource the resource 227 * @return the resource that was updated 228 * @throws SystemException if a system exception occurred 229 */ 230 public static com.liferay.portal.model.Resource updateResource( 231 com.liferay.portal.model.Resource resource) 232 throws com.liferay.portal.kernel.exception.SystemException { 233 return getService().updateResource(resource); 234 } 235 236 /** 237 * Updates the resource in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 238 * 239 * @param resource the resource 240 * @param merge whether to merge the resource with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 241 * @return the resource that was updated 242 * @throws SystemException if a system exception occurred 243 */ 244 public static com.liferay.portal.model.Resource updateResource( 245 com.liferay.portal.model.Resource resource, boolean merge) 246 throws com.liferay.portal.kernel.exception.SystemException { 247 return getService().updateResource(resource, merge); 248 } 249 250 /** 251 * Returns the Spring bean ID for this bean. 252 * 253 * @return the Spring bean ID for this bean 254 */ 255 public static java.lang.String getBeanIdentifier() { 256 return getService().getBeanIdentifier(); 257 } 258 259 /** 260 * Sets the Spring bean ID for this bean. 261 * 262 * @param beanIdentifier the Spring bean ID for this bean 263 */ 264 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 265 getService().setBeanIdentifier(beanIdentifier); 266 } 267 268 /** 269 * Adds resources for the model, always creating a resource at the 270 * individual scope and only creating resources at the group, group 271 * template, and company scope if such resources don't already exist. 272 * 273 * <ol> 274 * <li> 275 * If the service context specifies that default group or default guest 276 * permissions are to be added, then only default permissions are added. See 277 * {@link com.liferay.portal.service.ServiceContext#setAddGroupPermissions( 278 * boolean)} and {@link 279 * com.liferay.portal.service.ServiceContext#setAddGuestPermissions( 280 * boolean)}. 281 * </li> 282 * <li> 283 * Else ... 284 * <ol> 285 * <li> 286 * If the service context specifies to derive default permissions, then 287 * default group and guest permissions are derived from the model and 288 * added. See {@link 289 * com.liferay.portal.service.ServiceContext#setDeriveDefaultPermissions( 290 * boolean)}. 291 * </li> 292 * <li> 293 * Lastly group and guest permissions from the service 294 * context are applied. See {@link 295 * com.liferay.portal.service.ServiceContext#setGroupPermissions(String[])} 296 * and {@link 297 * com.liferay.portal.service.ServiceContext#setGuesPermissions(String[])}. 298 * </li> 299 * </ol> 300 * 301 * </li> 302 * </ol> 303 * 304 * @param auditedModel the model to associate with the resources 305 * @param serviceContext the service context to apply. Can set whether to 306 add the model's default group and guest permissions, set whether 307 to derive default group and guest permissions from the model, set 308 group permissions to apply, and set guest permissions to apply. 309 * @throws PortalException if no portal actions could be found associated 310 with the model or if a portal exception occurred 311 * @throws SystemException if a system exception occurred 312 */ 313 public static void addModelResources( 314 com.liferay.portal.model.AuditedModel auditedModel, 315 com.liferay.portal.service.ServiceContext serviceContext) 316 throws com.liferay.portal.kernel.exception.PortalException, 317 com.liferay.portal.kernel.exception.SystemException { 318 getService().addModelResources(auditedModel, serviceContext); 319 } 320 321 /** 322 * Adds resources for the model with the name and primary key, always 323 * creating a resource at the individual scope and only creating resources 324 * at the group, group template, and company scope if such resources don't 325 * already exist. 326 * 327 * @param companyId the primary key of the portal instance 328 * @param groupId the primary key of the group 329 * @param userId the primary key of the user adding the resources 330 * @param name a name for the resource, typically the model's class name 331 * @param primKey the primary key of the model instance, optionally 332 <code>0</code> if no instance exists 333 * @param groupPermissions the group permissions to be applied 334 * @param guestPermissions the guest permissions to be applied 335 * @throws PortalException if no portal actions could be found associated 336 with the model or if a portal exception occurred 337 * @throws SystemException if a system exception occurred 338 */ 339 public static void addModelResources(long companyId, long groupId, 340 long userId, java.lang.String name, long primKey, 341 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 342 throws com.liferay.portal.kernel.exception.PortalException, 343 com.liferay.portal.kernel.exception.SystemException { 344 getService() 345 .addModelResources(companyId, groupId, userId, name, primKey, 346 groupPermissions, guestPermissions); 347 } 348 349 /** 350 * Adds resources for the model with the name and primary key string, always 351 * creating a resource at the individual scope and only creating resources 352 * at the group, group template, and company scope if such resources don't 353 * already exist. 354 * 355 * @param companyId the primary key of the portal instance 356 * @param groupId the primary key of the group 357 * @param userId the primary key of the user adding the resources 358 * @param name a name for the resource, typically the model's class name 359 * @param primKey the primary key string of the model instance, optionally 360 an empty string if no instance exists 361 * @param groupPermissions the group permissions to be applied 362 * @param guestPermissions the guest permissions to be applied 363 * @throws PortalException if no portal actions could be found associated 364 with the model or if a portal exception occurred 365 * @throws SystemException if a system exception occurred 366 */ 367 public static void addModelResources(long companyId, long groupId, 368 long userId, java.lang.String name, java.lang.String primKey, 369 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 370 throws com.liferay.portal.kernel.exception.PortalException, 371 com.liferay.portal.kernel.exception.SystemException { 372 getService() 373 .addModelResources(companyId, groupId, userId, name, primKey, 374 groupPermissions, guestPermissions); 375 } 376 377 public static com.liferay.portal.model.Resource addResource( 378 long companyId, java.lang.String name, int scope, 379 java.lang.String primKey) 380 throws com.liferay.portal.kernel.exception.SystemException { 381 return getService().addResource(companyId, name, scope, primKey); 382 } 383 384 /** 385 * Adds resources for the entity with the name and primary key, always 386 * creating a resource at the individual scope and only creating resources 387 * at the group, group template, and company scope if such resources don't 388 * already exist. 389 * 390 * @param companyId the primary key of the portal instance 391 * @param groupId the primary key of the group 392 * @param userId the primary key of the user adding the resources 393 * @param name a name for the resource, which should be a portlet ID if the 394 resource is a portlet or the resource's class name otherwise 395 * @param primKey the primary key of the resource instance, optionally 396 <code>0</code> if no instance exists 397 * @param portletActions whether to associate portlet actions with the 398 resource 399 * @param addGroupPermissions whether to add group permissions 400 * @param addGuestPermissions whether to add guest permissions 401 * @throws PortalException if no portal actions could be found associated 402 with the resource or if a portal exception occurred 403 * @throws SystemException if a system exception occurred 404 */ 405 public static void addResources(long companyId, long groupId, long userId, 406 java.lang.String name, long primKey, boolean portletActions, 407 boolean addGroupPermissions, boolean addGuestPermissions) 408 throws com.liferay.portal.kernel.exception.PortalException, 409 com.liferay.portal.kernel.exception.SystemException { 410 getService() 411 .addResources(companyId, groupId, userId, name, primKey, 412 portletActions, addGroupPermissions, addGuestPermissions); 413 } 414 415 /** 416 * Adds resources for the entity with the name and primary key string, 417 * always creating a resource at the individual scope and only creating 418 * resources at the group, group template, and company scope if such 419 * resources don't already exist. 420 * 421 * @param companyId the primary key of the portal instance 422 * @param groupId the primary key of the group 423 * @param userId the primary key of the user adding the resources 424 * @param name a name for the resource, which should be a portlet ID if the 425 resource is a portlet or the resource's class name otherwise 426 * @param primKey the primary key string of the resource instance, 427 optionally an empty string if no instance exists 428 * @param portletActions whether to associate portlet actions with the 429 resource 430 * @param addGroupPermissions whether to add group permissions 431 * @param addGuestPermissions whether to add guest permissions 432 * @throws PortalException if no portal actions could be found associated 433 with the resource or if a portal exception occurred 434 * @throws SystemException if a system exception occurred 435 */ 436 public static void addResources(long companyId, long groupId, long userId, 437 java.lang.String name, java.lang.String primKey, 438 boolean portletActions, boolean addGroupPermissions, 439 boolean addGuestPermissions) 440 throws com.liferay.portal.kernel.exception.PortalException, 441 com.liferay.portal.kernel.exception.SystemException { 442 getService() 443 .addResources(companyId, groupId, userId, name, primKey, 444 portletActions, addGroupPermissions, addGuestPermissions); 445 } 446 447 /** 448 * Adds resources for the entity with the name. Use this method if the user 449 * is unknown or irrelevant and there is no current entity instance. 450 * 451 * @param companyId the primary key of the portal instance 452 * @param groupId the primary key of the group 453 * @param name a name for the resource, which should be a portlet ID if the 454 resource is a portlet or the resource's class name otherwise 455 * @param portletActions whether to associate portlet actions with the 456 resource 457 * @throws PortalException if no portal actions could be found associated 458 with the resource or if a portal exception occurred 459 * @throws SystemException if a system exception occurred 460 */ 461 public static void addResources(long companyId, long groupId, 462 java.lang.String name, boolean portletActions) 463 throws com.liferay.portal.kernel.exception.PortalException, 464 com.liferay.portal.kernel.exception.SystemException { 465 getService().addResources(companyId, groupId, name, portletActions); 466 } 467 468 /** 469 * Deletes the resource associated with the model at the scope. 470 * 471 * @param auditedModel the model associated with the resource 472 * @param scope the scope of the resource. For more information see {@link 473 com.liferay.portal.model.ResourceConstants}. 474 * @throws PortalException if a portal exception occurred 475 * @throws SystemException if a system exception occurred 476 */ 477 public static void deleteResource( 478 com.liferay.portal.model.AuditedModel auditedModel, int scope) 479 throws com.liferay.portal.kernel.exception.PortalException, 480 com.liferay.portal.kernel.exception.SystemException { 481 getService().deleteResource(auditedModel, scope); 482 } 483 484 /** 485 * Deletes the resource matching the primary key at the scope. 486 * 487 * @param companyId the primary key of the portal instance 488 * @param name the resource's name, which should be a portlet ID if the 489 resource is a portlet or the resource's class name otherwise 490 * @param scope the scope of the resource. For more information see {@link 491 com.liferay.portal.model.ResourceConstants}. 492 * @param primKey the primary key of the resource instance 493 * @throws PortalException if a portal exception occurred 494 * @throws SystemException if a system exception occurred 495 */ 496 public static void deleteResource(long companyId, java.lang.String name, 497 int scope, long primKey) 498 throws com.liferay.portal.kernel.exception.PortalException, 499 com.liferay.portal.kernel.exception.SystemException { 500 getService().deleteResource(companyId, name, scope, primKey); 501 } 502 503 /** 504 * Deletes the resource matching the primary key at the scope. 505 * 506 * @param companyId the primary key of the portal instance 507 * @param name the resource's name, which should be a portlet ID if the 508 resource is a portlet or the resource's class name otherwise 509 * @param scope the scope of the resource. For more information see {@link 510 com.liferay.portal.model.ResourceConstants}. 511 * @param primKey the primary key string of the resource instance 512 * @throws PortalException if a portal exception occurred 513 * @throws SystemException if a system exception occurred 514 */ 515 public static void deleteResource(long companyId, java.lang.String name, 516 int scope, java.lang.String primKey) 517 throws com.liferay.portal.kernel.exception.PortalException, 518 com.liferay.portal.kernel.exception.SystemException { 519 getService().deleteResource(companyId, name, scope, primKey); 520 } 521 522 public static void deleteResources(java.lang.String name) 523 throws com.liferay.portal.kernel.exception.SystemException { 524 getService().deleteResources(name); 525 } 526 527 public static com.liferay.portal.model.Resource fetchResource( 528 long companyId, java.lang.String name, int scope, 529 java.lang.String primKey) 530 throws com.liferay.portal.kernel.exception.SystemException { 531 return getService().fetchResource(companyId, name, scope, primKey); 532 } 533 534 public static long getLatestResourceId() 535 throws com.liferay.portal.kernel.exception.SystemException { 536 return getService().getLatestResourceId(); 537 } 538 539 /** 540 * Returns a new resource with the name and primary key at the scope. 541 * 542 * @param companyId the primary key of the portal instance 543 * @param name a name for the resource, which should be a portlet ID if the 544 resource is a portlet or the resource's class name otherwise 545 * @param scope the scope of the resource. For more information see {@link 546 com.liferay.portal.model.ResourceConstants}. 547 * @param primKey the primary key string of the resource 548 * @return the new resource 549 * @throws PortalException if a portal exception occurred 550 * @throws SystemException if a system exception occurred 551 */ 552 public static com.liferay.portal.model.Resource getResource( 553 long companyId, java.lang.String name, int scope, 554 java.lang.String primKey) 555 throws com.liferay.portal.kernel.exception.PortalException, 556 com.liferay.portal.kernel.exception.SystemException { 557 return getService().getResource(companyId, name, scope, primKey); 558 } 559 560 public static java.util.List<com.liferay.portal.model.Resource> getResources() 561 throws com.liferay.portal.kernel.exception.SystemException { 562 return getService().getResources(); 563 } 564 565 /** 566 * Updates the resources for the model, replacing their group and guest 567 * permissions with new ones from the service context. 568 * 569 * @param auditedModel the model associated with the resources 570 * @param serviceContext the service context to be applied. Can set group 571 and guest permissions. 572 * @throws PortalException if a portal exception occurred 573 * @throws SystemException if a system exception occurred 574 */ 575 public static void updateModelResources( 576 com.liferay.portal.model.AuditedModel auditedModel, 577 com.liferay.portal.service.ServiceContext serviceContext) 578 throws com.liferay.portal.kernel.exception.PortalException, 579 com.liferay.portal.kernel.exception.SystemException { 580 getService().updateModelResources(auditedModel, serviceContext); 581 } 582 583 /** 584 * Updates resources matching the group, name, and primary key at the 585 * individual scope, setting new group and guest permissions. 586 * 587 * @param companyId the primary key of the portal instance 588 * @param groupId the primary key of the group 589 * @param name the resource's name, which should be a portlet ID if the 590 resource is a portlet or the resource's class name otherwise 591 * @param primKey the primary key of the resource instance 592 * @param groupPermissions the group permissions to be applied 593 * @param guestPermissions the guest permissions to be applied 594 * @throws PortalException if a portal exception occurred 595 * @throws SystemException if a system exception occurred 596 */ 597 public static void updateResources(long companyId, long groupId, 598 java.lang.String name, long primKey, 599 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 600 throws com.liferay.portal.kernel.exception.PortalException, 601 com.liferay.portal.kernel.exception.SystemException { 602 getService() 603 .updateResources(companyId, groupId, name, primKey, 604 groupPermissions, guestPermissions); 605 } 606 607 /** 608 * Updates resources matching the group, name, and primary key string at the 609 * individual scope, setting new group and guest permissions. 610 * 611 * @param companyId the primary key of the portal instance 612 * @param groupId the primary key of the group 613 * @param name the resource's name, which should be a portlet ID if the 614 resource is a portlet or the resource's class name otherwise 615 * @param primKey the primary key string of the resource instance 616 * @param groupPermissions the group permissions to be applied 617 * @param guestPermissions the guest permissions to be applied 618 * @throws PortalException if a portal exception occurred 619 * @throws SystemException if a system exception occurred 620 */ 621 public static void updateResources(long companyId, long groupId, 622 java.lang.String name, java.lang.String primKey, 623 java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) 624 throws com.liferay.portal.kernel.exception.PortalException, 625 com.liferay.portal.kernel.exception.SystemException { 626 getService() 627 .updateResources(companyId, groupId, name, primKey, 628 groupPermissions, guestPermissions); 629 } 630 631 /** 632 * Updates resources matching the name, primary key string and scope, 633 * replacing the primary key of their resource permissions with the new 634 * primary key. 635 * 636 * @param companyId the primary key of the portal instance 637 * @param name the resource's name, which should be a portlet ID if the 638 resource is a portlet or the resource's class name otherwise 639 * @param scope the scope of the resource. For more information see {@link 640 com.liferay.portal.model.ResourceConstants}. 641 * @param primKey the primary key string of the resource instance 642 * @param newPrimKey the new primary key string of the resource 643 * @throws PortalException if a portal exception occurred 644 * @throws SystemException if a system exception occurred 645 */ 646 public static void updateResources(long companyId, java.lang.String name, 647 int scope, java.lang.String primKey, java.lang.String newPrimKey) 648 throws com.liferay.portal.kernel.exception.PortalException, 649 com.liferay.portal.kernel.exception.SystemException { 650 getService().updateResources(companyId, name, scope, primKey, newPrimKey); 651 } 652 653 public static ResourceLocalService getService() { 654 if (_service == null) { 655 _service = (ResourceLocalService)PortalBeanLocatorUtil.locate(ResourceLocalService.class.getName()); 656 657 ReferenceRegistry.registerReference(ResourceLocalServiceUtil.class, 658 "_service"); 659 } 660 661 return _service; 662 } 663 664 /** 665 * @deprecated 666 */ 667 public void setService(ResourceLocalService service) { 668 } 669 670 private static ResourceLocalService _service; 671 }