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.portlet.journal.service;
24  
25  
26  /**
27   * <a href="JournalTemplateLocalServiceUtil.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.portlet.journal.service.JournalTemplateLocalService</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   * <p>
43   * <code>com.liferay.portlet.journal.service.JournalTemplateLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portlet.journal.service.JournalTemplateLocalService
50   * @see com.liferay.portlet.journal.service.JournalTemplateLocalServiceFactory
51   *
52   */
53  public class JournalTemplateLocalServiceUtil {
54      public static com.liferay.portlet.journal.model.JournalTemplate addJournalTemplate(
55          com.liferay.portlet.journal.model.JournalTemplate journalTemplate)
56          throws com.liferay.portal.SystemException {
57          JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
58  
59          return journalTemplateLocalService.addJournalTemplate(journalTemplate);
60      }
61  
62      public static void deleteJournalTemplate(long id)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
66  
67          journalTemplateLocalService.deleteJournalTemplate(id);
68      }
69  
70      public static void deleteJournalTemplate(
71          com.liferay.portlet.journal.model.JournalTemplate journalTemplate)
72          throws com.liferay.portal.PortalException,
73              com.liferay.portal.SystemException {
74          JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
75  
76          journalTemplateLocalService.deleteJournalTemplate(journalTemplate);
77      }
78  
79      public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> dynamicQuery(
80          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
81          throws com.liferay.portal.SystemException {
82          JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
83  
84          return journalTemplateLocalService.dynamicQuery(queryInitializer);
85      }
86  
87      public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> dynamicQuery(
88          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
89          int begin, int end) throws com.liferay.portal.SystemException {
90          JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
91  
92          return journalTemplateLocalService.dynamicQuery(queryInitializer,
93              begin, end);
94      }
95  
96      public static com.liferay.portlet.journal.model.JournalTemplate updateJournalTemplate(
97          com.liferay.portlet.journal.model.JournalTemplate journalTemplate)
98          throws com.liferay.portal.SystemException {
99          JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
100 
101         return journalTemplateLocalService.updateJournalTemplate(journalTemplate);
102     }
103 
104     public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
105         long userId, java.lang.String templateId, boolean autoTemplateId,
106         long plid, java.lang.String structureId, java.lang.String name,
107         java.lang.String description, java.lang.String xsl, boolean formatXsl,
108         java.lang.String langType, boolean cacheable, boolean smallImage,
109         java.lang.String smallImageURL, java.io.File smallFile,
110         boolean addCommunityPermissions, boolean addGuestPermissions)
111         throws com.liferay.portal.PortalException,
112             com.liferay.portal.SystemException {
113         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
114 
115         return journalTemplateLocalService.addTemplate(userId, templateId,
116             autoTemplateId, plid, structureId, name, description, xsl,
117             formatXsl, langType, cacheable, smallImage, smallImageURL,
118             smallFile, addCommunityPermissions, addGuestPermissions);
119     }
120 
121     public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
122         java.lang.String uuid, long userId, java.lang.String templateId,
123         boolean autoTemplateId, long plid, java.lang.String structureId,
124         java.lang.String name, java.lang.String description,
125         java.lang.String xsl, boolean formatXsl, java.lang.String langType,
126         boolean cacheable, boolean smallImage, java.lang.String smallImageURL,
127         java.io.File smallFile, boolean addCommunityPermissions,
128         boolean addGuestPermissions)
129         throws com.liferay.portal.PortalException,
130             com.liferay.portal.SystemException {
131         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
132 
133         return journalTemplateLocalService.addTemplate(uuid, userId,
134             templateId, autoTemplateId, plid, structureId, name, description,
135             xsl, formatXsl, langType, cacheable, smallImage, smallImageURL,
136             smallFile, addCommunityPermissions, addGuestPermissions);
137     }
138 
139     public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
140         long userId, java.lang.String templateId, boolean autoTemplateId,
141         long plid, java.lang.String structureId, java.lang.String name,
142         java.lang.String description, java.lang.String xsl, boolean formatXsl,
143         java.lang.String langType, boolean cacheable, boolean smallImage,
144         java.lang.String smallImageURL, java.io.File smallFile,
145         java.lang.String[] communityPermissions,
146         java.lang.String[] guestPermissions)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException {
149         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
150 
151         return journalTemplateLocalService.addTemplate(userId, templateId,
152             autoTemplateId, plid, structureId, name, description, xsl,
153             formatXsl, langType, cacheable, smallImage, smallImageURL,
154             smallFile, communityPermissions, guestPermissions);
155     }
156 
157     public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
158         java.lang.String uuid, long userId, java.lang.String templateId,
159         boolean autoTemplateId, long plid, java.lang.String structureId,
160         java.lang.String name, java.lang.String description,
161         java.lang.String xsl, boolean formatXsl, java.lang.String langType,
162         boolean cacheable, boolean smallImage, java.lang.String smallImageURL,
163         java.io.File smallFile, java.lang.Boolean addCommunityPermissions,
164         java.lang.Boolean addGuestPermissions,
165         java.lang.String[] communityPermissions,
166         java.lang.String[] guestPermissions)
167         throws com.liferay.portal.PortalException,
168             com.liferay.portal.SystemException {
169         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
170 
171         return journalTemplateLocalService.addTemplate(uuid, userId,
172             templateId, autoTemplateId, plid, structureId, name, description,
173             xsl, formatXsl, langType, cacheable, smallImage, smallImageURL,
174             smallFile, addCommunityPermissions, addGuestPermissions,
175             communityPermissions, guestPermissions);
176     }
177 
178     public static com.liferay.portlet.journal.model.JournalTemplate addTemplateToGroup(
179         java.lang.String uuid, long userId, java.lang.String templateId,
180         boolean autoTemplateId, long groupId, java.lang.String structureId,
181         java.lang.String name, java.lang.String description,
182         java.lang.String xsl, boolean formatXsl, java.lang.String langType,
183         boolean cacheable, boolean smallImage, java.lang.String smallImageURL,
184         java.io.File smallFile, java.lang.Boolean addCommunityPermissions,
185         java.lang.Boolean addGuestPermissions,
186         java.lang.String[] communityPermissions,
187         java.lang.String[] guestPermissions)
188         throws com.liferay.portal.PortalException,
189             com.liferay.portal.SystemException {
190         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
191 
192         return journalTemplateLocalService.addTemplateToGroup(uuid, userId,
193             templateId, autoTemplateId, groupId, structureId, name,
194             description, xsl, formatXsl, langType, cacheable, smallImage,
195             smallImageURL, smallFile, addCommunityPermissions,
196             addGuestPermissions, communityPermissions, guestPermissions);
197     }
198 
199     public static void addTemplateResources(long groupId,
200         java.lang.String templateId, boolean addCommunityPermissions,
201         boolean addGuestPermissions)
202         throws com.liferay.portal.PortalException,
203             com.liferay.portal.SystemException {
204         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
205 
206         journalTemplateLocalService.addTemplateResources(groupId, templateId,
207             addCommunityPermissions, addGuestPermissions);
208     }
209 
210     public static void addTemplateResources(
211         com.liferay.portlet.journal.model.JournalTemplate template,
212         boolean addCommunityPermissions, boolean addGuestPermissions)
213         throws com.liferay.portal.PortalException,
214             com.liferay.portal.SystemException {
215         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
216 
217         journalTemplateLocalService.addTemplateResources(template,
218             addCommunityPermissions, addGuestPermissions);
219     }
220 
221     public static void addTemplateResources(long groupId,
222         java.lang.String templateId, java.lang.String[] communityPermissions,
223         java.lang.String[] guestPermissions)
224         throws com.liferay.portal.PortalException,
225             com.liferay.portal.SystemException {
226         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
227 
228         journalTemplateLocalService.addTemplateResources(groupId, templateId,
229             communityPermissions, guestPermissions);
230     }
231 
232     public static void addTemplateResources(
233         com.liferay.portlet.journal.model.JournalTemplate template,
234         java.lang.String[] communityPermissions,
235         java.lang.String[] guestPermissions)
236         throws com.liferay.portal.PortalException,
237             com.liferay.portal.SystemException {
238         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
239 
240         journalTemplateLocalService.addTemplateResources(template,
241             communityPermissions, guestPermissions);
242     }
243 
244     public static void checkNewLine(long groupId, java.lang.String templateId)
245         throws com.liferay.portal.PortalException,
246             com.liferay.portal.SystemException {
247         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
248 
249         journalTemplateLocalService.checkNewLine(groupId, templateId);
250     }
251 
252     public static void deleteTemplate(long groupId, java.lang.String templateId)
253         throws com.liferay.portal.PortalException,
254             com.liferay.portal.SystemException {
255         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
256 
257         journalTemplateLocalService.deleteTemplate(groupId, templateId);
258     }
259 
260     public static void deleteTemplate(
261         com.liferay.portlet.journal.model.JournalTemplate template)
262         throws com.liferay.portal.PortalException,
263             com.liferay.portal.SystemException {
264         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
265 
266         journalTemplateLocalService.deleteTemplate(template);
267     }
268 
269     public static void deleteTemplates(long groupId)
270         throws com.liferay.portal.PortalException,
271             com.liferay.portal.SystemException {
272         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
273 
274         journalTemplateLocalService.deleteTemplates(groupId);
275     }
276 
277     public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getStructureTemplates(
278         long groupId, java.lang.String structureId)
279         throws com.liferay.portal.SystemException {
280         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
281 
282         return journalTemplateLocalService.getStructureTemplates(groupId,
283             structureId);
284     }
285 
286     public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getStructureTemplates(
287         long groupId, java.lang.String structureId, int begin, int end)
288         throws com.liferay.portal.SystemException {
289         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
290 
291         return journalTemplateLocalService.getStructureTemplates(groupId,
292             structureId, begin, end);
293     }
294 
295     public static int getStructureTemplatesCount(long groupId,
296         java.lang.String structureId) throws com.liferay.portal.SystemException {
297         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
298 
299         return journalTemplateLocalService.getStructureTemplatesCount(groupId,
300             structureId);
301     }
302 
303     public static com.liferay.portlet.journal.model.JournalTemplate getTemplate(
304         long id)
305         throws com.liferay.portal.PortalException,
306             com.liferay.portal.SystemException {
307         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
308 
309         return journalTemplateLocalService.getTemplate(id);
310     }
311 
312     public static com.liferay.portlet.journal.model.JournalTemplate getTemplate(
313         long groupId, java.lang.String templateId)
314         throws com.liferay.portal.PortalException,
315             com.liferay.portal.SystemException {
316         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
317 
318         return journalTemplateLocalService.getTemplate(groupId, templateId);
319     }
320 
321     public static com.liferay.portlet.journal.model.JournalTemplate getTemplateBySmallImageId(
322         long smallImageId)
323         throws com.liferay.portal.PortalException,
324             com.liferay.portal.SystemException {
325         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
326 
327         return journalTemplateLocalService.getTemplateBySmallImageId(smallImageId);
328     }
329 
330     public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates()
331         throws com.liferay.portal.SystemException {
332         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
333 
334         return journalTemplateLocalService.getTemplates();
335     }
336 
337     public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates(
338         long groupId) throws com.liferay.portal.SystemException {
339         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
340 
341         return journalTemplateLocalService.getTemplates(groupId);
342     }
343 
344     public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates(
345         long groupId, int begin, int end)
346         throws com.liferay.portal.SystemException {
347         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
348 
349         return journalTemplateLocalService.getTemplates(groupId, begin, end);
350     }
351 
352     public static int getTemplatesCount(long groupId)
353         throws com.liferay.portal.SystemException {
354         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
355 
356         return journalTemplateLocalService.getTemplatesCount(groupId);
357     }
358 
359     public static boolean hasTemplate(long groupId, java.lang.String templateId)
360         throws com.liferay.portal.SystemException {
361         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
362 
363         return journalTemplateLocalService.hasTemplate(groupId, templateId);
364     }
365 
366     public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
367         long companyId, long groupId, java.lang.String keywords,
368         java.lang.String structureId, java.lang.String structureIdComparator,
369         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
370         throws com.liferay.portal.SystemException {
371         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
372 
373         return journalTemplateLocalService.search(companyId, groupId, keywords,
374             structureId, structureIdComparator, begin, end, obc);
375     }
376 
377     public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
378         long companyId, long groupId, java.lang.String templateId,
379         java.lang.String structureId, java.lang.String structureIdComparator,
380         java.lang.String name, java.lang.String description,
381         boolean andOperator, int begin, int end,
382         com.liferay.portal.kernel.util.OrderByComparator obc)
383         throws com.liferay.portal.SystemException {
384         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
385 
386         return journalTemplateLocalService.search(companyId, groupId,
387             templateId, structureId, structureIdComparator, name, description,
388             andOperator, begin, end, obc);
389     }
390 
391     public static int searchCount(long companyId, long groupId,
392         java.lang.String keywords, java.lang.String structureId,
393         java.lang.String structureIdComparator)
394         throws com.liferay.portal.SystemException {
395         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
396 
397         return journalTemplateLocalService.searchCount(companyId, groupId,
398             keywords, structureId, structureIdComparator);
399     }
400 
401     public static int searchCount(long companyId, long groupId,
402         java.lang.String templateId, java.lang.String structureId,
403         java.lang.String structureIdComparator, java.lang.String name,
404         java.lang.String description, boolean andOperator)
405         throws com.liferay.portal.SystemException {
406         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
407 
408         return journalTemplateLocalService.searchCount(companyId, groupId,
409             templateId, structureId, structureIdComparator, name, description,
410             andOperator);
411     }
412 
413     public static com.liferay.portlet.journal.model.JournalTemplate updateTemplate(
414         long groupId, java.lang.String templateId,
415         java.lang.String structureId, java.lang.String name,
416         java.lang.String description, java.lang.String xsl, boolean formatXsl,
417         java.lang.String langType, boolean cacheable, boolean smallImage,
418         java.lang.String smallImageURL, java.io.File smallFile)
419         throws com.liferay.portal.PortalException,
420             com.liferay.portal.SystemException {
421         JournalTemplateLocalService journalTemplateLocalService = JournalTemplateLocalServiceFactory.getService();
422 
423         return journalTemplateLocalService.updateTemplate(groupId, templateId,
424             structureId, name, description, xsl, formatXsl, langType,
425             cacheable, smallImage, smallImageURL, smallFile);
426     }
427 }