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