IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.
DISCLAIMER
All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.
Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.
Dont forget to checkout solutions uploaded by our customers, partners and community members here.
Related KBs Extension
/* Incident Tasks */ app.custom.formTasks.add('Incident', null, function(formObj, viewModel){ formObj.boundReady( function () { getRelatedKBs(); }); }); /* Service Request Tasks */ app.custom.formTasks.add('ServiceRequest', null, function(formObj, viewModel){ formObj.boundReady( function () { getRelatedKBs(); }); }); /* Change Request Tasks */ app.custom.formTasks.add('ChangeRequest', null, function(formObj, viewModel){ formObj.boundReady( function () { getRelatedKBs(); }); });
Comments
In any case, switching the data object in the ajax call to include the 'userLanguageCode' has fixed this up for us. Just posting in case anyone else was running into the same problem.
Code that wasn't working (starts at line 25 in the "ext_RelatedKB.js" file from the original post):
..."
Love this extension!
just a minor logic error in the code regarding calculation of relevance.
for (var j = 0; j < titleArray.length; j++) {
var occured = occurrences(data[i].Title, titleArray[j])
relevence += occured;
}
should be:
for (var j = 0; j < titleArray.length; j++) {
var occured = occurrences(data[i].Title.toLowerCase(), titleArray[j])
relevence += occured;
}
..as the occurrences function was not ordering relevance correctly when there was a difference in case sensitivity. (e.g.: 'SharePoint' would not match 'sharepoint'). The above change fixes this.
Cheers,
Adrian
So, I have been trying to write some improvements for this add-on, but have found something strange with my ajax api search results.
Essentially, what I am trying to do, is pull back the "key words" for different search results, and using the keywords, sort kb articles by relevance, rather than using the title of the article instead (which is less accurate).
Unfortionately, when using "/api/V3/KnowledgeBase/GetHTMLArticlesFullTextSearch" or "/api/V3/Article", it only seems to pull the "Title" and "Abstract" fields from KB articles, rather than other useful fields such as the "Keywords" field. The other fields are listed, but they are all null.
I am running Portal version 5.0.7
Any thoughts on this would be appreciated.
Kind Regards,
Adrian
Sounds great!
Thanks Seth
- Resolved issues with it throwing an error in a new item template when the title and description were both empty
- Resolved an issue where even if they were both filled in it would still choke on an output string
I got it to work. We are using portal version 9.0.3
Changed both url and data to this:
I also had to change the Notificationbar to the following:
Post edit: Removed tab in code section
@Jesper_Jeansson, would you please provide the full working script?
Note that i have the Install-lines in the begining of this file.
$.getScript("/CustomSpace/custom_extKB.js");
Edit: If i violate anything by posting the script to github, please let me know and I will remove it.