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 /** 103 * Deletes the trash entry with the entity class name and primary key. 104 * 105 * @param className the class name of entity 106 * @param classPK the primary key of the entry 107 * @return the trash entry with the entity class name and primary key 108 * @throws PortalException if a trash entry with the primary key could not 109 be found 110 */ 111 public static com.liferay.portlet.trash.model.TrashEntry deleteEntry( 112 java.lang.String className, long classPK) 113 throws com.liferay.portal.kernel.exception.PortalException { 114 return getService().deleteEntry(className, classPK); 115 } 116 117 /** 118 * Deletes the trash entry with the primary key. 119 * 120 * @param entryId the primary key of the trash entry 121 * @return the trash entry with the primary key 122 * @throws PortalException if a trash entry with the primary key could not 123 be found 124 */ 125 public static com.liferay.portlet.trash.model.TrashEntry deleteEntry( 126 long entryId) 127 throws com.liferay.portal.kernel.exception.PortalException { 128 return getService().deleteEntry(entryId); 129 } 130 131 public static com.liferay.portlet.trash.model.TrashEntry deleteEntry( 132 com.liferay.portlet.trash.model.TrashEntry trashEntry) { 133 return getService().deleteEntry(trashEntry); 134 } 135 136 /** 137 * @throws PortalException 138 */ 139 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 140 com.liferay.portal.model.PersistedModel persistedModel) 141 throws com.liferay.portal.kernel.exception.PortalException { 142 return getService().deletePersistedModel(persistedModel); 143 } 144 145 /** 146 * Deletes the trash entry with the primary key from the database. Also notifies the appropriate model listeners. 147 * 148 * @param entryId the primary key of the trash entry 149 * @return the trash entry that was removed 150 * @throws PortalException if a trash entry with the primary key could not be found 151 */ 152 public static com.liferay.portlet.trash.model.TrashEntry deleteTrashEntry( 153 long entryId) 154 throws com.liferay.portal.kernel.exception.PortalException { 155 return getService().deleteTrashEntry(entryId); 156 } 157 158 /** 159 * Deletes the trash entry from the database. Also notifies the appropriate model listeners. 160 * 161 * @param trashEntry the trash entry 162 * @return the trash entry that was removed 163 */ 164 public static com.liferay.portlet.trash.model.TrashEntry deleteTrashEntry( 165 com.liferay.portlet.trash.model.TrashEntry trashEntry) { 166 return getService().deleteTrashEntry(trashEntry); 167 } 168 169 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 170 return getService().dynamicQuery(); 171 } 172 173 /** 174 * Performs a dynamic query on the database and returns the matching rows. 175 * 176 * @param dynamicQuery the dynamic query 177 * @return the matching rows 178 */ 179 public static <T> java.util.List<T> dynamicQuery( 180 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 181 return getService().dynamicQuery(dynamicQuery); 182 } 183 184 /** 185 * Performs a dynamic query on the database and returns a 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 * @return the range of matching rows 195 */ 196 public static <T> java.util.List<T> dynamicQuery( 197 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 198 int end) { 199 return getService().dynamicQuery(dynamicQuery, start, end); 200 } 201 202 /** 203 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 204 * 205 * <p> 206 * 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. 207 * </p> 208 * 209 * @param dynamicQuery the dynamic query 210 * @param start the lower bound of the range of model instances 211 * @param end the upper bound of the range of model instances (not inclusive) 212 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 213 * @return the ordered range of matching rows 214 */ 215 public static <T> java.util.List<T> dynamicQuery( 216 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 217 int end, 218 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 219 return getService() 220 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 221 } 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 static long dynamicQueryCount( 230 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 231 return getService().dynamicQueryCount(dynamicQuery); 232 } 233 234 /** 235 * Returns the number of rows matching the dynamic query. 236 * 237 * @param dynamicQuery the dynamic query 238 * @param projection the projection to apply to the query 239 * @return the number of rows matching the dynamic query 240 */ 241 public static long dynamicQueryCount( 242 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 243 com.liferay.portal.kernel.dao.orm.Projection projection) { 244 return getService().dynamicQueryCount(dynamicQuery, projection); 245 } 246 247 /** 248 * Returns the trash entry with the entity class name and primary key. 249 * 250 * @param className the class name of the entity 251 * @param classPK the primary key of the entity 252 * @return the trash entry with the entity class name and primary key 253 */ 254 public static com.liferay.portlet.trash.model.TrashEntry fetchEntry( 255 java.lang.String className, long classPK) { 256 return getService().fetchEntry(className, classPK); 257 } 258 259 /** 260 * Returns the trash entry with the primary key. 261 * 262 * @param entryId the primary key of the entry 263 * @return the trash entry with the primary key 264 */ 265 public static com.liferay.portlet.trash.model.TrashEntry fetchEntry( 266 long entryId) { 267 return getService().fetchEntry(entryId); 268 } 269 270 public static com.liferay.portlet.trash.model.TrashEntry fetchTrashEntry( 271 long entryId) { 272 return getService().fetchTrashEntry(entryId); 273 } 274 275 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 276 return getService().getActionableDynamicQuery(); 277 } 278 279 /** 280 * Returns the Spring bean ID for this bean. 281 * 282 * @return the Spring bean ID for this bean 283 */ 284 public static java.lang.String getBeanIdentifier() { 285 return getService().getBeanIdentifier(); 286 } 287 288 /** 289 * Returns the trash entries with the matching group ID. 290 * 291 * @param groupId the primary key of the group 292 * @return the trash entries with the group ID 293 */ 294 public static java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 295 long groupId) { 296 return getService().getEntries(groupId); 297 } 298 299 public static java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 300 long groupId, java.lang.String className) { 301 return getService().getEntries(groupId, className); 302 } 303 304 /** 305 * Returns a range of all the trash entries matching the group ID. 306 * 307 * @param groupId the primary key of the group 308 * @param start the lower bound of the range of trash entries to return 309 * @param end the upper bound of the range of trash entries to return (not 310 inclusive) 311 * @return the range of matching trash entries 312 */ 313 public static java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 314 long groupId, int start, int end) { 315 return getService().getEntries(groupId, start, end); 316 } 317 318 /** 319 * Returns a range of all the trash entries matching the group ID. 320 * 321 * @param groupId the primary key of the group 322 * @param start the lower bound of the range of trash entries to return 323 * @param end the upper bound of the range of trash entries to return (not 324 inclusive) 325 * @param obc the comparator to order the trash entries (optionally 326 <code>null</code>) 327 * @return the range of matching trash entries ordered by comparator 328 <code>obc</code> 329 */ 330 public static java.util.List<com.liferay.portlet.trash.model.TrashEntry> getEntries( 331 long groupId, int start, int end, 332 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.trash.model.TrashEntry> obc) { 333 return getService().getEntries(groupId, start, end, obc); 334 } 335 336 /** 337 * Returns the number of trash entries with the group ID. 338 * 339 * @param groupId the primary key of the group 340 * @return the number of matching trash entries 341 */ 342 public static int getEntriesCount(long groupId) { 343 return getService().getEntriesCount(groupId); 344 } 345 346 /** 347 * Returns the entry with the entity class name and primary key. 348 * 349 * @param className the class name of the entity 350 * @param classPK the primary key of the entity 351 * @return the trash entry with the entity class name and primary key 352 * @throws PortalException if a trash entry with the primary key could not 353 be found 354 */ 355 public static com.liferay.portlet.trash.model.TrashEntry getEntry( 356 java.lang.String className, long classPK) 357 throws com.liferay.portal.kernel.exception.PortalException { 358 return getService().getEntry(className, classPK); 359 } 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 with the primary key 366 * @throws PortalException if a trash entry with the primary key could not 367 be found 368 */ 369 public static com.liferay.portlet.trash.model.TrashEntry getEntry( 370 long entryId) 371 throws com.liferay.portal.kernel.exception.PortalException { 372 return getService().getEntry(entryId); 373 } 374 375 public static com.liferay.portal.model.PersistedModel getPersistedModel( 376 java.io.Serializable primaryKeyObj) 377 throws com.liferay.portal.kernel.exception.PortalException { 378 return getService().getPersistedModel(primaryKeyObj); 379 } 380 381 /** 382 * Returns a range of all the trash entries. 383 * 384 * <p> 385 * 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. 386 * </p> 387 * 388 * @param start the lower bound of the range of trash entries 389 * @param end the upper bound of the range of trash entries (not inclusive) 390 * @return the range of trash entries 391 */ 392 public static java.util.List<com.liferay.portlet.trash.model.TrashEntry> getTrashEntries( 393 int start, int end) { 394 return getService().getTrashEntries(start, end); 395 } 396 397 /** 398 * Returns the number of trash entries. 399 * 400 * @return the number of trash entries 401 */ 402 public static int getTrashEntriesCount() { 403 return getService().getTrashEntriesCount(); 404 } 405 406 /** 407 * Returns the trash entry with the primary key. 408 * 409 * @param entryId the primary key of the trash entry 410 * @return the trash entry 411 * @throws PortalException if a trash entry with the primary key could not be found 412 */ 413 public static com.liferay.portlet.trash.model.TrashEntry getTrashEntry( 414 long entryId) 415 throws com.liferay.portal.kernel.exception.PortalException { 416 return getService().getTrashEntry(entryId); 417 } 418 419 public static com.liferay.portal.kernel.search.Hits search(long companyId, 420 long groupId, long userId, java.lang.String keywords, int start, 421 int end, com.liferay.portal.kernel.search.Sort sort) { 422 return getService() 423 .search(companyId, groupId, userId, keywords, start, end, 424 sort); 425 } 426 427 public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portlet.trash.model.TrashEntry> searchTrashEntries( 428 long companyId, long groupId, long userId, java.lang.String keywords, 429 int start, int end, com.liferay.portal.kernel.search.Sort sort) { 430 return getService() 431 .searchTrashEntries(companyId, groupId, userId, keywords, 432 start, end, sort); 433 } 434 435 /** 436 * Sets the Spring bean ID for this bean. 437 * 438 * @param beanIdentifier the Spring bean ID for this bean 439 */ 440 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 441 getService().setBeanIdentifier(beanIdentifier); 442 } 443 444 /** 445 * Updates the trash entry in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 446 * 447 * @param trashEntry the trash entry 448 * @return the trash entry that was updated 449 */ 450 public static com.liferay.portlet.trash.model.TrashEntry updateTrashEntry( 451 com.liferay.portlet.trash.model.TrashEntry trashEntry) { 452 return getService().updateTrashEntry(trashEntry); 453 } 454 455 public static TrashEntryLocalService getService() { 456 if (_service == null) { 457 _service = (TrashEntryLocalService)PortalBeanLocatorUtil.locate(TrashEntryLocalService.class.getName()); 458 459 ReferenceRegistry.registerReference(TrashEntryLocalServiceUtil.class, 460 "_service"); 461 } 462 463 return _service; 464 } 465 466 /** 467 * @deprecated As of 6.2.0 468 */ 469 @Deprecated 470 public void setService(TrashEntryLocalService service) { 471 } 472 473 private static TrashEntryLocalService _service; 474 }