001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.journal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the journal template local service. This utility wraps {@link com.liferay.portlet.journal.service.impl.JournalTemplateLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see JournalTemplateLocalService
030     * @see com.liferay.portlet.journal.service.base.JournalTemplateLocalServiceBaseImpl
031     * @see com.liferay.portlet.journal.service.impl.JournalTemplateLocalServiceImpl
032     * @generated
033     */
034    public class JournalTemplateLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.journal.service.impl.JournalTemplateLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the journal template to the database. Also notifies the appropriate model listeners.
043            *
044            * @param journalTemplate the journal template
045            * @return the journal template that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.journal.model.JournalTemplate addJournalTemplate(
049                    com.liferay.portlet.journal.model.JournalTemplate journalTemplate)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addJournalTemplate(journalTemplate);
052            }
053    
054            /**
055            * Creates a new journal template with the primary key. Does not add the journal template to the database.
056            *
057            * @param id the primary key for the new journal template
058            * @return the new journal template
059            */
060            public static com.liferay.portlet.journal.model.JournalTemplate createJournalTemplate(
061                    long id) {
062                    return getService().createJournalTemplate(id);
063            }
064    
065            /**
066            * Deletes the journal template with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param id the primary key of the journal template
069            * @throws PortalException if a journal template with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteJournalTemplate(long id)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteJournalTemplate(id);
076            }
077    
078            /**
079            * Deletes the journal template from the database. Also notifies the appropriate model listeners.
080            *
081            * @param journalTemplate the journal template
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteJournalTemplate(
085                    com.liferay.portlet.journal.model.JournalTemplate journalTemplate)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteJournalTemplate(journalTemplate);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            /**
162            * Returns the journal template with the primary key.
163            *
164            * @param id the primary key of the journal template
165            * @return the journal template
166            * @throws PortalException if a journal template with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.journal.model.JournalTemplate getJournalTemplate(
170                    long id)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getJournalTemplate(id);
174            }
175    
176            public static com.liferay.portal.model.PersistedModel getPersistedModel(
177                    java.io.Serializable primaryKeyObj)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    return getService().getPersistedModel(primaryKeyObj);
181            }
182    
183            /**
184            * Returns the journal template with the UUID in the group.
185            *
186            * @param uuid the UUID of journal template
187            * @param groupId the group id of the journal template
188            * @return the journal template
189            * @throws PortalException if a journal template with the UUID in the group could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.journal.model.JournalTemplate getJournalTemplateByUuidAndGroupId(
193                    java.lang.String uuid, long groupId)
194                    throws com.liferay.portal.kernel.exception.PortalException,
195                            com.liferay.portal.kernel.exception.SystemException {
196                    return getService().getJournalTemplateByUuidAndGroupId(uuid, groupId);
197            }
198    
199            /**
200            * Returns a range of all the journal templates.
201            *
202            * <p>
203            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
204            * </p>
205            *
206            * @param start the lower bound of the range of journal templates
207            * @param end the upper bound of the range of journal templates (not inclusive)
208            * @return the range of journal templates
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getJournalTemplates(
212                    int start, int end)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getJournalTemplates(start, end);
215            }
216    
217            /**
218            * Returns the number of journal templates.
219            *
220            * @return the number of journal templates
221            * @throws SystemException if a system exception occurred
222            */
223            public static int getJournalTemplatesCount()
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getService().getJournalTemplatesCount();
226            }
227    
228            /**
229            * Updates the journal template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
230            *
231            * @param journalTemplate the journal template
232            * @return the journal template that was updated
233            * @throws SystemException if a system exception occurred
234            */
235            public static com.liferay.portlet.journal.model.JournalTemplate updateJournalTemplate(
236                    com.liferay.portlet.journal.model.JournalTemplate journalTemplate)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getService().updateJournalTemplate(journalTemplate);
239            }
240    
241            /**
242            * Updates the journal template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
243            *
244            * @param journalTemplate the journal template
245            * @param merge whether to merge the journal template with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
246            * @return the journal template that was updated
247            * @throws SystemException if a system exception occurred
248            */
249            public static com.liferay.portlet.journal.model.JournalTemplate updateJournalTemplate(
250                    com.liferay.portlet.journal.model.JournalTemplate journalTemplate,
251                    boolean merge)
252                    throws com.liferay.portal.kernel.exception.SystemException {
253                    return getService().updateJournalTemplate(journalTemplate, merge);
254            }
255    
256            /**
257            * Returns the Spring bean ID for this bean.
258            *
259            * @return the Spring bean ID for this bean
260            */
261            public static java.lang.String getBeanIdentifier() {
262                    return getService().getBeanIdentifier();
263            }
264    
265            /**
266            * Sets the Spring bean ID for this bean.
267            *
268            * @param beanIdentifier the Spring bean ID for this bean
269            */
270            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
271                    getService().setBeanIdentifier(beanIdentifier);
272            }
273    
274            public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
275                    long userId, long groupId, java.lang.String templateId,
276                    boolean autoTemplateId, java.lang.String structureId,
277                    java.lang.String name, java.lang.String description,
278                    java.lang.String xsl, boolean formatXsl, java.lang.String langType,
279                    boolean cacheable, boolean smallImage, java.lang.String smallImageURL,
280                    java.io.File smallFile,
281                    com.liferay.portal.service.ServiceContext serviceContext)
282                    throws com.liferay.portal.kernel.exception.PortalException,
283                            com.liferay.portal.kernel.exception.SystemException {
284                    return getService()
285                                       .addTemplate(userId, groupId, templateId, autoTemplateId,
286                            structureId, name, description, xsl, formatXsl, langType,
287                            cacheable, smallImage, smallImageURL, smallFile, serviceContext);
288            }
289    
290            public static void addTemplateResources(
291                    com.liferay.portlet.journal.model.JournalTemplate template,
292                    boolean addCommunityPermissions, boolean addGuestPermissions)
293                    throws com.liferay.portal.kernel.exception.PortalException,
294                            com.liferay.portal.kernel.exception.SystemException {
295                    getService()
296                            .addTemplateResources(template, addCommunityPermissions,
297                            addGuestPermissions);
298            }
299    
300            public static void addTemplateResources(
301                    com.liferay.portlet.journal.model.JournalTemplate template,
302                    java.lang.String[] communityPermissions,
303                    java.lang.String[] guestPermissions)
304                    throws com.liferay.portal.kernel.exception.PortalException,
305                            com.liferay.portal.kernel.exception.SystemException {
306                    getService()
307                            .addTemplateResources(template, communityPermissions,
308                            guestPermissions);
309            }
310    
311            public static void addTemplateResources(long groupId,
312                    java.lang.String templateId, boolean addCommunityPermissions,
313                    boolean addGuestPermissions)
314                    throws com.liferay.portal.kernel.exception.PortalException,
315                            com.liferay.portal.kernel.exception.SystemException {
316                    getService()
317                            .addTemplateResources(groupId, templateId, addCommunityPermissions,
318                            addGuestPermissions);
319            }
320    
321            public static void addTemplateResources(long groupId,
322                    java.lang.String templateId, java.lang.String[] communityPermissions,
323                    java.lang.String[] guestPermissions)
324                    throws com.liferay.portal.kernel.exception.PortalException,
325                            com.liferay.portal.kernel.exception.SystemException {
326                    getService()
327                            .addTemplateResources(groupId, templateId, communityPermissions,
328                            guestPermissions);
329            }
330    
331            public static void checkNewLine(long groupId, java.lang.String templateId)
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    getService().checkNewLine(groupId, templateId);
335            }
336    
337            public static com.liferay.portlet.journal.model.JournalTemplate copyTemplate(
338                    long userId, long groupId, java.lang.String oldTemplateId,
339                    java.lang.String newTemplateId, boolean autoTemplateId)
340                    throws com.liferay.portal.kernel.exception.PortalException,
341                            com.liferay.portal.kernel.exception.SystemException {
342                    return getService()
343                                       .copyTemplate(userId, groupId, oldTemplateId, newTemplateId,
344                            autoTemplateId);
345            }
346    
347            public static void deleteTemplate(
348                    com.liferay.portlet.journal.model.JournalTemplate template)
349                    throws com.liferay.portal.kernel.exception.PortalException,
350                            com.liferay.portal.kernel.exception.SystemException {
351                    getService().deleteTemplate(template);
352            }
353    
354            public static void deleteTemplate(long groupId, java.lang.String templateId)
355                    throws com.liferay.portal.kernel.exception.PortalException,
356                            com.liferay.portal.kernel.exception.SystemException {
357                    getService().deleteTemplate(groupId, templateId);
358            }
359    
360            public static void deleteTemplates(long groupId)
361                    throws com.liferay.portal.kernel.exception.PortalException,
362                            com.liferay.portal.kernel.exception.SystemException {
363                    getService().deleteTemplates(groupId);
364            }
365    
366            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getStructureTemplates(
367                    long groupId, java.lang.String structureId)
368                    throws com.liferay.portal.kernel.exception.SystemException {
369                    return getService().getStructureTemplates(groupId, structureId);
370            }
371    
372            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getStructureTemplates(
373                    long groupId, java.lang.String structureId, int start, int end)
374                    throws com.liferay.portal.kernel.exception.SystemException {
375                    return getService()
376                                       .getStructureTemplates(groupId, structureId, start, end);
377            }
378    
379            public static int getStructureTemplatesCount(long groupId,
380                    java.lang.String structureId)
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    return getService().getStructureTemplatesCount(groupId, structureId);
383            }
384    
385            public static com.liferay.portlet.journal.model.JournalTemplate getTemplate(
386                    long id)
387                    throws com.liferay.portal.kernel.exception.PortalException,
388                            com.liferay.portal.kernel.exception.SystemException {
389                    return getService().getTemplate(id);
390            }
391    
392            public static com.liferay.portlet.journal.model.JournalTemplate getTemplate(
393                    long groupId, java.lang.String templateId)
394                    throws com.liferay.portal.kernel.exception.PortalException,
395                            com.liferay.portal.kernel.exception.SystemException {
396                    return getService().getTemplate(groupId, templateId);
397            }
398    
399            public static com.liferay.portlet.journal.model.JournalTemplate getTemplateBySmallImageId(
400                    long smallImageId)
401                    throws com.liferay.portal.kernel.exception.PortalException,
402                            com.liferay.portal.kernel.exception.SystemException {
403                    return getService().getTemplateBySmallImageId(smallImageId);
404            }
405    
406            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates()
407                    throws com.liferay.portal.kernel.exception.SystemException {
408                    return getService().getTemplates();
409            }
410    
411            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates(
412                    long groupId)
413                    throws com.liferay.portal.kernel.exception.SystemException {
414                    return getService().getTemplates(groupId);
415            }
416    
417            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates(
418                    long groupId, int start, int end)
419                    throws com.liferay.portal.kernel.exception.SystemException {
420                    return getService().getTemplates(groupId, start, end);
421            }
422    
423            public static int getTemplatesCount(long groupId)
424                    throws com.liferay.portal.kernel.exception.SystemException {
425                    return getService().getTemplatesCount(groupId);
426            }
427    
428            public static boolean hasTemplate(long groupId, java.lang.String templateId)
429                    throws com.liferay.portal.kernel.exception.SystemException {
430                    return getService().hasTemplate(groupId, templateId);
431            }
432    
433            /**
434            * @deprecated {@link #search(long, long[], String, String, String, int,
435            int, OrderByComparator)}
436            */
437            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
438                    long companyId, long groupId, java.lang.String keywords,
439                    java.lang.String structureId, java.lang.String structureIdComparator,
440                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    return getService()
443                                       .search(companyId, groupId, keywords, structureId,
444                            structureIdComparator, start, end, obc);
445            }
446    
447            /**
448            * @deprecated {@link #search(long, long[], String, String, String, String,
449            String, boolean, int, int, OrderByComparator)}
450            */
451            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
452                    long companyId, long groupId, java.lang.String templateId,
453                    java.lang.String structureId, java.lang.String structureIdComparator,
454                    java.lang.String name, java.lang.String description,
455                    boolean andOperator, int start, int end,
456                    com.liferay.portal.kernel.util.OrderByComparator obc)
457                    throws com.liferay.portal.kernel.exception.SystemException {
458                    return getService()
459                                       .search(companyId, groupId, templateId, structureId,
460                            structureIdComparator, name, description, andOperator, start, end,
461                            obc);
462            }
463    
464            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
465                    long companyId, long[] groupIds, java.lang.String keywords,
466                    java.lang.String structureId, java.lang.String structureIdComparator,
467                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getService()
470                                       .search(companyId, groupIds, keywords, structureId,
471                            structureIdComparator, start, end, obc);
472            }
473    
474            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
475                    long companyId, long[] groupIds, java.lang.String templateId,
476                    java.lang.String structureId, java.lang.String structureIdComparator,
477                    java.lang.String name, java.lang.String description,
478                    boolean andOperator, int start, int end,
479                    com.liferay.portal.kernel.util.OrderByComparator obc)
480                    throws com.liferay.portal.kernel.exception.SystemException {
481                    return getService()
482                                       .search(companyId, groupIds, templateId, structureId,
483                            structureIdComparator, name, description, andOperator, start, end,
484                            obc);
485            }
486    
487            /**
488            * @deprecated {@link #searchCount(long, long[], String, String, String)}
489            */
490            public static int searchCount(long companyId, long groupId,
491                    java.lang.String keywords, java.lang.String structureId,
492                    java.lang.String structureIdComparator)
493                    throws com.liferay.portal.kernel.exception.SystemException {
494                    return getService()
495                                       .searchCount(companyId, groupId, keywords, structureId,
496                            structureIdComparator);
497            }
498    
499            /**
500            * @deprecated {@link #searchCount(long, long[], String, String, String,
501            String, String, boolean)}
502            */
503            public static int searchCount(long companyId, long groupId,
504                    java.lang.String templateId, java.lang.String structureId,
505                    java.lang.String structureIdComparator, java.lang.String name,
506                    java.lang.String description, boolean andOperator)
507                    throws com.liferay.portal.kernel.exception.SystemException {
508                    return getService()
509                                       .searchCount(companyId, groupId, templateId, structureId,
510                            structureIdComparator, name, description, andOperator);
511            }
512    
513            public static int searchCount(long companyId, long[] groupIds,
514                    java.lang.String keywords, java.lang.String structureId,
515                    java.lang.String structureIdComparator)
516                    throws com.liferay.portal.kernel.exception.SystemException {
517                    return getService()
518                                       .searchCount(companyId, groupIds, keywords, structureId,
519                            structureIdComparator);
520            }
521    
522            public static int searchCount(long companyId, long[] groupIds,
523                    java.lang.String templateId, java.lang.String structureId,
524                    java.lang.String structureIdComparator, java.lang.String name,
525                    java.lang.String description, boolean andOperator)
526                    throws com.liferay.portal.kernel.exception.SystemException {
527                    return getService()
528                                       .searchCount(companyId, groupIds, templateId, structureId,
529                            structureIdComparator, name, description, andOperator);
530            }
531    
532            public static com.liferay.portlet.journal.model.JournalTemplate updateTemplate(
533                    long groupId, java.lang.String templateId,
534                    java.lang.String structureId, java.lang.String name,
535                    java.lang.String description, java.lang.String xsl, boolean formatXsl,
536                    java.lang.String langType, boolean cacheable, boolean smallImage,
537                    java.lang.String smallImageURL, java.io.File smallFile,
538                    com.liferay.portal.service.ServiceContext serviceContext)
539                    throws com.liferay.portal.kernel.exception.PortalException,
540                            com.liferay.portal.kernel.exception.SystemException {
541                    return getService()
542                                       .updateTemplate(groupId, templateId, structureId, name,
543                            description, xsl, formatXsl, langType, cacheable, smallImage,
544                            smallImageURL, smallFile, serviceContext);
545            }
546    
547            public static JournalTemplateLocalService getService() {
548                    if (_service == null) {
549                            _service = (JournalTemplateLocalService)PortalBeanLocatorUtil.locate(JournalTemplateLocalService.class.getName());
550    
551                            ReferenceRegistry.registerReference(JournalTemplateLocalServiceUtil.class,
552                                    "_service");
553                            MethodCache.remove(JournalTemplateLocalService.class);
554                    }
555    
556                    return _service;
557            }
558    
559            public void setService(JournalTemplateLocalService service) {
560                    MethodCache.remove(JournalTemplateLocalService.class);
561    
562                    _service = service;
563    
564                    ReferenceRegistry.registerReference(JournalTemplateLocalServiceUtil.class,
565                            "_service");
566                    MethodCache.remove(JournalTemplateLocalService.class);
567            }
568    
569            private static JournalTemplateLocalService _service;
570    }