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.AssetVocabulary;
020    
021    import com.liferay.exportimport.kernel.lar.PortletDataContext;
022    
023    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
024    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
025    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.Projection;
028    import com.liferay.portal.kernel.exception.PortalException;
029    import com.liferay.portal.kernel.exception.SystemException;
030    import com.liferay.portal.kernel.model.PersistedModel;
031    import com.liferay.portal.kernel.model.SystemEventConstants;
032    import com.liferay.portal.kernel.search.BaseModelSearchResult;
033    import com.liferay.portal.kernel.search.Hits;
034    import com.liferay.portal.kernel.search.Indexable;
035    import com.liferay.portal.kernel.search.IndexableType;
036    import com.liferay.portal.kernel.search.Sort;
037    import com.liferay.portal.kernel.service.BaseLocalService;
038    import com.liferay.portal.kernel.service.PersistedModelLocalService;
039    import com.liferay.portal.kernel.service.ServiceContext;
040    import com.liferay.portal.kernel.service.permission.ModelPermissions;
041    import com.liferay.portal.kernel.systemevent.SystemEvent;
042    import com.liferay.portal.kernel.transaction.Isolation;
043    import com.liferay.portal.kernel.transaction.Propagation;
044    import com.liferay.portal.kernel.transaction.Transactional;
045    import com.liferay.portal.kernel.util.OrderByComparator;
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 AssetVocabulary. 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 AssetVocabularyLocalServiceUtil
061     * @see com.liferay.portlet.asset.service.base.AssetVocabularyLocalServiceBaseImpl
062     * @see com.liferay.portlet.asset.service.impl.AssetVocabularyLocalServiceImpl
063     * @generated
064     */
065    @ProviderType
066    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
067            PortalException.class, SystemException.class})
068    public interface AssetVocabularyLocalService extends BaseLocalService,
069            PersistedModelLocalService {
070            /*
071             * NOTE FOR DEVELOPERS:
072             *
073             * Never modify or reference this interface directly. Always use {@link AssetVocabularyLocalServiceUtil} to access the asset vocabulary local service. Add custom service methods to {@link com.liferay.portlet.asset.service.impl.AssetVocabularyLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
074             */
075    
076            /**
077            * Adds the asset vocabulary to the database. Also notifies the appropriate model listeners.
078            *
079            * @param assetVocabulary the asset vocabulary
080            * @return the asset vocabulary that was added
081            */
082            @Indexable(type = IndexableType.REINDEX)
083            public AssetVocabulary addAssetVocabulary(AssetVocabulary assetVocabulary);
084    
085            public AssetVocabulary addDefaultVocabulary(long groupId)
086                    throws PortalException;
087    
088            public AssetVocabulary addVocabulary(long userId, long groupId,
089                    java.lang.String title, ServiceContext serviceContext)
090                    throws PortalException;
091    
092            @Indexable(type = IndexableType.REINDEX)
093            public AssetVocabulary addVocabulary(long userId, long groupId,
094                    java.lang.String title, Map<Locale, java.lang.String> titleMap,
095                    Map<Locale, java.lang.String> descriptionMap,
096                    java.lang.String settings, ServiceContext serviceContext)
097                    throws PortalException;
098    
099            public void addVocabularyResources(AssetVocabulary vocabulary,
100                    boolean addGroupPermissions, boolean addGuestPermissions)
101                    throws PortalException;
102    
103            public void addVocabularyResources(AssetVocabulary vocabulary,
104                    ModelPermissions modelPermissions) throws PortalException;
105    
106            /**
107            * Creates a new asset vocabulary with the primary key. Does not add the asset vocabulary to the database.
108            *
109            * @param vocabularyId the primary key for the new asset vocabulary
110            * @return the new asset vocabulary
111            */
112            public AssetVocabulary createAssetVocabulary(long vocabularyId);
113    
114            /**
115            * Deletes the asset vocabulary from the database. Also notifies the appropriate model listeners.
116            *
117            * @param assetVocabulary the asset vocabulary
118            * @return the asset vocabulary that was removed
119            */
120            @Indexable(type = IndexableType.DELETE)
121            public AssetVocabulary deleteAssetVocabulary(
122                    AssetVocabulary assetVocabulary);
123    
124            /**
125            * Deletes the asset vocabulary with the primary key from the database. Also notifies the appropriate model listeners.
126            *
127            * @param vocabularyId the primary key of the asset vocabulary
128            * @return the asset vocabulary that was removed
129            * @throws PortalException if a asset vocabulary with the primary key could not be found
130            */
131            @Indexable(type = IndexableType.DELETE)
132            public AssetVocabulary deleteAssetVocabulary(long vocabularyId)
133                    throws PortalException;
134    
135            /**
136            * @throws PortalException
137            */
138            @Override
139            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
140                    throws PortalException;
141    
142            public void deleteVocabularies(long groupId) throws PortalException;
143    
144            @Indexable(type = IndexableType.DELETE)
145            @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
146            public AssetVocabulary deleteVocabulary(AssetVocabulary vocabulary)
147                    throws PortalException;
148    
149            public void deleteVocabulary(long vocabularyId) throws PortalException;
150    
151            public DynamicQuery dynamicQuery();
152    
153            /**
154            * Performs a dynamic query on the database and returns the matching rows.
155            *
156            * @param dynamicQuery the dynamic query
157            * @return the matching rows
158            */
159            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
160    
161            /**
162            * Performs a dynamic query on the database and returns a range of the matching rows.
163            *
164            * <p>
165            * 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.AssetVocabularyModelImpl}. 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.
166            * </p>
167            *
168            * @param dynamicQuery the dynamic query
169            * @param start the lower bound of the range of model instances
170            * @param end the upper bound of the range of model instances (not inclusive)
171            * @return the range of matching rows
172            */
173            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
174                    int end);
175    
176            /**
177            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
178            *
179            * <p>
180            * 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.AssetVocabularyModelImpl}. 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.
181            * </p>
182            *
183            * @param dynamicQuery the dynamic query
184            * @param start the lower bound of the range of model instances
185            * @param end the upper bound of the range of model instances (not inclusive)
186            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
187            * @return the ordered range of matching rows
188            */
189            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
190                    int end, OrderByComparator<T> orderByComparator);
191    
192            /**
193            * Returns the number of rows matching the dynamic query.
194            *
195            * @param dynamicQuery the dynamic query
196            * @return the number of rows matching the dynamic query
197            */
198            public long dynamicQueryCount(DynamicQuery dynamicQuery);
199    
200            /**
201            * Returns the number of rows matching the dynamic query.
202            *
203            * @param dynamicQuery the dynamic query
204            * @param projection the projection to apply to the query
205            * @return the number of rows matching the dynamic query
206            */
207            public long dynamicQueryCount(DynamicQuery dynamicQuery,
208                    Projection projection);
209    
210            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211            public AssetVocabulary fetchAssetVocabulary(long vocabularyId);
212    
213            /**
214            * Returns the asset vocabulary matching the UUID and group.
215            *
216            * @param uuid the asset vocabulary's UUID
217            * @param groupId the primary key of the group
218            * @return the matching asset vocabulary, or <code>null</code> if a matching asset vocabulary could not be found
219            */
220            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221            public AssetVocabulary fetchAssetVocabularyByUuidAndGroupId(
222                    java.lang.String uuid, long groupId);
223    
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public ActionableDynamicQuery getActionableDynamicQuery();
226    
227            /**
228            * Returns a range of all the asset vocabularies.
229            *
230            * <p>
231            * 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.AssetVocabularyModelImpl}. 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.
232            * </p>
233            *
234            * @param start the lower bound of the range of asset vocabularies
235            * @param end the upper bound of the range of asset vocabularies (not inclusive)
236            * @return the range of asset vocabularies
237            */
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public List<AssetVocabulary> getAssetVocabularies(int start, int end);
240    
241            /**
242            * Returns all the asset vocabularies matching the UUID and company.
243            *
244            * @param uuid the UUID of the asset vocabularies
245            * @param companyId the primary key of the company
246            * @return the matching asset vocabularies, or an empty list if no matches were found
247            */
248            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249            public List<AssetVocabulary> getAssetVocabulariesByUuidAndCompanyId(
250                    java.lang.String uuid, long companyId);
251    
252            /**
253            * Returns a range of asset vocabularies matching the UUID and company.
254            *
255            * @param uuid the UUID of the asset vocabularies
256            * @param companyId the primary key of the company
257            * @param start the lower bound of the range of asset vocabularies
258            * @param end the upper bound of the range of asset vocabularies (not inclusive)
259            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
260            * @return the range of matching asset vocabularies, or an empty list if no matches were found
261            */
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public List<AssetVocabulary> getAssetVocabulariesByUuidAndCompanyId(
264                    java.lang.String uuid, long companyId, int start, int end,
265                    OrderByComparator<AssetVocabulary> orderByComparator);
266    
267            /**
268            * Returns the number of asset vocabularies.
269            *
270            * @return the number of asset vocabularies
271            */
272            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
273            public int getAssetVocabulariesCount();
274    
275            /**
276            * Returns the asset vocabulary with the primary key.
277            *
278            * @param vocabularyId the primary key of the asset vocabulary
279            * @return the asset vocabulary
280            * @throws PortalException if a asset vocabulary with the primary key could not be found
281            */
282            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
283            public AssetVocabulary getAssetVocabulary(long vocabularyId)
284                    throws PortalException;
285    
286            /**
287            * Returns the asset vocabulary matching the UUID and group.
288            *
289            * @param uuid the asset vocabulary's UUID
290            * @param groupId the primary key of the group
291            * @return the matching asset vocabulary
292            * @throws PortalException if a matching asset vocabulary could not be found
293            */
294            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
295            public AssetVocabulary getAssetVocabularyByUuidAndGroupId(
296                    java.lang.String uuid, long groupId) throws PortalException;
297    
298            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
299            public List<AssetVocabulary> getCompanyVocabularies(long companyId);
300    
301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
303                    PortletDataContext portletDataContext);
304    
305            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
306            public List<AssetVocabulary> getGroupVocabularies(long groupId)
307                    throws PortalException;
308    
309            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
310            public List<AssetVocabulary> getGroupVocabularies(long groupId,
311                    boolean addDefaultVocabulary) throws PortalException;
312    
313            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314            public List<AssetVocabulary> getGroupVocabularies(long groupId,
315                    java.lang.String name, int start, int end,
316                    OrderByComparator<AssetVocabulary> obc);
317    
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public List<AssetVocabulary> getGroupVocabularies(long[] groupIds);
320    
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public int getGroupVocabulariesCount(long[] groupIds);
323    
324            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325            public AssetVocabulary getGroupVocabulary(long groupId,
326                    java.lang.String name) throws PortalException;
327    
328            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
329            public List<AssetVocabulary> getGroupsVocabularies(long[] groupIds);
330    
331            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
332            public List<AssetVocabulary> getGroupsVocabularies(long[] groupIds,
333                    java.lang.String className);
334    
335            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336            public List<AssetVocabulary> getGroupsVocabularies(long[] groupIds,
337                    java.lang.String className, long classTypePK);
338    
339            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
340            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
341    
342            /**
343            * Returns the OSGi service identifier.
344            *
345            * @return the OSGi service identifier
346            */
347            public java.lang.String getOSGiServiceIdentifier();
348    
349            @Override
350            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
351            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
352                    throws PortalException;
353    
354            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
355            public List<AssetVocabulary> getVocabularies(Hits hits)
356                    throws PortalException;
357    
358            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
359            public List<AssetVocabulary> getVocabularies(long[] vocabularyIds)
360                    throws PortalException;
361    
362            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
363            public AssetVocabulary getVocabulary(long vocabularyId)
364                    throws PortalException;
365    
366            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
367            public BaseModelSearchResult<AssetVocabulary> searchVocabularies(
368                    long companyId, long groupId, java.lang.String title, int start, int end)
369                    throws PortalException;
370    
371            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
372            public BaseModelSearchResult<AssetVocabulary> searchVocabularies(
373                    long companyId, long groupId, java.lang.String title, int start,
374                    int end, Sort sort) throws PortalException;
375    
376            /**
377            * Updates the asset vocabulary in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
378            *
379            * @param assetVocabulary the asset vocabulary
380            * @return the asset vocabulary that was updated
381            */
382            @Indexable(type = IndexableType.REINDEX)
383            public AssetVocabulary updateAssetVocabulary(
384                    AssetVocabulary assetVocabulary);
385    
386            @Indexable(type = IndexableType.REINDEX)
387            public AssetVocabulary updateVocabulary(long vocabularyId,
388                    java.lang.String title, Map<Locale, java.lang.String> titleMap,
389                    Map<Locale, java.lang.String> descriptionMap,
390                    java.lang.String settings, ServiceContext serviceContext)
391                    throws PortalException;
392    }