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.blogs.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 blogs entry local service. This utility wraps {@link com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl} 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 BlogsEntryLocalService
030     * @see com.liferay.portlet.blogs.service.base.BlogsEntryLocalServiceBaseImpl
031     * @see com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl
032     * @generated
033     */
034    public class BlogsEntryLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.blogs.service.impl.BlogsEntryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the blogs entry to the database. Also notifies the appropriate model listeners.
043            *
044            * @param blogsEntry the blogs entry
045            * @return the blogs entry that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.blogs.model.BlogsEntry addBlogsEntry(
049                    com.liferay.portlet.blogs.model.BlogsEntry blogsEntry)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addBlogsEntry(blogsEntry);
052            }
053    
054            /**
055            * Creates a new blogs entry with the primary key. Does not add the blogs entry to the database.
056            *
057            * @param entryId the primary key for the new blogs entry
058            * @return the new blogs entry
059            */
060            public static com.liferay.portlet.blogs.model.BlogsEntry createBlogsEntry(
061                    long entryId) {
062                    return getService().createBlogsEntry(entryId);
063            }
064    
065            /**
066            * Deletes the blogs entry with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param entryId the primary key of the blogs entry
069            * @throws PortalException if a blogs entry with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteBlogsEntry(long entryId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteBlogsEntry(entryId);
076            }
077    
078            /**
079            * Deletes the blogs entry from the database. Also notifies the appropriate model listeners.
080            *
081            * @param blogsEntry the blogs entry
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteBlogsEntry(
085                    com.liferay.portlet.blogs.model.BlogsEntry blogsEntry)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteBlogsEntry(blogsEntry);
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 blogs entry with the primary key.
163            *
164            * @param entryId the primary key of the blogs entry
165            * @return the blogs entry
166            * @throws PortalException if a blogs entry with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.blogs.model.BlogsEntry getBlogsEntry(
170                    long entryId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getBlogsEntry(entryId);
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 blogs entry with the UUID in the group.
185            *
186            * @param uuid the UUID of blogs entry
187            * @param groupId the group id of the blogs entry
188            * @return the blogs entry
189            * @throws PortalException if a blogs entry 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.blogs.model.BlogsEntry getBlogsEntryByUuidAndGroupId(
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().getBlogsEntryByUuidAndGroupId(uuid, groupId);
197            }
198    
199            /**
200            * Returns a range of all the blogs entries.
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 blogs entries
207            * @param end the upper bound of the range of blogs entries (not inclusive)
208            * @return the range of blogs entries
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getBlogsEntries(
212                    int start, int end)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getBlogsEntries(start, end);
215            }
216    
217            /**
218            * Returns the number of blogs entries.
219            *
220            * @return the number of blogs entries
221            * @throws SystemException if a system exception occurred
222            */
223            public static int getBlogsEntriesCount()
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getService().getBlogsEntriesCount();
226            }
227    
228            /**
229            * Updates the blogs entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
230            *
231            * @param blogsEntry the blogs entry
232            * @return the blogs entry that was updated
233            * @throws SystemException if a system exception occurred
234            */
235            public static com.liferay.portlet.blogs.model.BlogsEntry updateBlogsEntry(
236                    com.liferay.portlet.blogs.model.BlogsEntry blogsEntry)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getService().updateBlogsEntry(blogsEntry);
239            }
240    
241            /**
242            * Updates the blogs entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
243            *
244            * @param blogsEntry the blogs entry
245            * @param merge whether to merge the blogs entry 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 blogs entry that was updated
247            * @throws SystemException if a system exception occurred
248            */
249            public static com.liferay.portlet.blogs.model.BlogsEntry updateBlogsEntry(
250                    com.liferay.portlet.blogs.model.BlogsEntry blogsEntry, boolean merge)
251                    throws com.liferay.portal.kernel.exception.SystemException {
252                    return getService().updateBlogsEntry(blogsEntry, merge);
253            }
254    
255            /**
256            * Returns the Spring bean ID for this bean.
257            *
258            * @return the Spring bean ID for this bean
259            */
260            public static java.lang.String getBeanIdentifier() {
261                    return getService().getBeanIdentifier();
262            }
263    
264            /**
265            * Sets the Spring bean ID for this bean.
266            *
267            * @param beanIdentifier the Spring bean ID for this bean
268            */
269            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
270                    getService().setBeanIdentifier(beanIdentifier);
271            }
272    
273            public static com.liferay.portlet.blogs.model.BlogsEntry addEntry(
274                    long userId, java.lang.String title, java.lang.String content,
275                    int displayDateMonth, int displayDateDay, int displayDateYear,
276                    int displayDateHour, int displayDateMinute, boolean allowPingbacks,
277                    boolean allowTrackbacks, java.lang.String[] trackbacks,
278                    com.liferay.portal.service.ServiceContext serviceContext)
279                    throws com.liferay.portal.kernel.exception.PortalException,
280                            com.liferay.portal.kernel.exception.SystemException {
281                    return getService()
282                                       .addEntry(userId, title, content, displayDateMonth,
283                            displayDateDay, displayDateYear, displayDateHour,
284                            displayDateMinute, allowPingbacks, allowTrackbacks, trackbacks,
285                            serviceContext);
286            }
287    
288            public static void addEntryResources(
289                    com.liferay.portlet.blogs.model.BlogsEntry entry,
290                    boolean addCommunityPermissions, boolean addGuestPermissions)
291                    throws com.liferay.portal.kernel.exception.PortalException,
292                            com.liferay.portal.kernel.exception.SystemException {
293                    getService()
294                            .addEntryResources(entry, addCommunityPermissions,
295                            addGuestPermissions);
296            }
297    
298            public static void addEntryResources(
299                    com.liferay.portlet.blogs.model.BlogsEntry entry,
300                    java.lang.String[] communityPermissions,
301                    java.lang.String[] guestPermissions)
302                    throws com.liferay.portal.kernel.exception.PortalException,
303                            com.liferay.portal.kernel.exception.SystemException {
304                    getService()
305                            .addEntryResources(entry, communityPermissions, guestPermissions);
306            }
307    
308            public static void addEntryResources(long entryId,
309                    boolean addCommunityPermissions, boolean addGuestPermissions)
310                    throws com.liferay.portal.kernel.exception.PortalException,
311                            com.liferay.portal.kernel.exception.SystemException {
312                    getService()
313                            .addEntryResources(entryId, addCommunityPermissions,
314                            addGuestPermissions);
315            }
316    
317            public static void addEntryResources(long entryId,
318                    java.lang.String[] communityPermissions,
319                    java.lang.String[] guestPermissions)
320                    throws com.liferay.portal.kernel.exception.PortalException,
321                            com.liferay.portal.kernel.exception.SystemException {
322                    getService()
323                            .addEntryResources(entryId, communityPermissions, guestPermissions);
324            }
325    
326            public static void deleteEntries(long groupId)
327                    throws com.liferay.portal.kernel.exception.PortalException,
328                            com.liferay.portal.kernel.exception.SystemException {
329                    getService().deleteEntries(groupId);
330            }
331    
332            public static void deleteEntry(
333                    com.liferay.portlet.blogs.model.BlogsEntry entry)
334                    throws com.liferay.portal.kernel.exception.PortalException,
335                            com.liferay.portal.kernel.exception.SystemException {
336                    getService().deleteEntry(entry);
337            }
338    
339            public static void deleteEntry(long entryId)
340                    throws com.liferay.portal.kernel.exception.PortalException,
341                            com.liferay.portal.kernel.exception.SystemException {
342                    getService().deleteEntry(entryId);
343            }
344    
345            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getCompanyEntries(
346                    long companyId, int status, int start, int end)
347                    throws com.liferay.portal.kernel.exception.SystemException {
348                    return getService().getCompanyEntries(companyId, status, start, end);
349            }
350    
351            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getCompanyEntries(
352                    long companyId, int status, int start, int end,
353                    com.liferay.portal.kernel.util.OrderByComparator obc)
354                    throws com.liferay.portal.kernel.exception.SystemException {
355                    return getService().getCompanyEntries(companyId, status, start, end, obc);
356            }
357    
358            public static int getCompanyEntriesCount(long companyId, int status)
359                    throws com.liferay.portal.kernel.exception.SystemException {
360                    return getService().getCompanyEntriesCount(companyId, status);
361            }
362    
363            public static com.liferay.portlet.blogs.model.BlogsEntry[] getEntriesPrevAndNext(
364                    long entryId)
365                    throws com.liferay.portal.kernel.exception.PortalException,
366                            com.liferay.portal.kernel.exception.SystemException {
367                    return getService().getEntriesPrevAndNext(entryId);
368            }
369    
370            public static com.liferay.portlet.blogs.model.BlogsEntry getEntry(
371                    long entryId)
372                    throws com.liferay.portal.kernel.exception.PortalException,
373                            com.liferay.portal.kernel.exception.SystemException {
374                    return getService().getEntry(entryId);
375            }
376    
377            public static com.liferay.portlet.blogs.model.BlogsEntry getEntry(
378                    long groupId, java.lang.String urlTitle)
379                    throws com.liferay.portal.kernel.exception.PortalException,
380                            com.liferay.portal.kernel.exception.SystemException {
381                    return getService().getEntry(groupId, urlTitle);
382            }
383    
384            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getGroupEntries(
385                    long groupId, int status, int start, int end)
386                    throws com.liferay.portal.kernel.exception.SystemException {
387                    return getService().getGroupEntries(groupId, status, start, end);
388            }
389    
390            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getGroupEntries(
391                    long groupId, int status, int start, int end,
392                    com.liferay.portal.kernel.util.OrderByComparator obc)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getService().getGroupEntries(groupId, status, start, end, obc);
395            }
396    
397            public static int getGroupEntriesCount(long groupId, int status)
398                    throws com.liferay.portal.kernel.exception.SystemException {
399                    return getService().getGroupEntriesCount(groupId, status);
400            }
401    
402            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getGroupsEntries(
403                    long companyId, long groupId, int status, int start, int end)
404                    throws com.liferay.portal.kernel.exception.SystemException {
405                    return getService()
406                                       .getGroupsEntries(companyId, groupId, status, start, end);
407            }
408    
409            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getGroupUserEntries(
410                    long groupId, long userId, int status, int start, int end)
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getService()
413                                       .getGroupUserEntries(groupId, userId, status, start, end);
414            }
415    
416            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getGroupUserEntries(
417                    long groupId, long userId, int status, int start, int end,
418                    com.liferay.portal.kernel.util.OrderByComparator obc)
419                    throws com.liferay.portal.kernel.exception.SystemException {
420                    return getService()
421                                       .getGroupUserEntries(groupId, userId, status, start, end, obc);
422            }
423    
424            public static int getGroupUserEntriesCount(long groupId, long userId,
425                    int status) throws com.liferay.portal.kernel.exception.SystemException {
426                    return getService().getGroupUserEntriesCount(groupId, userId, status);
427            }
428    
429            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getNoAssetEntries()
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    return getService().getNoAssetEntries();
432            }
433    
434            public static java.util.List<com.liferay.portlet.blogs.model.BlogsEntry> getOrganizationEntries(
435                    long organizationId, int status, int start, int end)
436                    throws com.liferay.portal.kernel.exception.SystemException {
437                    return getService()
438                                       .getOrganizationEntries(organizationId, status, start, end);
439            }
440    
441            public static int getOrganizationEntriesCount(long organizationId,
442                    int status) throws com.liferay.portal.kernel.exception.SystemException {
443                    return getService().getOrganizationEntriesCount(organizationId, status);
444            }
445    
446            public static void subscribe(long userId, long groupId)
447                    throws com.liferay.portal.kernel.exception.PortalException,
448                            com.liferay.portal.kernel.exception.SystemException {
449                    getService().subscribe(userId, groupId);
450            }
451    
452            public static void unsubscribe(long userId, long groupId)
453                    throws com.liferay.portal.kernel.exception.PortalException,
454                            com.liferay.portal.kernel.exception.SystemException {
455                    getService().unsubscribe(userId, groupId);
456            }
457    
458            public static void updateAsset(long userId,
459                    com.liferay.portlet.blogs.model.BlogsEntry entry,
460                    long[] assetCategoryIds, java.lang.String[] assetTagNames)
461                    throws com.liferay.portal.kernel.exception.PortalException,
462                            com.liferay.portal.kernel.exception.SystemException {
463                    getService().updateAsset(userId, entry, assetCategoryIds, assetTagNames);
464            }
465    
466            public static com.liferay.portlet.blogs.model.BlogsEntry updateEntry(
467                    long userId, long entryId, java.lang.String title,
468                    java.lang.String content, int displayDateMonth, int displayDateDay,
469                    int displayDateYear, int displayDateHour, int displayDateMinute,
470                    boolean allowPingbacks, boolean allowTrackbacks,
471                    java.lang.String[] trackbacks,
472                    com.liferay.portal.service.ServiceContext serviceContext)
473                    throws com.liferay.portal.kernel.exception.PortalException,
474                            com.liferay.portal.kernel.exception.SystemException {
475                    return getService()
476                                       .updateEntry(userId, entryId, title, content,
477                            displayDateMonth, displayDateDay, displayDateYear, displayDateHour,
478                            displayDateMinute, allowPingbacks, allowTrackbacks, trackbacks,
479                            serviceContext);
480            }
481    
482            public static void updateEntryResources(
483                    com.liferay.portlet.blogs.model.BlogsEntry entry,
484                    java.lang.String[] communityPermissions,
485                    java.lang.String[] guestPermissions)
486                    throws com.liferay.portal.kernel.exception.PortalException,
487                            com.liferay.portal.kernel.exception.SystemException {
488                    getService()
489                            .updateEntryResources(entry, communityPermissions, guestPermissions);
490            }
491    
492            public static com.liferay.portlet.blogs.model.BlogsEntry updateStatus(
493                    long userId, long entryId, int status,
494                    com.liferay.portal.service.ServiceContext serviceContext)
495                    throws com.liferay.portal.kernel.exception.PortalException,
496                            com.liferay.portal.kernel.exception.SystemException {
497                    return getService().updateStatus(userId, entryId, status, serviceContext);
498            }
499    
500            public static BlogsEntryLocalService getService() {
501                    if (_service == null) {
502                            _service = (BlogsEntryLocalService)PortalBeanLocatorUtil.locate(BlogsEntryLocalService.class.getName());
503    
504                            ReferenceRegistry.registerReference(BlogsEntryLocalServiceUtil.class,
505                                    "_service");
506                            MethodCache.remove(BlogsEntryLocalService.class);
507                    }
508    
509                    return _service;
510            }
511    
512            public void setService(BlogsEntryLocalService service) {
513                    MethodCache.remove(BlogsEntryLocalService.class);
514    
515                    _service = service;
516    
517                    ReferenceRegistry.registerReference(BlogsEntryLocalServiceUtil.class,
518                            "_service");
519                    MethodCache.remove(BlogsEntryLocalService.class);
520            }
521    
522            private static BlogsEntryLocalService _service;
523    }