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.DLFileRank;
020    
021    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
024    import com.liferay.portal.kernel.dao.orm.Projection;
025    import com.liferay.portal.kernel.exception.PortalException;
026    import com.liferay.portal.kernel.exception.SystemException;
027    import com.liferay.portal.kernel.model.PersistedModel;
028    import com.liferay.portal.kernel.model.SystemEventConstants;
029    import com.liferay.portal.kernel.search.Indexable;
030    import com.liferay.portal.kernel.search.IndexableType;
031    import com.liferay.portal.kernel.service.BaseLocalService;
032    import com.liferay.portal.kernel.service.PersistedModelLocalService;
033    import com.liferay.portal.kernel.service.ServiceContext;
034    import com.liferay.portal.kernel.systemevent.SystemEvent;
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 DLFileRank. 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 DLFileRankLocalServiceUtil
052     * @see com.liferay.portlet.documentlibrary.service.base.DLFileRankLocalServiceBaseImpl
053     * @see com.liferay.portlet.documentlibrary.service.impl.DLFileRankLocalServiceImpl
054     * @generated
055     */
056    @ProviderType
057    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
058            PortalException.class, SystemException.class})
059    public interface DLFileRankLocalService extends BaseLocalService,
060            PersistedModelLocalService {
061            /*
062             * NOTE FOR DEVELOPERS:
063             *
064             * Never modify or reference this interface directly. Always use {@link DLFileRankLocalServiceUtil} to access the document library file rank local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileRankLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
065             */
066    
067            /**
068            * Adds the document library file rank to the database. Also notifies the appropriate model listeners.
069            *
070            * @param dlFileRank the document library file rank
071            * @return the document library file rank that was added
072            */
073            @Indexable(type = IndexableType.REINDEX)
074            public DLFileRank addDLFileRank(DLFileRank dlFileRank);
075    
076            public DLFileRank addFileRank(long groupId, long companyId, long userId,
077                    long fileEntryId, ServiceContext serviceContext);
078    
079            /**
080            * Creates a new document library file rank with the primary key. Does not add the document library file rank to the database.
081            *
082            * @param fileRankId the primary key for the new document library file rank
083            * @return the new document library file rank
084            */
085            public DLFileRank createDLFileRank(long fileRankId);
086    
087            /**
088            * Deletes the document library file rank from the database. Also notifies the appropriate model listeners.
089            *
090            * @param dlFileRank the document library file rank
091            * @return the document library file rank that was removed
092            */
093            @Indexable(type = IndexableType.DELETE)
094            public DLFileRank deleteDLFileRank(DLFileRank dlFileRank);
095    
096            /**
097            * Deletes the document library file rank with the primary key from the database. Also notifies the appropriate model listeners.
098            *
099            * @param fileRankId the primary key of the document library file rank
100            * @return the document library file rank that was removed
101            * @throws PortalException if a document library file rank with the primary key could not be found
102            */
103            @Indexable(type = IndexableType.DELETE)
104            public DLFileRank deleteDLFileRank(long fileRankId)
105                    throws PortalException;
106    
107            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
108            public DLFileRank fetchDLFileRank(long fileRankId);
109    
110            /**
111            * Returns the document library file rank with the primary key.
112            *
113            * @param fileRankId the primary key of the document library file rank
114            * @return the document library file rank
115            * @throws PortalException if a document library file rank with the primary key could not be found
116            */
117            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
118            public DLFileRank getDLFileRank(long fileRankId) throws PortalException;
119    
120            /**
121            * Updates the document library file rank in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
122            *
123            * @param dlFileRank the document library file rank
124            * @return the document library file rank that was updated
125            */
126            @Indexable(type = IndexableType.REINDEX)
127            public DLFileRank updateDLFileRank(DLFileRank dlFileRank);
128    
129            public DLFileRank updateFileRank(long groupId, long companyId, long userId,
130                    long fileEntryId, ServiceContext serviceContext);
131    
132            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
133            public ActionableDynamicQuery getActionableDynamicQuery();
134    
135            public DynamicQuery dynamicQuery();
136    
137            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
139    
140            /**
141            * @throws PortalException
142            */
143            @Override
144            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
145                    throws PortalException;
146    
147            @Override
148            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
149            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
150                    throws PortalException;
151    
152            /**
153            * Returns the number of document library file ranks.
154            *
155            * @return the number of document library file ranks
156            */
157            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
158            public int getDLFileRanksCount();
159    
160            /**
161            * Returns the OSGi service identifier.
162            *
163            * @return the OSGi service identifier
164            */
165            public java.lang.String getOSGiServiceIdentifier();
166    
167            /**
168            * Performs a dynamic query on the database and returns the matching rows.
169            *
170            * @param dynamicQuery the dynamic query
171            * @return the matching rows
172            */
173            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
174    
175            /**
176            * Performs a dynamic query on the database and returns a 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.documentlibrary.model.impl.DLFileRankModelImpl}. 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            * @return the range of matching rows
186            */
187            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
188                    int end);
189    
190            /**
191            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
192            *
193            * <p>
194            * 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.DLFileRankModelImpl}. 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.
195            * </p>
196            *
197            * @param dynamicQuery the dynamic query
198            * @param start the lower bound of the range of model instances
199            * @param end the upper bound of the range of model instances (not inclusive)
200            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
201            * @return the ordered range of matching rows
202            */
203            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
204                    int end, OrderByComparator<T> orderByComparator);
205    
206            /**
207            * Returns a range of all the document library file ranks.
208            *
209            * <p>
210            * 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.DLFileRankModelImpl}. 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.
211            * </p>
212            *
213            * @param start the lower bound of the range of document library file ranks
214            * @param end the upper bound of the range of document library file ranks (not inclusive)
215            * @return the range of document library file ranks
216            */
217            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
218            public List<DLFileRank> getDLFileRanks(int start, int end);
219    
220            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221            public List<DLFileRank> getFileRanks(long groupId, long userId);
222    
223            /**
224            * Returns the number of rows matching the dynamic query.
225            *
226            * @param dynamicQuery the dynamic query
227            * @return the number of rows matching the dynamic query
228            */
229            public long dynamicQueryCount(DynamicQuery dynamicQuery);
230    
231            /**
232            * Returns the number of rows matching the dynamic query.
233            *
234            * @param dynamicQuery the dynamic query
235            * @param projection the projection to apply to the query
236            * @return the number of rows matching the dynamic query
237            */
238            public long dynamicQueryCount(DynamicQuery dynamicQuery,
239                    Projection projection);
240    
241            public void checkFileRanks();
242    
243            @SystemEvent(type = SystemEventConstants.TYPE_DELETE)
244            public void deleteFileRank(DLFileRank dlFileRank);
245    
246            public void deleteFileRank(long fileRankId) throws PortalException;
247    
248            public void deleteFileRanksByFileEntryId(long fileEntryId);
249    
250            public void deleteFileRanksByUserId(long userId);
251    
252            public void disableFileRanks(long fileEntryId);
253    
254            public void disableFileRanksByFolderId(long folderId)
255                    throws PortalException;
256    
257            public void enableFileRanks(long fileEntryId);
258    
259            public void enableFileRanksByFolderId(long folderId)
260                    throws PortalException;
261    }