1   /**
2    * Copyright (c) 2000-2008 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.persistence;
24  
25  /**
26   * <a href="LayoutUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class LayoutUtil {
32      public static com.liferay.portal.model.Layout create(long plid) {
33          return getPersistence().create(plid);
34      }
35  
36      public static com.liferay.portal.model.Layout remove(long plid)
37          throws com.liferay.portal.SystemException,
38              com.liferay.portal.NoSuchLayoutException {
39          return getPersistence().remove(plid);
40      }
41  
42      public static com.liferay.portal.model.Layout remove(
43          com.liferay.portal.model.Layout layout)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(layout);
46      }
47  
48      /**
49       * @deprecated Use <code>update(Layout layout, boolean merge)</code>.
50       */
51      public static com.liferay.portal.model.Layout update(
52          com.liferay.portal.model.Layout layout)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(layout);
55      }
56  
57      /**
58       * Add, update, or merge, the entity. This method also calls the model
59       * listeners to trigger the proper events associated with adding, deleting,
60       * or updating an entity.
61       *
62       * @param        layout the entity to add, update, or merge
63       * @param        merge boolean value for whether to merge the entity. The
64       *                default value is false. Setting merge to true is more
65       *                expensive and should only be true when layout is
66       *                transient. See LEP-5473 for a detailed discussion of this
67       *                method.
68       * @return        true if the portlet can be displayed via Ajax
69       */
70      public static com.liferay.portal.model.Layout update(
71          com.liferay.portal.model.Layout layout, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(layout, merge);
74      }
75  
76      public static com.liferay.portal.model.Layout updateImpl(
77          com.liferay.portal.model.Layout layout, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(layout, merge);
80      }
81  
82      public static com.liferay.portal.model.Layout findByPrimaryKey(long plid)
83          throws com.liferay.portal.SystemException,
84              com.liferay.portal.NoSuchLayoutException {
85          return getPersistence().findByPrimaryKey(plid);
86      }
87  
88      public static com.liferay.portal.model.Layout fetchByPrimaryKey(long plid)
89          throws com.liferay.portal.SystemException {
90          return getPersistence().fetchByPrimaryKey(plid);
91      }
92  
93      public static java.util.List<com.liferay.portal.model.Layout> findByGroupId(
94          long groupId) throws com.liferay.portal.SystemException {
95          return getPersistence().findByGroupId(groupId);
96      }
97  
98      public static java.util.List<com.liferay.portal.model.Layout> findByGroupId(
99          long groupId, int begin, int end)
100         throws com.liferay.portal.SystemException {
101         return getPersistence().findByGroupId(groupId, begin, end);
102     }
103 
104     public static java.util.List<com.liferay.portal.model.Layout> findByGroupId(
105         long groupId, int begin, int end,
106         com.liferay.portal.kernel.util.OrderByComparator obc)
107         throws com.liferay.portal.SystemException {
108         return getPersistence().findByGroupId(groupId, begin, end, obc);
109     }
110 
111     public static com.liferay.portal.model.Layout findByGroupId_First(
112         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
113         throws com.liferay.portal.SystemException,
114             com.liferay.portal.NoSuchLayoutException {
115         return getPersistence().findByGroupId_First(groupId, obc);
116     }
117 
118     public static com.liferay.portal.model.Layout findByGroupId_Last(
119         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
120         throws com.liferay.portal.SystemException,
121             com.liferay.portal.NoSuchLayoutException {
122         return getPersistence().findByGroupId_Last(groupId, obc);
123     }
124 
125     public static com.liferay.portal.model.Layout[] findByGroupId_PrevAndNext(
126         long plid, long groupId,
127         com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.SystemException,
129             com.liferay.portal.NoSuchLayoutException {
130         return getPersistence().findByGroupId_PrevAndNext(plid, groupId, obc);
131     }
132 
133     public static java.util.List<com.liferay.portal.model.Layout> findByCompanyId(
134         long companyId) throws com.liferay.portal.SystemException {
135         return getPersistence().findByCompanyId(companyId);
136     }
137 
138     public static java.util.List<com.liferay.portal.model.Layout> findByCompanyId(
139         long companyId, int begin, int end)
140         throws com.liferay.portal.SystemException {
141         return getPersistence().findByCompanyId(companyId, begin, end);
142     }
143 
144     public static java.util.List<com.liferay.portal.model.Layout> findByCompanyId(
145         long companyId, int begin, int end,
146         com.liferay.portal.kernel.util.OrderByComparator obc)
147         throws com.liferay.portal.SystemException {
148         return getPersistence().findByCompanyId(companyId, begin, end, obc);
149     }
150 
151     public static com.liferay.portal.model.Layout findByCompanyId_First(
152         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
153         throws com.liferay.portal.SystemException,
154             com.liferay.portal.NoSuchLayoutException {
155         return getPersistence().findByCompanyId_First(companyId, obc);
156     }
157 
158     public static com.liferay.portal.model.Layout findByCompanyId_Last(
159         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
160         throws com.liferay.portal.SystemException,
161             com.liferay.portal.NoSuchLayoutException {
162         return getPersistence().findByCompanyId_Last(companyId, obc);
163     }
164 
165     public static com.liferay.portal.model.Layout[] findByCompanyId_PrevAndNext(
166         long plid, long companyId,
167         com.liferay.portal.kernel.util.OrderByComparator obc)
168         throws com.liferay.portal.SystemException,
169             com.liferay.portal.NoSuchLayoutException {
170         return getPersistence().findByCompanyId_PrevAndNext(plid, companyId, obc);
171     }
172 
173     public static com.liferay.portal.model.Layout findByDLFolderId(
174         long dlFolderId)
175         throws com.liferay.portal.SystemException,
176             com.liferay.portal.NoSuchLayoutException {
177         return getPersistence().findByDLFolderId(dlFolderId);
178     }
179 
180     public static com.liferay.portal.model.Layout fetchByDLFolderId(
181         long dlFolderId) throws com.liferay.portal.SystemException {
182         return getPersistence().fetchByDLFolderId(dlFolderId);
183     }
184 
185     public static com.liferay.portal.model.Layout findByIconImageId(
186         long iconImageId)
187         throws com.liferay.portal.SystemException,
188             com.liferay.portal.NoSuchLayoutException {
189         return getPersistence().findByIconImageId(iconImageId);
190     }
191 
192     public static com.liferay.portal.model.Layout fetchByIconImageId(
193         long iconImageId) throws com.liferay.portal.SystemException {
194         return getPersistence().fetchByIconImageId(iconImageId);
195     }
196 
197     public static java.util.List<com.liferay.portal.model.Layout> findByG_P(
198         long groupId, boolean privateLayout)
199         throws com.liferay.portal.SystemException {
200         return getPersistence().findByG_P(groupId, privateLayout);
201     }
202 
203     public static java.util.List<com.liferay.portal.model.Layout> findByG_P(
204         long groupId, boolean privateLayout, int begin, int end)
205         throws com.liferay.portal.SystemException {
206         return getPersistence().findByG_P(groupId, privateLayout, begin, end);
207     }
208 
209     public static java.util.List<com.liferay.portal.model.Layout> findByG_P(
210         long groupId, boolean privateLayout, int begin, int end,
211         com.liferay.portal.kernel.util.OrderByComparator obc)
212         throws com.liferay.portal.SystemException {
213         return getPersistence()
214                    .findByG_P(groupId, privateLayout, begin, end, obc);
215     }
216 
217     public static com.liferay.portal.model.Layout findByG_P_First(
218         long groupId, boolean privateLayout,
219         com.liferay.portal.kernel.util.OrderByComparator obc)
220         throws com.liferay.portal.SystemException,
221             com.liferay.portal.NoSuchLayoutException {
222         return getPersistence().findByG_P_First(groupId, privateLayout, obc);
223     }
224 
225     public static com.liferay.portal.model.Layout findByG_P_Last(long groupId,
226         boolean privateLayout,
227         com.liferay.portal.kernel.util.OrderByComparator obc)
228         throws com.liferay.portal.SystemException,
229             com.liferay.portal.NoSuchLayoutException {
230         return getPersistence().findByG_P_Last(groupId, privateLayout, obc);
231     }
232 
233     public static com.liferay.portal.model.Layout[] findByG_P_PrevAndNext(
234         long plid, long groupId, boolean privateLayout,
235         com.liferay.portal.kernel.util.OrderByComparator obc)
236         throws com.liferay.portal.SystemException,
237             com.liferay.portal.NoSuchLayoutException {
238         return getPersistence()
239                    .findByG_P_PrevAndNext(plid, groupId, privateLayout, obc);
240     }
241 
242     public static com.liferay.portal.model.Layout findByG_P_L(long groupId,
243         boolean privateLayout, long layoutId)
244         throws com.liferay.portal.SystemException,
245             com.liferay.portal.NoSuchLayoutException {
246         return getPersistence().findByG_P_L(groupId, privateLayout, layoutId);
247     }
248 
249     public static com.liferay.portal.model.Layout fetchByG_P_L(long groupId,
250         boolean privateLayout, long layoutId)
251         throws com.liferay.portal.SystemException {
252         return getPersistence().fetchByG_P_L(groupId, privateLayout, layoutId);
253     }
254 
255     public static java.util.List<com.liferay.portal.model.Layout> findByG_P_P(
256         long groupId, boolean privateLayout, long parentLayoutId)
257         throws com.liferay.portal.SystemException {
258         return getPersistence()
259                    .findByG_P_P(groupId, privateLayout, parentLayoutId);
260     }
261 
262     public static java.util.List<com.liferay.portal.model.Layout> findByG_P_P(
263         long groupId, boolean privateLayout, long parentLayoutId, int begin,
264         int end) throws com.liferay.portal.SystemException {
265         return getPersistence()
266                    .findByG_P_P(groupId, privateLayout, parentLayoutId, begin,
267             end);
268     }
269 
270     public static java.util.List<com.liferay.portal.model.Layout> findByG_P_P(
271         long groupId, boolean privateLayout, long parentLayoutId, int begin,
272         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.SystemException {
274         return getPersistence()
275                    .findByG_P_P(groupId, privateLayout, parentLayoutId, begin,
276             end, obc);
277     }
278 
279     public static com.liferay.portal.model.Layout findByG_P_P_First(
280         long groupId, boolean privateLayout, long parentLayoutId,
281         com.liferay.portal.kernel.util.OrderByComparator obc)
282         throws com.liferay.portal.SystemException,
283             com.liferay.portal.NoSuchLayoutException {
284         return getPersistence()
285                    .findByG_P_P_First(groupId, privateLayout, parentLayoutId,
286             obc);
287     }
288 
289     public static com.liferay.portal.model.Layout findByG_P_P_Last(
290         long groupId, boolean privateLayout, long parentLayoutId,
291         com.liferay.portal.kernel.util.OrderByComparator obc)
292         throws com.liferay.portal.SystemException,
293             com.liferay.portal.NoSuchLayoutException {
294         return getPersistence()
295                    .findByG_P_P_Last(groupId, privateLayout, parentLayoutId, obc);
296     }
297 
298     public static com.liferay.portal.model.Layout[] findByG_P_P_PrevAndNext(
299         long plid, long groupId, boolean privateLayout, long parentLayoutId,
300         com.liferay.portal.kernel.util.OrderByComparator obc)
301         throws com.liferay.portal.SystemException,
302             com.liferay.portal.NoSuchLayoutException {
303         return getPersistence()
304                    .findByG_P_P_PrevAndNext(plid, groupId, privateLayout,
305             parentLayoutId, obc);
306     }
307 
308     public static com.liferay.portal.model.Layout findByG_P_F(long groupId,
309         boolean privateLayout, java.lang.String friendlyURL)
310         throws com.liferay.portal.SystemException,
311             com.liferay.portal.NoSuchLayoutException {
312         return getPersistence().findByG_P_F(groupId, privateLayout, friendlyURL);
313     }
314 
315     public static com.liferay.portal.model.Layout fetchByG_P_F(long groupId,
316         boolean privateLayout, java.lang.String friendlyURL)
317         throws com.liferay.portal.SystemException {
318         return getPersistence().fetchByG_P_F(groupId, privateLayout, friendlyURL);
319     }
320 
321     public static java.util.List<com.liferay.portal.model.Layout> findWithDynamicQuery(
322         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
323         throws com.liferay.portal.SystemException {
324         return getPersistence().findWithDynamicQuery(queryInitializer);
325     }
326 
327     public static java.util.List<com.liferay.portal.model.Layout> findWithDynamicQuery(
328         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
329         int begin, int end) throws com.liferay.portal.SystemException {
330         return getPersistence()
331                    .findWithDynamicQuery(queryInitializer, begin, end);
332     }
333 
334     public static java.util.List<com.liferay.portal.model.Layout> findAll()
335         throws com.liferay.portal.SystemException {
336         return getPersistence().findAll();
337     }
338 
339     public static java.util.List<com.liferay.portal.model.Layout> findAll(
340         int begin, int end) throws com.liferay.portal.SystemException {
341         return getPersistence().findAll(begin, end);
342     }
343 
344     public static java.util.List<com.liferay.portal.model.Layout> findAll(
345         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
346         throws com.liferay.portal.SystemException {
347         return getPersistence().findAll(begin, end, obc);
348     }
349 
350     public static void removeByGroupId(long groupId)
351         throws com.liferay.portal.SystemException {
352         getPersistence().removeByGroupId(groupId);
353     }
354 
355     public static void removeByCompanyId(long companyId)
356         throws com.liferay.portal.SystemException {
357         getPersistence().removeByCompanyId(companyId);
358     }
359 
360     public static void removeByDLFolderId(long dlFolderId)
361         throws com.liferay.portal.SystemException,
362             com.liferay.portal.NoSuchLayoutException {
363         getPersistence().removeByDLFolderId(dlFolderId);
364     }
365 
366     public static void removeByIconImageId(long iconImageId)
367         throws com.liferay.portal.SystemException,
368             com.liferay.portal.NoSuchLayoutException {
369         getPersistence().removeByIconImageId(iconImageId);
370     }
371 
372     public static void removeByG_P(long groupId, boolean privateLayout)
373         throws com.liferay.portal.SystemException {
374         getPersistence().removeByG_P(groupId, privateLayout);
375     }
376 
377     public static void removeByG_P_L(long groupId, boolean privateLayout,
378         long layoutId)
379         throws com.liferay.portal.SystemException,
380             com.liferay.portal.NoSuchLayoutException {
381         getPersistence().removeByG_P_L(groupId, privateLayout, layoutId);
382     }
383 
384     public static void removeByG_P_P(long groupId, boolean privateLayout,
385         long parentLayoutId) throws com.liferay.portal.SystemException {
386         getPersistence().removeByG_P_P(groupId, privateLayout, parentLayoutId);
387     }
388 
389     public static void removeByG_P_F(long groupId, boolean privateLayout,
390         java.lang.String friendlyURL)
391         throws com.liferay.portal.SystemException,
392             com.liferay.portal.NoSuchLayoutException {
393         getPersistence().removeByG_P_F(groupId, privateLayout, friendlyURL);
394     }
395 
396     public static void removeAll() throws com.liferay.portal.SystemException {
397         getPersistence().removeAll();
398     }
399 
400     public static int countByGroupId(long groupId)
401         throws com.liferay.portal.SystemException {
402         return getPersistence().countByGroupId(groupId);
403     }
404 
405     public static int countByCompanyId(long companyId)
406         throws com.liferay.portal.SystemException {
407         return getPersistence().countByCompanyId(companyId);
408     }
409 
410     public static int countByDLFolderId(long dlFolderId)
411         throws com.liferay.portal.SystemException {
412         return getPersistence().countByDLFolderId(dlFolderId);
413     }
414 
415     public static int countByIconImageId(long iconImageId)
416         throws com.liferay.portal.SystemException {
417         return getPersistence().countByIconImageId(iconImageId);
418     }
419 
420     public static int countByG_P(long groupId, boolean privateLayout)
421         throws com.liferay.portal.SystemException {
422         return getPersistence().countByG_P(groupId, privateLayout);
423     }
424 
425     public static int countByG_P_L(long groupId, boolean privateLayout,
426         long layoutId) throws com.liferay.portal.SystemException {
427         return getPersistence().countByG_P_L(groupId, privateLayout, layoutId);
428     }
429 
430     public static int countByG_P_P(long groupId, boolean privateLayout,
431         long parentLayoutId) throws com.liferay.portal.SystemException {
432         return getPersistence()
433                    .countByG_P_P(groupId, privateLayout, parentLayoutId);
434     }
435 
436     public static int countByG_P_F(long groupId, boolean privateLayout,
437         java.lang.String friendlyURL) throws com.liferay.portal.SystemException {
438         return getPersistence().countByG_P_F(groupId, privateLayout, friendlyURL);
439     }
440 
441     public static int countAll() throws com.liferay.portal.SystemException {
442         return getPersistence().countAll();
443     }
444 
445     public static LayoutPersistence getPersistence() {
446         return _getUtil()._persistence;
447     }
448 
449     public void setPersistence(LayoutPersistence persistence) {
450         _persistence = persistence;
451     }
452 
453     private static LayoutUtil _getUtil() {
454         if (_util == null) {
455             _util = (LayoutUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
456         }
457 
458         return _util;
459     }
460 
461     private static final String _UTIL = LayoutUtil.class.getName();
462     private static LayoutUtil _util;
463     private LayoutPersistence _persistence;
464 }