1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="ResourceLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link ResourceLocalService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       ResourceLocalService
37   * @generated
38   */
39  public class ResourceLocalServiceUtil {
40      public static com.liferay.portal.model.Resource addResource(
41          com.liferay.portal.model.Resource resource)
42          throws com.liferay.portal.kernel.exception.SystemException {
43          return getService().addResource(resource);
44      }
45  
46      public static com.liferay.portal.model.Resource createResource(
47          long resourceId) {
48          return getService().createResource(resourceId);
49      }
50  
51      public static void deleteResource(long resourceId)
52          throws com.liferay.portal.kernel.exception.PortalException,
53              com.liferay.portal.kernel.exception.SystemException {
54          getService().deleteResource(resourceId);
55      }
56  
57      public static void deleteResource(
58          com.liferay.portal.model.Resource resource)
59          throws com.liferay.portal.kernel.exception.SystemException {
60          getService().deleteResource(resource);
61      }
62  
63      @SuppressWarnings("unchecked")
64      public static java.util.List dynamicQuery(
65          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
66          throws com.liferay.portal.kernel.exception.SystemException {
67          return getService().dynamicQuery(dynamicQuery);
68      }
69  
70      @SuppressWarnings("unchecked")
71      public static java.util.List dynamicQuery(
72          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
73          int end) throws com.liferay.portal.kernel.exception.SystemException {
74          return getService().dynamicQuery(dynamicQuery, start, end);
75      }
76  
77      @SuppressWarnings("unchecked")
78      public static java.util.List dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
80          int end,
81          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
82          throws com.liferay.portal.kernel.exception.SystemException {
83          return getService()
84                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
85      }
86  
87      public static long dynamicQueryCount(
88          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
89          throws com.liferay.portal.kernel.exception.SystemException {
90          return getService().dynamicQueryCount(dynamicQuery);
91      }
92  
93      public static com.liferay.portal.model.Resource getResource(long resourceId)
94          throws com.liferay.portal.kernel.exception.PortalException,
95              com.liferay.portal.kernel.exception.SystemException {
96          return getService().getResource(resourceId);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.Resource> getResources(
100         int start, int end)
101         throws com.liferay.portal.kernel.exception.SystemException {
102         return getService().getResources(start, end);
103     }
104 
105     public static int getResourcesCount()
106         throws com.liferay.portal.kernel.exception.SystemException {
107         return getService().getResourcesCount();
108     }
109 
110     public static com.liferay.portal.model.Resource updateResource(
111         com.liferay.portal.model.Resource resource)
112         throws com.liferay.portal.kernel.exception.SystemException {
113         return getService().updateResource(resource);
114     }
115 
116     public static com.liferay.portal.model.Resource updateResource(
117         com.liferay.portal.model.Resource resource, boolean merge)
118         throws com.liferay.portal.kernel.exception.SystemException {
119         return getService().updateResource(resource, merge);
120     }
121 
122     public static void addModelResources(long companyId, long groupId,
123         long userId, java.lang.String name, long primKey,
124         java.lang.String[] communityPermissions,
125         java.lang.String[] guestPermissions)
126         throws com.liferay.portal.kernel.exception.PortalException,
127             com.liferay.portal.kernel.exception.SystemException {
128         getService()
129             .addModelResources(companyId, groupId, userId, name, primKey,
130             communityPermissions, guestPermissions);
131     }
132 
133     public static void addModelResources(long companyId, long groupId,
134         long userId, java.lang.String name, java.lang.String primKey,
135         java.lang.String[] communityPermissions,
136         java.lang.String[] guestPermissions)
137         throws com.liferay.portal.kernel.exception.PortalException,
138             com.liferay.portal.kernel.exception.SystemException {
139         getService()
140             .addModelResources(companyId, groupId, userId, name, primKey,
141             communityPermissions, guestPermissions);
142     }
143 
144     public static com.liferay.portal.model.Resource addResource(
145         long companyId, java.lang.String name, int scope,
146         java.lang.String primKey)
147         throws com.liferay.portal.kernel.exception.SystemException {
148         return getService().addResource(companyId, name, scope, primKey);
149     }
150 
151     public static void addResources(long companyId, long groupId,
152         java.lang.String name, boolean portletActions)
153         throws com.liferay.portal.kernel.exception.PortalException,
154             com.liferay.portal.kernel.exception.SystemException {
155         getService().addResources(companyId, groupId, name, portletActions);
156     }
157 
158     public static void addResources(long companyId, long groupId, long userId,
159         java.lang.String name, long primKey, boolean portletActions,
160         boolean addCommunityPermissions, boolean addGuestPermissions)
161         throws com.liferay.portal.kernel.exception.PortalException,
162             com.liferay.portal.kernel.exception.SystemException {
163         getService()
164             .addResources(companyId, groupId, userId, name, primKey,
165             portletActions, addCommunityPermissions, addGuestPermissions);
166     }
167 
168     public static void addResources(long companyId, long groupId, long userId,
169         java.lang.String name, java.lang.String primKey,
170         boolean portletActions, boolean addCommunityPermissions,
171         boolean addGuestPermissions)
172         throws com.liferay.portal.kernel.exception.PortalException,
173             com.liferay.portal.kernel.exception.SystemException {
174         getService()
175             .addResources(companyId, groupId, userId, name, primKey,
176             portletActions, addCommunityPermissions, addGuestPermissions);
177     }
178 
179     public static void deleteResource(long companyId, java.lang.String name,
180         int scope, long primKey)
181         throws com.liferay.portal.kernel.exception.PortalException,
182             com.liferay.portal.kernel.exception.SystemException {
183         getService().deleteResource(companyId, name, scope, primKey);
184     }
185 
186     public static void deleteResource(long companyId, java.lang.String name,
187         int scope, java.lang.String primKey)
188         throws com.liferay.portal.kernel.exception.PortalException,
189             com.liferay.portal.kernel.exception.SystemException {
190         getService().deleteResource(companyId, name, scope, primKey);
191     }
192 
193     public static void deleteResources(java.lang.String name)
194         throws com.liferay.portal.kernel.exception.SystemException {
195         getService().deleteResources(name);
196     }
197 
198     public static long getLatestResourceId()
199         throws com.liferay.portal.kernel.exception.SystemException {
200         return getService().getLatestResourceId();
201     }
202 
203     public static com.liferay.portal.model.Resource getResource(
204         long companyId, java.lang.String name, int scope,
205         java.lang.String primKey)
206         throws com.liferay.portal.kernel.exception.PortalException,
207             com.liferay.portal.kernel.exception.SystemException {
208         return getService().getResource(companyId, name, scope, primKey);
209     }
210 
211     public static java.util.List<com.liferay.portal.model.Resource> getResources()
212         throws com.liferay.portal.kernel.exception.SystemException {
213         return getService().getResources();
214     }
215 
216     public static void updateResources(long companyId, long groupId,
217         java.lang.String name, long primKey,
218         java.lang.String[] communityPermissions,
219         java.lang.String[] guestPermissions)
220         throws com.liferay.portal.kernel.exception.PortalException,
221             com.liferay.portal.kernel.exception.SystemException {
222         getService()
223             .updateResources(companyId, groupId, name, primKey,
224             communityPermissions, guestPermissions);
225     }
226 
227     public static void updateResources(long companyId, long groupId,
228         java.lang.String name, java.lang.String primKey,
229         java.lang.String[] communityPermissions,
230         java.lang.String[] guestPermissions)
231         throws com.liferay.portal.kernel.exception.PortalException,
232             com.liferay.portal.kernel.exception.SystemException {
233         getService()
234             .updateResources(companyId, groupId, name, primKey,
235             communityPermissions, guestPermissions);
236     }
237 
238     public static ResourceLocalService getService() {
239         if (_service == null) {
240             _service = (ResourceLocalService)PortalBeanLocatorUtil.locate(ResourceLocalService.class.getName());
241         }
242 
243         return _service;
244     }
245 
246     public void setService(ResourceLocalService service) {
247         _service = service;
248     }
249 
250     private static ResourceLocalService _service;
251 }