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