c_SSPKnowledgeData

Description

Part of Portal library

Methods


<static> _mapKnowledgeArticle( record ) → {KnowledgeArticle}

Description

Map a GlideRecord into a KnowledgeArticle Object

Parameters
Name Type Description
record GlideRecord

<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
number string

Number of the knowledge article (KBxxxxxx)

user UserConfiguration

User object to relate ACL's to

forApproval boolean

<static> _substituteBlocks( content, articleSysId, user ) → {string}

Description

Substite blocks in article

Parameters
Name Type Description
content string
articleSysId sys_id
user UserConfiguration
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
sysId sys_id
user UserConfiguration
forApproval boolean

<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
user UserConfiguration
Properties
Name Type Description
list Array.<ListItem>
count number

Total count of records

encodedQuery string

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
availableKnowledgeBases Array.<sys_id>

Retrieved from $sp.getKnowledgeBases()

Returns

Array of KB sys_id


<static> increaseArticleViewCount( articleSysId, userSysId )

Description

Increase article view/use count

Parameters
Name Type Description
articleSysId sys_id

Article object

userSysId sys_id

User sys_id


<static> getKnowledgeCategoryTree( user, encodedQuery ) → {Array.<CategoryTreeItem>}

Description

Get the complete category tree that is available for a user/company

Parameters
Name Type Description
user UserConfiguration
encodedQuery string

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
list Array.<CategoryTreeItem>
Returns

<static> _getRootCategories( categorySysId ) → {Object}

Description

Get the root categories for a given (sub)category

Parameters
Name Type Description
categorySysId sys_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
knowledgeBases Array.<sys_id>

Array of sys_id for the Knowledge Bases

language LanguageType

Language to select articles with

Returns

Array of category objects


<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
sysId sys_id
Returns

<static> getCategoryChildren( sysId, language ) → {Array.<CategoryTreeItem>}

Description

Recursively get all the children of a parent category

Parameters
Name Type Description
sysId sys_id
language LanguageType
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
companySysId sys_id

Company sys_id

Returns

Array of sys_id's for KnowledgeBase where a company has access to


<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
user UserConfiguration
Returns

<static> provideFeedback( sysId, userSysId, useful, comments )

Description

Provide/save a user feedback

Parameters
Name Type Description
sysId sys_id

Article sys_id

userSysId sys_id

User sys_id

useful boolean

Was the article useful or not

comments string

Comments when not useful