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