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 public void checkFileRanks(); 080 081 /** 082 * Creates a new document library file rank with the primary key. Does not add the document library file rank to the database. 083 * 084 * @param fileRankId the primary key for the new document library file rank 085 * @return the new document library file rank 086 */ 087 public DLFileRank createDLFileRank(long fileRankId); 088 089 /** 090 * Deletes the document library file rank from the database. Also notifies the appropriate model listeners. 091 * 092 * @param dlFileRank the document library file rank 093 * @return the document library file rank that was removed 094 */ 095 @Indexable(type = IndexableType.DELETE) 096 public DLFileRank deleteDLFileRank(DLFileRank dlFileRank); 097 098 /** 099 * Deletes the document library file rank with the primary key from the database. Also notifies the appropriate model listeners. 100 * 101 * @param fileRankId the primary key of the document library file rank 102 * @return the document library file rank that was removed 103 * @throws PortalException if a document library file rank with the primary key could not be found 104 */ 105 @Indexable(type = IndexableType.DELETE) 106 public DLFileRank deleteDLFileRank(long fileRankId) 107 throws PortalException; 108 109 @SystemEvent(type = SystemEventConstants.TYPE_DELETE) 110 public void deleteFileRank(DLFileRank dlFileRank); 111 112 public void deleteFileRank(long fileRankId) throws PortalException; 113 114 public void deleteFileRanksByFileEntryId(long fileEntryId); 115 116 public void deleteFileRanksByUserId(long userId); 117 118 /** 119 * @throws PortalException 120 */ 121 @Override 122 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 123 throws PortalException; 124 125 public void disableFileRanks(long fileEntryId); 126 127 public void disableFileRanksByFolderId(long folderId) 128 throws PortalException; 129 130 public DynamicQuery dynamicQuery(); 131 132 /** 133 * Performs a dynamic query on the database and returns the matching rows. 134 * 135 * @param dynamicQuery the dynamic query 136 * @return the matching rows 137 */ 138 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 139 140 /** 141 * Performs a dynamic query on the database and returns a range of the matching rows. 142 * 143 * <p> 144 * 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. 145 * </p> 146 * 147 * @param dynamicQuery the dynamic query 148 * @param start the lower bound of the range of model instances 149 * @param end the upper bound of the range of model instances (not inclusive) 150 * @return the range of matching rows 151 */ 152 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 153 int end); 154 155 /** 156 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 157 * 158 * <p> 159 * 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. 160 * </p> 161 * 162 * @param dynamicQuery the dynamic query 163 * @param start the lower bound of the range of model instances 164 * @param end the upper bound of the range of model instances (not inclusive) 165 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 166 * @return the ordered range of matching rows 167 */ 168 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 169 int end, OrderByComparator<T> orderByComparator); 170 171 /** 172 * Returns the number of rows matching the dynamic query. 173 * 174 * @param dynamicQuery the dynamic query 175 * @return the number of rows matching the dynamic query 176 */ 177 public long dynamicQueryCount(DynamicQuery dynamicQuery); 178 179 /** 180 * Returns the number of rows matching the dynamic query. 181 * 182 * @param dynamicQuery the dynamic query 183 * @param projection the projection to apply to the query 184 * @return the number of rows matching the dynamic query 185 */ 186 public long dynamicQueryCount(DynamicQuery dynamicQuery, 187 Projection projection); 188 189 public void enableFileRanks(long fileEntryId); 190 191 public void enableFileRanksByFolderId(long folderId) 192 throws PortalException; 193 194 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 195 public DLFileRank fetchDLFileRank(long fileRankId); 196 197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 198 public ActionableDynamicQuery getActionableDynamicQuery(); 199 200 /** 201 * Returns the document library file rank with the primary key. 202 * 203 * @param fileRankId the primary key of the document library file rank 204 * @return the document library file rank 205 * @throws PortalException if a document library file rank with the primary key could not be found 206 */ 207 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 208 public DLFileRank getDLFileRank(long fileRankId) throws PortalException; 209 210 /** 211 * Returns a range of all the document library file ranks. 212 * 213 * <p> 214 * 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. 215 * </p> 216 * 217 * @param start the lower bound of the range of document library file ranks 218 * @param end the upper bound of the range of document library file ranks (not inclusive) 219 * @return the range of document library file ranks 220 */ 221 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 222 public List<DLFileRank> getDLFileRanks(int start, int end); 223 224 /** 225 * Returns the number of document library file ranks. 226 * 227 * @return the number of document library file ranks 228 */ 229 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 230 public int getDLFileRanksCount(); 231 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public List<DLFileRank> getFileRanks(long groupId, long userId); 234 235 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 236 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 237 238 /** 239 * Returns the OSGi service identifier. 240 * 241 * @return the OSGi service identifier 242 */ 243 public java.lang.String getOSGiServiceIdentifier(); 244 245 @Override 246 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 247 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 248 throws PortalException; 249 250 /** 251 * Updates the document library file rank in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 252 * 253 * @param dlFileRank the document library file rank 254 * @return the document library file rank that was updated 255 */ 256 @Indexable(type = IndexableType.REINDEX) 257 public DLFileRank updateDLFileRank(DLFileRank dlFileRank); 258 259 public DLFileRank updateFileRank(long groupId, long companyId, long userId, 260 long fileEntryId, ServiceContext serviceContext); 261 }