1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service;
21  
22  
23  /**
24   * <a href="ResourceLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portal.service.ResourceLocalService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portal.service.ResourceLocalService
42   *
43   */
44  public class ResourceLocalServiceUtil {
45      public static com.liferay.portal.model.Resource addResource(
46          com.liferay.portal.model.Resource resource)
47          throws com.liferay.portal.SystemException {
48          return getService().addResource(resource);
49      }
50  
51      public static com.liferay.portal.model.Resource createResource(
52          long resourceId) {
53          return getService().createResource(resourceId);
54      }
55  
56      public static void deleteResource(long resourceId)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException {
59          getService().deleteResource(resourceId);
60      }
61  
62      public static void deleteResource(
63          com.liferay.portal.model.Resource resource)
64          throws com.liferay.portal.SystemException {
65          getService().deleteResource(resource);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portal.model.Resource getResource(long resourceId)
81          throws com.liferay.portal.PortalException,
82              com.liferay.portal.SystemException {
83          return getService().getResource(resourceId);
84      }
85  
86      public static java.util.List<com.liferay.portal.model.Resource> getResources(
87          int start, int end) throws com.liferay.portal.SystemException {
88          return getService().getResources(start, end);
89      }
90  
91      public static int getResourcesCount()
92          throws com.liferay.portal.SystemException {
93          return getService().getResourcesCount();
94      }
95  
96      public static com.liferay.portal.model.Resource updateResource(
97          com.liferay.portal.model.Resource resource)
98          throws com.liferay.portal.SystemException {
99          return getService().updateResource(resource);
100     }
101 
102     public static com.liferay.portal.model.Resource updateResource(
103         com.liferay.portal.model.Resource resource, boolean merge)
104         throws com.liferay.portal.SystemException {
105         return getService().updateResource(resource, merge);
106     }
107 
108     public static void addModelResources(long companyId, long groupId,
109         long userId, java.lang.String name, long primKey,
110         java.lang.String[] communityPermissions,
111         java.lang.String[] guestPermissions)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException {
114         getService()
115             .addModelResources(companyId, groupId, userId, name, primKey,
116             communityPermissions, guestPermissions);
117     }
118 
119     public static void addModelResources(long companyId, long groupId,
120         long userId, java.lang.String name, java.lang.String primKey,
121         java.lang.String[] communityPermissions,
122         java.lang.String[] guestPermissions)
123         throws com.liferay.portal.PortalException,
124             com.liferay.portal.SystemException {
125         getService()
126             .addModelResources(companyId, groupId, userId, name, primKey,
127             communityPermissions, guestPermissions);
128     }
129 
130     public static com.liferay.portal.model.Resource addResource(
131         long companyId, java.lang.String name, int scope,
132         java.lang.String primKey) throws com.liferay.portal.SystemException {
133         return getService().addResource(companyId, name, scope, primKey);
134     }
135 
136     public static void addResources(long companyId, long groupId,
137         java.lang.String name, boolean portletActions)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException {
140         getService().addResources(companyId, groupId, name, portletActions);
141     }
142 
143     public static void addResources(long companyId, long groupId, long userId,
144         java.lang.String name, long primKey, boolean portletActions,
145         boolean addCommunityPermissions, boolean addGuestPermissions)
146         throws com.liferay.portal.PortalException,
147             com.liferay.portal.SystemException {
148         getService()
149             .addResources(companyId, groupId, userId, name, primKey,
150             portletActions, addCommunityPermissions, addGuestPermissions);
151     }
152 
153     public static void addResources(long companyId, long groupId, long userId,
154         java.lang.String name, java.lang.String primKey,
155         boolean portletActions, boolean addCommunityPermissions,
156         boolean addGuestPermissions)
157         throws com.liferay.portal.PortalException,
158             com.liferay.portal.SystemException {
159         getService()
160             .addResources(companyId, groupId, userId, name, primKey,
161             portletActions, addCommunityPermissions, addGuestPermissions);
162     }
163 
164     public static void deleteResource(long companyId, java.lang.String name,
165         int scope, long primKey)
166         throws com.liferay.portal.PortalException,
167             com.liferay.portal.SystemException {
168         getService().deleteResource(companyId, name, scope, primKey);
169     }
170 
171     public static void deleteResource(long companyId, java.lang.String name,
172         int scope, java.lang.String primKey)
173         throws com.liferay.portal.PortalException,
174             com.liferay.portal.SystemException {
175         getService().deleteResource(companyId, name, scope, primKey);
176     }
177 
178     public static void deleteResources(java.lang.String name)
179         throws com.liferay.portal.SystemException {
180         getService().deleteResources(name);
181     }
182 
183     public static long getLatestResourceId()
184         throws com.liferay.portal.SystemException {
185         return getService().getLatestResourceId();
186     }
187 
188     public static com.liferay.portal.model.Resource getResource(
189         long companyId, java.lang.String name, int scope,
190         java.lang.String primKey)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException {
193         return getService().getResource(companyId, name, scope, primKey);
194     }
195 
196     public static java.util.List<com.liferay.portal.model.Resource> getResources()
197         throws com.liferay.portal.SystemException {
198         return getService().getResources();
199     }
200 
201     public static void updateResources(long companyId, long groupId,
202         java.lang.String name, long primKey,
203         java.lang.String[] communityPermissions,
204         java.lang.String[] guestPermissions)
205         throws com.liferay.portal.PortalException,
206             com.liferay.portal.SystemException {
207         getService()
208             .updateResources(companyId, groupId, name, primKey,
209             communityPermissions, guestPermissions);
210     }
211 
212     public static void updateResources(long companyId, long groupId,
213         java.lang.String name, java.lang.String primKey,
214         java.lang.String[] communityPermissions,
215         java.lang.String[] guestPermissions)
216         throws com.liferay.portal.PortalException,
217             com.liferay.portal.SystemException {
218         getService()
219             .updateResources(companyId, groupId, name, primKey,
220             communityPermissions, guestPermissions);
221     }
222 
223     public static ResourceLocalService getService() {
224         if (_service == null) {
225             throw new RuntimeException("ResourceLocalService is not set");
226         }
227 
228         return _service;
229     }
230 
231     public void setService(ResourceLocalService service) {
232         _service = service;
233     }
234 
235     private static ResourceLocalService _service;
236 }