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      public static java.util.List<Object> dynamicQuery(
64          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
65          throws com.liferay.portal.kernel.exception.SystemException {
66          return getService().dynamicQuery(dynamicQuery);
67      }
68  
69      public static java.util.List<Object> dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
71          int end) throws com.liferay.portal.kernel.exception.SystemException {
72          return getService().dynamicQuery(dynamicQuery, start, end);
73      }
74  
75      public static java.util.List<Object> dynamicQuery(
76          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
77          int end,
78          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
79          throws com.liferay.portal.kernel.exception.SystemException {
80          return getService()
81                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
82      }
83  
84      public static int dynamicQueryCount(
85          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
86          throws com.liferay.portal.kernel.exception.SystemException {
87          return getService().dynamicQueryCount(dynamicQuery);
88      }
89  
90      public static com.liferay.portal.model.Resource getResource(long resourceId)
91          throws com.liferay.portal.kernel.exception.PortalException,
92              com.liferay.portal.kernel.exception.SystemException {
93          return getService().getResource(resourceId);
94      }
95  
96      public static java.util.List<com.liferay.portal.model.Resource> getResources(
97          int start, int end)
98          throws com.liferay.portal.kernel.exception.SystemException {
99          return getService().getResources(start, end);
100     }
101 
102     public static int getResourcesCount()
103         throws com.liferay.portal.kernel.exception.SystemException {
104         return getService().getResourcesCount();
105     }
106 
107     public static com.liferay.portal.model.Resource updateResource(
108         com.liferay.portal.model.Resource resource)
109         throws com.liferay.portal.kernel.exception.SystemException {
110         return getService().updateResource(resource);
111     }
112 
113     public static com.liferay.portal.model.Resource updateResource(
114         com.liferay.portal.model.Resource resource, boolean merge)
115         throws com.liferay.portal.kernel.exception.SystemException {
116         return getService().updateResource(resource, merge);
117     }
118 
119     public static void addModelResources(long companyId, long groupId,
120         long userId, java.lang.String name, long primKey,
121         java.lang.String[] communityPermissions,
122         java.lang.String[] guestPermissions)
123         throws com.liferay.portal.kernel.exception.PortalException,
124             com.liferay.portal.kernel.exception.SystemException {
125         getService()
126             .addModelResources(companyId, groupId, userId, name, primKey,
127             communityPermissions, guestPermissions);
128     }
129 
130     public static void addModelResources(long companyId, long groupId,
131         long userId, java.lang.String name, java.lang.String primKey,
132         java.lang.String[] communityPermissions,
133         java.lang.String[] guestPermissions)
134         throws com.liferay.portal.kernel.exception.PortalException,
135             com.liferay.portal.kernel.exception.SystemException {
136         getService()
137             .addModelResources(companyId, groupId, userId, name, primKey,
138             communityPermissions, guestPermissions);
139     }
140 
141     public static com.liferay.portal.model.Resource addResource(
142         long companyId, java.lang.String name, int scope,
143         java.lang.String primKey)
144         throws com.liferay.portal.kernel.exception.SystemException {
145         return getService().addResource(companyId, name, scope, primKey);
146     }
147 
148     public static void addResources(long companyId, long groupId,
149         java.lang.String name, boolean portletActions)
150         throws com.liferay.portal.kernel.exception.PortalException,
151             com.liferay.portal.kernel.exception.SystemException {
152         getService().addResources(companyId, groupId, name, portletActions);
153     }
154 
155     public static void addResources(long companyId, long groupId, long userId,
156         java.lang.String name, long primKey, boolean portletActions,
157         boolean addCommunityPermissions, boolean addGuestPermissions)
158         throws com.liferay.portal.kernel.exception.PortalException,
159             com.liferay.portal.kernel.exception.SystemException {
160         getService()
161             .addResources(companyId, groupId, userId, name, primKey,
162             portletActions, addCommunityPermissions, addGuestPermissions);
163     }
164 
165     public static void addResources(long companyId, long groupId, long userId,
166         java.lang.String name, java.lang.String primKey,
167         boolean portletActions, boolean addCommunityPermissions,
168         boolean addGuestPermissions)
169         throws com.liferay.portal.kernel.exception.PortalException,
170             com.liferay.portal.kernel.exception.SystemException {
171         getService()
172             .addResources(companyId, groupId, userId, name, primKey,
173             portletActions, addCommunityPermissions, addGuestPermissions);
174     }
175 
176     public static void deleteResource(long companyId, java.lang.String name,
177         int scope, long primKey)
178         throws com.liferay.portal.kernel.exception.PortalException,
179             com.liferay.portal.kernel.exception.SystemException {
180         getService().deleteResource(companyId, name, scope, primKey);
181     }
182 
183     public static void deleteResource(long companyId, java.lang.String name,
184         int scope, java.lang.String primKey)
185         throws com.liferay.portal.kernel.exception.PortalException,
186             com.liferay.portal.kernel.exception.SystemException {
187         getService().deleteResource(companyId, name, scope, primKey);
188     }
189 
190     public static void deleteResources(java.lang.String name)
191         throws com.liferay.portal.kernel.exception.SystemException {
192         getService().deleteResources(name);
193     }
194 
195     public static long getLatestResourceId()
196         throws com.liferay.portal.kernel.exception.SystemException {
197         return getService().getLatestResourceId();
198     }
199 
200     public static com.liferay.portal.model.Resource getResource(
201         long companyId, java.lang.String name, int scope,
202         java.lang.String primKey)
203         throws com.liferay.portal.kernel.exception.PortalException,
204             com.liferay.portal.kernel.exception.SystemException {
205         return getService().getResource(companyId, name, scope, primKey);
206     }
207 
208     public static java.util.List<com.liferay.portal.model.Resource> getResources()
209         throws com.liferay.portal.kernel.exception.SystemException {
210         return getService().getResources();
211     }
212 
213     public static void updateResources(long companyId, long groupId,
214         java.lang.String name, long primKey,
215         java.lang.String[] communityPermissions,
216         java.lang.String[] guestPermissions)
217         throws com.liferay.portal.kernel.exception.PortalException,
218             com.liferay.portal.kernel.exception.SystemException {
219         getService()
220             .updateResources(companyId, groupId, name, primKey,
221             communityPermissions, guestPermissions);
222     }
223 
224     public static void updateResources(long companyId, long groupId,
225         java.lang.String name, java.lang.String primKey,
226         java.lang.String[] communityPermissions,
227         java.lang.String[] guestPermissions)
228         throws com.liferay.portal.kernel.exception.PortalException,
229             com.liferay.portal.kernel.exception.SystemException {
230         getService()
231             .updateResources(companyId, groupId, name, primKey,
232             communityPermissions, guestPermissions);
233     }
234 
235     public static ResourceLocalService getService() {
236         if (_service == null) {
237             _service = (ResourceLocalService)PortalBeanLocatorUtil.locate(ResourceLocalService.class.getName());
238         }
239 
240         return _service;
241     }
242 
243     public void setService(ResourceLocalService service) {
244         _service = service;
245     }
246 
247     private static ResourceLocalService _service;
248 }