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.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 category local service. This utility wraps {@link com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl} 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 AssetCategoryLocalService
030     * @see com.liferay.portlet.asset.service.base.AssetCategoryLocalServiceBaseImpl
031     * @see com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl
032     * @generated
033     */
034    public class AssetCategoryLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the asset category to the database. Also notifies the appropriate model listeners.
043            *
044            * @param assetCategory the asset category
045            * @return the asset category that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.asset.model.AssetCategory addAssetCategory(
049                    com.liferay.portlet.asset.model.AssetCategory assetCategory)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addAssetCategory(assetCategory);
052            }
053    
054            /**
055            * Creates a new asset category with the primary key. Does not add the asset category to the database.
056            *
057            * @param categoryId the primary key for the new asset category
058            * @return the new asset category
059            */
060            public static com.liferay.portlet.asset.model.AssetCategory createAssetCategory(
061                    long categoryId) {
062                    return getService().createAssetCategory(categoryId);
063            }
064    
065            /**
066            * Deletes the asset category with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param categoryId the primary key of the asset category
069            * @throws PortalException if a asset category with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteAssetCategory(long categoryId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteAssetCategory(categoryId);
076            }
077    
078            /**
079            * Deletes the asset category from the database. Also notifies the appropriate model listeners.
080            *
081            * @param assetCategory the asset category
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteAssetCategory(
085                    com.liferay.portlet.asset.model.AssetCategory assetCategory)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteAssetCategory(assetCategory);
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.asset.model.AssetCategory fetchAssetCategory(
162                    long categoryId)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().fetchAssetCategory(categoryId);
165            }
166    
167            /**
168            * Returns the asset category with the primary key.
169            *
170            * @param categoryId the primary key of the asset category
171            * @return the asset category
172            * @throws PortalException if a asset category with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portlet.asset.model.AssetCategory getAssetCategory(
176                    long categoryId)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getService().getAssetCategory(categoryId);
180            }
181    
182            public static com.liferay.portal.model.PersistedModel getPersistedModel(
183                    java.io.Serializable primaryKeyObj)
184                    throws com.liferay.portal.kernel.exception.PortalException,
185                            com.liferay.portal.kernel.exception.SystemException {
186                    return getService().getPersistedModel(primaryKeyObj);
187            }
188    
189            /**
190            * Returns the asset category with the UUID in the group.
191            *
192            * @param uuid the UUID of asset category
193            * @param groupId the group id of the asset category
194            * @return the asset category
195            * @throws PortalException if a asset category with the UUID in the group could not be found
196            * @throws SystemException if a system exception occurred
197            */
198            public static com.liferay.portlet.asset.model.AssetCategory getAssetCategoryByUuidAndGroupId(
199                    java.lang.String uuid, long groupId)
200                    throws com.liferay.portal.kernel.exception.PortalException,
201                            com.liferay.portal.kernel.exception.SystemException {
202                    return getService().getAssetCategoryByUuidAndGroupId(uuid, groupId);
203            }
204    
205            /**
206            * Returns a range of all the asset categories.
207            *
208            * <p>
209            * 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.
210            * </p>
211            *
212            * @param start the lower bound of the range of asset categories
213            * @param end the upper bound of the range of asset categories (not inclusive)
214            * @return the range of asset categories
215            * @throws SystemException if a system exception occurred
216            */
217            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getAssetCategories(
218                    int start, int end)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getService().getAssetCategories(start, end);
221            }
222    
223            /**
224            * Returns the number of asset categories.
225            *
226            * @return the number of asset categories
227            * @throws SystemException if a system exception occurred
228            */
229            public static int getAssetCategoriesCount()
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getService().getAssetCategoriesCount();
232            }
233    
234            /**
235            * Updates the asset category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
236            *
237            * @param assetCategory the asset category
238            * @return the asset category that was updated
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portlet.asset.model.AssetCategory updateAssetCategory(
242                    com.liferay.portlet.asset.model.AssetCategory assetCategory)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().updateAssetCategory(assetCategory);
245            }
246    
247            /**
248            * Updates the asset category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
249            *
250            * @param assetCategory the asset category
251            * @param merge whether to merge the asset category 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.
252            * @return the asset category that was updated
253            * @throws SystemException if a system exception occurred
254            */
255            public static com.liferay.portlet.asset.model.AssetCategory updateAssetCategory(
256                    com.liferay.portlet.asset.model.AssetCategory assetCategory,
257                    boolean merge)
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    return getService().updateAssetCategory(assetCategory, merge);
260            }
261    
262            /**
263            * Returns the Spring bean ID for this bean.
264            *
265            * @return the Spring bean ID for this bean
266            */
267            public static java.lang.String getBeanIdentifier() {
268                    return getService().getBeanIdentifier();
269            }
270    
271            /**
272            * Sets the Spring bean ID for this bean.
273            *
274            * @param beanIdentifier the Spring bean ID for this bean
275            */
276            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
277                    getService().setBeanIdentifier(beanIdentifier);
278            }
279    
280            public static com.liferay.portlet.asset.model.AssetCategory addCategory(
281                    long userId, long parentCategoryId,
282                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
283                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
284                    long vocabularyId, java.lang.String[] categoryProperties,
285                    com.liferay.portal.service.ServiceContext serviceContext)
286                    throws com.liferay.portal.kernel.exception.PortalException,
287                            com.liferay.portal.kernel.exception.SystemException {
288                    return getService()
289                                       .addCategory(userId, parentCategoryId, titleMap,
290                            descriptionMap, vocabularyId, categoryProperties, serviceContext);
291            }
292    
293            public static void addCategoryResources(
294                    com.liferay.portlet.asset.model.AssetCategory category,
295                    boolean addGroupPermissions, boolean addGuestPermissions)
296                    throws com.liferay.portal.kernel.exception.PortalException,
297                            com.liferay.portal.kernel.exception.SystemException {
298                    getService()
299                            .addCategoryResources(category, addGroupPermissions,
300                            addGuestPermissions);
301            }
302    
303            public static void addCategoryResources(
304                    com.liferay.portlet.asset.model.AssetCategory category,
305                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
306                    throws com.liferay.portal.kernel.exception.PortalException,
307                            com.liferay.portal.kernel.exception.SystemException {
308                    getService()
309                            .addCategoryResources(category, groupPermissions, guestPermissions);
310            }
311    
312            public static void deleteCategory(
313                    com.liferay.portlet.asset.model.AssetCategory category)
314                    throws com.liferay.portal.kernel.exception.PortalException,
315                            com.liferay.portal.kernel.exception.SystemException {
316                    getService().deleteCategory(category);
317            }
318    
319            public static void deleteCategory(long categoryId)
320                    throws com.liferay.portal.kernel.exception.PortalException,
321                            com.liferay.portal.kernel.exception.SystemException {
322                    getService().deleteCategory(categoryId);
323            }
324    
325            public static void deleteVocabularyCategories(long vocabularyId)
326                    throws com.liferay.portal.kernel.exception.PortalException,
327                            com.liferay.portal.kernel.exception.SystemException {
328                    getService().deleteVocabularyCategories(vocabularyId);
329            }
330    
331            public static com.liferay.portlet.asset.model.AssetCategory fetchCategory(
332                    long categoryId)
333                    throws com.liferay.portal.kernel.exception.SystemException {
334                    return getService().fetchCategory(categoryId);
335            }
336    
337            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getCategories()
338                    throws com.liferay.portal.kernel.exception.SystemException {
339                    return getService().getCategories();
340            }
341    
342            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getCategories(
343                    long classNameId, long classPK)
344                    throws com.liferay.portal.kernel.exception.SystemException {
345                    return getService().getCategories(classNameId, classPK);
346            }
347    
348            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getCategories(
349                    java.lang.String className, long classPK)
350                    throws com.liferay.portal.kernel.exception.SystemException {
351                    return getService().getCategories(className, classPK);
352            }
353    
354            public static com.liferay.portlet.asset.model.AssetCategory getCategory(
355                    long categoryId)
356                    throws com.liferay.portal.kernel.exception.PortalException,
357                            com.liferay.portal.kernel.exception.SystemException {
358                    return getService().getCategory(categoryId);
359            }
360    
361            public static long[] getCategoryIds(java.lang.String className, long classPK)
362                    throws com.liferay.portal.kernel.exception.SystemException {
363                    return getService().getCategoryIds(className, classPK);
364            }
365    
366            public static java.lang.String[] getCategoryNames()
367                    throws com.liferay.portal.kernel.exception.SystemException {
368                    return getService().getCategoryNames();
369            }
370    
371            public static java.lang.String[] getCategoryNames(long classNameId,
372                    long classPK)
373                    throws com.liferay.portal.kernel.exception.SystemException {
374                    return getService().getCategoryNames(classNameId, classPK);
375            }
376    
377            public static java.lang.String[] getCategoryNames(
378                    java.lang.String className, long classPK)
379                    throws com.liferay.portal.kernel.exception.SystemException {
380                    return getService().getCategoryNames(className, classPK);
381            }
382    
383            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getChildCategories(
384                    long parentCategoryId)
385                    throws com.liferay.portal.kernel.exception.SystemException {
386                    return getService().getChildCategories(parentCategoryId);
387            }
388    
389            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getChildCategories(
390                    long parentCategoryId, int start, int end,
391                    com.liferay.portal.kernel.util.OrderByComparator obc)
392                    throws com.liferay.portal.kernel.exception.SystemException {
393                    return getService().getChildCategories(parentCategoryId, start, end, obc);
394            }
395    
396            public static int getChildCategoriesCount(long parentCategoryId)
397                    throws com.liferay.portal.kernel.exception.SystemException {
398                    return getService().getChildCategoriesCount(parentCategoryId);
399            }
400    
401            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getEntryCategories(
402                    long entryId)
403                    throws com.liferay.portal.kernel.exception.SystemException {
404                    return getService().getEntryCategories(entryId);
405            }
406    
407            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyCategories(
408                    long vocabularyId, int start, int end,
409                    com.liferay.portal.kernel.util.OrderByComparator obc)
410                    throws com.liferay.portal.kernel.exception.SystemException {
411                    return getService()
412                                       .getVocabularyCategories(vocabularyId, start, end, obc);
413            }
414    
415            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyCategories(
416                    long parentCategoryId, long vocabularyId, int start, int end,
417                    com.liferay.portal.kernel.util.OrderByComparator obc)
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    return getService()
420                                       .getVocabularyCategories(parentCategoryId, vocabularyId,
421                            start, end, obc);
422            }
423    
424            public static int getVocabularyCategoriesCount(long vocabularyId)
425                    throws com.liferay.portal.kernel.exception.SystemException {
426                    return getService().getVocabularyCategoriesCount(vocabularyId);
427            }
428    
429            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> getVocabularyRootCategories(
430                    long vocabularyId, int start, int end,
431                    com.liferay.portal.kernel.util.OrderByComparator obc)
432                    throws com.liferay.portal.kernel.exception.SystemException {
433                    return getService()
434                                       .getVocabularyRootCategories(vocabularyId, start, end, obc);
435            }
436    
437            public static void mergeCategories(long fromCategoryId, long toCategoryId)
438                    throws com.liferay.portal.kernel.exception.PortalException,
439                            com.liferay.portal.kernel.exception.SystemException {
440                    getService().mergeCategories(fromCategoryId, toCategoryId);
441            }
442    
443            public static com.liferay.portlet.asset.model.AssetCategory moveCategory(
444                    long categoryId, long parentCategoryId, long vocabularyId,
445                    com.liferay.portal.service.ServiceContext serviceContext)
446                    throws com.liferay.portal.kernel.exception.PortalException,
447                            com.liferay.portal.kernel.exception.SystemException {
448                    return getService()
449                                       .moveCategory(categoryId, parentCategoryId, vocabularyId,
450                            serviceContext);
451            }
452    
453            public static void rebuildTree(long groupId, boolean force)
454                    throws com.liferay.portal.kernel.exception.SystemException {
455                    getService().rebuildTree(groupId, force);
456            }
457    
458            public static java.util.List<com.liferay.portlet.asset.model.AssetCategory> search(
459                    long groupId, java.lang.String name,
460                    java.lang.String[] categoryProperties, int start, int end)
461                    throws com.liferay.portal.kernel.exception.SystemException {
462                    return getService().search(groupId, name, categoryProperties, start, end);
463            }
464    
465            public static com.liferay.portlet.asset.model.AssetCategory updateCategory(
466                    long userId, long categoryId, long parentCategoryId,
467                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
468                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
469                    long vocabularyId, java.lang.String[] categoryProperties,
470                    com.liferay.portal.service.ServiceContext serviceContext)
471                    throws com.liferay.portal.kernel.exception.PortalException,
472                            com.liferay.portal.kernel.exception.SystemException {
473                    return getService()
474                                       .updateCategory(userId, categoryId, parentCategoryId,
475                            titleMap, descriptionMap, vocabularyId, categoryProperties,
476                            serviceContext);
477            }
478    
479            public static AssetCategoryLocalService getService() {
480                    if (_service == null) {
481                            _service = (AssetCategoryLocalService)PortalBeanLocatorUtil.locate(AssetCategoryLocalService.class.getName());
482    
483                            ReferenceRegistry.registerReference(AssetCategoryLocalServiceUtil.class,
484                                    "_service");
485                            MethodCache.remove(AssetCategoryLocalService.class);
486                    }
487    
488                    return _service;
489            }
490    
491            public void setService(AssetCategoryLocalService service) {
492                    MethodCache.remove(AssetCategoryLocalService.class);
493    
494                    _service = service;
495    
496                    ReferenceRegistry.registerReference(AssetCategoryLocalServiceUtil.class,
497                            "_service");
498                    MethodCache.remove(AssetCategoryLocalService.class);
499            }
500    
501            private static AssetCategoryLocalService _service;
502    }