• Wim Velzeboer 6
  • NEWBIE
  • 15 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I want to build my own custom <knowledge:articleList> container, but I can't seem to get it working.

My Configuration:
The DataCategoryGroup is called: Knowledge_Base
The DataCategory is: testCategory
I have 10 articles in Knowledge_Base:testCategory

My VisualForce Page with the standard <knowledge:articleList> container (see below) will show the list of 10 Articles:
<apex:page>
    <apex:pageBlock title="My Searchresults">
        <knowledge:articleList articleVar="article" categories="Knowledge_Base:testCategory" hasMoreVar="false" pageSize="10">
            <apex:outputLink value="{!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink><br/>
            <small>{!article.lastModifiedDate},{!article.Id}</small>
            <hr/>
        </knowledge:articleList>
    </apex:pageBlock>
</apex:page>

When I try to build it with a custom Apex Class and VisualForce Page (see below) it will not work.

APEX CLASS:
public class cc_debug_search {
    public List<KnowledgeArticleVersion> getSearchResults(){ 
        String qryString = 'SELECT Id, title, UrlName, LastPublishedDate,LastModifiedById, KnowledgeArticleId FROM KnowledgeArticleVersion WHERE (PublishStatus = \'online\' and Language = \'en_US\')';
        List<KnowledgeArticleVersion> articleList= Database.query(qryString);
        return articleList;
    }
}
  

VISUALFORCE PAGE:
<apex:page controller="cc_debug_search">
    <apex:pageBlock title="My Custom Searchresults">
        <apex:repeat value="{!SearchResults}" var="article">
            <apex:outputLink value="{!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink><br/>
            <small>{!article.lastModifiedDate},{!article.Id}</small>
            <hr/>
        </apex:repeat>
    </apex:pageBlock>
    </apex:page>
  

This will return the error message:
Unable to Access Page
The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.



MY ANALYSIS:

It goos wrong on the {!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])} part. 
It seems the returned Id is wrong. I also tried to replace it with:

 - {!URLFOR($Action.KnowledgeArticle.View, article.KnowledgeArticleId,['popup' = 'true'])}
 - {!URLFOR($Action.KnowledgeArticle.View, LEFT(article.Id,15),['popup' = 'true'])}  to get a 15 char ID
 - {!URLFOR($Action.KnowledgeArticle.View, LEFT(article.KnowledgeArticleId,15),['popup' = 'true'])}  to get a 15 char ID

All without result...

Can anyone help me with this?
Hi, 
I would like to make a visualforce page with a preview of the file attached to the Knowledge article within a custom file field.

Currently I am able to do that, but only for an chatterFile/Attachment but not a file-field file, with the code below.
But how to I modify my code to preview a file stored within a custom-file-field on a Knowledge Article

<div class="chatterFileViewerPanel" id="chatterFileViewerPanel">
<embed src="/_swf/192001/sfc/flex/DocViewer.swf" 
    flashvars="shepherd_prefix=/sfc/servlet.shepherd&v={!myDocument.id}&mode=chatterfilepreview&in_tests=false" 
    width="100%" height="100%"  align="middle" id="renditionLarge" quality="high" bgcolor="#f3f3f3" name="renditionLarge" 
    allowscriptaccess="sameDomain" allowfullscreen="true" pluginspage="http://www.adobe.com/go/getflashplayer" wmode="opaque" 
    type="application/x-shockwave-flash" />
<noembed>&lt;p&gt;Flash file preview&lt;/p&gt;</noembed>
</div>
<script>
  insertFlexComponent('/_swf/192001/sfc/flex/DocViewer', 
     'shepherd_prefix=/sfc/servlet.shepherd&v={!myDocument.id}&mode=chatterfilepreview&in_tests=false', 
     '100%', '100%', '#f3f3f3', 'chatterFileViewerPanel', 'renditionLarge', false, 
     { adobeFlashVersionLbl : 'You must enable or download Adobe Flash Player version 9.0.115 or later to use this feature.', 
       downloadAdobeLbl : 'Download Adobe Flash Player', 
       downloadAdobeLinkLbl : 'Click the link below to download the Adobe Flash Player:', 
       closeDialogLbl : 'Cancel'}); 
Ninja.Flex.ContentStaticResourcesBase = '/_swf/192001/sfc';
Ninja.Flex.ShepherdController = '/sfc/servlet.shepherd';
</script>
Hi, 
I am setting up a Knowledge Base and I want to use a custom Search page build with Visual Force. I copied the exact code from: http://www.salesforce.com/docs/developer/knowledge_devpre/Content/knowledge_customize_searchpage_visualforce_04searchfilter.htm
Then I changed the line categoryCondition = 'Fashions:All,Stores:All,Products:All' ; into categoryCondition = 'Knowledge_Base:All'  in the file
VfSearchController.

I only have one Data Category Group named: Knowledge_Base
My Data Category Structure looks like this:
- Test1
- Test2
- - Test3 (= child of Test2)
- - Test4 (= child of Test2)

When I logon as Admin the filter displays the above list correctly (All, No Filter, Test1, etc...)
But when I create a user and give him only rights to access Test1 and Test3 I get the error message: "<knowledge:categoryList> unknown category: All

How do I have to modify my code to get a Category Filter list look like this:
- No Filter
- Test1
- Test3

When I login as that user and use the standard Knowledge Search, all works well and I get the above filter list.

Please help!
I want to build my own custom <knowledge:articleList> container, but I can't seem to get it working.

My Configuration:
The DataCategoryGroup is called: Knowledge_Base
The DataCategory is: testCategory
I have 10 articles in Knowledge_Base:testCategory

My VisualForce Page with the standard <knowledge:articleList> container (see below) will show the list of 10 Articles:
<apex:page>
    <apex:pageBlock title="My Searchresults">
        <knowledge:articleList articleVar="article" categories="Knowledge_Base:testCategory" hasMoreVar="false" pageSize="10">
            <apex:outputLink value="{!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink><br/>
            <small>{!article.lastModifiedDate},{!article.Id}</small>
            <hr/>
        </knowledge:articleList>
    </apex:pageBlock>
</apex:page>

When I try to build it with a custom Apex Class and VisualForce Page (see below) it will not work.

APEX CLASS:
public class cc_debug_search {
    public List<KnowledgeArticleVersion> getSearchResults(){ 
        String qryString = 'SELECT Id, title, UrlName, LastPublishedDate,LastModifiedById, KnowledgeArticleId FROM KnowledgeArticleVersion WHERE (PublishStatus = \'online\' and Language = \'en_US\')';
        List<KnowledgeArticleVersion> articleList= Database.query(qryString);
        return articleList;
    }
}
  

VISUALFORCE PAGE:
<apex:page controller="cc_debug_search">
    <apex:pageBlock title="My Custom Searchresults">
        <apex:repeat value="{!SearchResults}" var="article">
            <apex:outputLink value="{!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink><br/>
            <small>{!article.lastModifiedDate},{!article.Id}</small>
            <hr/>
        </apex:repeat>
    </apex:pageBlock>
    </apex:page>
  

This will return the error message:
Unable to Access Page
The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.



MY ANALYSIS:

It goos wrong on the {!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])} part. 
It seems the returned Id is wrong. I also tried to replace it with:

 - {!URLFOR($Action.KnowledgeArticle.View, article.KnowledgeArticleId,['popup' = 'true'])}
 - {!URLFOR($Action.KnowledgeArticle.View, LEFT(article.Id,15),['popup' = 'true'])}  to get a 15 char ID
 - {!URLFOR($Action.KnowledgeArticle.View, LEFT(article.KnowledgeArticleId,15),['popup' = 'true'])}  to get a 15 char ID

All without result...

Can anyone help me with this?
I want to build my own custom <knowledge:articleList> container, but I can't seem to get it working.

My Configuration:
The DataCategoryGroup is called: Knowledge_Base
The DataCategory is: testCategory
I have 10 articles in Knowledge_Base:testCategory

My VisualForce Page with the standard <knowledge:articleList> container (see below) will show the list of 10 Articles:
<apex:page>
    <apex:pageBlock title="My Searchresults">
        <knowledge:articleList articleVar="article" categories="Knowledge_Base:testCategory" hasMoreVar="false" pageSize="10">
            <apex:outputLink value="{!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink><br/>
            <small>{!article.lastModifiedDate},{!article.Id}</small>
            <hr/>
        </knowledge:articleList>
    </apex:pageBlock>
</apex:page>

When I try to build it with a custom Apex Class and VisualForce Page (see below) it will not work.

APEX CLASS:
public class cc_debug_search {
    public List<KnowledgeArticleVersion> getSearchResults(){ 
        String qryString = 'SELECT Id, title, UrlName, LastPublishedDate,LastModifiedById, KnowledgeArticleId FROM KnowledgeArticleVersion WHERE (PublishStatus = \'online\' and Language = \'en_US\')';
        List<KnowledgeArticleVersion> articleList= Database.query(qryString);
        return articleList;
    }
}
  

VISUALFORCE PAGE:
<apex:page controller="cc_debug_search">
    <apex:pageBlock title="My Custom Searchresults">
        <apex:repeat value="{!SearchResults}" var="article">
            <apex:outputLink value="{!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])}">{!article.title}</apex:outputLink><br/>
            <small>{!article.lastModifiedDate},{!article.Id}</small>
            <hr/>
        </apex:repeat>
    </apex:pageBlock>
    </apex:page>
  

This will return the error message:
Unable to Access Page
The value of a parameter contains a character that is not allowed or the value exceeds the maximum allowed length. Remove the character from the parameter value or reduce the value length and resubmit. If the error still persists, report it to our Customer Support team. Provide the URL of the page you were requesting as well as any other related information.



MY ANALYSIS:

It goos wrong on the {!URLFOR($Action.KnowledgeArticle.View, article.id,['popup' = 'true'])} part. 
It seems the returned Id is wrong. I also tried to replace it with:

 - {!URLFOR($Action.KnowledgeArticle.View, article.KnowledgeArticleId,['popup' = 'true'])}
 - {!URLFOR($Action.KnowledgeArticle.View, LEFT(article.Id,15),['popup' = 'true'])}  to get a 15 char ID
 - {!URLFOR($Action.KnowledgeArticle.View, LEFT(article.KnowledgeArticleId,15),['popup' = 'true'])}  to get a 15 char ID

All without result...

Can anyone help me with this?