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            /**
100            * Creates a new asset vocabulary with the primary key. Does not add the asset vocabulary to the database.
101            *
102            * @param vocabularyId the primary key for the new asset vocabulary
103            * @return the new asset vocabulary
104            */
105            public AssetVocabulary createAssetVocabulary(long vocabularyId);
106    
107            /**
108            * Deletes the asset vocabulary from the database. Also notifies the appropriate model listeners.
109            *
110            * @param assetVocabulary the asset vocabulary
111            * @return the asset vocabulary that was removed
112            */
113            @Indexable(type = IndexableType.DELETE)
114            public AssetVocabulary deleteAssetVocabulary(
115                    AssetVocabulary assetVocabulary);
116    
117            /**
118            * Deletes the asset vocabulary with the primary key from the database. Also notifies the appropriate model listeners.
119            *
120            * @param vocabularyId the primary key of the asset vocabulary
121            * @return the asset vocabulary that was removed
122            * @throws PortalException if a asset vocabulary with the primary key could not be found
123            */
124            @Indexable(type = IndexableType.DELETE)
125            public AssetVocabulary deleteAssetVocabulary(long vocabularyId)
126                    throws PortalException;
127    
128            @Indexable(type = IndexableType.DELETE)
129            @SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
130            public AssetVocabulary deleteVocabulary(AssetVocabulary vocabulary)
131                    throws PortalException;
132    
133            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134            public AssetVocabulary fetchAssetVocabulary(long vocabularyId);
135    
136            /**
137            * Returns the asset vocabulary matching the UUID and group.
138            *
139            * @param uuid the asset vocabulary's UUID
140            * @param groupId the primary key of the group
141            * @return the matching asset vocabulary, or <code>null</code> if a matching asset vocabulary could not be found
142            */
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public AssetVocabulary fetchAssetVocabularyByUuidAndGroupId(
145                    java.lang.String uuid, long groupId);
146    
147            /**
148            * Returns the asset vocabulary with the primary key.
149            *
150            * @param vocabularyId the primary key of the asset vocabulary
151            * @return the asset vocabulary
152            * @throws PortalException if a asset vocabulary with the primary key could not be found
153            */
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public AssetVocabulary getAssetVocabulary(long vocabularyId)
156                    throws PortalException;
157    
158            /**
159            * Returns the asset vocabulary matching the UUID and group.
160            *
161            * @param uuid the asset vocabulary's UUID
162            * @param groupId the primary key of the group
163            * @return the matching asset vocabulary
164            * @throws PortalException if a matching asset vocabulary could not be found
165            */
166            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167            public AssetVocabulary getAssetVocabularyByUuidAndGroupId(
168                    java.lang.String uuid, long groupId) throws PortalException;
169    
170            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171            public AssetVocabulary getGroupVocabulary(long groupId,
172                    java.lang.String name) throws PortalException;
173    
174            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
175            public AssetVocabulary getVocabulary(long vocabularyId)
176                    throws PortalException;
177    
178            /**
179            * Updates the asset vocabulary in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
180            *
181            * @param assetVocabulary the asset vocabulary
182            * @return the asset vocabulary that was updated
183            */
184            @Indexable(type = IndexableType.REINDEX)
185            public AssetVocabulary updateAssetVocabulary(
186                    AssetVocabulary assetVocabulary);
187    
188            @Indexable(type = IndexableType.REINDEX)
189            public AssetVocabulary updateVocabulary(long vocabularyId,
190                    java.lang.String title, Map<Locale, java.lang.String> titleMap,
191                    Map<Locale, java.lang.String> descriptionMap,
192                    java.lang.String settings, ServiceContext serviceContext)
193                    throws PortalException;
194    
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public ActionableDynamicQuery getActionableDynamicQuery();
197    
198            public DynamicQuery dynamicQuery();
199    
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
202                    PortletDataContext portletDataContext);
203    
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
206    
207            /**
208            * @throws PortalException
209            */
210            @Override
211            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
212                    throws PortalException;
213    
214            @Override
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
217                    throws PortalException;
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public BaseModelSearchResult<AssetVocabulary> searchVocabularies(
221                    long companyId, long groupId, java.lang.String title, int start, int end)
222                    throws PortalException;
223    
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public BaseModelSearchResult<AssetVocabulary> searchVocabularies(
226                    long companyId, long groupId, java.lang.String title, int start,
227                    int end, Sort sort) throws PortalException;
228    
229            /**
230            * Returns the number of asset vocabularies.
231            *
232            * @return the number of asset vocabularies
233            */
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public int getAssetVocabulariesCount();
236    
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public int getGroupVocabulariesCount(long[] groupIds);
239    
240            /**
241            * Returns the OSGi service identifier.
242            *
243            * @return the OSGi service identifier
244            */
245            public java.lang.String getOSGiServiceIdentifier();
246    
247            /**
248            * Performs a dynamic query on the database and returns the matching rows.
249            *
250            * @param dynamicQuery the dynamic query
251            * @return the matching rows
252            */
253            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
254    
255            /**
256            * Performs a dynamic query on the database and returns a range of the matching rows.
257            *
258            * <p>
259            * 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.
260            * </p>
261            *
262            * @param dynamicQuery the dynamic query
263            * @param start the lower bound of the range of model instances
264            * @param end the upper bound of the range of model instances (not inclusive)
265            * @return the range of matching rows
266            */
267            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
268                    int end);
269    
270            /**
271            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
272            *
273            * <p>
274            * 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.
275            * </p>
276            *
277            * @param dynamicQuery the dynamic query
278            * @param start the lower bound of the range of model instances
279            * @param end the upper bound of the range of model instances (not inclusive)
280            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
281            * @return the ordered range of matching rows
282            */
283            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
284                    int end, OrderByComparator<T> orderByComparator);
285    
286            /**
287            * Returns a range of all the asset vocabularies.
288            *
289            * <p>
290            * 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.
291            * </p>
292            *
293            * @param start the lower bound of the range of asset vocabularies
294            * @param end the upper bound of the range of asset vocabularies (not inclusive)
295            * @return the range of asset vocabularies
296            */
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public List<AssetVocabulary> getAssetVocabularies(int start, int end);
299    
300            /**
301            * Returns all the asset vocabularies matching the UUID and company.
302            *
303            * @param uuid the UUID of the asset vocabularies
304            * @param companyId the primary key of the company
305            * @return the matching asset vocabularies, or an empty list if no matches were found
306            */
307            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
308            public List<AssetVocabulary> getAssetVocabulariesByUuidAndCompanyId(
309                    java.lang.String uuid, long companyId);
310    
311            /**
312            * Returns a range of asset vocabularies matching the UUID and company.
313            *
314            * @param uuid the UUID of the asset vocabularies
315            * @param companyId the primary key of the company
316            * @param start the lower bound of the range of asset vocabularies
317            * @param end the upper bound of the range of asset vocabularies (not inclusive)
318            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
319            * @return the range of matching asset vocabularies, or an empty list if no matches were found
320            */
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public List<AssetVocabulary> getAssetVocabulariesByUuidAndCompanyId(
323                    java.lang.String uuid, long companyId, int start, int end,
324                    OrderByComparator<AssetVocabulary> orderByComparator);
325    
326            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
327            public List<AssetVocabulary> getCompanyVocabularies(long companyId);
328    
329            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330            public List<AssetVocabulary> getGroupVocabularies(long groupId)
331                    throws PortalException;
332    
333            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
334            public List<AssetVocabulary> getGroupVocabularies(long groupId,
335                    boolean addDefaultVocabulary) throws PortalException;
336    
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public List<AssetVocabulary> getGroupVocabularies(long groupId,
339                    java.lang.String name, int start, int end,
340                    OrderByComparator<AssetVocabulary> obc);
341    
342            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
343            public List<AssetVocabulary> getGroupVocabularies(long[] groupIds);
344    
345            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
346            public List<AssetVocabulary> getGroupsVocabularies(long[] groupIds);
347    
348            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
349            public List<AssetVocabulary> getGroupsVocabularies(long[] groupIds,
350                    java.lang.String className);
351    
352            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
353            public List<AssetVocabulary> getGroupsVocabularies(long[] groupIds,
354                    java.lang.String className, long classTypePK);
355    
356            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357            public List<AssetVocabulary> getVocabularies(Hits hits)
358                    throws PortalException;
359    
360            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361            public List<AssetVocabulary> getVocabularies(long[] vocabularyIds)
362                    throws PortalException;
363    
364            /**
365            * Returns the number of rows matching the dynamic query.
366            *
367            * @param dynamicQuery the dynamic query
368            * @return the number of rows matching the dynamic query
369            */
370            public long dynamicQueryCount(DynamicQuery dynamicQuery);
371    
372            /**
373            * Returns the number of rows matching the dynamic query.
374            *
375            * @param dynamicQuery the dynamic query
376            * @param projection the projection to apply to the query
377            * @return the number of rows matching the dynamic query
378            */
379            public long dynamicQueryCount(DynamicQuery dynamicQuery,
380                    Projection projection);
381    
382            public void addVocabularyResources(AssetVocabulary vocabulary,
383                    boolean addGroupPermissions, boolean addGuestPermissions)
384                    throws PortalException;
385    
386            public void addVocabularyResources(AssetVocabulary vocabulary,
387                    ModelPermissions modelPermissions) throws PortalException;
388    
389            public void deleteVocabularies(long groupId) throws PortalException;
390    
391            public void deleteVocabulary(long vocabularyId) throws PortalException;
392    }