001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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            public static com.liferay.portlet.journal.model.JournalTemplate fetchJournalTemplate(
162                    long id) throws com.liferay.portal.kernel.exception.SystemException {
163                    return getService().fetchJournalTemplate(id);
164            }
165    
166            /**
167            * Returns the journal template with the primary key.
168            *
169            * @param id the primary key of the journal template
170            * @return the journal template
171            * @throws PortalException if a journal template with the primary key could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portlet.journal.model.JournalTemplate getJournalTemplate(
175                    long id)
176                    throws com.liferay.portal.kernel.exception.PortalException,
177                            com.liferay.portal.kernel.exception.SystemException {
178                    return getService().getJournalTemplate(id);
179            }
180    
181            public static com.liferay.portal.model.PersistedModel getPersistedModel(
182                    java.io.Serializable primaryKeyObj)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getPersistedModel(primaryKeyObj);
186            }
187    
188            /**
189            * Returns the journal template with the UUID in the group.
190            *
191            * @param uuid the UUID of journal template
192            * @param groupId the group id of the journal template
193            * @return the journal template
194            * @throws PortalException if a journal template with the UUID in the group could not be found
195            * @throws SystemException if a system exception occurred
196            */
197            public static com.liferay.portlet.journal.model.JournalTemplate getJournalTemplateByUuidAndGroupId(
198                    java.lang.String uuid, long groupId)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    return getService().getJournalTemplateByUuidAndGroupId(uuid, groupId);
202            }
203    
204            /**
205            * Returns a range of all the journal templates.
206            *
207            * <p>
208            * 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.
209            * </p>
210            *
211            * @param start the lower bound of the range of journal templates
212            * @param end the upper bound of the range of journal templates (not inclusive)
213            * @return the range of journal templates
214            * @throws SystemException if a system exception occurred
215            */
216            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getJournalTemplates(
217                    int start, int end)
218                    throws com.liferay.portal.kernel.exception.SystemException {
219                    return getService().getJournalTemplates(start, end);
220            }
221    
222            /**
223            * Returns the number of journal templates.
224            *
225            * @return the number of journal templates
226            * @throws SystemException if a system exception occurred
227            */
228            public static int getJournalTemplatesCount()
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return getService().getJournalTemplatesCount();
231            }
232    
233            /**
234            * Updates the journal template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
235            *
236            * @param journalTemplate the journal template
237            * @return the journal template that was updated
238            * @throws SystemException if a system exception occurred
239            */
240            public static com.liferay.portlet.journal.model.JournalTemplate updateJournalTemplate(
241                    com.liferay.portlet.journal.model.JournalTemplate journalTemplate)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getService().updateJournalTemplate(journalTemplate);
244            }
245    
246            /**
247            * Updates the journal template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
248            *
249            * @param journalTemplate the journal template
250            * @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.
251            * @return the journal template that was updated
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portlet.journal.model.JournalTemplate updateJournalTemplate(
255                    com.liferay.portlet.journal.model.JournalTemplate journalTemplate,
256                    boolean merge)
257                    throws com.liferay.portal.kernel.exception.SystemException {
258                    return getService().updateJournalTemplate(journalTemplate, merge);
259            }
260    
261            /**
262            * Returns the Spring bean ID for this bean.
263            *
264            * @return the Spring bean ID for this bean
265            */
266            public static java.lang.String getBeanIdentifier() {
267                    return getService().getBeanIdentifier();
268            }
269    
270            /**
271            * Sets the Spring bean ID for this bean.
272            *
273            * @param beanIdentifier the Spring bean ID for this bean
274            */
275            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
276                    getService().setBeanIdentifier(beanIdentifier);
277            }
278    
279            public static com.liferay.portlet.journal.model.JournalTemplate addTemplate(
280                    long userId, long groupId, java.lang.String templateId,
281                    boolean autoTemplateId, java.lang.String structureId,
282                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
283                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
284                    java.lang.String xsl, boolean formatXsl, java.lang.String langType,
285                    boolean cacheable, boolean smallImage, java.lang.String smallImageURL,
286                    java.io.File smallImageFile,
287                    com.liferay.portal.service.ServiceContext serviceContext)
288                    throws com.liferay.portal.kernel.exception.PortalException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    return getService()
291                                       .addTemplate(userId, groupId, templateId, autoTemplateId,
292                            structureId, nameMap, descriptionMap, xsl, formatXsl, langType,
293                            cacheable, smallImage, smallImageURL, smallImageFile, serviceContext);
294            }
295    
296            public static void addTemplateResources(
297                    com.liferay.portlet.journal.model.JournalTemplate template,
298                    boolean addGroupPermissions, boolean addGuestPermissions)
299                    throws com.liferay.portal.kernel.exception.PortalException,
300                            com.liferay.portal.kernel.exception.SystemException {
301                    getService()
302                            .addTemplateResources(template, addGroupPermissions,
303                            addGuestPermissions);
304            }
305    
306            public static void addTemplateResources(
307                    com.liferay.portlet.journal.model.JournalTemplate template,
308                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    getService()
312                            .addTemplateResources(template, groupPermissions, guestPermissions);
313            }
314    
315            public static void addTemplateResources(long groupId,
316                    java.lang.String templateId, boolean addGroupPermissions,
317                    boolean addGuestPermissions)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    getService()
321                            .addTemplateResources(groupId, templateId, addGroupPermissions,
322                            addGuestPermissions);
323            }
324    
325            public static void addTemplateResources(long groupId,
326                    java.lang.String templateId, java.lang.String[] groupPermissions,
327                    java.lang.String[] guestPermissions)
328                    throws com.liferay.portal.kernel.exception.PortalException,
329                            com.liferay.portal.kernel.exception.SystemException {
330                    getService()
331                            .addTemplateResources(groupId, templateId, groupPermissions,
332                            guestPermissions);
333            }
334    
335            public static void checkNewLine(long groupId, java.lang.String templateId)
336                    throws com.liferay.portal.kernel.exception.PortalException,
337                            com.liferay.portal.kernel.exception.SystemException {
338                    getService().checkNewLine(groupId, templateId);
339            }
340    
341            public static com.liferay.portlet.journal.model.JournalTemplate copyTemplate(
342                    long userId, long groupId, java.lang.String oldTemplateId,
343                    java.lang.String newTemplateId, boolean autoTemplateId)
344                    throws com.liferay.portal.kernel.exception.PortalException,
345                            com.liferay.portal.kernel.exception.SystemException {
346                    return getService()
347                                       .copyTemplate(userId, groupId, oldTemplateId, newTemplateId,
348                            autoTemplateId);
349            }
350    
351            public static void deleteTemplate(
352                    com.liferay.portlet.journal.model.JournalTemplate template)
353                    throws com.liferay.portal.kernel.exception.PortalException,
354                            com.liferay.portal.kernel.exception.SystemException {
355                    getService().deleteTemplate(template);
356            }
357    
358            public static void deleteTemplate(long groupId, java.lang.String templateId)
359                    throws com.liferay.portal.kernel.exception.PortalException,
360                            com.liferay.portal.kernel.exception.SystemException {
361                    getService().deleteTemplate(groupId, templateId);
362            }
363    
364            public static void deleteTemplates(long groupId)
365                    throws com.liferay.portal.kernel.exception.PortalException,
366                            com.liferay.portal.kernel.exception.SystemException {
367                    getService().deleteTemplates(groupId);
368            }
369    
370            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getStructureTemplates(
371                    long groupId, java.lang.String structureId)
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    return getService().getStructureTemplates(groupId, structureId);
374            }
375    
376            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getStructureTemplates(
377                    long groupId, java.lang.String structureId, int start, int end)
378                    throws com.liferay.portal.kernel.exception.SystemException {
379                    return getService()
380                                       .getStructureTemplates(groupId, structureId, start, end);
381            }
382    
383            public static int getStructureTemplatesCount(long groupId,
384                    java.lang.String structureId)
385                    throws com.liferay.portal.kernel.exception.SystemException {
386                    return getService().getStructureTemplatesCount(groupId, structureId);
387            }
388    
389            public static com.liferay.portlet.journal.model.JournalTemplate getTemplate(
390                    long id)
391                    throws com.liferay.portal.kernel.exception.PortalException,
392                            com.liferay.portal.kernel.exception.SystemException {
393                    return getService().getTemplate(id);
394            }
395    
396            public static com.liferay.portlet.journal.model.JournalTemplate getTemplate(
397                    long groupId, java.lang.String templateId)
398                    throws com.liferay.portal.kernel.exception.PortalException,
399                            com.liferay.portal.kernel.exception.SystemException {
400                    return getService().getTemplate(groupId, templateId);
401            }
402    
403            public static com.liferay.portlet.journal.model.JournalTemplate getTemplateBySmallImageId(
404                    long smallImageId)
405                    throws com.liferay.portal.kernel.exception.PortalException,
406                            com.liferay.portal.kernel.exception.SystemException {
407                    return getService().getTemplateBySmallImageId(smallImageId);
408            }
409    
410            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates()
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getService().getTemplates();
413            }
414    
415            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates(
416                    long groupId)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getService().getTemplates(groupId);
419            }
420    
421            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> getTemplates(
422                    long groupId, int start, int end)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getService().getTemplates(groupId, start, end);
425            }
426    
427            public static int getTemplatesCount(long groupId)
428                    throws com.liferay.portal.kernel.exception.SystemException {
429                    return getService().getTemplatesCount(groupId);
430            }
431    
432            public static boolean hasTemplate(long groupId, java.lang.String templateId)
433                    throws com.liferay.portal.kernel.exception.SystemException {
434                    return getService().hasTemplate(groupId, templateId);
435            }
436    
437            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
438                    long companyId, long[] groupIds, 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, groupIds, keywords, structureId,
444                            structureIdComparator, start, end, obc);
445            }
446    
447            public static java.util.List<com.liferay.portlet.journal.model.JournalTemplate> search(
448                    long companyId, long[] groupIds, java.lang.String templateId,
449                    java.lang.String structureId, java.lang.String structureIdComparator,
450                    java.lang.String name, java.lang.String description,
451                    boolean andOperator, int start, int end,
452                    com.liferay.portal.kernel.util.OrderByComparator obc)
453                    throws com.liferay.portal.kernel.exception.SystemException {
454                    return getService()
455                                       .search(companyId, groupIds, templateId, structureId,
456                            structureIdComparator, name, description, andOperator, start, end,
457                            obc);
458            }
459    
460            public static int searchCount(long companyId, long[] groupIds,
461                    java.lang.String keywords, java.lang.String structureId,
462                    java.lang.String structureIdComparator)
463                    throws com.liferay.portal.kernel.exception.SystemException {
464                    return getService()
465                                       .searchCount(companyId, groupIds, keywords, structureId,
466                            structureIdComparator);
467            }
468    
469            public static int searchCount(long companyId, long[] groupIds,
470                    java.lang.String templateId, java.lang.String structureId,
471                    java.lang.String structureIdComparator, java.lang.String name,
472                    java.lang.String description, boolean andOperator)
473                    throws com.liferay.portal.kernel.exception.SystemException {
474                    return getService()
475                                       .searchCount(companyId, groupIds, templateId, structureId,
476                            structureIdComparator, name, description, andOperator);
477            }
478    
479            public static com.liferay.portlet.journal.model.JournalTemplate updateTemplate(
480                    long groupId, java.lang.String templateId,
481                    java.lang.String structureId,
482                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
483                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
484                    java.lang.String xsl, boolean formatXsl, java.lang.String langType,
485                    boolean cacheable, boolean smallImage, java.lang.String smallImageURL,
486                    java.io.File smallImageFile,
487                    com.liferay.portal.service.ServiceContext serviceContext)
488                    throws com.liferay.portal.kernel.exception.PortalException,
489                            com.liferay.portal.kernel.exception.SystemException {
490                    return getService()
491                                       .updateTemplate(groupId, templateId, structureId, nameMap,
492                            descriptionMap, xsl, formatXsl, langType, cacheable, smallImage,
493                            smallImageURL, smallImageFile, serviceContext);
494            }
495    
496            public static JournalTemplateLocalService getService() {
497                    if (_service == null) {
498                            _service = (JournalTemplateLocalService)PortalBeanLocatorUtil.locate(JournalTemplateLocalService.class.getName());
499    
500                            ReferenceRegistry.registerReference(JournalTemplateLocalServiceUtil.class,
501                                    "_service");
502                            MethodCache.remove(JournalTemplateLocalService.class);
503                    }
504    
505                    return _service;
506            }
507    
508            public void setService(JournalTemplateLocalService service) {
509                    MethodCache.remove(JournalTemplateLocalService.class);
510    
511                    _service = service;
512    
513                    ReferenceRegistry.registerReference(JournalTemplateLocalServiceUtil.class,
514                            "_service");
515                    MethodCache.remove(JournalTemplateLocalService.class);
516            }
517    
518            private static JournalTemplateLocalService _service;
519    }