1   /**
2    * Copyright (c) 2000-2007 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   * <a href="ResourceLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portal.service.ResourceLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portal.service.ResourceLocalServiceFactory</code> is responsible
42   * for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portal.service.ResourceLocalService
48   * @see com.liferay.portal.service.ResourceLocalServiceFactory
49   *
50   */
51  public class ResourceLocalServiceUtil {
52      public static com.liferay.portal.model.Resource addResource(
53          com.liferay.portal.model.Resource model)
54          throws com.liferay.portal.SystemException {
55          ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
56  
57          return resourceLocalService.addResource(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
64  
65          return resourceLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
72  
73          return resourceLocalService.dynamicQuery(queryInitializer, begin, end);
74      }
75  
76      public static com.liferay.portal.model.Resource updateResource(
77          com.liferay.portal.model.Resource model)
78          throws com.liferay.portal.SystemException {
79          ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
80  
81          return resourceLocalService.updateResource(model);
82      }
83  
84      public static void addModelResources(long companyId, long groupId,
85          long userId, java.lang.String name, long primKey,
86          java.lang.String[] communityPermissions,
87          java.lang.String[] guestPermissions)
88          throws com.liferay.portal.PortalException, 
89              com.liferay.portal.SystemException {
90          ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
91          resourceLocalService.addModelResources(companyId, groupId, userId,
92              name, primKey, communityPermissions, guestPermissions);
93      }
94  
95      public static void addModelResources(long companyId, long groupId,
96          long userId, java.lang.String name, java.lang.String primKey,
97          java.lang.String[] communityPermissions,
98          java.lang.String[] guestPermissions)
99          throws com.liferay.portal.PortalException, 
100             com.liferay.portal.SystemException {
101         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
102         resourceLocalService.addModelResources(companyId, groupId, userId,
103             name, primKey, communityPermissions, guestPermissions);
104     }
105 
106     public static com.liferay.portal.model.Resource addResource(
107         long companyId, java.lang.String name, int scope,
108         java.lang.String primKey)
109         throws com.liferay.portal.PortalException, 
110             com.liferay.portal.SystemException {
111         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
112 
113         return resourceLocalService.addResource(companyId, name, scope, primKey);
114     }
115 
116     public static void addResources(long companyId, long groupId,
117         java.lang.String name, boolean portletActions)
118         throws com.liferay.portal.PortalException, 
119             com.liferay.portal.SystemException {
120         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
121         resourceLocalService.addResources(companyId, groupId, name,
122             portletActions);
123     }
124 
125     public static void addResources(long companyId, long groupId, long userId,
126         java.lang.String name, long primKey, boolean portletActions,
127         boolean addCommunityPermissions, boolean addGuestPermissions)
128         throws com.liferay.portal.PortalException, 
129             com.liferay.portal.SystemException {
130         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
131         resourceLocalService.addResources(companyId, groupId, userId, name,
132             primKey, portletActions, addCommunityPermissions,
133             addGuestPermissions);
134     }
135 
136     public static void addResources(long companyId, long groupId, long userId,
137         java.lang.String name, java.lang.String primKey,
138         boolean portletActions, boolean addCommunityPermissions,
139         boolean addGuestPermissions)
140         throws com.liferay.portal.PortalException, 
141             com.liferay.portal.SystemException {
142         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
143         resourceLocalService.addResources(companyId, groupId, userId, name,
144             primKey, portletActions, addCommunityPermissions,
145             addGuestPermissions);
146     }
147 
148     public static void deleteResource(long resourceId)
149         throws com.liferay.portal.PortalException, 
150             com.liferay.portal.SystemException {
151         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
152         resourceLocalService.deleteResource(resourceId);
153     }
154 
155     public static void deleteResource(
156         com.liferay.portal.model.Resource resource)
157         throws com.liferay.portal.PortalException, 
158             com.liferay.portal.SystemException {
159         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
160         resourceLocalService.deleteResource(resource);
161     }
162 
163     public static void deleteResource(long companyId, java.lang.String name,
164         int scope, long primKey)
165         throws com.liferay.portal.PortalException, 
166             com.liferay.portal.SystemException {
167         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
168         resourceLocalService.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         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
176         resourceLocalService.deleteResource(companyId, name, scope, primKey);
177     }
178 
179     public static void deleteResources(java.lang.String name)
180         throws com.liferay.portal.PortalException, 
181             com.liferay.portal.SystemException {
182         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
183         resourceLocalService.deleteResources(name);
184     }
185 
186     public static long getLatestResourceId()
187         throws com.liferay.portal.PortalException, 
188             com.liferay.portal.SystemException {
189         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
190 
191         return resourceLocalService.getLatestResourceId();
192     }
193 
194     public static com.liferay.portal.model.Resource getResource(long resourceId)
195         throws com.liferay.portal.PortalException, 
196             com.liferay.portal.SystemException {
197         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
198 
199         return resourceLocalService.getResource(resourceId);
200     }
201 
202     public static java.util.List getResources()
203         throws com.liferay.portal.SystemException {
204         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
205 
206         return resourceLocalService.getResources();
207     }
208 
209     public static com.liferay.portal.model.Resource getResource(
210         long companyId, java.lang.String name, int scope,
211         java.lang.String primKey)
212         throws com.liferay.portal.PortalException, 
213             com.liferay.portal.SystemException {
214         ResourceLocalService resourceLocalService = ResourceLocalServiceFactory.getService();
215 
216         return resourceLocalService.getResource(companyId, name, scope, primKey);
217     }
218 }