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 com.liferay.portal.kernel.exception.PortalException; 086 087 public void checkEntries() 088 throws com.liferay.portal.kernel.exception.PortalException; 089 090 /** 091 * Creates a new trash entry with the primary key. Does not add the trash entry to the database. 092 * 093 * @param entryId the primary key for the new trash entry 094 * @return the new trash entry 095 */ 096 public com.liferay.portlet.trash.model.TrashEntry createTrashEntry( 097 long entryId); 098 099 /** 100 * Deletes the trash entry with the entity class name and primary key. 101 * 102 * @param className the class name of entity 103 * @param classPK the primary key of the entry 104 * @return the trash entry with the entity class name and primary key 105 * @throws PortalException if a trash entry with the primary key could not 106 be found 107 */ 108 public com.liferay.portlet.trash.model.TrashEntry deleteEntry( 109 java.lang.String className, long classPK) 110 throws com.liferay.portal.kernel.exception.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 com.liferay.portal.kernel.exception.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 com.liferay.portal.kernel.exception.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) 145 throws com.liferay.portal.kernel.exception.PortalException; 146 147 /** 148 * Deletes the trash entry from the database. Also notifies the appropriate model listeners. 149 * 150 * @param trashEntry the trash entry 151 * @return the trash entry that was removed 152 */ 153 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 154 public com.liferay.portlet.trash.model.TrashEntry deleteTrashEntry( 155 com.liferay.portlet.trash.model.TrashEntry trashEntry); 156 157 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 158 159 /** 160 * Performs a dynamic query on the database and returns the matching rows. 161 * 162 * @param dynamicQuery the dynamic query 163 * @return the matching rows 164 */ 165 public <T> java.util.List<T> dynamicQuery( 166 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 167 168 /** 169 * Performs a dynamic query on the database and returns a range of the matching rows. 170 * 171 * <p> 172 * 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. 173 * </p> 174 * 175 * @param dynamicQuery the dynamic query 176 * @param start the lower bound of the range of model instances 177 * @param end the upper bound of the range of model instances (not inclusive) 178 * @return the range of matching rows 179 */ 180 public <T> java.util.List<T> dynamicQuery( 181 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 182 int end); 183 184 /** 185 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 186 * 187 * <p> 188 * 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. 189 * </p> 190 * 191 * @param dynamicQuery the dynamic query 192 * @param start the lower bound of the range of model instances 193 * @param end the upper bound of the range of model instances (not inclusive) 194 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 195 * @return the ordered range of matching rows 196 */ 197 public <T> java.util.List<T> dynamicQuery( 198 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 199 int end, 200 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator); 201 202 /** 203 * Returns the number of rows matching the dynamic query. 204 * 205 * @param dynamicQuery the dynamic query 206 * @return the number of rows matching the dynamic query 207 */ 208 public long dynamicQueryCount( 209 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 210 211 /** 212 * Returns the number of rows matching the dynamic query. 213 * 214 * @param dynamicQuery the dynamic query 215 * @param projection the projection to apply to the query 216 * @return the number of rows matching the dynamic query 217 */ 218 public long dynamicQueryCount( 219 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 220 com.liferay.portal.kernel.dao.orm.Projection projection); 221 222 /** 223 * Returns the trash entry with the entity class name and primary key. 224 * 225 * @param className the class name of the entity 226 * @param classPK the primary key of the entity 227 * @return the trash entry with the entity class name and primary key 228 */ 229 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 230 public com.liferay.portlet.trash.model.TrashEntry fetchEntry( 231 java.lang.String className, long classPK); 232 233 /** 234 * Returns the trash entry with the primary key. 235 * 236 * @param entryId the primary key of the entry 237 * @return the trash entry with the primary key 238 */ 239 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 240 public com.liferay.portlet.trash.model.TrashEntry fetchEntry(long entryId); 241 242 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 243 public com.liferay.portlet.trash.model.TrashEntry fetchTrashEntry( 244 long entryId); 245 246 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 247 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(); 248 249 /** 250 * Returns the Spring bean ID for this bean. 251 * 252 * @return the Spring bean ID for this bean 253 */ 254 public java.lang.String getBeanIdentifier(); 255 256 /** 257 * Returns the trash entries with the matching group ID. 258 * 259 * @param groupId the primary key of the group 260 * @return the trash entries with the group ID 261 */ 262 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 263 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 264 long groupId); 265 266 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 267 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 268 long groupId, java.lang.String className); 269 270 /** 271 * Returns a range of all the trash entries matching the group ID. 272 * 273 * @param groupId the primary key of the group 274 * @param start the lower bound of the range of trash entries to return 275 * @param end the upper bound of the range of trash entries to return (not 276 inclusive) 277 * @return the range of matching trash entries 278 */ 279 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 280 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 281 long groupId, int start, int end); 282 283 /** 284 * Returns a range of all the trash entries matching the group ID. 285 * 286 * @param groupId the primary key of the group 287 * @param start the lower bound of the range of trash entries to return 288 * @param end the upper bound of the range of trash entries to return (not 289 inclusive) 290 * @param obc the comparator to order the trash entries (optionally 291 <code>null</code>) 292 * @return the range of matching trash entries ordered by comparator 293 <code>obc</code> 294 */ 295 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 296 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 297 long groupId, int start, int end, 298 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashEntry> obc); 299 300 /** 301 * Returns the number of trash entries with the group ID. 302 * 303 * @param groupId the primary key of the group 304 * @return the number of matching trash entries 305 */ 306 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 307 public int getEntriesCount(long groupId); 308 309 /** 310 * Returns the entry with the entity class name and primary key. 311 * 312 * @param className the class name of the entity 313 * @param classPK the primary key of the entity 314 * @return the trash entry with the entity class name and primary key 315 * @throws PortalException if a trash entry with the primary key could not 316 be found 317 */ 318 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 319 public com.liferay.portlet.trash.model.TrashEntry getEntry( 320 java.lang.String className, long classPK) 321 throws com.liferay.portal.kernel.exception.PortalException; 322 323 /** 324 * Returns the trash entry with the primary key. 325 * 326 * @param entryId the primary key of the trash entry 327 * @return the trash entry with the primary key 328 * @throws PortalException if a trash entry with the primary key could not 329 be found 330 */ 331 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 332 public com.liferay.portlet.trash.model.TrashEntry getEntry(long entryId) 333 throws com.liferay.portal.kernel.exception.PortalException; 334 335 @Override 336 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 337 public com.liferay.portal.model.PersistedModel getPersistedModel( 338 java.io.Serializable primaryKeyObj) 339 throws com.liferay.portal.kernel.exception.PortalException; 340 341 /** 342 * Returns a range of all the trash entries. 343 * 344 * <p> 345 * 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. 346 * </p> 347 * 348 * @param start the lower bound of the range of trash entries 349 * @param end the upper bound of the range of trash entries (not inclusive) 350 * @return the range of trash entries 351 */ 352 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 353 public java.util.List<com.liferay.portlet.trash.model.TrashEntry> getTrashEntries( 354 int start, int end); 355 356 /** 357 * Returns the number of trash entries. 358 * 359 * @return the number of trash entries 360 */ 361 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 362 public int getTrashEntriesCount(); 363 364 /** 365 * Returns the trash entry with the primary key. 366 * 367 * @param entryId the primary key of the trash entry 368 * @return the trash entry 369 * @throws PortalException if a trash entry with the primary key could not be found 370 */ 371 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 372 public com.liferay.portlet.trash.model.TrashEntry getTrashEntry( 373 long entryId) 374 throws com.liferay.portal.kernel.exception.PortalException; 375 376 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 377 public com.liferay.portal.kernel.search.Hits search(long companyId, 378 long groupId, long userId, java.lang.String keywords, int start, 379 int end, com.liferay.portal.kernel.search.Sort sort); 380 381 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 382 public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portlet.trash.model.TrashEntry> searchTrashEntries( 383 long companyId, long groupId, long userId, java.lang.String keywords, 384 int start, int end, com.liferay.portal.kernel.search.Sort sort); 385 386 /** 387 * Sets the Spring bean ID for this bean. 388 * 389 * @param beanIdentifier the Spring bean ID for this bean 390 */ 391 public void setBeanIdentifier(java.lang.String beanIdentifier); 392 393 /** 394 * Updates the trash entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 395 * 396 * @param trashEntry the trash entry 397 * @return the trash entry that was updated 398 */ 399 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 400 public com.liferay.portlet.trash.model.TrashEntry updateTrashEntry( 401 com.liferay.portlet.trash.model.TrashEntry trashEntry); 402 }