public class KBArticleLocalServiceUtil
extends java.lang.Object
com.liferay.knowledge.base.service.impl.KBArticleLocalServiceImpl and
is an 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.KBArticleLocalService| Constructor and Description |
|---|
KBArticleLocalServiceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static FileEntry |
addAttachment(long userId,
long resourcePrimKey,
java.lang.String fileName,
java.io.InputStream inputStream,
java.lang.String mimeType) |
static KBArticle |
addKBArticle(KBArticle kbArticle)
Adds the kb article to the database.
|
static KBArticle |
addKBArticle(long userId,
long parentResourceClassNameId,
long parentResourcePrimKey,
java.lang.String title,
java.lang.String urlTitle,
java.lang.String content,
java.lang.String description,
java.lang.String sourceURL,
java.lang.String[] sections,
java.lang.String[] selectedFileNames,
ServiceContext serviceContext) |
static void |
addKBArticleResources(KBArticle kbArticle,
boolean addGroupPermissions,
boolean addGuestPermissions) |
static void |
addKBArticleResources(KBArticle kbArticle,
ModelPermissions modelPermissions) |
static void |
addKBArticleResources(long kbArticleId,
boolean addGroupPermissions,
boolean addGuestPermissions) |
static int |
addKBArticlesMarkdown(long userId,
long groupId,
long parentKbFolderId,
java.lang.String fileName,
boolean prioritizeByNumericalPrefix,
java.io.InputStream inputStream,
ServiceContext serviceContext) |
static void |
addTempAttachment(long groupId,
long userId,
java.lang.String fileName,
java.lang.String tempFolderName,
java.io.InputStream inputStream,
java.lang.String mimeType) |
static KBArticle |
createKBArticle(long kbArticleId)
Creates a new kb article with the primary key.
|
static PersistedModel |
createPersistedModel(java.io.Serializable primaryKeyObj) |
static void |
deleteGroupKBArticles(long groupId) |
static KBArticle |
deleteKBArticle(KBArticle kbArticle)
Deletes the kb article from the database.
|
static KBArticle |
deleteKBArticle(long kbArticleId)
Deletes the kb article with the primary key from the database.
|
static void |
deleteKBArticles(long[] resourcePrimKeys) |
static void |
deleteKBArticles(long groupId,
long parentResourcePrimKey) |
static PersistedModel |
deletePersistedModel(PersistedModel persistedModel) |
static void |
deleteTempAttachment(long groupId,
long userId,
java.lang.String fileName,
java.lang.String tempFolderName) |
static <T> T |
dslQuery(DSLQuery dslQuery) |
static DynamicQuery |
dynamicQuery() |
static <T> java.util.List<T> |
dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.
|
static <T> java.util.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> java.util.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 KBArticle |
fetchFirstChildKBArticle(long groupId,
long parentResourcePrimKey) |
static KBArticle |
fetchKBArticle(long kbArticleId) |
static KBArticle |
fetchKBArticle(long resourcePrimKey,
long groupId,
int version) |
static KBArticle |
fetchKBArticleByUrlTitle(long groupId,
long kbFolderId,
java.lang.String urlTitle) |
static KBArticle |
fetchKBArticleByUrlTitle(long groupId,
java.lang.String kbFolderUrlTitle,
java.lang.String urlTitle) |
static KBArticle |
fetchKBArticleByUuidAndGroupId(java.lang.String uuid,
long groupId)
Returns the kb article matching the UUID and group.
|
static KBArticle |
fetchLatestKBArticle(long resourcePrimKey,
int status) |
static KBArticle |
fetchLatestKBArticle(long resourcePrimKey,
long groupId) |
static KBArticle |
fetchLatestKBArticleByUrlTitle(long groupId,
long kbFolderId,
java.lang.String urlTitle,
int status) |
static ActionableDynamicQuery |
getActionableDynamicQuery() |
static java.util.List<KBArticle> |
getAllDescendantKBArticles(long resourcePrimKey,
int status,
OrderByComparator<KBArticle> orderByComparator) |
static java.util.List<KBArticle> |
getCompanyKBArticles(long companyId,
int status,
int start,
int end,
OrderByComparator<KBArticle> orderByComparator) |
static int |
getCompanyKBArticlesCount(long companyId,
int status) |
static ExportActionableDynamicQuery |
getExportActionableDynamicQuery(PortletDataContext portletDataContext) |
static java.util.List<KBArticle> |
getGroupKBArticles(long groupId,
int status,
int start,
int end,
OrderByComparator<KBArticle> orderByComparator) |
static int |
getGroupKBArticlesCount(long groupId,
int status) |
static IndexableActionableDynamicQuery |
getIndexableActionableDynamicQuery() |
static KBArticle |
getKBArticle(long kbArticleId)
Returns the kb article with the primary key.
|
static KBArticle |
getKBArticle(long resourcePrimKey,
int version) |
static java.util.List<KBArticle> |
getKBArticleAndAllDescendantKBArticles(long resourcePrimKey,
int status,
OrderByComparator<KBArticle> orderByComparator) |
static KBArticle |
getKBArticleByUrlTitle(long groupId,
long kbFolderId,
java.lang.String urlTitle) |
static KBArticle |
getKBArticleByUrlTitle(long groupId,
java.lang.String kbFolderUrlTitle,
java.lang.String urlTitle) |
static KBArticle |
getKBArticleByUuidAndGroupId(java.lang.String uuid,
long groupId)
Returns the kb article matching the UUID and group.
|
static java.util.List<KBArticle> |
getKBArticles(int start,
int end)
Returns a range of all the kb articles.
|
static java.util.List<KBArticle> |
getKBArticles(long[] resourcePrimKeys,
int status,
OrderByComparator<KBArticle> orderByComparator) |
static java.util.List<KBArticle> |
getKBArticles(long groupId,
long parentResourcePrimKey,
int status,
int start,
int end,
OrderByComparator<KBArticle> orderByComparator) |
static java.util.List<KBArticle> |
getKBArticlesByUuidAndCompanyId(java.lang.String uuid,
long companyId)
Returns all the kb articles matching the UUID and company.
|
static java.util.List<KBArticle> |
getKBArticlesByUuidAndCompanyId(java.lang.String uuid,
long companyId,
int start,
int end,
OrderByComparator<KBArticle> orderByComparator)
Returns a range of kb articles matching the UUID and company.
|
static int |
getKBArticlesCount()
Returns the number of kb articles.
|
static int |
getKBArticlesCount(long groupId,
long parentResourcePrimKey,
int status) |
static java.util.List<KBArticle> |
getKBArticleVersions(long resourcePrimKey,
int status,
int start,
int end,
OrderByComparator<KBArticle> orderByComparator) |
static int |
getKBArticleVersionsCount(long resourcePrimKey,
int status) |
static java.util.List<KBArticle> |
getKBFolderKBArticles(long groupId,
long kbFolderId) |
static int |
getKBFolderKBArticlesCount(long groupId,
long kbFolderId,
int status) |
static KBArticle |
getLatestKBArticle(long resourcePrimKey,
int status) |
static KBArticle |
getLatestKBArticleByUrlTitle(long groupId,
long kbFolderId,
java.lang.String urlTitle,
int status) |
static java.lang.String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
static java.util.List<? extends PersistedModel> |
getPersistedModel(long resourcePrimKey) |
static PersistedModel |
getPersistedModel(java.io.Serializable primaryKeyObj) |
static KBArticle[] |
getPreviousAndNextKBArticles(long kbArticleId) |
static java.util.List<KBArticle> |
getSectionsKBArticles(long groupId,
java.lang.String[] sections,
int status,
int start,
int end,
OrderByComparator<KBArticle> orderByComparator) |
static int |
getSectionsKBArticlesCount(long groupId,
java.lang.String[] sections,
int status) |
static KBArticleLocalService |
getService() |
static java.lang.String[] |
getTempAttachmentNames(long groupId,
long userId,
java.lang.String tempFolderName) |
static void |
incrementViewCount(long userId,
long resourcePrimKey,
int increment) |
static void |
moveKBArticle(long userId,
long resourcePrimKey,
long parentResourceClassNameId,
long parentResourcePrimKey,
double priority) |
static KBArticle |
revertKBArticle(long userId,
long resourcePrimKey,
int version,
ServiceContext serviceContext) |
static java.util.List<KBArticle> |
search(long groupId,
java.lang.String title,
java.lang.String content,
int status,
java.util.Date startDate,
java.util.Date endDate,
boolean andOperator,
int start,
int end,
OrderByComparator<KBArticle> orderByComparator) |
static void |
subscribeGroupKBArticles(long userId,
long groupId) |
static void |
subscribeKBArticle(long userId,
long groupId,
long resourcePrimKey) |
static void |
unsubscribeGroupKBArticles(long userId,
long groupId) |
static void |
unsubscribeKBArticle(long userId,
long resourcePrimKey) |
static KBArticle |
updateKBArticle(KBArticle kbArticle)
Updates the kb article in the database or adds it if it does not yet exist.
|
static KBArticle |
updateKBArticle(long userId,
long resourcePrimKey,
java.lang.String title,
java.lang.String content,
java.lang.String description,
java.lang.String sourceURL,
java.lang.String[] sections,
java.lang.String[] selectedFileNames,
long[] removeFileEntryIds,
ServiceContext serviceContext) |
static void |
updateKBArticleAsset(long userId,
KBArticle kbArticle,
long[] assetCategoryIds,
java.lang.String[] assetTagNames,
long[] assetLinkEntryIds) |
static void |
updateKBArticleResources(KBArticle kbArticle,
java.lang.String[] groupPermissions,
java.lang.String[] guestPermissions) |
static void |
updateKBArticlesPriorities(java.util.Map<java.lang.Long,java.lang.Double> resourcePrimKeyToPriorityMap) |
static void |
updatePriority(long resourcePrimKey,
double priority) |
static KBArticle |
updateStatus(long userId,
long resourcePrimKey,
int status,
ServiceContext serviceContext) |
public static FileEntry addAttachment(long userId, long resourcePrimKey, java.lang.String fileName, java.io.InputStream inputStream, java.lang.String mimeType) throws PortalException
PortalExceptionpublic static KBArticle addKBArticle(KBArticle kbArticle)
kbArticle - the kb articlepublic static KBArticle addKBArticle(long userId, long parentResourceClassNameId, long parentResourcePrimKey, java.lang.String title, java.lang.String urlTitle, java.lang.String content, java.lang.String description, java.lang.String sourceURL, java.lang.String[] sections, java.lang.String[] selectedFileNames, ServiceContext serviceContext) throws PortalException
PortalExceptionpublic static void addKBArticleResources(KBArticle kbArticle, boolean addGroupPermissions, boolean addGuestPermissions) throws PortalException
PortalExceptionpublic static void addKBArticleResources(KBArticle kbArticle, ModelPermissions modelPermissions) throws PortalException
PortalExceptionpublic static void addKBArticleResources(long kbArticleId,
boolean addGroupPermissions,
boolean addGuestPermissions)
throws PortalException
PortalExceptionpublic static int addKBArticlesMarkdown(long userId,
long groupId,
long parentKbFolderId,
java.lang.String fileName,
boolean prioritizeByNumericalPrefix,
java.io.InputStream inputStream,
ServiceContext serviceContext)
throws PortalException
PortalExceptionpublic static void addTempAttachment(long groupId,
long userId,
java.lang.String fileName,
java.lang.String tempFolderName,
java.io.InputStream inputStream,
java.lang.String mimeType)
throws PortalException
PortalExceptionpublic static KBArticle createKBArticle(long kbArticleId)
kbArticleId - the primary key for the new kb articlepublic static PersistedModel createPersistedModel(java.io.Serializable primaryKeyObj) throws PortalException
PortalExceptionpublic static void deleteGroupKBArticles(long groupId)
throws PortalException
PortalExceptionpublic static KBArticle deleteKBArticle(KBArticle kbArticle) throws PortalException
kbArticle - the kb articlePortalExceptionpublic static KBArticle deleteKBArticle(long kbArticleId) throws PortalException
kbArticleId - the primary key of the kb articlePortalException - if a kb article with the primary key could not be foundpublic static void deleteKBArticles(long groupId,
long parentResourcePrimKey)
throws PortalException
PortalExceptionpublic static void deleteKBArticles(long[] resourcePrimKeys)
throws PortalException
PortalExceptionpublic static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
PortalExceptionpublic static void deleteTempAttachment(long groupId,
long userId,
java.lang.String fileName,
java.lang.String tempFolderName)
throws PortalException
PortalExceptionpublic static <T> T dslQuery(DSLQuery dslQuery)
public static DynamicQuery dynamicQuery()
public static <T> java.util.List<T> dynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery - the dynamic querypublic static <T> java.util.List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
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 com.liferay.portal.kernel.dao.orm.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, then the query will include the default ORDER BY logic from com.liferay.knowledge.base.model.impl.KBArticleModelImpl.
dynamicQuery - the dynamic querystart - the lower bound of the range of model instancesend - the upper bound of the range of model instances (not inclusive)public static <T> java.util.List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
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 com.liferay.portal.kernel.dao.orm.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, then the query will include the default ORDER BY logic from com.liferay.knowledge.base.model.impl.KBArticleModelImpl.
dynamicQuery - the dynamic querystart - the lower bound of the range of model instancesend - the upper bound of the range of model instances (not inclusive)orderByComparator - the comparator to order the results by (optionally null)public static long dynamicQueryCount(DynamicQuery dynamicQuery)
dynamicQuery - the dynamic querypublic static long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
dynamicQuery - the dynamic queryprojection - the projection to apply to the querypublic static KBArticle fetchFirstChildKBArticle(long groupId, long parentResourcePrimKey)
public static KBArticle fetchKBArticle(long kbArticleId)
public static KBArticle fetchKBArticle(long resourcePrimKey, long groupId, int version)
public static KBArticle fetchKBArticleByUrlTitle(long groupId, long kbFolderId, java.lang.String urlTitle)
public static KBArticle fetchKBArticleByUrlTitle(long groupId, java.lang.String kbFolderUrlTitle, java.lang.String urlTitle)
public static KBArticle fetchKBArticleByUuidAndGroupId(java.lang.String uuid, long groupId)
uuid - the kb article's UUIDgroupId - the primary key of the groupnull if a matching kb article could not be foundpublic static KBArticle fetchLatestKBArticle(long resourcePrimKey, int status)
public static KBArticle fetchLatestKBArticle(long resourcePrimKey, long groupId)
public static KBArticle fetchLatestKBArticleByUrlTitle(long groupId, long kbFolderId, java.lang.String urlTitle, int status)
public static ActionableDynamicQuery getActionableDynamicQuery()
public static java.util.List<KBArticle> getAllDescendantKBArticles(long resourcePrimKey, int status, OrderByComparator<KBArticle> orderByComparator)
public static java.util.List<KBArticle> getCompanyKBArticles(long companyId, int status, int start, int end, OrderByComparator<KBArticle> orderByComparator)
public static int getCompanyKBArticlesCount(long companyId,
int status)
public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
public static java.util.List<KBArticle> getGroupKBArticles(long groupId, int status, int start, int end, OrderByComparator<KBArticle> orderByComparator)
public static int getGroupKBArticlesCount(long groupId,
int status)
public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
public static KBArticle getKBArticle(long kbArticleId) throws PortalException
kbArticleId - the primary key of the kb articlePortalException - if a kb article with the primary key could not be foundpublic static KBArticle getKBArticle(long resourcePrimKey, int version) throws PortalException
PortalExceptionpublic static java.util.List<KBArticle> getKBArticleAndAllDescendantKBArticles(long resourcePrimKey, int status, OrderByComparator<KBArticle> orderByComparator)
public static KBArticle getKBArticleByUrlTitle(long groupId, long kbFolderId, java.lang.String urlTitle) throws PortalException
PortalExceptionpublic static KBArticle getKBArticleByUrlTitle(long groupId, java.lang.String kbFolderUrlTitle, java.lang.String urlTitle) throws PortalException
PortalExceptionpublic static KBArticle getKBArticleByUuidAndGroupId(java.lang.String uuid, long groupId) throws PortalException
uuid - the kb article's UUIDgroupId - the primary key of the groupPortalException - if a matching kb article could not be foundpublic static java.util.List<KBArticle> getKBArticles(int start, int end)
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 com.liferay.portal.kernel.dao.orm.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, then the query will include the default ORDER BY logic from com.liferay.knowledge.base.model.impl.KBArticleModelImpl.
start - the lower bound of the range of kb articlesend - the upper bound of the range of kb articles (not inclusive)public static java.util.List<KBArticle> getKBArticles(long groupId, long parentResourcePrimKey, int status, int start, int end, OrderByComparator<KBArticle> orderByComparator)
public static java.util.List<KBArticle> getKBArticles(long[] resourcePrimKeys, int status, OrderByComparator<KBArticle> orderByComparator)
public static java.util.List<KBArticle> getKBArticlesByUuidAndCompanyId(java.lang.String uuid, long companyId)
uuid - the UUID of the kb articlescompanyId - the primary key of the companypublic static java.util.List<KBArticle> getKBArticlesByUuidAndCompanyId(java.lang.String uuid, long companyId, int start, int end, OrderByComparator<KBArticle> orderByComparator)
uuid - the UUID of the kb articlescompanyId - the primary key of the companystart - the lower bound of the range of kb articlesend - the upper bound of the range of kb articles (not inclusive)orderByComparator - the comparator to order the results by (optionally null)public static int getKBArticlesCount()
public static int getKBArticlesCount(long groupId,
long parentResourcePrimKey,
int status)
public static java.util.List<KBArticle> getKBArticleVersions(long resourcePrimKey, int status, int start, int end, OrderByComparator<KBArticle> orderByComparator)
public static int getKBArticleVersionsCount(long resourcePrimKey,
int status)
public static java.util.List<KBArticle> getKBFolderKBArticles(long groupId, long kbFolderId)
public static int getKBFolderKBArticlesCount(long groupId,
long kbFolderId,
int status)
public static KBArticle getLatestKBArticle(long resourcePrimKey, int status) throws PortalException
PortalExceptionpublic static KBArticle getLatestKBArticleByUrlTitle(long groupId, long kbFolderId, java.lang.String urlTitle, int status) throws PortalException
PortalExceptionpublic static java.lang.String getOSGiServiceIdentifier()
public static java.util.List<? extends PersistedModel> getPersistedModel(long resourcePrimKey) throws PortalException
PortalExceptionpublic static PersistedModel getPersistedModel(java.io.Serializable primaryKeyObj) throws PortalException
PortalExceptionpublic static KBArticle[] getPreviousAndNextKBArticles(long kbArticleId) throws PortalException
PortalExceptionpublic static java.util.List<KBArticle> getSectionsKBArticles(long groupId, java.lang.String[] sections, int status, int start, int end, OrderByComparator<KBArticle> orderByComparator)
public static int getSectionsKBArticlesCount(long groupId,
java.lang.String[] sections,
int status)
public static java.lang.String[] getTempAttachmentNames(long groupId,
long userId,
java.lang.String tempFolderName)
throws PortalException
PortalExceptionpublic static void incrementViewCount(long userId,
long resourcePrimKey,
int increment)
throws PortalException
PortalExceptionpublic static void moveKBArticle(long userId,
long resourcePrimKey,
long parentResourceClassNameId,
long parentResourcePrimKey,
double priority)
throws PortalException
PortalExceptionpublic static KBArticle revertKBArticle(long userId, long resourcePrimKey, int version, ServiceContext serviceContext) throws PortalException
PortalExceptionpublic static java.util.List<KBArticle> search(long groupId, java.lang.String title, java.lang.String content, int status, java.util.Date startDate, java.util.Date endDate, boolean andOperator, int start, int end, OrderByComparator<KBArticle> orderByComparator)
public static void subscribeGroupKBArticles(long userId,
long groupId)
throws PortalException
PortalExceptionpublic static void subscribeKBArticle(long userId,
long groupId,
long resourcePrimKey)
throws PortalException
PortalExceptionpublic static void unsubscribeGroupKBArticles(long userId,
long groupId)
throws PortalException
PortalExceptionpublic static void unsubscribeKBArticle(long userId,
long resourcePrimKey)
throws PortalException
PortalExceptionpublic static KBArticle updateKBArticle(KBArticle kbArticle)
kbArticle - the kb articlepublic static KBArticle updateKBArticle(long userId, long resourcePrimKey, java.lang.String title, java.lang.String content, java.lang.String description, java.lang.String sourceURL, java.lang.String[] sections, java.lang.String[] selectedFileNames, long[] removeFileEntryIds, ServiceContext serviceContext) throws PortalException
PortalExceptionpublic static void updateKBArticleAsset(long userId,
KBArticle kbArticle,
long[] assetCategoryIds,
java.lang.String[] assetTagNames,
long[] assetLinkEntryIds)
throws PortalException
PortalExceptionpublic static void updateKBArticleResources(KBArticle kbArticle, java.lang.String[] groupPermissions, java.lang.String[] guestPermissions) throws PortalException
PortalExceptionpublic static void updateKBArticlesPriorities(java.util.Map<java.lang.Long,java.lang.Double> resourcePrimKeyToPriorityMap)
throws PortalException
PortalExceptionpublic static void updatePriority(long resourcePrimKey,
double priority)
public static KBArticle updateStatus(long userId, long resourcePrimKey, int status, ServiceContext serviceContext) throws PortalException
PortalExceptionpublic static KBArticleLocalService getService()