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.wiki.service;
24  
25  
26  /**
27   * <a href="WikiPageLocalServiceUtil.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.wiki.service.WikiPageLocalService</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.wiki.service.WikiPageLocalServiceFactory</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.wiki.service.WikiPageLocalService
50   * @see com.liferay.portlet.wiki.service.WikiPageLocalServiceFactory
51   *
52   */
53  public class WikiPageLocalServiceUtil {
54      public static com.liferay.portlet.wiki.model.WikiPage addWikiPage(
55          com.liferay.portlet.wiki.model.WikiPage wikiPage)
56          throws com.liferay.portal.SystemException {
57          WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
58  
59          return wikiPageLocalService.addWikiPage(wikiPage);
60      }
61  
62      public static void deleteWikiPage(long pageId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
66  
67          wikiPageLocalService.deleteWikiPage(pageId);
68      }
69  
70      public static void deleteWikiPage(
71          com.liferay.portlet.wiki.model.WikiPage wikiPage)
72          throws com.liferay.portal.SystemException {
73          WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
74  
75          wikiPageLocalService.deleteWikiPage(wikiPage);
76      }
77  
78      public static java.util.List<Object> dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
80          throws com.liferay.portal.SystemException {
81          WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
82  
83          return wikiPageLocalService.dynamicQuery(dynamicQuery);
84      }
85  
86      public static java.util.List<Object> dynamicQuery(
87          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
88          int end) throws com.liferay.portal.SystemException {
89          WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
90  
91          return wikiPageLocalService.dynamicQuery(dynamicQuery, start, end);
92      }
93  
94      public static com.liferay.portlet.wiki.model.WikiPage getWikiPage(
95          long pageId)
96          throws com.liferay.portal.PortalException,
97              com.liferay.portal.SystemException {
98          WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
99  
100         return wikiPageLocalService.getWikiPage(pageId);
101     }
102 
103     public static com.liferay.portlet.wiki.model.WikiPage updateWikiPage(
104         com.liferay.portlet.wiki.model.WikiPage wikiPage)
105         throws com.liferay.portal.SystemException {
106         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
107 
108         return wikiPageLocalService.updateWikiPage(wikiPage);
109     }
110 
111     public static com.liferay.portlet.wiki.model.WikiPage addPage(long userId,
112         long nodeId, java.lang.String title, java.lang.String content,
113         java.lang.String summary, boolean minorEdit,
114         javax.portlet.PortletPreferences prefs,
115         com.liferay.portal.theme.ThemeDisplay themeDisplay)
116         throws com.liferay.portal.PortalException,
117             com.liferay.portal.SystemException {
118         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
119 
120         return wikiPageLocalService.addPage(userId, nodeId, title, content,
121             summary, minorEdit, prefs, themeDisplay);
122     }
123 
124     public static com.liferay.portlet.wiki.model.WikiPage addPage(
125         java.lang.String uuid, long userId, long nodeId,
126         java.lang.String title, double version, java.lang.String content,
127         java.lang.String summary, boolean minorEdit, java.lang.String format,
128         boolean head, java.lang.String parentTitle,
129         java.lang.String redirectTitle, java.lang.String[] tagsEntries,
130         javax.portlet.PortletPreferences prefs,
131         com.liferay.portal.theme.ThemeDisplay themeDisplay)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException {
134         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
135 
136         return wikiPageLocalService.addPage(uuid, userId, nodeId, title,
137             version, content, summary, minorEdit, format, head, parentTitle,
138             redirectTitle, tagsEntries, prefs, themeDisplay);
139     }
140 
141     public static void addPageAttachments(long nodeId, java.lang.String title,
142         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files)
143         throws com.liferay.portal.PortalException,
144             com.liferay.portal.SystemException {
145         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
146 
147         wikiPageLocalService.addPageAttachments(nodeId, title, files);
148     }
149 
150     public static void addPageResources(long nodeId, java.lang.String title,
151         boolean addCommunityPermissions, boolean addGuestPermissions)
152         throws com.liferay.portal.PortalException,
153             com.liferay.portal.SystemException {
154         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
155 
156         wikiPageLocalService.addPageResources(nodeId, title,
157             addCommunityPermissions, addGuestPermissions);
158     }
159 
160     public static void addPageResources(
161         com.liferay.portlet.wiki.model.WikiNode node,
162         com.liferay.portlet.wiki.model.WikiPage page,
163         boolean addCommunityPermissions, boolean addGuestPermissions)
164         throws com.liferay.portal.PortalException,
165             com.liferay.portal.SystemException {
166         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
167 
168         wikiPageLocalService.addPageResources(node, page,
169             addCommunityPermissions, addGuestPermissions);
170     }
171 
172     public static void addPageResources(long nodeId, java.lang.String title,
173         java.lang.String[] communityPermissions,
174         java.lang.String[] guestPermissions)
175         throws com.liferay.portal.PortalException,
176             com.liferay.portal.SystemException {
177         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
178 
179         wikiPageLocalService.addPageResources(nodeId, title,
180             communityPermissions, guestPermissions);
181     }
182 
183     public static void addPageResources(
184         com.liferay.portlet.wiki.model.WikiNode node,
185         com.liferay.portlet.wiki.model.WikiPage page,
186         java.lang.String[] communityPermissions,
187         java.lang.String[] guestPermissions)
188         throws com.liferay.portal.PortalException,
189             com.liferay.portal.SystemException {
190         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
191 
192         wikiPageLocalService.addPageResources(node, page, communityPermissions,
193             guestPermissions);
194     }
195 
196     public static void changeParent(long userId, long nodeId,
197         java.lang.String title, java.lang.String newParentTitle,
198         javax.portlet.PortletPreferences prefs,
199         com.liferay.portal.theme.ThemeDisplay themeDisplay)
200         throws com.liferay.portal.PortalException,
201             com.liferay.portal.SystemException {
202         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
203 
204         wikiPageLocalService.changeParent(userId, nodeId, title,
205             newParentTitle, prefs, themeDisplay);
206     }
207 
208     public static void deletePage(long nodeId, java.lang.String title)
209         throws com.liferay.portal.PortalException,
210             com.liferay.portal.SystemException {
211         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
212 
213         wikiPageLocalService.deletePage(nodeId, title);
214     }
215 
216     public static void deletePage(com.liferay.portlet.wiki.model.WikiPage page)
217         throws com.liferay.portal.PortalException,
218             com.liferay.portal.SystemException {
219         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
220 
221         wikiPageLocalService.deletePage(page);
222     }
223 
224     public static void deletePageAttachment(long nodeId,
225         java.lang.String title, java.lang.String fileName)
226         throws com.liferay.portal.PortalException,
227             com.liferay.portal.SystemException {
228         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
229 
230         wikiPageLocalService.deletePageAttachment(nodeId, title, fileName);
231     }
232 
233     public static void deletePages(long nodeId)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException {
236         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
237 
238         wikiPageLocalService.deletePages(nodeId);
239     }
240 
241     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getChildren(
242         long nodeId, boolean head, java.lang.String parentTitle)
243         throws com.liferay.portal.SystemException {
244         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
245 
246         return wikiPageLocalService.getChildren(nodeId, head, parentTitle);
247     }
248 
249     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getIncomingLinks(
250         long nodeId, java.lang.String title)
251         throws com.liferay.portal.PortalException,
252             com.liferay.portal.SystemException {
253         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
254 
255         return wikiPageLocalService.getIncomingLinks(nodeId, title);
256     }
257 
258     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getNoAssetPages()
259         throws com.liferay.portal.SystemException {
260         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
261 
262         return wikiPageLocalService.getNoAssetPages();
263     }
264 
265     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getOrphans(
266         long nodeId)
267         throws com.liferay.portal.PortalException,
268             com.liferay.portal.SystemException {
269         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
270 
271         return wikiPageLocalService.getOrphans(nodeId);
272     }
273 
274     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getOutgoingLinks(
275         long nodeId, java.lang.String title)
276         throws com.liferay.portal.PortalException,
277             com.liferay.portal.SystemException {
278         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
279 
280         return wikiPageLocalService.getOutgoingLinks(nodeId, title);
281     }
282 
283     public static com.liferay.portlet.wiki.model.WikiPage getPage(long nodeId,
284         java.lang.String title)
285         throws com.liferay.portal.PortalException,
286             com.liferay.portal.SystemException {
287         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
288 
289         return wikiPageLocalService.getPage(nodeId, title);
290     }
291 
292     public static com.liferay.portlet.wiki.model.WikiPage getPage(long nodeId,
293         java.lang.String title, double version)
294         throws com.liferay.portal.PortalException,
295             com.liferay.portal.SystemException {
296         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
297 
298         return wikiPageLocalService.getPage(nodeId, title, version);
299     }
300 
301     public static com.liferay.portlet.wiki.model.WikiPageDisplay getPageDisplay(
302         long nodeId, java.lang.String title,
303         javax.portlet.PortletURL viewPageURL,
304         javax.portlet.PortletURL editPageURL,
305         java.lang.String attachmentURLPrefix)
306         throws com.liferay.portal.PortalException,
307             com.liferay.portal.SystemException {
308         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
309 
310         return wikiPageLocalService.getPageDisplay(nodeId, title, viewPageURL,
311             editPageURL, attachmentURLPrefix);
312     }
313 
314     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getPages(
315         long nodeId, int start, int end)
316         throws com.liferay.portal.SystemException {
317         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
318 
319         return wikiPageLocalService.getPages(nodeId, start, end);
320     }
321 
322     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getPages(
323         java.lang.String format) throws com.liferay.portal.SystemException {
324         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
325 
326         return wikiPageLocalService.getPages(format);
327     }
328 
329     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getPages(
330         long nodeId, java.lang.String title, int start, int end)
331         throws com.liferay.portal.SystemException {
332         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
333 
334         return wikiPageLocalService.getPages(nodeId, title, start, end);
335     }
336 
337     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getPages(
338         long nodeId, java.lang.String title, int start, int end,
339         com.liferay.portal.kernel.util.OrderByComparator obc)
340         throws com.liferay.portal.SystemException {
341         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
342 
343         return wikiPageLocalService.getPages(nodeId, title, start, end, obc);
344     }
345 
346     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getPages(
347         long nodeId, boolean head, int start, int end)
348         throws com.liferay.portal.SystemException {
349         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
350 
351         return wikiPageLocalService.getPages(nodeId, head, start, end);
352     }
353 
354     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getPages(
355         long nodeId, java.lang.String title, boolean head, int start, int end)
356         throws com.liferay.portal.SystemException {
357         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
358 
359         return wikiPageLocalService.getPages(nodeId, title, head, start, end);
360     }
361 
362     public static int getPagesCount(long nodeId)
363         throws com.liferay.portal.SystemException {
364         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
365 
366         return wikiPageLocalService.getPagesCount(nodeId);
367     }
368 
369     public static int getPagesCount(long nodeId, java.lang.String title)
370         throws com.liferay.portal.SystemException {
371         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
372 
373         return wikiPageLocalService.getPagesCount(nodeId, title);
374     }
375 
376     public static int getPagesCount(long nodeId, boolean head)
377         throws com.liferay.portal.SystemException {
378         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
379 
380         return wikiPageLocalService.getPagesCount(nodeId, head);
381     }
382 
383     public static int getPagesCount(long nodeId, java.lang.String title,
384         boolean head) throws com.liferay.portal.SystemException {
385         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
386 
387         return wikiPageLocalService.getPagesCount(nodeId, title, head);
388     }
389 
390     public static java.util.List<com.liferay.portlet.wiki.model.WikiPage> getRecentChanges(
391         long nodeId, int start, int end)
392         throws com.liferay.portal.SystemException {
393         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
394 
395         return wikiPageLocalService.getRecentChanges(nodeId, start, end);
396     }
397 
398     public static int getRecentChangesCount(long nodeId)
399         throws com.liferay.portal.SystemException {
400         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
401 
402         return wikiPageLocalService.getRecentChangesCount(nodeId);
403     }
404 
405     public static void movePage(long userId, long nodeId,
406         java.lang.String title, java.lang.String newTitle,
407         javax.portlet.PortletPreferences prefs,
408         com.liferay.portal.theme.ThemeDisplay themeDisplay)
409         throws com.liferay.portal.PortalException,
410             com.liferay.portal.SystemException {
411         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
412 
413         wikiPageLocalService.movePage(userId, nodeId, title, newTitle, prefs,
414             themeDisplay);
415     }
416 
417     public static void movePage(long userId, long nodeId,
418         java.lang.String title, java.lang.String newTitle, boolean strict,
419         javax.portlet.PortletPreferences prefs,
420         com.liferay.portal.theme.ThemeDisplay themeDisplay)
421         throws com.liferay.portal.PortalException,
422             com.liferay.portal.SystemException {
423         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
424 
425         wikiPageLocalService.movePage(userId, nodeId, title, newTitle, strict,
426             prefs, themeDisplay);
427     }
428 
429     public static com.liferay.portlet.wiki.model.WikiPage revertPage(
430         long userId, long nodeId, java.lang.String title, double version,
431         javax.portlet.PortletPreferences prefs,
432         com.liferay.portal.theme.ThemeDisplay themeDisplay)
433         throws com.liferay.portal.PortalException,
434             com.liferay.portal.SystemException {
435         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
436 
437         return wikiPageLocalService.revertPage(userId, nodeId, title, version,
438             prefs, themeDisplay);
439     }
440 
441     public static void subscribePage(long userId, long nodeId,
442         java.lang.String title)
443         throws com.liferay.portal.PortalException,
444             com.liferay.portal.SystemException {
445         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
446 
447         wikiPageLocalService.subscribePage(userId, nodeId, title);
448     }
449 
450     public static void unsubscribePage(long userId, long nodeId,
451         java.lang.String title)
452         throws com.liferay.portal.PortalException,
453             com.liferay.portal.SystemException {
454         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
455 
456         wikiPageLocalService.unsubscribePage(userId, nodeId, title);
457     }
458 
459     public static com.liferay.portlet.wiki.model.WikiPage updatePage(
460         long userId, long nodeId, java.lang.String title, double version,
461         java.lang.String content, java.lang.String summary, boolean minorEdit,
462         java.lang.String format, java.lang.String parentTitle,
463         java.lang.String redirectTitle, java.lang.String[] tagsEntries,
464         javax.portlet.PortletPreferences prefs,
465         com.liferay.portal.theme.ThemeDisplay themeDisplay)
466         throws com.liferay.portal.PortalException,
467             com.liferay.portal.SystemException {
468         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
469 
470         return wikiPageLocalService.updatePage(userId, nodeId, title, version,
471             content, summary, minorEdit, format, parentTitle, redirectTitle,
472             tagsEntries, prefs, themeDisplay);
473     }
474 
475     public static void updateTagsAsset(long userId,
476         com.liferay.portlet.wiki.model.WikiPage page,
477         java.lang.String[] tagsEntries)
478         throws com.liferay.portal.PortalException,
479             com.liferay.portal.SystemException {
480         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
481 
482         wikiPageLocalService.updateTagsAsset(userId, page, tagsEntries);
483     }
484 
485     public static void validateTitle(java.lang.String title)
486         throws com.liferay.portal.PortalException {
487         WikiPageLocalService wikiPageLocalService = WikiPageLocalServiceFactory.getService();
488 
489         wikiPageLocalService.validateTitle(title);
490     }
491 }