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