Class KBArticleLocalServiceUtil
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.- See Also:
- Generated:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.liferay.portal.kernel.repository.model.FileEntryaddAttachment(long userId, long resourcePrimKey, String fileName, InputStream inputStream, String mimeType) static KBArticleaddKBArticle(KBArticle kbArticle) Adds the kb article to the database.static KBArticleaddKBArticle(String externalReferenceCode, long userId, long parentResourceClassNameId, long parentResourcePrimKey, String title, String urlTitle, String content, String description, String[] sections, String sourceURL, Date displayDate, Date expirationDate, Date reviewDate, String[] selectedFileNames, com.liferay.portal.kernel.service.ServiceContext serviceContext) static voidaddKBArticleResources(long kbArticleId, boolean addGroupPermissions, boolean addGuestPermissions) static voidaddKBArticleResources(KBArticle kbArticle, boolean addGroupPermissions, boolean addGuestPermissions) static voidaddKBArticleResources(KBArticle kbArticle, com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions) static intaddKBArticlesMarkdown(long userId, long groupId, long parentKbFolderId, String fileName, boolean prioritizeByNumericalPrefix, InputStream inputStream, com.liferay.portal.kernel.service.ServiceContext serviceContext) static voidaddTempAttachment(long groupId, long userId, String fileName, String tempFolderName, InputStream inputStream, String mimeType) static voidcheckKBArticles(long companyId) static KBArticlecreateKBArticle(long kbArticleId) Creates a new kb article with the primary key.static com.liferay.portal.kernel.model.PersistedModelcreatePersistedModel(Serializable primaryKeyObj) static voiddeleteGroupKBArticles(long groupId) static KBArticledeleteKBArticle(long kbArticleId) Deletes the kb article with the primary key from the database.static KBArticledeleteKBArticle(long userId, long resourcePrimKey, int version) static KBArticledeleteKBArticle(KBArticle kbArticle) Deletes the kb article from the database.static voiddeleteKBArticles(long[] resourcePrimKeys) static voiddeleteKBArticles(long groupId, long parentResourcePrimKey) static voiddeleteKBArticles(long groupId, long parentResourcePrimKey, boolean includeTrashedEntries) static com.liferay.portal.kernel.model.PersistedModeldeletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) static voiddeleteTempAttachment(long groupId, long userId, String fileName, String tempFolderName) static <T> TdslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static intdslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static com.liferay.portal.kernel.dao.orm.DynamicQuerystatic <T> List<T>dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.static <T> List<T>dynamicQuery(com.liferay.portal.kernel.dao.orm.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(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) Performs a dynamic query on the database and returns an ordered range of the matching rows.static longdynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static longdynamicQueryCount(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection) Returns the number of rows matching the dynamic query.static KBArticleexpireKBArticle(long userId, long resourcePrimKey, com.liferay.portal.kernel.service.ServiceContext serviceContext) static KBArticlefetchFirstChildKBArticle(long groupId, long parentResourcePrimKey) static KBArticlefetchKBArticle(long kbArticleId) static KBArticlefetchKBArticle(long resourcePrimKey, long groupId, int version) static KBArticlefetchKBArticleByUrlTitle(long groupId, long kbFolderId, String urlTitle) static KBArticlefetchKBArticleByUrlTitle(long groupId, String kbFolderUrlTitle, String urlTitle) static KBArticlefetchKBArticleByUuidAndGroupId(String uuid, long groupId) Returns the kb article matching the UUID and group.static KBArticlefetchLatestKBArticle(long resourcePrimKey, int status) static KBArticlefetchLatestKBArticle(long resourcePrimKey, long groupId) static KBArticlefetchLatestKBArticleByExternalReferenceCode(long groupId, String externalReferenceCode) static KBArticlefetchLatestKBArticleByUrlTitle(long groupId, long kbFolderId, String urlTitle, int status) static com.liferay.portal.kernel.model.PersistedModelfetchPersistedModel(Serializable primaryKeyObj) static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuerygetAllDescendantKBArticles(long resourcePrimKey, int status, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) getCompanyKBArticles(long companyId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) static intgetCompanyKBArticlesCount(long companyId, int status) static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuerygetExportActionableDynamicQuery(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) getGroupKBArticles(long groupId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) static intgetGroupKBArticlesCount(long groupId, int status) static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuerystatic KBArticlegetKBArticle(long kbArticleId) Returns the kb article with the primary key.static KBArticlegetKBArticle(long resourcePrimKey, int version) getKBArticleAndAllDescendantKBArticles(long resourcePrimKey, int status, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) static KBArticlegetKBArticleByUrlTitle(long groupId, long kbFolderId, String urlTitle) static KBArticlegetKBArticleByUrlTitle(long groupId, String kbFolderUrlTitle, String urlTitle) static KBArticlegetKBArticleByUuidAndGroupId(String uuid, long groupId) Returns the kb article matching the UUID and group.getKBArticles(int start, int end) Returns a range of all the kb articles.getKBArticles(long[] resourcePrimKeys, int status, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) getKBArticles(long groupId, long parentResourcePrimKey, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) getKBArticlesByUuidAndCompanyId(String uuid, long companyId) Returns all the kb articles matching the UUID and company.getKBArticlesByUuidAndCompanyId(String uuid, long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) Returns a range of kb articles matching the UUID and company.static intReturns the number of kb articles.static intgetKBArticlesCount(long groupId, long parentResourcePrimKey, int status) getKBArticleVersions(long resourcePrimKey, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) static intgetKBArticleVersionsCount(long resourcePrimKey, int status) getKBFolderKBArticles(long groupId, long kbFolderId) static intgetKBFolderKBArticlesCount(long groupId, long kbFolderId, int status) static KBArticlegetLatestKBArticle(long resourcePrimKey) static KBArticlegetLatestKBArticle(long resourcePrimKey, int status) static KBArticlegetLatestKBArticle(long resourcePrimKey, int[] statuses) static KBArticlegetLatestKBArticleByExternalReferenceCode(long groupId, String externalReferenceCode) static KBArticlegetLatestKBArticleByUrlTitle(long groupId, long kbFolderId, String urlTitle, int status) static StringReturns the OSGi service identifier.static List<? extends com.liferay.portal.kernel.model.PersistedModel>getPersistedModel(long resourcePrimKey) static com.liferay.portal.kernel.model.PersistedModelgetPersistedModel(Serializable primaryKeyObj) static KBArticle[]getPreviousAndNextKBArticles(long kbArticleId) getSectionsKBArticles(long groupId, String[] sections, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) static intgetSectionsKBArticlesCount(long groupId, String[] sections, int status) static KBArticleLocalServicestatic String[]getTempAttachmentNames(long groupId, long userId, String tempFolderName) static booleanhasKBArticleLock(long userId, long resourcePrimKey) static voidincrementViewCount(long userId, long resourcePrimKey, int increment) static com.liferay.portal.kernel.lock.LocklockKBArticle(long userId, long resourcePrimKey) static voidmoveDependentKBArticlesToTrash(long parentResourcePrimKey, long trashEntryId) static voidmoveDependentKBArticleToTrash(KBArticle kbArticle, long trashEntryId) static voidmoveKBArticle(long userId, long resourcePrimKey, long parentResourceClassNameId, long parentResourcePrimKey, double priority) static voidmoveKBArticleFromTrash(long userId, long resourcePrimKey, long parentResourceClassNameId, long parentResourcePrimKey) static KBArticlemoveKBArticleToTrash(long userId, long resourcePrimKey) static voidrestoreDependentKBArticleFromTrash(KBArticle kbArticle) static voidrestoreDependentKBArticlesFromTrash(long parentResourcePrimKey) static voidrestoreKBArticleFromTrash(long userId, long resourcePrimKey) static KBArticlerevertKBArticle(long userId, long resourcePrimKey, int version, com.liferay.portal.kernel.service.ServiceContext serviceContext) search(long groupId, String title, String content, int status, Date startDate, Date endDate, boolean andOperator, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) static voidsubscribeGroupKBArticles(long userId, long groupId) static voidsubscribeKBArticle(long userId, long groupId, long resourcePrimKey) static voidunlockKBArticle(long userId, long resourcePrimKey) static voidunlockKBArticle(long userId, long resourcePrimKey, boolean force) static voidunsubscribeGroupKBArticles(long userId, long groupId) static voidunsubscribeKBArticle(long userId, long resourcePrimKey) static KBArticleupdateAndUnlockKBArticle(long userId, long resourcePrimKey, String title, String content, String description, String[] sections, String sourceURL, Date displayDate, Date expirationDate, Date reviewDate, String[] selectedFileNames, long[] removeFileEntryIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) static KBArticleupdateKBArticle(long userId, long resourcePrimKey, String title, String content, String description, String[] sections, String sourceURL, Date displayDate, Date expirationDate, Date reviewDate, String[] selectedFileNames, long[] removeFileEntryIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) static KBArticleupdateKBArticle(KBArticle kbArticle) Updates the kb article in the database or adds it if it does not yet exist.static voidupdateKBArticleAsset(long userId, KBArticle kbArticle, long[] assetCategoryIds, String[] assetTagNames, long[] assetLinkEntryIds) static voidupdateKBArticleResources(KBArticle kbArticle, String[] groupPermissions, String[] guestPermissions) static voidupdateKBArticlesPriorities(Map<Long, Double> resourcePrimKeyToPriorityMap) static voidupdatePriority(long resourcePrimKey, double priority) static KBArticleupdateStatus(long userId, long resourcePrimKey, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext)
-
Constructor Details
-
KBArticleLocalServiceUtil
public KBArticleLocalServiceUtil()
-
-
Method Details
-
addAttachment
public static com.liferay.portal.kernel.repository.model.FileEntry addAttachment(long userId, long resourcePrimKey, String fileName, InputStream inputStream, String mimeType) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addKBArticle
Adds the kb article to the database. Also notifies the appropriate model listeners.Important: Inspect KBArticleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
kbArticle- the kb article- Returns:
- the kb article that was added
-
addKBArticle
public static KBArticle addKBArticle(String externalReferenceCode, long userId, long parentResourceClassNameId, long parentResourcePrimKey, String title, String urlTitle, String content, String description, String[] sections, String sourceURL, Date displayDate, Date expirationDate, Date reviewDate, String[] selectedFileNames, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addKBArticleResources
public static void addKBArticleResources(KBArticle kbArticle, boolean addGroupPermissions, boolean addGuestPermissions) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addKBArticleResources
public static void addKBArticleResources(KBArticle kbArticle, com.liferay.portal.kernel.service.permission.ModelPermissions modelPermissions) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addKBArticleResources
public static void addKBArticleResources(long kbArticleId, boolean addGroupPermissions, boolean addGuestPermissions) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addKBArticlesMarkdown
public static int addKBArticlesMarkdown(long userId, long groupId, long parentKbFolderId, String fileName, boolean prioritizeByNumericalPrefix, InputStream inputStream, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
addTempAttachment
public static void addTempAttachment(long groupId, long userId, String fileName, String tempFolderName, InputStream inputStream, String mimeType) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
checkKBArticles
public static void checkKBArticles(long companyId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
createKBArticle
Creates a new kb article with the primary key. Does not add the kb article to the database.- Parameters:
kbArticleId- the primary key for the new kb article- Returns:
- the new kb article
-
createPersistedModel
public static com.liferay.portal.kernel.model.PersistedModel createPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteGroupKBArticles
public static void deleteGroupKBArticles(long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteKBArticle
public static KBArticle deleteKBArticle(KBArticle kbArticle) throws com.liferay.portal.kernel.exception.PortalException Deletes the kb article from the database. Also notifies the appropriate model listeners.Important: Inspect KBArticleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
kbArticle- the kb article- Returns:
- the kb article that was removed
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteKBArticle
public static KBArticle deleteKBArticle(long kbArticleId) throws com.liferay.portal.kernel.exception.PortalException Deletes the kb article with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect KBArticleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
kbArticleId- the primary key of the kb article- Returns:
- the kb article that was removed
- Throws:
com.liferay.portal.kernel.exception.PortalException- if a kb article with the primary key could not be found
-
deleteKBArticle
public static KBArticle deleteKBArticle(long userId, long resourcePrimKey, int version) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteKBArticles
public static void deleteKBArticles(long groupId, long parentResourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteKBArticles
public static void deleteKBArticles(long groupId, long parentResourcePrimKey, boolean includeTrashedEntries) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteKBArticles
public static void deleteKBArticles(long[] resourcePrimKeys) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deletePersistedModel
public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(com.liferay.portal.kernel.model.PersistedModel persistedModel) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteTempAttachment
public static void deleteTempAttachment(long groupId, long userId, String fileName, String tempFolderName) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
dslQuery
public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dslQueryCount
public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dynamicQuery
public static com.liferay.portal.kernel.dao.orm.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(com.liferay.portal.kernel.dao.orm.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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.knowledge.base.model.impl.KBArticleModelImpl.- Parameters:
dynamicQuery- the dynamic querystart- the lower bound of the range of model instancesend- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
public static <T> List<T> dynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.knowledge.base.model.impl.KBArticleModelImpl.- Parameters:
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 (optionallynull)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
public static long dynamicQueryCount(com.liferay.portal.kernel.dao.orm.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(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, com.liferay.portal.kernel.dao.orm.Projection projection) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery- the dynamic queryprojection- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
expireKBArticle
public static KBArticle expireKBArticle(long userId, long resourcePrimKey, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
fetchFirstChildKBArticle
-
fetchKBArticle
-
fetchKBArticle
-
fetchKBArticleByUrlTitle
-
fetchKBArticleByUrlTitle
-
fetchKBArticleByUuidAndGroupId
Returns the kb article matching the UUID and group.- Parameters:
uuid- the kb article's UUIDgroupId- the primary key of the group- Returns:
- the matching kb article, or
nullif a matching kb article could not be found
-
fetchLatestKBArticle
-
fetchLatestKBArticle
-
fetchLatestKBArticleByExternalReferenceCode
-
fetchLatestKBArticleByUrlTitle
-
fetchPersistedModel
public static com.liferay.portal.kernel.model.PersistedModel fetchPersistedModel(Serializable primaryKeyObj) -
getActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() -
getAllDescendantKBArticles
-
getCompanyKBArticles
-
getCompanyKBArticlesCount
public static int getCompanyKBArticlesCount(long companyId, int status) -
getExportActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) -
getGroupKBArticles
-
getGroupKBArticlesCount
public static int getGroupKBArticlesCount(long groupId, int status) -
getIndexableActionableDynamicQuery
public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() -
getKBArticle
public static KBArticle getKBArticle(long kbArticleId) throws com.liferay.portal.kernel.exception.PortalException Returns the kb article with the primary key.- Parameters:
kbArticleId- the primary key of the kb article- Returns:
- the kb article
- Throws:
com.liferay.portal.kernel.exception.PortalException- if a kb article with the primary key could not be found
-
getKBArticle
public static KBArticle getKBArticle(long resourcePrimKey, int version) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getKBArticleAndAllDescendantKBArticles
-
getKBArticleByUrlTitle
public static KBArticle getKBArticleByUrlTitle(long groupId, long kbFolderId, String urlTitle) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getKBArticleByUrlTitle
public static KBArticle getKBArticleByUrlTitle(long groupId, String kbFolderUrlTitle, String urlTitle) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getKBArticleByUuidAndGroupId
public static KBArticle getKBArticleByUuidAndGroupId(String uuid, long groupId) throws com.liferay.portal.kernel.exception.PortalException Returns the kb article matching the UUID and group.- Parameters:
uuid- the kb article's UUIDgroupId- the primary key of the group- Returns:
- the matching kb article
- Throws:
com.liferay.portal.kernel.exception.PortalException- if a matching kb article could not be found
-
getKBArticles
Returns a range of all the kb articles.Useful when paginating results. Returns a maximum of
end - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris absent, then the query will include the default ORDER BY logic fromcom.liferay.knowledge.base.model.impl.KBArticleModelImpl.- Parameters:
start- the lower bound of the range of kb articlesend- the upper bound of the range of kb articles (not inclusive)- Returns:
- the range of kb articles
-
getKBArticles
-
getKBArticles
-
getKBArticlesByUuidAndCompanyId
Returns all the kb articles matching the UUID and company.- Parameters:
uuid- the UUID of the kb articlescompanyId- the primary key of the company- Returns:
- the matching kb articles, or an empty list if no matches were found
-
getKBArticlesByUuidAndCompanyId
public static List<KBArticle> getKBArticlesByUuidAndCompanyId(String uuid, long companyId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<KBArticle> orderByComparator) Returns a range of kb articles matching the UUID and company.- Parameters:
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 (optionallynull)- Returns:
- the range of matching kb articles, or an empty list if no matches were found
-
getKBArticlesCount
public static int getKBArticlesCount()Returns the number of kb articles.- Returns:
- the number of kb articles
-
getKBArticlesCount
public static int getKBArticlesCount(long groupId, long parentResourcePrimKey, int status) -
getKBArticleVersions
-
getKBArticleVersionsCount
public static int getKBArticleVersionsCount(long resourcePrimKey, int status) -
getKBFolderKBArticles
-
getKBFolderKBArticlesCount
public static int getKBFolderKBArticlesCount(long groupId, long kbFolderId, int status) -
getLatestKBArticle
public static KBArticle getLatestKBArticle(long resourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getLatestKBArticle
public static KBArticle getLatestKBArticle(long resourcePrimKey, int status) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getLatestKBArticle
public static KBArticle getLatestKBArticle(long resourcePrimKey, int[] statuses) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getLatestKBArticleByExternalReferenceCode
public static KBArticle getLatestKBArticleByExternalReferenceCode(long groupId, String externalReferenceCode) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getLatestKBArticleByUrlTitle
public static KBArticle getLatestKBArticleByUrlTitle(long groupId, long kbFolderId, String urlTitle, int status) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
public static List<? extends com.liferay.portal.kernel.model.PersistedModel> getPersistedModel(long resourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getPersistedModel
public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getPreviousAndNextKBArticles
public static KBArticle[] getPreviousAndNextKBArticles(long kbArticleId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getSectionsKBArticles
-
getSectionsKBArticlesCount
-
getTempAttachmentNames
public static String[] getTempAttachmentNames(long groupId, long userId, String tempFolderName) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
hasKBArticleLock
public static boolean hasKBArticleLock(long userId, long resourcePrimKey) -
incrementViewCount
public static void incrementViewCount(long userId, long resourcePrimKey, int increment) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
lockKBArticle
public static com.liferay.portal.kernel.lock.Lock lockKBArticle(long userId, long resourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
moveDependentKBArticlesToTrash
public static void moveDependentKBArticlesToTrash(long parentResourcePrimKey, long trashEntryId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
moveDependentKBArticleToTrash
public static void moveDependentKBArticleToTrash(KBArticle kbArticle, long trashEntryId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
moveKBArticle
public static void moveKBArticle(long userId, long resourcePrimKey, long parentResourceClassNameId, long parentResourcePrimKey, double priority) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
moveKBArticleFromTrash
public static void moveKBArticleFromTrash(long userId, long resourcePrimKey, long parentResourceClassNameId, long parentResourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
moveKBArticleToTrash
public static KBArticle moveKBArticleToTrash(long userId, long resourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
restoreDependentKBArticleFromTrash
public static void restoreDependentKBArticleFromTrash(KBArticle kbArticle) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
restoreDependentKBArticlesFromTrash
public static void restoreDependentKBArticlesFromTrash(long parentResourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
restoreKBArticleFromTrash
public static void restoreKBArticleFromTrash(long userId, long resourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
revertKBArticle
public static KBArticle revertKBArticle(long userId, long resourcePrimKey, int version, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
search
-
subscribeGroupKBArticles
public static void subscribeGroupKBArticles(long userId, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
subscribeKBArticle
public static void subscribeKBArticle(long userId, long groupId, long resourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
unlockKBArticle
public static void unlockKBArticle(long userId, long resourcePrimKey) -
unlockKBArticle
public static void unlockKBArticle(long userId, long resourcePrimKey, boolean force) -
unsubscribeGroupKBArticles
public static void unsubscribeGroupKBArticles(long userId, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
unsubscribeKBArticle
public static void unsubscribeKBArticle(long userId, long resourcePrimKey) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateAndUnlockKBArticle
public static KBArticle updateAndUnlockKBArticle(long userId, long resourcePrimKey, String title, String content, String description, String[] sections, String sourceURL, Date displayDate, Date expirationDate, Date reviewDate, String[] selectedFileNames, long[] removeFileEntryIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateKBArticle
Updates the kb article in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect KBArticleLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
- Parameters:
kbArticle- the kb article- Returns:
- the kb article that was updated
-
updateKBArticle
public static KBArticle updateKBArticle(long userId, long resourcePrimKey, String title, String content, String description, String[] sections, String sourceURL, Date displayDate, Date expirationDate, Date reviewDate, String[] selectedFileNames, long[] removeFileEntryIds, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateKBArticleAsset
public static void updateKBArticleAsset(long userId, KBArticle kbArticle, long[] assetCategoryIds, String[] assetTagNames, long[] assetLinkEntryIds) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateKBArticleResources
public static void updateKBArticleResources(KBArticle kbArticle, String[] groupPermissions, String[] guestPermissions) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateKBArticlesPriorities
public static void updateKBArticlesPriorities(Map<Long, Double> resourcePrimKeyToPriorityMap) throws com.liferay.portal.kernel.exception.PortalException- Throws:
com.liferay.portal.kernel.exception.PortalException
-
updatePriority
public static void updatePriority(long resourcePrimKey, double priority) -
updateStatus
public static KBArticle updateStatus(long userId, long resourcePrimKey, int status, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getService
-