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.message.boards.kernel.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 MBDiscussion. This utility wraps 024 * {@link com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl} 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 MBDiscussionLocalService 032 * @see com.liferay.portlet.messageboards.service.base.MBDiscussionLocalServiceBaseImpl 033 * @see com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class MBDiscussionLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBDiscussionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * @deprecated As of 7.0.0, replaced by {@link #addDiscussion(long, long, 046 long, long, long, ServiceContext)} 047 */ 048 @Deprecated 049 public static com.liferay.message.boards.kernel.model.MBDiscussion addDiscussion( 050 long userId, long classNameId, long classPK, long threadId, 051 com.liferay.portal.kernel.service.ServiceContext serviceContext) 052 throws com.liferay.portal.kernel.exception.PortalException { 053 return getService() 054 .addDiscussion(userId, classNameId, classPK, threadId, 055 serviceContext); 056 } 057 058 public static com.liferay.message.boards.kernel.model.MBDiscussion addDiscussion( 059 long userId, long groupId, long classNameId, long classPK, 060 long threadId, 061 com.liferay.portal.kernel.service.ServiceContext serviceContext) 062 throws com.liferay.portal.kernel.exception.PortalException { 063 return getService() 064 .addDiscussion(userId, groupId, classNameId, classPK, 065 threadId, serviceContext); 066 } 067 068 /** 069 * Adds the message boards discussion to the database. Also notifies the appropriate model listeners. 070 * 071 * @param mbDiscussion the message boards discussion 072 * @return the message boards discussion that was added 073 */ 074 public static com.liferay.message.boards.kernel.model.MBDiscussion addMBDiscussion( 075 com.liferay.message.boards.kernel.model.MBDiscussion mbDiscussion) { 076 return getService().addMBDiscussion(mbDiscussion); 077 } 078 079 /** 080 * Creates a new message boards discussion with the primary key. Does not add the message boards discussion to the database. 081 * 082 * @param discussionId the primary key for the new message boards discussion 083 * @return the new message boards discussion 084 */ 085 public static com.liferay.message.boards.kernel.model.MBDiscussion createMBDiscussion( 086 long discussionId) { 087 return getService().createMBDiscussion(discussionId); 088 } 089 090 /** 091 * Deletes the message boards discussion from the database. Also notifies the appropriate model listeners. 092 * 093 * @param mbDiscussion the message boards discussion 094 * @return the message boards discussion that was removed 095 */ 096 public static com.liferay.message.boards.kernel.model.MBDiscussion deleteMBDiscussion( 097 com.liferay.message.boards.kernel.model.MBDiscussion mbDiscussion) { 098 return getService().deleteMBDiscussion(mbDiscussion); 099 } 100 101 /** 102 * Deletes the message boards discussion with the primary key from the database. Also notifies the appropriate model listeners. 103 * 104 * @param discussionId the primary key of the message boards discussion 105 * @return the message boards discussion that was removed 106 * @throws PortalException if a message boards discussion with the primary key could not be found 107 */ 108 public static com.liferay.message.boards.kernel.model.MBDiscussion deleteMBDiscussion( 109 long discussionId) 110 throws com.liferay.portal.kernel.exception.PortalException { 111 return getService().deleteMBDiscussion(discussionId); 112 } 113 114 public static com.liferay.message.boards.kernel.model.MBDiscussion fetchDiscussion( 115 java.lang.String className, long classPK) { 116 return getService().fetchDiscussion(className, classPK); 117 } 118 119 public static com.liferay.message.boards.kernel.model.MBDiscussion fetchDiscussion( 120 long discussionId) { 121 return getService().fetchDiscussion(discussionId); 122 } 123 124 public static com.liferay.message.boards.kernel.model.MBDiscussion fetchMBDiscussion( 125 long discussionId) { 126 return getService().fetchMBDiscussion(discussionId); 127 } 128 129 /** 130 * Returns the message boards discussion matching the UUID and group. 131 * 132 * @param uuid the message boards discussion's UUID 133 * @param groupId the primary key of the group 134 * @return the matching message boards discussion, or <code>null</code> if a matching message boards discussion could not be found 135 */ 136 public static com.liferay.message.boards.kernel.model.MBDiscussion fetchMBDiscussionByUuidAndGroupId( 137 java.lang.String uuid, long groupId) { 138 return getService().fetchMBDiscussionByUuidAndGroupId(uuid, groupId); 139 } 140 141 public static com.liferay.message.boards.kernel.model.MBDiscussion fetchThreadDiscussion( 142 long threadId) { 143 return getService().fetchThreadDiscussion(threadId); 144 } 145 146 public static com.liferay.message.boards.kernel.model.MBDiscussion getDiscussion( 147 java.lang.String className, long classPK) 148 throws com.liferay.portal.kernel.exception.PortalException { 149 return getService().getDiscussion(className, classPK); 150 } 151 152 public static com.liferay.message.boards.kernel.model.MBDiscussion getDiscussion( 153 long discussionId) 154 throws com.liferay.portal.kernel.exception.PortalException { 155 return getService().getDiscussion(discussionId); 156 } 157 158 /** 159 * Returns the message boards discussion with the primary key. 160 * 161 * @param discussionId the primary key of the message boards discussion 162 * @return the message boards discussion 163 * @throws PortalException if a message boards discussion with the primary key could not be found 164 */ 165 public static com.liferay.message.boards.kernel.model.MBDiscussion getMBDiscussion( 166 long discussionId) 167 throws com.liferay.portal.kernel.exception.PortalException { 168 return getService().getMBDiscussion(discussionId); 169 } 170 171 /** 172 * Returns the message boards discussion matching the UUID and group. 173 * 174 * @param uuid the message boards discussion's UUID 175 * @param groupId the primary key of the group 176 * @return the matching message boards discussion 177 * @throws PortalException if a matching message boards discussion could not be found 178 */ 179 public static com.liferay.message.boards.kernel.model.MBDiscussion getMBDiscussionByUuidAndGroupId( 180 java.lang.String uuid, long groupId) 181 throws com.liferay.portal.kernel.exception.PortalException { 182 return getService().getMBDiscussionByUuidAndGroupId(uuid, groupId); 183 } 184 185 public static com.liferay.message.boards.kernel.model.MBDiscussion getThreadDiscussion( 186 long threadId) 187 throws com.liferay.portal.kernel.exception.PortalException { 188 return getService().getThreadDiscussion(threadId); 189 } 190 191 /** 192 * Updates the message boards discussion in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 193 * 194 * @param mbDiscussion the message boards discussion 195 * @return the message boards discussion that was updated 196 */ 197 public static com.liferay.message.boards.kernel.model.MBDiscussion updateMBDiscussion( 198 com.liferay.message.boards.kernel.model.MBDiscussion mbDiscussion) { 199 return getService().updateMBDiscussion(mbDiscussion); 200 } 201 202 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 203 return getService().getActionableDynamicQuery(); 204 } 205 206 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 207 return getService().dynamicQuery(); 208 } 209 210 public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 211 com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) { 212 return getService().getExportActionableDynamicQuery(portletDataContext); 213 } 214 215 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 216 return getService().getIndexableActionableDynamicQuery(); 217 } 218 219 /** 220 * @throws PortalException 221 */ 222 public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( 223 com.liferay.portal.kernel.model.PersistedModel persistedModel) 224 throws com.liferay.portal.kernel.exception.PortalException { 225 return getService().deletePersistedModel(persistedModel); 226 } 227 228 public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel( 229 java.io.Serializable primaryKeyObj) 230 throws com.liferay.portal.kernel.exception.PortalException { 231 return getService().getPersistedModel(primaryKeyObj); 232 } 233 234 /** 235 * Returns the number of message boards discussions. 236 * 237 * @return the number of message boards discussions 238 */ 239 public static int getMBDiscussionsCount() { 240 return getService().getMBDiscussionsCount(); 241 } 242 243 /** 244 * Returns the OSGi service identifier. 245 * 246 * @return the OSGi service identifier 247 */ 248 public static java.lang.String getOSGiServiceIdentifier() { 249 return getService().getOSGiServiceIdentifier(); 250 } 251 252 /** 253 * Performs a dynamic query on the database and returns the matching rows. 254 * 255 * @param dynamicQuery the dynamic query 256 * @return the matching rows 257 */ 258 public static <T> java.util.List<T> dynamicQuery( 259 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 260 return getService().dynamicQuery(dynamicQuery); 261 } 262 263 /** 264 * Performs a dynamic query on the database and returns a range of the matching rows. 265 * 266 * <p> 267 * 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.messageboards.model.impl.MBDiscussionModelImpl}. 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. 268 * </p> 269 * 270 * @param dynamicQuery the dynamic query 271 * @param start the lower bound of the range of model instances 272 * @param end the upper bound of the range of model instances (not inclusive) 273 * @return the range of matching rows 274 */ 275 public static <T> java.util.List<T> dynamicQuery( 276 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 277 int end) { 278 return getService().dynamicQuery(dynamicQuery, start, end); 279 } 280 281 /** 282 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 283 * 284 * <p> 285 * 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.messageboards.model.impl.MBDiscussionModelImpl}. 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. 286 * </p> 287 * 288 * @param dynamicQuery the dynamic query 289 * @param start the lower bound of the range of model instances 290 * @param end the upper bound of the range of model instances (not inclusive) 291 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 292 * @return the ordered range of matching rows 293 */ 294 public static <T> java.util.List<T> dynamicQuery( 295 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 296 int end, 297 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 298 return getService() 299 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 300 } 301 302 /** 303 * Returns a range of all the message boards discussions. 304 * 305 * <p> 306 * 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.messageboards.model.impl.MBDiscussionModelImpl}. 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. 307 * </p> 308 * 309 * @param start the lower bound of the range of message boards discussions 310 * @param end the upper bound of the range of message boards discussions (not inclusive) 311 * @return the range of message boards discussions 312 */ 313 public static java.util.List<com.liferay.message.boards.kernel.model.MBDiscussion> getMBDiscussions( 314 int start, int end) { 315 return getService().getMBDiscussions(start, end); 316 } 317 318 /** 319 * Returns all the message boards discussions matching the UUID and company. 320 * 321 * @param uuid the UUID of the message boards discussions 322 * @param companyId the primary key of the company 323 * @return the matching message boards discussions, or an empty list if no matches were found 324 */ 325 public static java.util.List<com.liferay.message.boards.kernel.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId( 326 java.lang.String uuid, long companyId) { 327 return getService().getMBDiscussionsByUuidAndCompanyId(uuid, companyId); 328 } 329 330 /** 331 * Returns a range of message boards discussions matching the UUID and company. 332 * 333 * @param uuid the UUID of the message boards discussions 334 * @param companyId the primary key of the company 335 * @param start the lower bound of the range of message boards discussions 336 * @param end the upper bound of the range of message boards discussions (not inclusive) 337 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 338 * @return the range of matching message boards discussions, or an empty list if no matches were found 339 */ 340 public static java.util.List<com.liferay.message.boards.kernel.model.MBDiscussion> getMBDiscussionsByUuidAndCompanyId( 341 java.lang.String uuid, long companyId, int start, int end, 342 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.message.boards.kernel.model.MBDiscussion> orderByComparator) { 343 return getService() 344 .getMBDiscussionsByUuidAndCompanyId(uuid, companyId, start, 345 end, orderByComparator); 346 } 347 348 /** 349 * Returns the number of rows matching the dynamic query. 350 * 351 * @param dynamicQuery the dynamic query 352 * @return the number of rows matching the dynamic query 353 */ 354 public static long dynamicQueryCount( 355 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 356 return getService().dynamicQueryCount(dynamicQuery); 357 } 358 359 /** 360 * Returns the number of rows matching the dynamic query. 361 * 362 * @param dynamicQuery the dynamic query 363 * @param projection the projection to apply to the query 364 * @return the number of rows matching the dynamic query 365 */ 366 public static long dynamicQueryCount( 367 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 368 com.liferay.portal.kernel.dao.orm.Projection projection) { 369 return getService().dynamicQueryCount(dynamicQuery, projection); 370 } 371 372 public static void subscribeDiscussion(long userId, long groupId, 373 java.lang.String className, long classPK) 374 throws com.liferay.portal.kernel.exception.PortalException { 375 getService().subscribeDiscussion(userId, groupId, className, classPK); 376 } 377 378 public static void unsubscribeDiscussion(long userId, 379 java.lang.String className, long classPK) 380 throws com.liferay.portal.kernel.exception.PortalException { 381 getService().unsubscribeDiscussion(userId, className, classPK); 382 } 383 384 public static MBDiscussionLocalService getService() { 385 if (_service == null) { 386 _service = (MBDiscussionLocalService)PortalBeanLocatorUtil.locate(MBDiscussionLocalService.class.getName()); 387 388 ReferenceRegistry.registerReference(MBDiscussionLocalServiceUtil.class, 389 "_service"); 390 } 391 392 return _service; 393 } 394 395 private static MBDiscussionLocalService _service; 396 }