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