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.document.library.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.document.library.kernel.model.DLFileVersion;
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.search.Indexable;
032    import com.liferay.portal.kernel.search.IndexableType;
033    import com.liferay.portal.kernel.service.BaseLocalService;
034    import com.liferay.portal.kernel.service.PersistedModelLocalService;
035    import com.liferay.portal.kernel.transaction.Isolation;
036    import com.liferay.portal.kernel.transaction.Propagation;
037    import com.liferay.portal.kernel.transaction.Transactional;
038    import com.liferay.portal.kernel.util.OrderByComparator;
039    
040    import java.io.Serializable;
041    
042    import java.util.List;
043    
044    /**
045     * Provides the local service interface for DLFileVersion. Methods of this
046     * service will not have security checks based on the propagated JAAS
047     * credentials because this service can only be accessed from within the same
048     * VM.
049     *
050     * @author Brian Wing Shun Chan
051     * @see DLFileVersionLocalServiceUtil
052     * @see com.liferay.portlet.documentlibrary.service.base.DLFileVersionLocalServiceBaseImpl
053     * @see com.liferay.portlet.documentlibrary.service.impl.DLFileVersionLocalServiceImpl
054     * @generated
055     */
056    @ProviderType
057    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
058            PortalException.class, SystemException.class})
059    public interface DLFileVersionLocalService extends BaseLocalService,
060            PersistedModelLocalService {
061            /*
062             * NOTE FOR DEVELOPERS:
063             *
064             * Never modify or reference this interface directly. Always use {@link DLFileVersionLocalServiceUtil} to access the document library file version local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileVersionLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
065             */
066    
067            /**
068            * Adds the document library file version to the database. Also notifies the appropriate model listeners.
069            *
070            * @param dlFileVersion the document library file version
071            * @return the document library file version that was added
072            */
073            @Indexable(type = IndexableType.REINDEX)
074            public DLFileVersion addDLFileVersion(DLFileVersion dlFileVersion);
075    
076            /**
077            * Creates a new document library file version with the primary key. Does not add the document library file version to the database.
078            *
079            * @param fileVersionId the primary key for the new document library file version
080            * @return the new document library file version
081            */
082            public DLFileVersion createDLFileVersion(long fileVersionId);
083    
084            /**
085            * Deletes the document library file version from the database. Also notifies the appropriate model listeners.
086            *
087            * @param dlFileVersion the document library file version
088            * @return the document library file version that was removed
089            */
090            @Indexable(type = IndexableType.DELETE)
091            public DLFileVersion deleteDLFileVersion(DLFileVersion dlFileVersion);
092    
093            /**
094            * Deletes the document library file version with the primary key from the database. Also notifies the appropriate model listeners.
095            *
096            * @param fileVersionId the primary key of the document library file version
097            * @return the document library file version that was removed
098            * @throws PortalException if a document library file version with the primary key could not be found
099            */
100            @Indexable(type = IndexableType.DELETE)
101            public DLFileVersion deleteDLFileVersion(long fileVersionId)
102                    throws PortalException;
103    
104            /**
105            * @throws PortalException
106            */
107            @Override
108            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
109                    throws PortalException;
110    
111            public DynamicQuery dynamicQuery();
112    
113            /**
114            * Performs a dynamic query on the database and returns the matching rows.
115            *
116            * @param dynamicQuery the dynamic query
117            * @return the matching rows
118            */
119            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
120    
121            /**
122            * Performs a dynamic query on the database and returns a range of the matching rows.
123            *
124            * <p>
125            * 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.documentlibrary.model.impl.DLFileVersionModelImpl}. 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.
126            * </p>
127            *
128            * @param dynamicQuery the dynamic query
129            * @param start the lower bound of the range of model instances
130            * @param end the upper bound of the range of model instances (not inclusive)
131            * @return the range of matching rows
132            */
133            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
134                    int end);
135    
136            /**
137            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
138            *
139            * <p>
140            * 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.documentlibrary.model.impl.DLFileVersionModelImpl}. 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.
141            * </p>
142            *
143            * @param dynamicQuery the dynamic query
144            * @param start the lower bound of the range of model instances
145            * @param end the upper bound of the range of model instances (not inclusive)
146            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
147            * @return the ordered range of matching rows
148            */
149            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
150                    int end, OrderByComparator<T> orderByComparator);
151    
152            /**
153            * Returns the number of rows matching the dynamic query.
154            *
155            * @param dynamicQuery the dynamic query
156            * @return the number of rows matching the dynamic query
157            */
158            public long dynamicQueryCount(DynamicQuery dynamicQuery);
159    
160            /**
161            * Returns the number of rows matching the dynamic query.
162            *
163            * @param dynamicQuery the dynamic query
164            * @param projection the projection to apply to the query
165            * @return the number of rows matching the dynamic query
166            */
167            public long dynamicQueryCount(DynamicQuery dynamicQuery,
168                    Projection projection);
169    
170            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
171            public DLFileVersion fetchDLFileVersion(long fileVersionId);
172    
173            /**
174            * Returns the document library file version matching the UUID and group.
175            *
176            * @param uuid the document library file version's UUID
177            * @param groupId the primary key of the group
178            * @return the matching document library file version, or <code>null</code> if a matching document library file version could not be found
179            */
180            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181            public DLFileVersion fetchDLFileVersionByUuidAndGroupId(
182                    java.lang.String uuid, long groupId);
183    
184            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
185            public DLFileVersion fetchLatestFileVersion(long fileEntryId,
186                    boolean excludeWorkingCopy);
187    
188            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189            public ActionableDynamicQuery getActionableDynamicQuery();
190    
191            /**
192            * Returns the document library file version with the primary key.
193            *
194            * @param fileVersionId the primary key of the document library file version
195            * @return the document library file version
196            * @throws PortalException if a document library file version with the primary key could not be found
197            */
198            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
199            public DLFileVersion getDLFileVersion(long fileVersionId)
200                    throws PortalException;
201    
202            /**
203            * Returns the document library file version matching the UUID and group.
204            *
205            * @param uuid the document library file version's UUID
206            * @param groupId the primary key of the group
207            * @return the matching document library file version
208            * @throws PortalException if a matching document library file version could not be found
209            */
210            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
211            public DLFileVersion getDLFileVersionByUuidAndGroupId(
212                    java.lang.String uuid, long groupId) throws PortalException;
213    
214            /**
215            * Returns a range of all the document library file versions.
216            *
217            * <p>
218            * 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.documentlibrary.model.impl.DLFileVersionModelImpl}. 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.
219            * </p>
220            *
221            * @param start the lower bound of the range of document library file versions
222            * @param end the upper bound of the range of document library file versions (not inclusive)
223            * @return the range of document library file versions
224            */
225            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
226            public List<DLFileVersion> getDLFileVersions(int start, int end);
227    
228            /**
229            * Returns all the document library file versions matching the UUID and company.
230            *
231            * @param uuid the UUID of the document library file versions
232            * @param companyId the primary key of the company
233            * @return the matching document library file versions, or an empty list if no matches were found
234            */
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public List<DLFileVersion> getDLFileVersionsByUuidAndCompanyId(
237                    java.lang.String uuid, long companyId);
238    
239            /**
240            * Returns a range of document library file versions matching the UUID and company.
241            *
242            * @param uuid the UUID of the document library file versions
243            * @param companyId the primary key of the company
244            * @param start the lower bound of the range of document library file versions
245            * @param end the upper bound of the range of document library file versions (not inclusive)
246            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
247            * @return the range of matching document library file versions, or an empty list if no matches were found
248            */
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public List<DLFileVersion> getDLFileVersionsByUuidAndCompanyId(
251                    java.lang.String uuid, long companyId, int start, int end,
252                    OrderByComparator<DLFileVersion> orderByComparator);
253    
254            /**
255            * Returns the number of document library file versions.
256            *
257            * @return the number of document library file versions
258            */
259            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
260            public int getDLFileVersionsCount();
261    
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
264                    PortletDataContext portletDataContext);
265    
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public DLFileVersion getFileVersion(long fileEntryId,
268                    java.lang.String version) throws PortalException;
269    
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public DLFileVersion getFileVersion(long fileVersionId)
272                    throws PortalException;
273    
274            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
275            public DLFileVersion getFileVersionByUuidAndGroupId(java.lang.String uuid,
276                    long groupId);
277    
278            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
279            public List<DLFileVersion> getFileVersions(long fileEntryId, int status);
280    
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public int getFileVersionsCount(long fileEntryId, int status);
283    
284            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
285            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
286    
287            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
288            public DLFileVersion getLatestFileVersion(long fileEntryId,
289                    boolean excludeWorkingCopy) throws PortalException;
290    
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public DLFileVersion getLatestFileVersion(long userId, long fileEntryId)
293                    throws PortalException;
294    
295            /**
296            * Returns the OSGi service identifier.
297            *
298            * @return the OSGi service identifier
299            */
300            public java.lang.String getOSGiServiceIdentifier();
301    
302            @Override
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
305                    throws PortalException;
306    
307            public void rebuildTree(long companyId) throws PortalException;
308    
309            public void setTreePaths(long folderId, java.lang.String treePath)
310                    throws PortalException;
311    
312            /**
313            * Updates the document library file version in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
314            *
315            * @param dlFileVersion the document library file version
316            * @return the document library file version that was updated
317            */
318            @Indexable(type = IndexableType.REINDEX)
319            public DLFileVersion updateDLFileVersion(DLFileVersion dlFileVersion);
320    }