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