Liferay 7.0-ce-b4

com.liferay.portlet.messageboards.service
Class MBThreadLocalServiceUtil

java.lang.Object
  extended by com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil

@ProviderType
public class MBThreadLocalServiceUtil
extends Object

Provides the local service utility for MBThread. This utility wraps com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl and is the primary access point for service operations in application layer code running on the local server. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.

See Also:
MBThreadLocalService, com.liferay.portlet.messageboards.service.base.MBThreadLocalServiceBaseImpl, com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl

Constructor Summary
MBThreadLocalServiceUtil()
           
 
Method Summary
static MBThread addMBThread(MBThread mbThread)
          Adds the message boards thread to the database.
static MBThread addThread(long categoryId, MBMessage message, ServiceContext serviceContext)
           
static MBThread createMBThread(long threadId)
          Creates a new message boards thread with the primary key.
static MBThread deleteMBThread(long threadId)
          Deletes the message boards thread with the primary key from the database.
static MBThread deleteMBThread(MBThread mbThread)
          Deletes the message boards thread from the database.
static PersistedModel deletePersistedModel(PersistedModel persistedModel)
           
static void deleteThread(long threadId)
           
static void deleteThread(MBThread thread)
           
static void deleteThreads(long groupId, long categoryId)
           
static void deleteThreads(long groupId, long categoryId, boolean includeTrashedEntries)
           
static DynamicQuery dynamicQuery()
           
static
<T> List<T>
dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
static
<T> List<T>
dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
static
<T> List<T>
dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
static long dynamicQueryCount(DynamicQuery dynamicQuery)
          Returns the number of rows matching the dynamic query.
static long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
          Returns the number of rows matching the dynamic query.
static MBThread fetchMBThread(long threadId)
           
static MBThread fetchMBThreadByUuidAndGroupId(String uuid, long groupId)
          Returns the message boards thread matching the UUID and group.
static MBThread fetchThread(long threadId)
           
static ActionableDynamicQuery getActionableDynamicQuery()
           
static int getCategoryThreadsCount(long groupId, long categoryId, int status)
           
static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
           
static List<MBThread> getGroupThreads(long groupId, int status, int start, int end)
          Deprecated. As of 6.2.0, replaced by getGroupThreads(long, QueryDefinition)
static List<MBThread> getGroupThreads(long groupId, long userId, boolean subscribed, boolean includeAnonymous, QueryDefinition<MBThread> queryDefinition)
           
static List<MBThread> getGroupThreads(long groupId, long userId, boolean subscribed, QueryDefinition<MBThread> queryDefinition)
           
static List<MBThread> getGroupThreads(long groupId, long userId, int status, boolean subscribed, boolean includeAnonymous, int start, int end)
          Deprecated. As of 6.2.0, replaced by getGroupThreads(long, long, boolean, boolean, QueryDefinition)
static List<MBThread> getGroupThreads(long groupId, long userId, int status, boolean subscribed, int start, int end)
          Deprecated. As of 6.2.0, replaced by getGroupThreads(long, long, boolean, QueryDefinition)
static List<MBThread> getGroupThreads(long groupId, long userId, int status, int start, int end)
          Deprecated. As of 6.2.0, replaced by getGroupThreads(long, long, QueryDefinition)
static List<MBThread> getGroupThreads(long groupId, long userId, QueryDefinition<MBThread> queryDefinition)
           
static List<MBThread> getGroupThreads(long groupId, QueryDefinition<MBThread> queryDefinition)
           
static int getGroupThreadsCount(long groupId, int status)
          Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, QueryDefinition)
static int getGroupThreadsCount(long groupId, long userId, boolean subscribed, boolean includeAnonymous, QueryDefinition<MBThread> queryDefinition)
           
static int getGroupThreadsCount(long groupId, long userId, boolean subscribed, QueryDefinition<MBThread> queryDefinition)
           
static int getGroupThreadsCount(long groupId, long userId, int status)
          Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, long, QueryDefinition)
static int getGroupThreadsCount(long groupId, long userId, int status, boolean subscribed)
          Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, long, boolean, QueryDefinition)
static int getGroupThreadsCount(long groupId, long userId, int status, boolean subscribed, boolean includeAnonymous)
          Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, long, boolean, boolean, QueryDefinition)
static int getGroupThreadsCount(long groupId, long userId, QueryDefinition<MBThread> queryDefinition)
           
static int getGroupThreadsCount(long groupId, QueryDefinition<MBThread> queryDefinition)
           
static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
           
static MBThread getMBThread(long threadId)
          Returns the message boards thread with the primary key.
static MBThread getMBThreadByUuidAndGroupId(String uuid, long groupId)
          Returns the message boards thread matching the UUID and group.
static List<MBThread> getMBThreads(int start, int end)
          Returns a range of all the message boards threads.
static List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid, long companyId)
          Returns all the message boards threads matching the UUID and company.
static List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid, long companyId, int start, int end, OrderByComparator<MBThread> orderByComparator)
          Returns a range of message boards threads matching the UUID and company.
static int getMBThreadsCount()
          Returns the number of message boards threads.
static List<MBThread> getNoAssetThreads()
           
static String getOSGiServiceIdentifier()
          Returns the OSGi service identifier.
static PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
static List<MBThread> getPriorityThreads(long categoryId, double priority)
           
static List<MBThread> getPriorityThreads(long categoryId, double priority, boolean inherit)
           
static MBThreadLocalService getService()
           
static MBThread getThread(long threadId)
           
static List<MBThread> getThreads(long groupId, long categoryId, int status, int start, int end)
           
static int getThreadsCount(long groupId, long categoryId, int status)
           
static boolean hasAnswerMessage(long threadId)
           
static void incrementViewCounter(long threadId, int increment)
           
static void moveDependentsToTrash(long groupId, long threadId, long trashEntryId)
           
static MBThread moveThread(long groupId, long categoryId, long threadId)
           
static MBThread moveThreadFromTrash(long userId, long categoryId, long threadId)
           
static void moveThreadsToTrash(long groupId, long userId)
           
static MBThread moveThreadToTrash(long userId, long threadId)
           
static MBThread moveThreadToTrash(long userId, MBThread thread)
           
static void restoreDependentsFromTrash(long groupId, long threadId)
           
static void restoreDependentsFromTrash(long groupId, long threadId, long trashEntryId)
          Deprecated. As of 7.0.0, replaced by restoreDependentsFromTrash(long, long)
static void restoreThreadFromTrash(long userId, long threadId)
           
static Hits search(long groupId, long userId, long creatorUserId, int status, int start, int end)
           
static Hits search(long groupId, long userId, long creatorUserId, long startDate, long endDate, int status, int start, int end)
           
static MBThread splitThread(long userId, long messageId, String subject, ServiceContext serviceContext)
           
static MBThread updateMBThread(MBThread mbThread)
          Updates the message boards thread in the database or adds it if it does not yet exist.
static MBThread updateMessageCount(long threadId)
           
static void updateQuestion(long threadId, boolean question)
           
static MBThread updateStatus(long userId, long threadId, int status)
           
static MBThread updateThread(long threadId, int viewCount)
          Deprecated. As of 6.2.0, replaced by incrementViewCounter(long, int)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBThreadLocalServiceUtil

public MBThreadLocalServiceUtil()
Method Detail

addMBThread

public static MBThread addMBThread(MBThread mbThread)
Adds the message boards thread to the database. Also notifies the appropriate model listeners.

Parameters:
mbThread - the message boards thread
Returns:
the message boards thread that was added

addThread

public static MBThread addThread(long categoryId,
                                 MBMessage message,
                                 ServiceContext serviceContext)
                          throws PortalException
Throws:
PortalException

createMBThread

public static MBThread createMBThread(long threadId)
Creates a new message boards thread with the primary key. Does not add the message boards thread to the database.

Parameters:
threadId - the primary key for the new message boards thread
Returns:
the new message boards thread

deleteMBThread

public static MBThread deleteMBThread(MBThread mbThread)
Deletes the message boards thread from the database. Also notifies the appropriate model listeners.

Parameters:
mbThread - the message boards thread
Returns:
the message boards thread that was removed

deleteMBThread

public static MBThread deleteMBThread(long threadId)
                               throws PortalException
Deletes the message boards thread with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
threadId - the primary key of the message boards thread
Returns:
the message boards thread that was removed
Throws:
PortalException - if a message boards thread with the primary key could not be found

deletePersistedModel

public static PersistedModel deletePersistedModel(PersistedModel persistedModel)
                                           throws PortalException
Throws:
PortalException

deleteThread

public static void deleteThread(MBThread thread)
                         throws PortalException
Throws:
PortalException

deleteThread

public static void deleteThread(long threadId)
                         throws PortalException
Throws:
PortalException

deleteThreads

public static void deleteThreads(long groupId,
                                 long categoryId)
                          throws PortalException
Throws:
PortalException

deleteThreads

public static void deleteThreads(long groupId,
                                 long categoryId,
                                 boolean includeTrashedEntries)
                          throws PortalException
Throws:
PortalException

dynamicQuery

public static DynamicQuery dynamicQuery()

dynamicQuery

public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query
Returns:
the matching rows

dynamicQuery

public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery,
                                       int start,
                                       int end)
Performs a dynamic query on the database and returns a range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from com.liferay.portlet.messageboards.model.impl.MBThreadModelImpl. If both orderByComparator 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.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
Returns:
the range of matching rows

dynamicQuery

public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery,
                                       int start,
                                       int end,
                                       OrderByComparator<T> orderByComparator)
Performs a dynamic query on the database and returns an ordered range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from com.liferay.portlet.messageboards.model.impl.MBThreadModelImpl. If both orderByComparator 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.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching rows

dynamicQueryCount

public static long dynamicQueryCount(DynamicQuery dynamicQuery)
Returns the number of rows matching the dynamic query.

Parameters:
dynamicQuery - the dynamic query
Returns:
the number of rows matching the dynamic query

dynamicQueryCount

public static long dynamicQueryCount(DynamicQuery dynamicQuery,
                                     Projection projection)
Returns the number of rows matching the dynamic query.

Parameters:
dynamicQuery - the dynamic query
projection - the projection to apply to the query
Returns:
the number of rows matching the dynamic query

fetchMBThread

public static MBThread fetchMBThread(long threadId)

fetchMBThreadByUuidAndGroupId

public static MBThread fetchMBThreadByUuidAndGroupId(String uuid,
                                                     long groupId)
Returns the message boards thread matching the UUID and group.

Parameters:
uuid - the message boards thread's UUID
groupId - the primary key of the group
Returns:
the matching message boards thread, or null if a matching message boards thread could not be found

fetchThread

public static MBThread fetchThread(long threadId)

getActionableDynamicQuery

public static ActionableDynamicQuery getActionableDynamicQuery()

getCategoryThreadsCount

public static int getCategoryThreadsCount(long groupId,
                                          long categoryId,
                                          int status)

getExportActionableDynamicQuery

public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)

getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             QueryDefinition<MBThread> queryDefinition)

getGroupThreads

@Deprecated
public static List<MBThread> getGroupThreads(long groupId,
                                                        int status,
                                                        int start,
                                                        int end)
Deprecated. As of 6.2.0, replaced by getGroupThreads(long, QueryDefinition)


getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             long userId,
                                             QueryDefinition<MBThread> queryDefinition)

getGroupThreads

@Deprecated
public static List<MBThread> getGroupThreads(long groupId,
                                                        long userId,
                                                        int status,
                                                        int start,
                                                        int end)
Deprecated. As of 6.2.0, replaced by getGroupThreads(long, long, QueryDefinition)


getGroupThreads

@Deprecated
public static List<MBThread> getGroupThreads(long groupId,
                                                        long userId,
                                                        int status,
                                                        boolean subscribed,
                                                        boolean includeAnonymous,
                                                        int start,
                                                        int end)
Deprecated. As of 6.2.0, replaced by getGroupThreads(long, long, boolean, boolean, QueryDefinition)


getGroupThreads

@Deprecated
public static List<MBThread> getGroupThreads(long groupId,
                                                        long userId,
                                                        int status,
                                                        boolean subscribed,
                                                        int start,
                                                        int end)
Deprecated. As of 6.2.0, replaced by getGroupThreads(long, long, boolean, QueryDefinition)


getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             long userId,
                                             boolean subscribed,
                                             boolean includeAnonymous,
                                             QueryDefinition<MBThread> queryDefinition)

getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             long userId,
                                             boolean subscribed,
                                             QueryDefinition<MBThread> queryDefinition)

getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       QueryDefinition<MBThread> queryDefinition)

getGroupThreadsCount

@Deprecated
public static int getGroupThreadsCount(long groupId,
                                                  int status)
Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, QueryDefinition)


getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       long userId,
                                       QueryDefinition<MBThread> queryDefinition)

getGroupThreadsCount

@Deprecated
public static int getGroupThreadsCount(long groupId,
                                                  long userId,
                                                  int status)
Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, long, QueryDefinition)


getGroupThreadsCount

@Deprecated
public static int getGroupThreadsCount(long groupId,
                                                  long userId,
                                                  int status,
                                                  boolean subscribed)
Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, long, boolean, QueryDefinition)


getGroupThreadsCount

@Deprecated
public static int getGroupThreadsCount(long groupId,
                                                  long userId,
                                                  int status,
                                                  boolean subscribed,
                                                  boolean includeAnonymous)
Deprecated. As of 6.2.0, replaced by getGroupThreadsCount(long, long, boolean, boolean, QueryDefinition)


getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       long userId,
                                       boolean subscribed,
                                       boolean includeAnonymous,
                                       QueryDefinition<MBThread> queryDefinition)

getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       long userId,
                                       boolean subscribed,
                                       QueryDefinition<MBThread> queryDefinition)

getIndexableActionableDynamicQuery

public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()

getMBThread

public static MBThread getMBThread(long threadId)
                            throws PortalException
Returns the message boards thread with the primary key.

Parameters:
threadId - the primary key of the message boards thread
Returns:
the message boards thread
Throws:
PortalException - if a message boards thread with the primary key could not be found

getMBThreadByUuidAndGroupId

public static MBThread getMBThreadByUuidAndGroupId(String uuid,
                                                   long groupId)
                                            throws PortalException
Returns the message boards thread matching the UUID and group.

Parameters:
uuid - the message boards thread's UUID
groupId - the primary key of the group
Returns:
the matching message boards thread
Throws:
PortalException - if a matching message boards thread could not be found

getMBThreads

public static List<MBThread> getMBThreads(int start,
                                          int end)
Returns a range of all the message boards threads.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from com.liferay.portlet.messageboards.model.impl.MBThreadModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of message boards threads
end - the upper bound of the range of message boards threads (not inclusive)
Returns:
the range of message boards threads

getMBThreadsByUuidAndCompanyId

public static List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid,
                                                            long companyId)
Returns all the message boards threads matching the UUID and company.

Parameters:
uuid - the UUID of the message boards threads
companyId - the primary key of the company
Returns:
the matching message boards threads, or an empty list if no matches were found

getMBThreadsByUuidAndCompanyId

public static List<MBThread> getMBThreadsByUuidAndCompanyId(String uuid,
                                                            long companyId,
                                                            int start,
                                                            int end,
                                                            OrderByComparator<MBThread> orderByComparator)
Returns a range of message boards threads matching the UUID and company.

Parameters:
uuid - the UUID of the message boards threads
companyId - the primary key of the company
start - the lower bound of the range of message boards threads
end - the upper bound of the range of message boards threads (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the range of matching message boards threads, or an empty list if no matches were found

getMBThreadsCount

public static int getMBThreadsCount()
Returns the number of message boards threads.

Returns:
the number of message boards threads

getNoAssetThreads

public static List<MBThread> getNoAssetThreads()

getOSGiServiceIdentifier

public static String getOSGiServiceIdentifier()
Returns the OSGi service identifier.

Returns:
the OSGi service identifier

getPersistedModel

public static PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                        throws PortalException
Throws:
PortalException

getPriorityThreads

public static List<MBThread> getPriorityThreads(long categoryId,
                                                double priority)
                                         throws PortalException
Throws:
PortalException

getPriorityThreads

public static List<MBThread> getPriorityThreads(long categoryId,
                                                double priority,
                                                boolean inherit)
                                         throws PortalException
Throws:
PortalException

getThread

public static MBThread getThread(long threadId)
                          throws PortalException
Throws:
PortalException

getThreads

public static List<MBThread> getThreads(long groupId,
                                        long categoryId,
                                        int status,
                                        int start,
                                        int end)

getThreadsCount

public static int getThreadsCount(long groupId,
                                  long categoryId,
                                  int status)

hasAnswerMessage

public static boolean hasAnswerMessage(long threadId)

incrementViewCounter

public static void incrementViewCounter(long threadId,
                                        int increment)
                                 throws PortalException
Throws:
PortalException

moveDependentsToTrash

public static void moveDependentsToTrash(long groupId,
                                         long threadId,
                                         long trashEntryId)
                                  throws PortalException
Throws:
PortalException

moveThread

public static MBThread moveThread(long groupId,
                                  long categoryId,
                                  long threadId)
                           throws PortalException
Throws:
PortalException

moveThreadFromTrash

public static MBThread moveThreadFromTrash(long userId,
                                           long categoryId,
                                           long threadId)
                                    throws PortalException
Throws:
PortalException

moveThreadToTrash

public static MBThread moveThreadToTrash(long userId,
                                         MBThread thread)
                                  throws PortalException
Throws:
PortalException

moveThreadToTrash

public static MBThread moveThreadToTrash(long userId,
                                         long threadId)
                                  throws PortalException
Throws:
PortalException

moveThreadsToTrash

public static void moveThreadsToTrash(long groupId,
                                      long userId)
                               throws PortalException
Throws:
PortalException

restoreDependentsFromTrash

public static void restoreDependentsFromTrash(long groupId,
                                              long threadId)
                                       throws PortalException
Throws:
PortalException

restoreDependentsFromTrash

@Deprecated
public static void restoreDependentsFromTrash(long groupId,
                                                         long threadId,
                                                         long trashEntryId)
                                       throws PortalException
Deprecated. As of 7.0.0, replaced by restoreDependentsFromTrash(long, long)

Throws:
PortalException

restoreThreadFromTrash

public static void restoreThreadFromTrash(long userId,
                                          long threadId)
                                   throws PortalException
Throws:
PortalException

search

public static Hits search(long groupId,
                          long userId,
                          long creatorUserId,
                          long startDate,
                          long endDate,
                          int status,
                          int start,
                          int end)
                   throws PortalException
Throws:
PortalException

search

public static Hits search(long groupId,
                          long userId,
                          long creatorUserId,
                          int status,
                          int start,
                          int end)
                   throws PortalException
Throws:
PortalException

splitThread

public static MBThread splitThread(long userId,
                                   long messageId,
                                   String subject,
                                   ServiceContext serviceContext)
                            throws PortalException
Throws:
PortalException

updateMBThread

public static MBThread updateMBThread(MBThread mbThread)
Updates the message boards thread in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
mbThread - the message boards thread
Returns:
the message boards thread that was updated

updateMessageCount

public static MBThread updateMessageCount(long threadId)

updateQuestion

public static void updateQuestion(long threadId,
                                  boolean question)
                           throws PortalException
Throws:
PortalException

updateStatus

public static MBThread updateStatus(long userId,
                                    long threadId,
                                    int status)
                             throws PortalException
Throws:
PortalException

updateThread

@Deprecated
public static MBThread updateThread(long threadId,
                                               int viewCount)
                             throws PortalException
Deprecated. As of 6.2.0, replaced by incrementViewCounter(long, int)

Throws:
PortalException

getService

public static MBThreadLocalService getService()

Liferay 7.0-ce-b4