001    /**
002     * Copyright (c) 2000-present 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.asset.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.asset.kernel.model.AssetCategory;
020    
021    import com.liferay.exportimport.kernel.lar.PortletDataContext;
022    
023    import com.liferay.portal.kernel.cache.thread.local.ThreadLocalCachable;
024    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.Projection;
029    import com.liferay.portal.kernel.exception.PortalException;
030    import com.liferay.portal.kernel.exception.SystemException;
031    import com.liferay.portal.kernel.model.PersistedModel;
032    import com.liferay.portal.kernel.model.SystemEventConstants;
033    import com.liferay.portal.kernel.search.BaseModelSearchResult;
034    import com.liferay.portal.kernel.search.Hits;
035    import com.liferay.portal.kernel.search.Indexable;
036    import com.liferay.portal.kernel.search.IndexableType;
037    import com.liferay.portal.kernel.search.Sort;
038    import com.liferay.portal.kernel.service.BaseLocalService;
039    import com.liferay.portal.kernel.service.PersistedModelLocalService;
040    import com.liferay.portal.kernel.service.ServiceContext;
041    import com.liferay.portal.kernel.service.permission.ModelPermissions;
042    import com.liferay.portal.kernel.systemevent.SystemEvent;
043    import com.liferay.portal.kernel.transaction.Isolation;
044    import com.liferay.portal.kernel.transaction.Propagation;
045    import com.liferay.portal.kernel.transaction.Transactional;
046    import com.liferay.portal.kernel.util.OrderByComparator;
047    
048    import java.io.Serializable;
049    
050    import java.util.List;
051    import java.util.Locale;
052    import java.util.Map;
053    
054    /**
055     * Provides the local service interface for AssetCategory. Methods of this
056     * service will not have security checks based on the propagated JAAS
057     * credentials because this service can only be accessed from within the same
058     * VM.
059     *
060     * @author Brian Wing Shun Chan
061     * @see AssetCategoryLocalServiceUtil
062     * @see com.liferay.portlet.asset.service.base.AssetCategoryLocalServiceBaseImpl
063     * @see com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl
064     * @generated
065     */
066    @ProviderType
067    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
068            PortalException.class, SystemException.class})
069    public interface AssetCategoryLocalService extends BaseLocalService,
070            PersistedModelLocalService {
071            /*
072             * NOTE FOR DEVELOPERS:
073             *
074             * Never modify or reference this interface directly. Always use {@link AssetCategoryLocalServiceUtil} to access the asset category local service. Add custom service methods to {@link com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
075             */
076    
077            /**
078            * Adds the asset category to the database. Also notifies the appropriate model listeners.
079            *
080            * @param assetCategory the asset category
081            * @return the asset category that was added
082            */
083            @Indexable(type = IndexableType.REINDEX)
084            public AssetCategory addAssetCategory(AssetCategory assetCategory);
085    
086            public void addAssetEntryAssetCategories(long entryId,
087                    List<AssetCategory> AssetCategories);
088    
089            public void addAssetEntryAssetCategories(long entryId, long[] categoryIds);
090    
091            public void addAssetEntryAssetCategory(long entryId,
092                    AssetCategory assetCategory);
093    
094            public void addAssetEntryAssetCategory(long entryId, long categoryId);
095    
096            @Indexable(type = IndexableType.REINDEX)
097            public AssetCategory addCategory(long userId, long groupId,
098                    long parentCategoryId, Map<Locale, java.lang.String> titleMap,
099                    Map<Locale, java.lang.String> descriptionMap, long vocabularyId,
100                    java.lang.String[] categoryProperties, ServiceContext serviceContext)
101                    throws PortalException;
102    
103            public AssetCategory addCategory(long userId, long groupId,
104                    java.lang.String title, long vocabularyId, ServiceContext serviceContext)
105                    throws PortalException;
106    
107            public void addCategoryResources(AssetCategory category,
108                    boolean addGroupPermissions, boolean addGuestPermissions)
109                    throws PortalException;
110    
111            public void addCategoryResources(AssetCategory category,
112                    ModelPermissions modelPermissions) throws PortalException;
113    
114            public void clearAssetEntryAssetCategories(long entryId);
115    
116            /**
117            * Creates a new asset category with the primary key. Does not add the asset category to the database.
118            *
119            * @param categoryId the primary key for the new asset category
120            * @return the new asset category
121            */
122            public AssetCategory createAssetCategory(long categoryId);
123    
124            /**
125            * Deletes the asset category from the database. Also notifies the appropriate model listeners.
126            *
127            * @param assetCategory the asset category
128            * @return the asset category that was removed
129            */
130            @Indexable(type = IndexableType.DELETE)
131            public AssetCategory deleteAssetCategory(AssetCategory assetCategory);
132    
133            /**
134            * Deletes the asset category with the primary key from the database. Also notifies the appropriate model listeners.
135            *
136            * @param categoryId the primary key of the asset category
137            * @return the asset category that was removed
138            * @throws PortalException if a asset category with the primary key could not be found
139            */
140            @Indexable(type = IndexableType.DELETE)
141            public AssetCategory deleteAssetCategory(long categoryId)
142                    throws PortalException;
143    
144            public void deleteAssetEntryAssetCategories(long entryId,
145                    List<AssetCategory> AssetCategories);
146    
147            public void deleteAssetEntryAssetCategories(long entryId, long[] categoryIds);
148    
149            public void deleteAssetEntryAssetCategory(long entryId,
150                    AssetCategory assetCategory);
151    
152            public void deleteAssetEntryAssetCategory(long entryId, long categoryId);
153    
154            public void deleteCategories(List<AssetCategory> categories)
155                    throws PortalException;
156    
157            public void deleteCategories(long[] categoryIds) throws PortalException;
158    
159            public AssetCategory deleteCategory(AssetCategory category)
160                    throws PortalException;
161    
162            @Indexable(type = IndexableType.DELETE)
163            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
164            public AssetCategory deleteCategory(AssetCategory category,
165                    boolean skipRebuildTree) throws PortalException;
166    
167            public AssetCategory deleteCategory(long categoryId)
168                    throws PortalException;
169    
170            /**
171            * @throws PortalException
172            */
173            @Override
174            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
175                    throws PortalException;
176    
177            public void deleteVocabularyCategories(long vocabularyId)
178                    throws PortalException;
179    
180            public DynamicQuery dynamicQuery();
181    
182            /**
183            * Performs a dynamic query on the database and returns the matching rows.
184            *
185            * @param dynamicQuery the dynamic query
186            * @return the matching rows
187            */
188            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
189    
190            /**
191            * Performs a dynamic query on the database and returns a range of the matching rows.
192            *
193            * <p>
194            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.asset.model.impl.AssetCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
195            * </p>
196            *
197            * @param dynamicQuery the dynamic query
198            * @param start the lower bound of the range of model instances
199            * @param end the upper bound of the range of model instances (not inclusive)
200            * @return the range of matching rows
201            */
202            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
203                    int end);
204    
205            /**
206            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.asset.model.impl.AssetCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
210            * </p>
211            *
212            * @param dynamicQuery the dynamic query
213            * @param start the lower bound of the range of model instances
214            * @param end the upper bound of the range of model instances (not inclusive)
215            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
216            * @return the ordered range of matching rows
217            */
218            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
219                    int end, OrderByComparator<T> orderByComparator);
220    
221            /**
222            * Returns the number of rows matching the dynamic query.
223            *
224            * @param dynamicQuery the dynamic query
225            * @return the number of rows matching the dynamic query
226            */
227            public long dynamicQueryCount(DynamicQuery dynamicQuery);
228    
229            /**
230            * Returns the number of rows matching the dynamic query.
231            *
232            * @param dynamicQuery the dynamic query
233            * @param projection the projection to apply to the query
234            * @return the number of rows matching the dynamic query
235            */
236            public long dynamicQueryCount(DynamicQuery dynamicQuery,
237                    Projection projection);
238    
239            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240            public AssetCategory fetchAssetCategory(long categoryId);
241    
242            /**
243            * Returns the asset category matching the UUID and group.
244            *
245            * @param uuid the asset category's UUID
246            * @param groupId the primary key of the group
247            * @return the matching asset category, or <code>null</code> if a matching asset category could not be found
248            */
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public AssetCategory fetchAssetCategoryByUuidAndGroupId(
251                    java.lang.String uuid, long groupId);
252    
253            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254            public AssetCategory fetchCategory(long categoryId);
255    
256            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
257            public ActionableDynamicQuery getActionableDynamicQuery();
258    
259            /**
260            * Returns a range of all the asset categories.
261            *
262            * <p>
263            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.asset.model.impl.AssetCategoryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
264            * </p>
265            *
266            * @param start the lower bound of the range of asset categories
267            * @param end the upper bound of the range of asset categories (not inclusive)
268            * @return the range of asset categories
269            */
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public List<AssetCategory> getAssetCategories(int start, int end);
272    
273            /**
274            * Returns all the asset categories matching the UUID and company.
275            *
276            * @param uuid the UUID of the asset categories
277            * @param companyId the primary key of the company
278            * @return the matching asset categories, or an empty list if no matches were found
279            */
280            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281            public List<AssetCategory> getAssetCategoriesByUuidAndCompanyId(
282                    java.lang.String uuid, long companyId);
283    
284            /**
285            * Returns a range of asset categories matching the UUID and company.
286            *
287            * @param uuid the UUID of the asset categories
288            * @param companyId the primary key of the company
289            * @param start the lower bound of the range of asset categories
290            * @param end the upper bound of the range of asset categories (not inclusive)
291            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
292            * @return the range of matching asset categories, or an empty list if no matches were found
293            */
294            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
295            public List<AssetCategory> getAssetCategoriesByUuidAndCompanyId(
296                    java.lang.String uuid, long companyId, int start, int end,
297                    OrderByComparator<AssetCategory> orderByComparator);
298    
299            /**
300            * Returns the number of asset categories.
301            *
302            * @return the number of asset categories
303            */
304            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
305            public int getAssetCategoriesCount();
306    
307            /**
308            * Returns the asset category with the primary key.
309            *
310            * @param categoryId the primary key of the asset category
311            * @return the asset category
312            * @throws PortalException if a asset category with the primary key could not be found
313            */
314            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
315            public AssetCategory getAssetCategory(long categoryId)
316                    throws PortalException;
317    
318            /**
319            * Returns the asset category matching the UUID and group.
320            *
321            * @param uuid the asset category's UUID
322            * @param groupId the primary key of the group
323            * @return the matching asset category
324            * @throws PortalException if a matching asset category could not be found
325            */
326            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
327            public AssetCategory getAssetCategoryByUuidAndGroupId(
328                    java.lang.String uuid, long groupId) throws PortalException;
329    
330            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331            public List<AssetCategory> getAssetEntryAssetCategories(long entryId);
332    
333            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
334            public List<AssetCategory> getAssetEntryAssetCategories(long entryId,
335                    int start, int end);
336    
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public List<AssetCategory> getAssetEntryAssetCategories(long entryId,
339                    int start, int end, OrderByComparator<AssetCategory> orderByComparator);
340    
341            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
342            public int getAssetEntryAssetCategoriesCount(long entryId);
343    
344            /**
345            * Returns the entryIds of the asset entries associated with the asset category.
346            *
347            * @param categoryId the categoryId of the asset category
348            * @return long[] the entryIds of asset entries associated with the asset category
349            */
350            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
351            public long[] getAssetEntryPrimaryKeys(long categoryId);
352    
353            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
354            public List<AssetCategory> getCategories();
355    
356            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357            public List<AssetCategory> getCategories(java.lang.String className,
358                    long classPK);
359    
360            @ThreadLocalCachable
361            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
362            public List<AssetCategory> getCategories(long classNameId, long classPK);
363    
364            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
365            public List<AssetCategory> getCategories(Hits hits)
366                    throws PortalException;
367    
368            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
369            public AssetCategory getCategory(long categoryId) throws PortalException;
370    
371            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
372            public AssetCategory getCategory(java.lang.String uuid, long groupId)
373                    throws PortalException;
374    
375            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
376            public long[] getCategoryIds(java.lang.String className, long classPK);
377    
378            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
379            public java.lang.String[] getCategoryNames();
380    
381            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
382            public java.lang.String[] getCategoryNames(java.lang.String className,
383                    long classPK);
384    
385            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
386            public java.lang.String[] getCategoryNames(long classNameId, long classPK);
387    
388            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
389            public List<AssetCategory> getChildCategories(long parentCategoryId);
390    
391            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
392            public List<AssetCategory> getChildCategories(long parentCategoryId,
393                    int start, int end, OrderByComparator<AssetCategory> obc);
394    
395            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
396            public int getChildCategoriesCount(long parentCategoryId);
397    
398            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
399            public List<AssetCategory> getEntryCategories(long entryId);
400    
401            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
402            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
403                    PortletDataContext portletDataContext);
404    
405            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
406            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
407    
408            /**
409            * Returns the OSGi service identifier.
410            *
411            * @return the OSGi service identifier
412            */
413            public java.lang.String getOSGiServiceIdentifier();
414    
415            @Override
416            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
417            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
418                    throws PortalException;
419    
420            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
421            public List<java.lang.Long> getSubcategoryIds(long parentCategoryId);
422    
423            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
424            public List<AssetCategory> getVocabularyCategories(long parentCategoryId,
425                    long vocabularyId, int start, int end,
426                    OrderByComparator<AssetCategory> obc);
427    
428            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
429            public List<AssetCategory> getVocabularyCategories(long vocabularyId,
430                    int start, int end, OrderByComparator<AssetCategory> obc);
431    
432            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
433            public int getVocabularyCategoriesCount(long vocabularyId);
434    
435            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
436            public List<AssetCategory> getVocabularyRootCategories(long vocabularyId,
437                    int start, int end, OrderByComparator<AssetCategory> obc);
438    
439            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
440            public int getVocabularyRootCategoriesCount(long vocabularyId);
441    
442            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
443            public boolean hasAssetEntryAssetCategories(long entryId);
444    
445            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
446            public boolean hasAssetEntryAssetCategory(long entryId, long categoryId);
447    
448            @Indexable(type = IndexableType.REINDEX)
449            public AssetCategory mergeCategories(long fromCategoryId, long toCategoryId)
450                    throws PortalException;
451    
452            @Indexable(type = IndexableType.REINDEX)
453            public AssetCategory moveCategory(long categoryId, long parentCategoryId,
454                    long vocabularyId, ServiceContext serviceContext)
455                    throws PortalException;
456    
457            public void rebuildTree(long groupId, boolean force);
458    
459            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
460            public List<AssetCategory> search(long groupId, java.lang.String name,
461                    java.lang.String[] categoryProperties, int start, int end);
462    
463            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
464            public BaseModelSearchResult<AssetCategory> searchCategories(
465                    long companyId, long[] groupIds, java.lang.String title,
466                    long[] parentCategoryIds, long[] vocabularyIds, int start, int end)
467                    throws PortalException;
468    
469            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
470            public BaseModelSearchResult<AssetCategory> searchCategories(
471                    long companyId, long groupIds, java.lang.String title,
472                    long vocabularyId, int start, int end) throws PortalException;
473    
474            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
475            public BaseModelSearchResult<AssetCategory> searchCategories(
476                    long companyId, long[] groupIds, java.lang.String title,
477                    long[] vocabularyIds, long[] parentCategoryIds, int start, int end,
478                    Sort sort) throws PortalException;
479    
480            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
481            public BaseModelSearchResult<AssetCategory> searchCategories(
482                    long companyId, long[] groupIds, java.lang.String title,
483                    long[] vocabularyIds, int start, int end) throws PortalException;
484    
485            public void setAssetEntryAssetCategories(long entryId, long[] categoryIds);
486    
487            /**
488            * Updates the asset category in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
489            *
490            * @param assetCategory the asset category
491            * @return the asset category that was updated
492            */
493            @Indexable(type = IndexableType.REINDEX)
494            public AssetCategory updateAssetCategory(AssetCategory assetCategory);
495    
496            @Indexable(type = IndexableType.REINDEX)
497            public AssetCategory updateCategory(long userId, long categoryId,
498                    long parentCategoryId, Map<Locale, java.lang.String> titleMap,
499                    Map<Locale, java.lang.String> descriptionMap, long vocabularyId,
500                    java.lang.String[] categoryProperties, ServiceContext serviceContext)
501                    throws PortalException;
502    }