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