001    /**
002     * Copyright (c) 2000-2011 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.asset.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 asset entry local service. This utility wraps {@link com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl} 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 AssetEntryLocalService
030     * @see com.liferay.portlet.asset.service.base.AssetEntryLocalServiceBaseImpl
031     * @see com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl
032     * @generated
033     */
034    public class AssetEntryLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.asset.service.impl.AssetEntryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the asset entry to the database. Also notifies the appropriate model listeners.
043            *
044            * @param assetEntry the asset entry
045            * @return the asset entry that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.asset.model.AssetEntry addAssetEntry(
049                    com.liferay.portlet.asset.model.AssetEntry assetEntry)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addAssetEntry(assetEntry);
052            }
053    
054            /**
055            * Creates a new asset entry with the primary key. Does not add the asset entry to the database.
056            *
057            * @param entryId the primary key for the new asset entry
058            * @return the new asset entry
059            */
060            public static com.liferay.portlet.asset.model.AssetEntry createAssetEntry(
061                    long entryId) {
062                    return getService().createAssetEntry(entryId);
063            }
064    
065            /**
066            * Deletes the asset entry with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param entryId the primary key of the asset entry
069            * @throws PortalException if a asset entry with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteAssetEntry(long entryId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteAssetEntry(entryId);
076            }
077    
078            /**
079            * Deletes the asset entry from the database. Also notifies the appropriate model listeners.
080            *
081            * @param assetEntry the asset entry
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteAssetEntry(
085                    com.liferay.portlet.asset.model.AssetEntry assetEntry)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteAssetEntry(assetEntry);
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 asset entry with the primary key.
163            *
164            * @param entryId the primary key of the asset entry
165            * @return the asset entry
166            * @throws PortalException if a asset entry with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.asset.model.AssetEntry getAssetEntry(
170                    long entryId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getAssetEntry(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 a range of all the asset entries.
185            *
186            * <p>
187            * 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.
188            * </p>
189            *
190            * @param start the lower bound of the range of asset entries
191            * @param end the upper bound of the range of asset entries (not inclusive)
192            * @return the range of asset entries
193            * @throws SystemException if a system exception occurred
194            */
195            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getAssetEntries(
196                    int start, int end)
197                    throws com.liferay.portal.kernel.exception.SystemException {
198                    return getService().getAssetEntries(start, end);
199            }
200    
201            /**
202            * Returns the number of asset entries.
203            *
204            * @return the number of asset entries
205            * @throws SystemException if a system exception occurred
206            */
207            public static int getAssetEntriesCount()
208                    throws com.liferay.portal.kernel.exception.SystemException {
209                    return getService().getAssetEntriesCount();
210            }
211    
212            /**
213            * Updates the asset entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
214            *
215            * @param assetEntry the asset entry
216            * @return the asset entry that was updated
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portlet.asset.model.AssetEntry updateAssetEntry(
220                    com.liferay.portlet.asset.model.AssetEntry assetEntry)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getService().updateAssetEntry(assetEntry);
223            }
224    
225            /**
226            * Updates the asset entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
227            *
228            * @param assetEntry the asset entry
229            * @param merge whether to merge the asset 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.
230            * @return the asset entry that was updated
231            * @throws SystemException if a system exception occurred
232            */
233            public static com.liferay.portlet.asset.model.AssetEntry updateAssetEntry(
234                    com.liferay.portlet.asset.model.AssetEntry assetEntry, boolean merge)
235                    throws com.liferay.portal.kernel.exception.SystemException {
236                    return getService().updateAssetEntry(assetEntry, merge);
237            }
238    
239            /**
240            * Returns the Spring bean ID for this bean.
241            *
242            * @return the Spring bean ID for this bean
243            */
244            public static java.lang.String getBeanIdentifier() {
245                    return getService().getBeanIdentifier();
246            }
247    
248            /**
249            * Sets the Spring bean ID for this bean.
250            *
251            * @param beanIdentifier the Spring bean ID for this bean
252            */
253            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
254                    getService().setBeanIdentifier(beanIdentifier);
255            }
256    
257            public static void deleteEntry(
258                    com.liferay.portlet.asset.model.AssetEntry entry)
259                    throws com.liferay.portal.kernel.exception.PortalException,
260                            com.liferay.portal.kernel.exception.SystemException {
261                    getService().deleteEntry(entry);
262            }
263    
264            public static void deleteEntry(long entryId)
265                    throws com.liferay.portal.kernel.exception.PortalException,
266                            com.liferay.portal.kernel.exception.SystemException {
267                    getService().deleteEntry(entryId);
268            }
269    
270            public static void deleteEntry(java.lang.String className, long classPK)
271                    throws com.liferay.portal.kernel.exception.PortalException,
272                            com.liferay.portal.kernel.exception.SystemException {
273                    getService().deleteEntry(className, classPK);
274            }
275    
276            public static com.liferay.portlet.asset.model.AssetEntry fetchEntry(
277                    long entryId)
278                    throws com.liferay.portal.kernel.exception.SystemException {
279                    return getService().fetchEntry(entryId);
280            }
281    
282            public static com.liferay.portlet.asset.model.AssetEntry fetchEntry(
283                    java.lang.String className, long classPK)
284                    throws com.liferay.portal.kernel.exception.SystemException {
285                    return getService().fetchEntry(className, classPK);
286            }
287    
288            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getAncestorEntries(
289                    long entryId)
290                    throws com.liferay.portal.kernel.exception.PortalException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    return getService().getAncestorEntries(entryId);
293            }
294    
295            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getChildEntries(
296                    long entryId)
297                    throws com.liferay.portal.kernel.exception.PortalException,
298                            com.liferay.portal.kernel.exception.SystemException {
299                    return getService().getChildEntries(entryId);
300            }
301    
302            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
303                    long companyId, int start, int end)
304                    throws com.liferay.portal.kernel.exception.SystemException {
305                    return getService().getCompanyEntries(companyId, start, end);
306            }
307    
308            public static int getCompanyEntriesCount(long companyId)
309                    throws com.liferay.portal.kernel.exception.SystemException {
310                    return getService().getCompanyEntriesCount(companyId);
311            }
312    
313            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] getCompanyEntryDisplays(
314                    long companyId, int start, int end, java.lang.String languageId)
315                    throws com.liferay.portal.kernel.exception.SystemException {
316                    return getService()
317                                       .getCompanyEntryDisplays(companyId, start, end, languageId);
318            }
319    
320            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
321                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    return getService().getEntries(entryQuery);
324            }
325    
326            public static int getEntriesCount(
327                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
328                    throws com.liferay.portal.kernel.exception.SystemException {
329                    return getService().getEntriesCount(entryQuery);
330            }
331    
332            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
333                    long entryId)
334                    throws com.liferay.portal.kernel.exception.PortalException,
335                            com.liferay.portal.kernel.exception.SystemException {
336                    return getService().getEntry(entryId);
337            }
338    
339            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
340                    long groupId, java.lang.String classUuid)
341                    throws com.liferay.portal.kernel.exception.PortalException,
342                            com.liferay.portal.kernel.exception.SystemException {
343                    return getService().getEntry(groupId, classUuid);
344            }
345    
346            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
347                    java.lang.String className, long classPK)
348                    throws com.liferay.portal.kernel.exception.PortalException,
349                            com.liferay.portal.kernel.exception.SystemException {
350                    return getService().getEntry(className, classPK);
351            }
352    
353            public static com.liferay.portlet.asset.model.AssetEntry getNextEntry(
354                    long entryId)
355                    throws com.liferay.portal.kernel.exception.PortalException,
356                            com.liferay.portal.kernel.exception.SystemException {
357                    return getService().getNextEntry(entryId);
358            }
359    
360            public static com.liferay.portlet.asset.model.AssetEntry getParentEntry(
361                    long entryId)
362                    throws com.liferay.portal.kernel.exception.PortalException,
363                            com.liferay.portal.kernel.exception.SystemException {
364                    return getService().getParentEntry(entryId);
365            }
366    
367            public static com.liferay.portlet.asset.model.AssetEntry getPreviousEntry(
368                    long entryId)
369                    throws com.liferay.portal.kernel.exception.PortalException,
370                            com.liferay.portal.kernel.exception.SystemException {
371                    return getService().getPreviousEntry(entryId);
372            }
373    
374            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getTopViewedEntries(
375                    java.lang.String className, boolean asc, int start, int end)
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return getService().getTopViewedEntries(className, asc, start, end);
378            }
379    
380            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getTopViewedEntries(
381                    java.lang.String[] className, boolean asc, int start, int end)
382                    throws com.liferay.portal.kernel.exception.SystemException {
383                    return getService().getTopViewedEntries(className, asc, start, end);
384            }
385    
386            public static com.liferay.portlet.asset.model.AssetEntry incrementViewCounter(
387                    long userId, java.lang.String className, long classPK, int increment)
388                    throws com.liferay.portal.kernel.exception.PortalException,
389                            com.liferay.portal.kernel.exception.SystemException {
390                    return getService()
391                                       .incrementViewCounter(userId, className, classPK, increment);
392            }
393    
394            public static void reindex(
395                    java.util.List<com.liferay.portlet.asset.model.AssetEntry> entries)
396                    throws com.liferay.portal.kernel.exception.PortalException {
397                    getService().reindex(entries);
398            }
399    
400            public static com.liferay.portal.kernel.search.Hits search(long companyId,
401                    long[] groupIds, java.lang.String className, java.lang.String keywords,
402                    int start, int end)
403                    throws com.liferay.portal.kernel.exception.SystemException {
404                    return getService()
405                                       .search(companyId, groupIds, className, keywords, start, end);
406            }
407    
408            public static com.liferay.portal.kernel.search.Hits search(long companyId,
409                    long[] groupIds, long userId, java.lang.String className,
410                    java.lang.String keywords, int start, int end)
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getService()
413                                       .search(companyId, groupIds, userId, className, keywords,
414                            start, end);
415            }
416    
417            public static com.liferay.portal.kernel.search.Hits search(long companyId,
418                    long[] groupIds, long userId, java.lang.String className,
419                    java.lang.String userName, java.lang.String title,
420                    java.lang.String description, java.lang.String assetCategoryIds,
421                    java.lang.String assetTagNames, boolean andSearch, int start, int end)
422                    throws com.liferay.portal.kernel.exception.SystemException {
423                    return getService()
424                                       .search(companyId, groupIds, userId, className, userName,
425                            title, description, assetCategoryIds, assetTagNames, andSearch,
426                            start, end);
427            }
428    
429            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] searchEntryDisplays(
430                    long companyId, long[] groupIds, java.lang.String className,
431                    java.lang.String keywords, java.lang.String languageId, int start,
432                    int end) throws com.liferay.portal.kernel.exception.SystemException {
433                    return getService()
434                                       .searchEntryDisplays(companyId, groupIds, className,
435                            keywords, languageId, start, end);
436            }
437    
438            public static int searchEntryDisplaysCount(long companyId, long[] groupIds,
439                    java.lang.String className, java.lang.String keywords,
440                    java.lang.String languageId)
441                    throws com.liferay.portal.kernel.exception.SystemException {
442                    return getService()
443                                       .searchEntryDisplaysCount(companyId, groupIds, className,
444                            keywords, languageId);
445            }
446    
447            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
448                    long userId, long groupId, java.lang.String className, long classPK,
449                    long[] categoryIds, java.lang.String[] tagNames)
450                    throws com.liferay.portal.kernel.exception.PortalException,
451                            com.liferay.portal.kernel.exception.SystemException {
452                    return getService()
453                                       .updateEntry(userId, groupId, className, classPK,
454                            categoryIds, tagNames);
455            }
456    
457            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
458                    long userId, long groupId, java.lang.String className, long classPK,
459                    java.lang.String classUuid, long classTypeId, long[] categoryIds,
460                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
461                    java.util.Date endDate, java.util.Date publishDate,
462                    java.util.Date expirationDate, java.lang.String mimeType,
463                    java.lang.String title, java.lang.String description,
464                    java.lang.String summary, java.lang.String url,
465                    java.lang.String layoutUuid, int height, int width,
466                    java.lang.Integer priority, boolean sync)
467                    throws com.liferay.portal.kernel.exception.PortalException,
468                            com.liferay.portal.kernel.exception.SystemException {
469                    return getService()
470                                       .updateEntry(userId, groupId, className, classPK, classUuid,
471                            classTypeId, categoryIds, tagNames, visible, startDate, endDate,
472                            publishDate, expirationDate, mimeType, title, description, summary,
473                            url, layoutUuid, height, width, priority, sync);
474            }
475    
476            public static com.liferay.portlet.asset.model.AssetEntry updateVisible(
477                    java.lang.String className, long classPK, boolean visible)
478                    throws com.liferay.portal.kernel.exception.PortalException,
479                            com.liferay.portal.kernel.exception.SystemException {
480                    return getService().updateVisible(className, classPK, visible);
481            }
482    
483            public static void validate(long groupId, java.lang.String className,
484                    long[] categoryIds, java.lang.String[] tagNames)
485                    throws com.liferay.portal.kernel.exception.PortalException,
486                            com.liferay.portal.kernel.exception.SystemException {
487                    getService().validate(groupId, className, categoryIds, tagNames);
488            }
489    
490            public static AssetEntryLocalService getService() {
491                    if (_service == null) {
492                            _service = (AssetEntryLocalService)PortalBeanLocatorUtil.locate(AssetEntryLocalService.class.getName());
493    
494                            ReferenceRegistry.registerReference(AssetEntryLocalServiceUtil.class,
495                                    "_service");
496                            MethodCache.remove(AssetEntryLocalService.class);
497                    }
498    
499                    return _service;
500            }
501    
502            public void setService(AssetEntryLocalService service) {
503                    MethodCache.remove(AssetEntryLocalService.class);
504    
505                    _service = service;
506    
507                    ReferenceRegistry.registerReference(AssetEntryLocalServiceUtil.class,
508                            "_service");
509                    MethodCache.remove(AssetEntryLocalService.class);
510            }
511    
512            private static AssetEntryLocalService _service;
513    }