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.trash.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.search.IndexableType; 022 import com.liferay.portal.kernel.transaction.Isolation; 023 import com.liferay.portal.kernel.transaction.Propagation; 024 import com.liferay.portal.kernel.transaction.Transactional; 025 import com.liferay.portal.service.BaseLocalService; 026 import com.liferay.portal.service.PersistedModelLocalService; 027 028 /** 029 * Provides the local service interface for TrashEntry. Methods of this 030 * service will not have security checks based on the propagated JAAS 031 * credentials because this service can only be accessed from within the same 032 * VM. 033 * 034 * @author Brian Wing Shun Chan 035 * @see TrashEntryLocalServiceUtil 036 * @see com.liferay.portlet.trash.service.base.TrashEntryLocalServiceBaseImpl 037 * @see com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl 038 * @generated 039 */ 040 @ProviderType 041 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 042 PortalException.class, SystemException.class}) 043 public interface TrashEntryLocalService extends BaseLocalService, 044 PersistedModelLocalService { 045 /* 046 * NOTE FOR DEVELOPERS: 047 * 048 * Never modify or reference this interface directly. Always use {@link TrashEntryLocalServiceUtil} to access the trash entry local service. Add custom service methods to {@link com.liferay.portlet.trash.service.impl.TrashEntryLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 049 */ 050 051 /** 052 * Adds the trash entry to the database. Also notifies the appropriate model listeners. 053 * 054 * @param trashEntry the trash entry 055 * @return the trash entry that was added 056 */ 057 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 058 public com.liferay.portlet.trash.model.TrashEntry addTrashEntry( 059 com.liferay.portlet.trash.model.TrashEntry trashEntry); 060 061 /** 062 * Moves an entry to trash. 063 * 064 * @param userId the primary key of the user removing the entity 065 * @param groupId the primary key of the entry's group 066 * @param className the class name of the entity 067 * @param classPK the primary key of the entity 068 * @param classUuid the UUID of the entity's class 069 * @param referrerClassName the referrer class name used to add a deletion 070 {@link SystemEvent} 071 * @param status the status of the entity prior to being moved to trash 072 * @param statusOVPs the primary keys and statuses of any of the entry's 073 versions (e.g., {@link 074 com.liferay.portlet.documentlibrary.model.DLFileVersion}) 075 * @param typeSettingsProperties the type settings properties 076 * @return the trashEntry 077 * @throws PortalException if a user with the primary key could not be found 078 */ 079 public com.liferay.portlet.trash.model.TrashEntry addTrashEntry( 080 long userId, long groupId, java.lang.String className, long classPK, 081 java.lang.String classUuid, java.lang.String referrerClassName, 082 int status, 083 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.Long, java.lang.Integer>> statusOVPs, 084 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) 085 throws PortalException; 086 087 public void checkEntries() throws PortalException; 088 089 /** 090 * Creates a new trash entry with the primary key. Does not add the trash entry to the database. 091 * 092 * @param entryId the primary key for the new trash entry 093 * @return the new trash entry 094 */ 095 public com.liferay.portlet.trash.model.TrashEntry createTrashEntry( 096 long entryId); 097 098 public void deleteEntries(long groupId); 099 100 /** 101 * Deletes the trash entry with the entity class name and primary key. 102 * 103 * @param className the class name of entity 104 * @param classPK the primary key of the entry 105 * @return the trash entry with the entity class name and primary key 106 * @throws PortalException if a trash entry with the primary key could not 107 be found 108 */ 109 public com.liferay.portlet.trash.model.TrashEntry deleteEntry( 110 java.lang.String className, long classPK) throws PortalException; 111 112 /** 113 * Deletes the trash entry with the primary key. 114 * 115 * @param entryId the primary key of the trash entry 116 * @return the trash entry with the primary key 117 * @throws PortalException if a trash entry with the primary key could not 118 be found 119 */ 120 public com.liferay.portlet.trash.model.TrashEntry deleteEntry(long entryId) 121 throws PortalException; 122 123 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 124 public com.liferay.portlet.trash.model.TrashEntry deleteEntry( 125 com.liferay.portlet.trash.model.TrashEntry trashEntry); 126 127 /** 128 * @throws PortalException 129 */ 130 @Override 131 public com.liferay.portal.model.PersistedModel deletePersistedModel( 132 com.liferay.portal.model.PersistedModel persistedModel) 133 throws PortalException; 134 135 /** 136 * Deletes the trash entry with the primary key from the database. Also notifies the appropriate model listeners. 137 * 138 * @param entryId the primary key of the trash entry 139 * @return the trash entry that was removed 140 * @throws PortalException if a trash entry with the primary key could not be found 141 */ 142 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 143 public com.liferay.portlet.trash.model.TrashEntry deleteTrashEntry( 144 long entryId) throws PortalException; 145 146 /** 147 * Deletes the trash entry from the database. Also notifies the appropriate model listeners. 148 * 149 * @param trashEntry the trash entry 150 * @return the trash entry that was removed 151 */ 152 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 153 public com.liferay.portlet.trash.model.TrashEntry deleteTrashEntry( 154 com.liferay.portlet.trash.model.TrashEntry trashEntry); 155 156 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 157 158 /** 159 * Performs a dynamic query on the database and returns the matching rows. 160 * 161 * @param dynamicQuery the dynamic query 162 * @return the matching rows 163 */ 164 public <T> java.util.List<T> dynamicQuery( 165 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 166 167 /** 168 * Performs a dynamic query on the database and returns a range of the matching rows. 169 * 170 * <p> 171 * 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.trash.model.impl.TrashEntryModelImpl}. 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. 172 * </p> 173 * 174 * @param dynamicQuery the dynamic query 175 * @param start the lower bound of the range of model instances 176 * @param end the upper bound of the range of model instances (not inclusive) 177 * @return the range of matching rows 178 */ 179 public <T> java.util.List<T> dynamicQuery( 180 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 181 int end); 182 183 /** 184 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 185 * 186 * <p> 187 * 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.trash.model.impl.TrashEntryModelImpl}. 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. 188 * </p> 189 * 190 * @param dynamicQuery the dynamic query 191 * @param start the lower bound of the range of model instances 192 * @param end the upper bound of the range of model instances (not inclusive) 193 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 194 * @return the ordered range of matching rows 195 */ 196 public <T> java.util.List<T> dynamicQuery( 197 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 198 int end, 199 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator); 200 201 /** 202 * Returns the number of rows matching the dynamic query. 203 * 204 * @param dynamicQuery the dynamic query 205 * @return the number of rows matching the dynamic query 206 */ 207 public long dynamicQueryCount( 208 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 209 210 /** 211 * Returns the number of rows matching the dynamic query. 212 * 213 * @param dynamicQuery the dynamic query 214 * @param projection the projection to apply to the query 215 * @return the number of rows matching the dynamic query 216 */ 217 public long dynamicQueryCount( 218 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 219 com.liferay.portal.kernel.dao.orm.Projection projection); 220 221 /** 222 * Returns the trash entry with the entity class name and primary key. 223 * 224 * @param className the class name of the entity 225 * @param classPK the primary key of the entity 226 * @return the trash entry with the entity class name and primary key 227 */ 228 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 229 public com.liferay.portlet.trash.model.TrashEntry fetchEntry( 230 java.lang.String className, long classPK); 231 232 /** 233 * Returns the trash entry with the primary key. 234 * 235 * @param entryId the primary key of the entry 236 * @return the trash entry with the primary key 237 */ 238 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 239 public com.liferay.portlet.trash.model.TrashEntry fetchEntry(long entryId); 240 241 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 242 public com.liferay.portlet.trash.model.TrashEntry fetchTrashEntry( 243 long entryId); 244 245 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 246 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(); 247 248 /** 249 * Returns the Spring bean ID for this bean. 250 * 251 * @return the Spring bean ID for this bean 252 */ 253 public java.lang.String getBeanIdentifier(); 254 255 /** 256 * Returns the trash entries with the matching group ID. 257 * 258 * @param groupId the primary key of the group 259 * @return the trash entries with the group ID 260 */ 261 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 262 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 263 long groupId); 264 265 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 266 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 267 long groupId, java.lang.String className); 268 269 /** 270 * Returns a range of all the trash entries matching the group ID. 271 * 272 * @param groupId the primary key of the group 273 * @param start the lower bound of the range of trash entries to return 274 * @param end the upper bound of the range of trash entries to return (not 275 inclusive) 276 * @return the range of matching trash entries 277 */ 278 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 279 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 280 long groupId, int start, int end); 281 282 /** 283 * Returns a range of all the trash entries matching the group ID. 284 * 285 * @param groupId the primary key of the group 286 * @param start the lower bound of the range of trash entries to return 287 * @param end the upper bound of the range of trash entries to return (not 288 inclusive) 289 * @param obc the comparator to order the trash entries (optionally 290 <code>null</code>) 291 * @return the range of matching trash entries ordered by comparator 292 <code>obc</code> 293 */ 294 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 295 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 296 long groupId, int start, int end, 297 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashEntry> obc); 298 299 /** 300 * Returns the number of trash entries with the group ID. 301 * 302 * @param groupId the primary key of the group 303 * @return the number of matching trash entries 304 */ 305 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 306 public int getEntriesCount(long groupId); 307 308 /** 309 * Returns the entry with the entity class name and primary key. 310 * 311 * @param className the class name of the entity 312 * @param classPK the primary key of the entity 313 * @return the trash entry with the entity class name and primary key 314 * @throws PortalException if a trash entry with the primary key could not 315 be found 316 */ 317 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 318 public com.liferay.portlet.trash.model.TrashEntry getEntry( 319 java.lang.String className, long classPK) throws PortalException; 320 321 /** 322 * Returns the trash entry with the primary key. 323 * 324 * @param entryId the primary key of the trash entry 325 * @return the trash entry with the primary key 326 * @throws PortalException if a trash entry with the primary key could not 327 be found 328 */ 329 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 330 public com.liferay.portlet.trash.model.TrashEntry getEntry(long entryId) 331 throws PortalException; 332 333 @Override 334 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 335 public com.liferay.portal.model.PersistedModel getPersistedModel( 336 java.io.Serializable primaryKeyObj) throws PortalException; 337 338 /** 339 * Returns a range of all the trash entries. 340 * 341 * <p> 342 * 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.trash.model.impl.TrashEntryModelImpl}. 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. 343 * </p> 344 * 345 * @param start the lower bound of the range of trash entries 346 * @param end the upper bound of the range of trash entries (not inclusive) 347 * @return the range of trash entries 348 */ 349 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 350 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getTrashEntries( 351 int start, int end); 352 353 /** 354 * Returns the number of trash entries. 355 * 356 * @return the number of trash entries 357 */ 358 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 359 public int getTrashEntriesCount(); 360 361 /** 362 * Returns the trash entry with the primary key. 363 * 364 * @param entryId the primary key of the trash entry 365 * @return the trash entry 366 * @throws PortalException if a trash entry with the primary key could not be found 367 */ 368 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 369 public com.liferay.portlet.trash.model.TrashEntry getTrashEntry( 370 long entryId) throws PortalException; 371 372 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 373 public com.liferay.portal.kernel.search.Hits search(long companyId, 374 long groupId, long userId, java.lang.String keywords, int start, 375 int end, com.liferay.portal.kernel.search.Sort sort); 376 377 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 378 public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portlet.trash.model.TrashEntry> searchTrashEntries( 379 long companyId, long groupId, long userId, java.lang.String keywords, 380 int start, int end, com.liferay.portal.kernel.search.Sort sort); 381 382 /** 383 * Sets the Spring bean ID for this bean. 384 * 385 * @param beanIdentifier the Spring bean ID for this bean 386 */ 387 public void setBeanIdentifier(java.lang.String beanIdentifier); 388 389 /** 390 * Updates the trash entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 391 * 392 * @param trashEntry the trash entry 393 * @return the trash entry that was updated 394 */ 395 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 396 public com.liferay.portlet.trash.model.TrashEntry updateTrashEntry( 397 com.liferay.portlet.trash.model.TrashEntry trashEntry); 398 }