+ Start a Discussion
wposnerwposner 

syndicated knowledge issues

Followed instructions, put up page, all it does is display sample data, checked and re-checked settings. Never pulls data from live public KB.

Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
Brad HermanBrad Herman

I worked with @wposner to squash the bug that was causing this problem (thanks, Bill).  An updated version of the Syndicated Knowledge app is now live on AppExchange - http://sites.force.com/appexchange/listingDetail?listingId=a0N30000003IsNeEAK

All Answers

wposnerwposner

Thank you, but that is not the issue I am having. Public database is up and accesable, it's the Syndicated Knowledge app that's not working correctly.

Thanks for the suggestion!!!

This is the code that is spit out of the program and supposedly we just copy and paste:

 

<script> 
<!--
/**
 * Builds an unordered list from the JSON feed entries of articles.
 * Adapted from Google Code: http://code.google.com/apis/gdata/samples/base_sample.html
 **/
function listEntries(feed) {
  // Clear any information displayed under the "syndicatedknowledge" div.
  removeOldResults()
 
  // Transform the JSON results: each article becomes an element in an unordered list of links.
  if (feed.Articles == 0) {
    var ul = document.createElement("p");
    var txt = document.createTextNode("Search returned no articles");
    ul.appendChild(txt);
  } 
  var ul = document.createElement("ul");
  for (var i = 0; i < feed.Articles.length; ++i) {
    var article = feed.Articles[i];
    var li = document.createElement("li");
    var txt = document.createTextNode(article.Title);
    var a = document.createElement("a");
    a.href = feed.kbBaseURL + article.URLName;
    a.appendChild(txt);
    li.appendChild(a);
    ul.appendChild(li);
  }
  document.getElementById("syndicatedknowledge").appendChild(ul);
}
 
/**
 * Adds a JSON script element which queries the public Knoweldgebase and calls the call-back function.
 **/
function search(query) {
  removeOldJSONScriptNodes();
  removeOldResults()
 
  // Show a "Searching..." indicator.
  var div = document.getElementById('syndicatedknowledge');
  var p = document.createElement('p');
  p.appendChild(document.createTextNode('Searching Knowledgebase...'));
  div.appendChild(p);
 
  // Add a script element with the src as the knowledge JSON query. 
  // The callback funtion is specified as a URI argument.
  var scriptElement = document.createElement("script");
  scriptElement.setAttribute("type", "text/javascript");
  scriptElement.setAttribute("src", "/SyndicatedKnowledgeJSONP?s=" + escape(query.s.value) + "&n=" + 10 + "&callback=listEntries");
  
  document.documentElement.firstChild.appendChild(scriptElement);
}
 
/**
 * Similar JSON loading function, but for the initial search on load
 **/
function initialSearch(initialText) {
  var scriptElement = document.createElement("script");
  scriptElement.setAttribute("type", "text/javascript");
  scriptElement.setAttribute("src", "http://syndicatedknowledge-developer-edition.na3.force.com/SyndicatedKnowledgeJSONP?s=" + initialText + "&n=" + 10 + "&callback=listEntries");  
  document.documentElement.firstChild.appendChild(scriptElement);
}
 
/**
 * Deletes any old script elements which have been created by previous calls to search().
 **/
function removeOldJSONScriptNodes() {
  var jsonScript = document.getElementById("jsonScript");
  if (jsonScript) { jsonScript.parentNode.removeChild(jsonScript); }
}
 
/**
 * Deletes pre-existing children of the syndicatedknowledge div from the page. 
 * This may contain a "Searching..." message, or previous results.
 **/
function removeOldResults() {
  var div = document.getElementById("syndicatedknowledge");
  if (div.firstChild) { div.removeChild(div.firstChild); }
}
//-->
</script> 

 If you take the URL that is in the code "  http://syndicatedknowledge-developer-edition.na3.force.com/SyndicatedKnowledgeJSONP?s= "

and place in browser,, you get this back:

})

 

 

({
 "SearchPhrase" : "",
 "kbBaseURL" : "http://syndicatedknowledge-developer-edition.na3.force.com/articles/How_to/",
 "Articles" : [
   {"Title" : "Which rate plan is right for me?", "Summary" : "compare rate plans", "URLName" : "Which-rate-plan-is-right-for-me"},
   {"Title" : "Unable to Activate the AT&T 3G MicroCell", "Summary" : "", "URLName" : "Unable-to-Activate-the-AT-T-3G-MicroCell"},
   {"Title" : "How do I enroll in Wireless Phone Insurance?", "Summary" : "", "URLName" : "How-do-I-enroll-in-Wireless-Phone-Insurance"},
   {"Title" : "What do I need to do to enable Multimedia Messaging (MMS) on my iPhone 3G or iPhone 3GS?", "Summary" : "", "URLName" : "What-do-I-need-to-do-to-enable-Multimedia-Messaging-MMS-on-my-iPhone-3G-or-iPhone-3GS"},
   {"Title" : "How do I replace a broken phone?", "Summary" : "", "URLName" : "How-do-I-replace-a-broken-phone"},
   {"Title" : "How can I add, change or remove a feature?", "Summary" : "", "URLName" : "How-can-I-add-change-or-remove-a-feature"},
   {"Title" : "How can I estimate my data usage?", "Summary" : "", "URLName" : "How-can-I-estimate-my-data-usage"},
   {"Title" : "Will my minutes roll over?", "Summary" : "do minutes roll over", "URLName" : "Will-my-minutes-roll-over"},
  ] 
Brad HermanBrad Herman

I worked with @wposner to squash the bug that was causing this problem (thanks, Bill).  An updated version of the Syndicated Knowledge app is now live on AppExchange - http://sites.force.com/appexchange/listingDetail?listingId=a0N30000003IsNeEAK

This was selected as the best answer
wposnerwposner

Works great, does exactly what it says, easy setup, takes like 10 minutes.  Thanks for the quick response Brad!!