1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="ResourceLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link ResourceLocalService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       ResourceLocalService
39   * @generated
40   */
41  public class ResourceLocalServiceUtil {
42      public static com.liferay.portal.model.Resource addResource(
43          com.liferay.portal.model.Resource resource)
44          throws com.liferay.portal.SystemException {
45          return getService().addResource(resource);
46      }
47  
48      public static com.liferay.portal.model.Resource createResource(
49          long resourceId) {
50          return getService().createResource(resourceId);
51      }
52  
53      public static void deleteResource(long resourceId)
54          throws com.liferay.portal.PortalException,
55              com.liferay.portal.SystemException {
56          getService().deleteResource(resourceId);
57      }
58  
59      public static void deleteResource(
60          com.liferay.portal.model.Resource resource)
61          throws com.liferay.portal.SystemException {
62          getService().deleteResource(resource);
63      }
64  
65      @SuppressWarnings("rawtypes")
66      public static java.util.List dynamicQuery(
67          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
68          throws com.liferay.portal.SystemException {
69          return getService().dynamicQuery(dynamicQuery);
70      }
71  
72      @SuppressWarnings("rawtypes")
73      public static java.util.List dynamicQuery(
74          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
75          int end) throws com.liferay.portal.SystemException {
76          return getService().dynamicQuery(dynamicQuery, start, end);
77      }
78  
79      @SuppressWarnings("rawtypes")
80      public static java.util.List dynamicQuery(
81          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
82          int end,
83          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
84          throws com.liferay.portal.SystemException {
85          return getService()
86                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
87      }
88  
89      public static int dynamicQueryCount(
90          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
91          throws com.liferay.portal.SystemException {
92          return getService().dynamicQueryCount(dynamicQuery);
93      }
94  
95      public static com.liferay.portal.model.Resource getResource(long resourceId)
96          throws com.liferay.portal.PortalException,
97              com.liferay.portal.SystemException {
98          return getService().getResource(resourceId);
99      }
100 
101     public static java.util.List<com.liferay.portal.model.Resource> getResources(
102         int start, int end) throws com.liferay.portal.SystemException {
103         return getService().getResources(start, end);
104     }
105 
106     public static int getResourcesCount()
107         throws com.liferay.portal.SystemException {
108         return getService().getResourcesCount();
109     }
110 
111     public static com.liferay.portal.model.Resource updateResource(
112         com.liferay.portal.model.Resource resource)
113         throws com.liferay.portal.SystemException {
114         return getService().updateResource(resource);
115     }
116 
117     public static com.liferay.portal.model.Resource updateResource(
118         com.liferay.portal.model.Resource resource, boolean merge)
119         throws com.liferay.portal.SystemException {
120         return getService().updateResource(resource, merge);
121     }
122 
123     public static void addModelResources(long companyId, long groupId,
124         long userId, java.lang.String name, long primKey,
125         java.lang.String[] communityPermissions,
126         java.lang.String[] guestPermissions)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException {
129         getService()
130             .addModelResources(companyId, groupId, userId, name, primKey,
131             communityPermissions, guestPermissions);
132     }
133 
134     public static void addModelResources(long companyId, long groupId,
135         long userId, java.lang.String name, java.lang.String primKey,
136         java.lang.String[] communityPermissions,
137         java.lang.String[] guestPermissions)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException {
140         getService()
141             .addModelResources(companyId, groupId, userId, name, primKey,
142             communityPermissions, guestPermissions);
143     }
144 
145     public static com.liferay.portal.model.Resource addResource(
146         long companyId, java.lang.String name, int scope,
147         java.lang.String primKey) throws com.liferay.portal.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.PortalException,
154             com.liferay.portal.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.PortalException,
162             com.liferay.portal.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.PortalException,
173             com.liferay.portal.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.PortalException,
182             com.liferay.portal.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.PortalException,
189             com.liferay.portal.SystemException {
190         getService().deleteResource(companyId, name, scope, primKey);
191     }
192 
193     public static void deleteResources(java.lang.String name)
194         throws com.liferay.portal.SystemException {
195         getService().deleteResources(name);
196     }
197 
198     public static long getLatestResourceId()
199         throws com.liferay.portal.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.PortalException,
207             com.liferay.portal.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.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.PortalException,
221             com.liferay.portal.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.PortalException,
232             com.liferay.portal.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             ReferenceRegistry.registerReference(ResourceLocalServiceUtil.class,
243                 "_service");
244             MethodCache.remove(ResourceLocalService.class);
245         }
246 
247         return _service;
248     }
249 
250     public void setService(ResourceLocalService service) {
251         MethodCache.remove(ResourceLocalService.class);
252 
253         _service = service;
254 
255         ReferenceRegistry.registerReference(ResourceLocalServiceUtil.class,
256             "_service");
257         MethodCache.remove(ResourceLocalService.class);
258     }
259 
260     private static ResourceLocalService _service;
261 }