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.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 java.util.List<com.liferay.portlet.asset.model.AssetEntry> getAncestorEntries(
277                    long entryId)
278                    throws com.liferay.portal.kernel.exception.PortalException,
279                            com.liferay.portal.kernel.exception.SystemException {
280                    return getService().getAncestorEntries(entryId);
281            }
282    
283            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getChildEntries(
284                    long entryId)
285                    throws com.liferay.portal.kernel.exception.PortalException,
286                            com.liferay.portal.kernel.exception.SystemException {
287                    return getService().getChildEntries(entryId);
288            }
289    
290            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getCompanyEntries(
291                    long companyId, int start, int end)
292                    throws com.liferay.portal.kernel.exception.SystemException {
293                    return getService().getCompanyEntries(companyId, start, end);
294            }
295    
296            public static int getCompanyEntriesCount(long companyId)
297                    throws com.liferay.portal.kernel.exception.SystemException {
298                    return getService().getCompanyEntriesCount(companyId);
299            }
300    
301            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] getCompanyEntryDisplays(
302                    long companyId, int start, int end, java.lang.String languageId)
303                    throws com.liferay.portal.kernel.exception.SystemException {
304                    return getService()
305                                       .getCompanyEntryDisplays(companyId, start, end, languageId);
306            }
307    
308            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getEntries(
309                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
310                    throws com.liferay.portal.kernel.exception.SystemException {
311                    return getService().getEntries(entryQuery);
312            }
313    
314            public static int getEntriesCount(
315                    com.liferay.portlet.asset.service.persistence.AssetEntryQuery entryQuery)
316                    throws com.liferay.portal.kernel.exception.SystemException {
317                    return getService().getEntriesCount(entryQuery);
318            }
319    
320            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
321                    long entryId)
322                    throws com.liferay.portal.kernel.exception.PortalException,
323                            com.liferay.portal.kernel.exception.SystemException {
324                    return getService().getEntry(entryId);
325            }
326    
327            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
328                    long groupId, java.lang.String classUuid)
329                    throws com.liferay.portal.kernel.exception.PortalException,
330                            com.liferay.portal.kernel.exception.SystemException {
331                    return getService().getEntry(groupId, classUuid);
332            }
333    
334            public static com.liferay.portlet.asset.model.AssetEntry getEntry(
335                    java.lang.String className, long classPK)
336                    throws com.liferay.portal.kernel.exception.PortalException,
337                            com.liferay.portal.kernel.exception.SystemException {
338                    return getService().getEntry(className, classPK);
339            }
340    
341            public static com.liferay.portlet.asset.model.AssetEntry getNextEntry(
342                    long entryId)
343                    throws com.liferay.portal.kernel.exception.PortalException,
344                            com.liferay.portal.kernel.exception.SystemException {
345                    return getService().getNextEntry(entryId);
346            }
347    
348            public static com.liferay.portlet.asset.model.AssetEntry getParentEntry(
349                    long entryId)
350                    throws com.liferay.portal.kernel.exception.PortalException,
351                            com.liferay.portal.kernel.exception.SystemException {
352                    return getService().getParentEntry(entryId);
353            }
354    
355            public static com.liferay.portlet.asset.model.AssetEntry getPreviousEntry(
356                    long entryId)
357                    throws com.liferay.portal.kernel.exception.PortalException,
358                            com.liferay.portal.kernel.exception.SystemException {
359                    return getService().getPreviousEntry(entryId);
360            }
361    
362            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getTopViewedEntries(
363                    java.lang.String className, boolean asc, int start, int end)
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    return getService().getTopViewedEntries(className, asc, start, end);
366            }
367    
368            public static java.util.List<com.liferay.portlet.asset.model.AssetEntry> getTopViewedEntries(
369                    java.lang.String[] className, boolean asc, int start, int end)
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getService().getTopViewedEntries(className, asc, start, end);
372            }
373    
374            public static void incrementViewCounter(long userId,
375                    java.lang.String className, long classPK)
376                    throws com.liferay.portal.kernel.exception.PortalException,
377                            com.liferay.portal.kernel.exception.SystemException {
378                    getService().incrementViewCounter(userId, className, classPK);
379            }
380    
381            public static void incrementViewCounter(long userId,
382                    java.lang.String className, long classPK, int increment)
383                    throws com.liferay.portal.kernel.exception.PortalException,
384                            com.liferay.portal.kernel.exception.SystemException {
385                    getService().incrementViewCounter(userId, className, classPK, increment);
386            }
387    
388            public static com.liferay.portal.kernel.search.Hits search(long companyId,
389                    long[] groupIds, java.lang.String className, java.lang.String keywords,
390                    int start, int end)
391                    throws com.liferay.portal.kernel.exception.SystemException {
392                    return getService()
393                                       .search(companyId, groupIds, className, keywords, start, end);
394            }
395    
396            public static com.liferay.portal.kernel.search.Hits search(long companyId,
397                    long[] groupIds, long userId, java.lang.String className,
398                    java.lang.String keywords, int start, int end)
399                    throws com.liferay.portal.kernel.exception.SystemException {
400                    return getService()
401                                       .search(companyId, groupIds, userId, className, keywords,
402                            start, end);
403            }
404    
405            public static com.liferay.portal.kernel.search.Hits search(long companyId,
406                    long[] groupIds, long userId, java.lang.String className,
407                    java.lang.String userName, java.lang.String title,
408                    java.lang.String description, java.lang.String assetCategoryIds,
409                    java.lang.String assetTagNames, boolean andSearch, int start, int end)
410                    throws com.liferay.portal.kernel.exception.SystemException {
411                    return getService()
412                                       .search(companyId, groupIds, userId, className, userName,
413                            title, description, assetCategoryIds, assetTagNames, andSearch,
414                            start, end);
415            }
416    
417            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] searchEntryDisplays(
418                    long companyId, long[] groupIds, java.lang.String className,
419                    java.lang.String keywords, java.lang.String languageId, int start,
420                    int end) throws com.liferay.portal.kernel.exception.SystemException {
421                    return getService()
422                                       .searchEntryDisplays(companyId, groupIds, className,
423                            keywords, languageId, start, end);
424            }
425    
426            /**
427            * @deprecated {@link #searchEntryDisplays(long, long[], String, String,
428            String)}
429            */
430            public static com.liferay.portlet.asset.model.AssetEntryDisplay[] searchEntryDisplays(
431                    long companyId, java.lang.String portletId, java.lang.String keywords,
432                    java.lang.String languageId, int start, int end)
433                    throws com.liferay.portal.kernel.exception.SystemException {
434                    return getService()
435                                       .searchEntryDisplays(companyId, portletId, keywords,
436                            languageId, start, end);
437            }
438    
439            public static int searchEntryDisplaysCount(long companyId, long[] groupIds,
440                    java.lang.String className, java.lang.String keywords,
441                    java.lang.String languageId)
442                    throws com.liferay.portal.kernel.exception.SystemException {
443                    return getService()
444                                       .searchEntryDisplaysCount(companyId, groupIds, className,
445                            keywords, languageId);
446            }
447    
448            /**
449            * @deprecated {@link #searchEntryDisplaysCount(long, long[], String,
450            String, String)}
451            */
452            public static int searchEntryDisplaysCount(long companyId,
453                    java.lang.String portletId, java.lang.String keywords,
454                    java.lang.String languageId)
455                    throws com.liferay.portal.kernel.exception.SystemException {
456                    return getService()
457                                       .searchEntryDisplaysCount(companyId, portletId, keywords,
458                            languageId);
459            }
460    
461            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
462                    long userId, long groupId, java.lang.String className, long classPK,
463                    long[] categoryIds, java.lang.String[] tagNames)
464                    throws com.liferay.portal.kernel.exception.PortalException,
465                            com.liferay.portal.kernel.exception.SystemException {
466                    return getService()
467                                       .updateEntry(userId, groupId, className, classPK,
468                            categoryIds, tagNames);
469            }
470    
471            public static com.liferay.portlet.asset.model.AssetEntry updateEntry(
472                    long userId, long groupId, java.lang.String className, long classPK,
473                    java.lang.String classUuid, long[] categoryIds,
474                    java.lang.String[] tagNames, boolean visible, java.util.Date startDate,
475                    java.util.Date endDate, java.util.Date publishDate,
476                    java.util.Date expirationDate, java.lang.String mimeType,
477                    java.lang.String title, java.lang.String description,
478                    java.lang.String summary, java.lang.String url, int height, int width,
479                    java.lang.Integer priority, boolean sync)
480                    throws com.liferay.portal.kernel.exception.PortalException,
481                            com.liferay.portal.kernel.exception.SystemException {
482                    return getService()
483                                       .updateEntry(userId, groupId, className, classPK, classUuid,
484                            categoryIds, tagNames, visible, startDate, endDate, publishDate,
485                            expirationDate, mimeType, title, description, summary, url, height,
486                            width, priority, sync);
487            }
488    
489            public static com.liferay.portlet.asset.model.AssetEntry updateVisible(
490                    java.lang.String className, long classPK, boolean visible)
491                    throws com.liferay.portal.kernel.exception.PortalException,
492                            com.liferay.portal.kernel.exception.SystemException {
493                    return getService().updateVisible(className, classPK, visible);
494            }
495    
496            public static void validate(long groupId, java.lang.String className,
497                    long[] categoryIds, java.lang.String[] tagNames)
498                    throws com.liferay.portal.kernel.exception.PortalException,
499                            com.liferay.portal.kernel.exception.SystemException {
500                    getService().validate(groupId, className, categoryIds, tagNames);
501            }
502    
503            public static AssetEntryLocalService getService() {
504                    if (_service == null) {
505                            _service = (AssetEntryLocalService)PortalBeanLocatorUtil.locate(AssetEntryLocalService.class.getName());
506    
507                            ReferenceRegistry.registerReference(AssetEntryLocalServiceUtil.class,
508                                    "_service");
509                            MethodCache.remove(AssetEntryLocalService.class);
510                    }
511    
512                    return _service;
513            }
514    
515            public void setService(AssetEntryLocalService service) {
516                    MethodCache.remove(AssetEntryLocalService.class);
517    
518                    _service = service;
519    
520                    ReferenceRegistry.registerReference(AssetEntryLocalServiceUtil.class,
521                            "_service");
522                    MethodCache.remove(AssetEntryLocalService.class);
523            }
524    
525            private static AssetEntryLocalService _service;
526    }