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