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