Methods
-
<static> _mapKnowledgeArticle( record ) → {KnowledgeArticle}
-
Description
Map a GlideRecord into a KnowledgeArticle Object
Parameters
Name Type Description recordGlideRecord Returns
-
<static> getArticleByNumber( number, user, forApproval ) → {KnowledgeArticle}
-
Description
Retrieve a knowledge article that is the latest version and in the correct language as the article requested it can be a different number.
Parameters
Name Type Description numberstring Number of the knowledge article (KBxxxxxx)
userUserConfiguration User object to relate ACL's to
forApprovalboolean Returns
-
<static> _substituteBlocks( content, articleSysId, user ) → {string}
-
Description
Substite blocks in article
Parameters
Name Type Description contentstring articleSysIdsys_id userUserConfiguration Returns
-
<static> getArticleBySysId( sysId, user, forApproval ) → {KnowledgeArticle}
-
Description
Retrieve a knowledge article by sysId. The article is considering version and language and might not the actual article.
Parameters
Name Type Description sysIdsys_id userUserConfiguration forApprovalboolean Returns
-
<static> getPinnedArticleList() → {Array.<ListItem>}
-
Description
Get a list of pinned article, might be limited
Returns
-
<static> getKnowledgeItemList( user ) → {Object}
-
Description
Get a (windowed) list of articles
Parameters
Name Type Description userUserConfiguration Properties
Name Type Description listArray.<ListItem> countnumber Total count of records
encodedQuerystring The encoded query that was used to retrieve articles
Returns
-
<static> getAccessibleKnowledgeBaseList( availableKnowledgeBases ) → {Array.<sys_id>}
-
Description
Get an array of accessible (can read) Knowledge bases
Parameters
Name Type Description availableKnowledgeBasesArray.<sys_id> Retrieved from $sp.getKnowledgeBases()
Returns
-
<static> increaseArticleViewCount( articleSysId, userSysId )
-
<static> getKnowledgeCategoryTree( user, encodedQuery ) → {Array.<CategoryTreeItem>}
-
Description
Get the complete category tree that is available for a user/company
Parameters
Name Type Description userUserConfiguration encodedQuerystring Query used to fetch article based on a filter
Returns
-
<static> _buildTree( list ) → {Array.<CategoryTreeItem>}
-
Description
Build a tree from a list
Parameters
Name Type Description listArray.<CategoryTreeItem> Returns
-
<static> _getRootCategories( categorySysId ) → {Object}
-
Description
Get the root categories for a given (sub)category
Parameters
Name Type Description categorySysIdsys_id Returns
-
<static> getKnowledgeCategories( knowledgeBases, language ) → {Array.<CategoryTreeItem>}
-
Description
Get all categories for Knowledge Bases in the provided array (usually all company bases)
Parameters
Name Type Description knowledgeBasesArray.<sys_id> Array of sys_id for the Knowledge Bases
languageLanguageType Language to select articles with
Returns
-
<static> getCategoryChildrenSysIdList( sysId ) → {Array.<sys_id>}
-
Description
Recusively get all the children for a parent as a combined flat list of sys_id's
Parameters
Name Type Description sysIdsys_id Returns
-
<static> getCategoryChildren( sysId, language ) → {Array.<CategoryTreeItem>}
-
Description
Recursively get all the children of a parent category
Parameters
Name Type Description sysIdsys_id languageLanguageType Returns
-
<static> getCompanyKnowledgeBaseList( companySysId ) → {Array.<sys_id>}
-
Description
Get an list (array) of Knowledge base (kb_knowledge_base) sys_id that are available to a company
Parameters
Name Type Description companySysIdsys_id Company sys_id
Returns
-
<static> getMostViewedKnowledgeList( user ) → {Array.<ListItem>}
-
Description
Get at maximum 10 most viewed knowledge articles that are allowed to see by this user
Parameters
Name Type Description userUserConfiguration Returns
-
<static> provideFeedback( sysId, userSysId, useful, comments )