Sharing Content - Knowledge base - across Organizations and Communities

The topic “sharing content across organizations” has been discussed for a while. You can refer to forums entries like

Ideas for sharing content across organizations

Proposal: sharing tags and assets in organization hierarchy

Main challenges are, but not limited,  

  • Security on content
  • Scope of sharing

In 6.0, it introduces a group called Shared Global - the content in a group Shared Global would be visible across organizations and communities. This is good feature. But this feature did not provide real capability - sharing content in organization hierarchy or sharing content across groups.

It is too big to discuss on how to share any content like Web Content, Wiki articles, Blogs entries, Forum messages, Bookmarks entries, calendar entries, Image gallery images, document library documents, etc.  Thus, this article will introduce proposals on sharing content - Knowledge base – across groups. Especially, it will discuss how to share content -Knowledge base – across any groups (developed in plugins SDK). If these approaches were really good, they could be applied on any content of the portal core, too. 

Introduction

What’s knowledge base or knowledge management (KM)? The portlet Knowledge Base allows authoring articles and organize them in a hierarchy of navigable categories. It leverages Web Content articles, structures, and templates; allows rating on articles; allows commenting on articles; allows adding hierarchy of categories; allows adding tags on articles; exports articles to PDF and other formats; supports workflow; allows adding custom attributes (called custom fields); supports indexing and advanced search; allows using rule engine; etc.

Most importantly the portlet Knowledge Base supports import of a semantic mark-up language for technical documentation called DocBook. DocBook enables its users to create document content in a presentation-neutral form that captures the logical structure of the content; that content can then be published in a variety of formats, like HTML, XHTML, EPUB, and PDF, without requiring users to make any changes to the source. Refer to http://www.docbook.org/.

In general, the portlet Knowledge Base provides two pieces inside: Articles – managing knowledge base articles - and Article Aggregator - publishing knowledge base articles. 

Abstracted from the book: Liferay Portal 6 Enterprise Intranets (coming out soon)

Schemes - sharing knowledge base articles across groups 

In brief, we proposed four sharing knowledge scheme.

  1. Sharing knowledge articles across groups (organization, communities, my community) by specific permission SHARE – called shared-by-permission.
  2. Sharing knowledge articles by organization hierarchy - called shared-by-organization-hierarchy.
  3. Sharing knowledge articles across groups (organization, communities, my community) by membership - called shared-by-membership.
  4. Sharing knowledge articles across groups (organization, communities, my community) by ownership - called shared-by-subscription.

Scheme shared-by-permission

Knowledge base articles could be shared by assigning permission SHARE. How to achieve this?

First, define permission action SHARE on model com.liferay.kb.knowledgebase.model.KBArticle in default.xml as follows.

<action-key>SHARED_ARTICLE</action-key> 

Then, set a property for shared articles by permission across groups.

## shared articles by permission across groups (organizations, communities, my community).

## The permission SHARE is available only if kb.shared.articles.by.permission is set to true.

kb.shared.articles.by.permission=true

##Nothing shared by permission if this property is set to false.

# kb.shared.articles.by.permission=false

Scheme shared-by-organization-hierarchy

Knowledge base articles could be shared by organization hierarchy. How to achieve this?

First, define a property kb.shared.articles.by.organization.hierarchy.enabled. To enable this feature, set it to true.  To disable this feature, set it to false.

## shared articles by organization hierarchy

kb.shared.articles.by.organization.hierarchy.enabled=true

Then, specify sharing approaches. Sharing approaches would be top-down or bottom-up.

## Shared articles in organization hierarchy.

## Sharing approaches: top-down, bottom-up

## The property kb.shared.articles.in.organization.hierarchy will be loaded 

## only if kb.shared.articles.by.organization.hierarchy.enabled is set to true.

## Supposed that there are organizations Level 0, Level 1 and Level 2, Level 0 is parent of Level 1 and Level 2 is child of level 1.  

## Using approach bottom-up, the user Level2User, a member of Level 2, would be able to see all articles in Level 0 and Level 1 as shared articles in Level 2; the user Level1User, a member of Level 1, would be able to see all articles in Level 0 as shared articles in Level 1.

kb.shared.articles.in.organization.hierarchy=bottom-up

## Using approach top-down, the user Level0User, a member of Level 0, would be able to see all articles in Level 1 and Level 2 as shared articles in Level 0; the user Level1User, a member of Level 1, would be able to see all articles in Level 2 as shared articles in Level 1.

## kb.shared.articles.in.organization.hierarchy=top-down

Scheme shared-by-membership

Knowledge base articles could be shared by membership. How to achieve this?

## Enable shared by membership

## Supposed that the end user is a member of groups (organizations or communities) G1 and G2, in My Community the end user should be able to see all approved articles of groups G1 and G2 as shared articles.

kb.shared.by.membership.enabled=true

Scheme shared-by-subscription

Knowledge base articles could be shared by subscription. How to achieve this?

Supposed that the end user is a member of groups (organizations or communities) G1 and G2, the end user has subscribed a set of Knowledge base articles in any groups like G1 and G2. Now when the end user clicks on “My Subscription” in any group (organization, community or my community), the end user would be able to see all subscriptions, either as shared articles or as normal articles.    

## enable all subscriptions for current user

kb.all.subscriptions.enabled=true

Prototype – an implementation

Environment: Liferay portal 5.2.5 – EE 5.2 SP1; Knowledge base portlet. It would be easy to upgrade to 6.0.

Share articles by permission SHARE.

Display shared articles in current group as well as normal articles of current group.

Share articles by organization hierarchy

Share articles by membership – show all articles from groups which current user is a group member in My Community.

Share articles by subscription - all subscriptions for current user

Summary

As you can see, content - knowledge base articles - can be shared by permissions, organization hierarchy, membership and ownership. And sharing content knowledge schemes across groups are configurable. That is, you would be able to configure them according to your own requirements. By the way, these approaches would be helpful for sharing any content across groups in the portal instance, like Web Content, Wiki articles, Blogs entries, Forum messages, Bookmarks entries, calendar entries, Image gallery images, document library documents, etc.

Last but not least, I'd like to send special thanks to Peter Shin, Julio Camarero, Jorge Ferrer, Bruno Farache, Robert Chen and Frank Yu who did an amazing job to make Knowledge base portlets a reality. Also to everyone else that helped during development and providing feedback. 

Blogs
Good job!
It seems very interesting... where can i find source code? I didn't find it in public svn... i would like to take a look at it.
Thanks
Hi Luca, thank you.

You could find source code (basic for 6.0 from the book: Liferay Portal 6 Enterprise Intranets) at http://liferay.cignex.com/palm_tree/book/0387/chapter11/knowledge-base-portlet-6.0.0.1.war

This WAR file will get updated regularly.

Details source code for both 5.2 and 6.0 will be available shortly.
What would be required to use this under the CE 5.2.3 with Tomcat 6.0? I've tried installing as a plugin and when I do I lose the ability to look at plugins, get a white page until the kb is deleted and liferay is restarted.

Thanks,
Hi Douglas, Thanks. KM is only available for Liferay EE 5.2.5 SP1 or above like Liferay 6.0. Yes, you will get error in CE 5.2.3. Please let me know if you need it for Liferay EE 5.2 and Liferay 6.0.
Hi Jonas, i'd like to test it in liferay EE 5.2.3. What can i do ? I had tested other version and end up crash my liferay. My Company is evaluate the KB system for replacement.
Hi Ming,

Thank you. You can find WAR of KB at

http://liferay.cignex.com/palm_tree/0387/knowledge-base-portlet-5.2.5.1.war

Just tested KB in 5.2 EE SP1, SP2 and SP3, it seems working well.
Hi Jonas,

Great job! I'd like to use your portlet for my company. I tried to install it but with no success because of a NoClassDefFoundError on com.lifera.portal.NoSuchModelException. I'm using Liferay EE 5.2.6 SP2 and JBoss AS but I didn't find that class in Liferay source code. I thought that it should have been in Liferay code as not present in your generated service classes, is that correct? Did you try to install your portlet in Liferay EE 5.2.6 SP2?
Hi Camlillo, Thanks. The portlet link provided in above post is for Liferay portal 6. Definitely the build is for Liferay portal 6 or above, not for 5.2 EE.

Of course, we did have KB portlets for 5.2 EE like SP1, SP2 and SP3. If you need it, I would send you a link and you may play with KB portlets in EE 5.2.6 SP2 (or SP1 or SP3).
Could you give me the link to KB portlets compatible with Liferay EE 5.2.3?
Hi Chew, KB portlets need special support in Liferay CE 5.2.3. And CE 5.2.3 is buggy and unstable. Would you plan to use Liferay 5.2 EE like SP1 or SP2 or SP3?
Oops, mistaken, I'm using Liferay 5.2 EE SP2. Does this version needs special support?
Hi Chew,

Thank you. You can find WAR of KB at

http://liferay.cignex.com/palm_tree/0387/knowledge-base-portlet-5.2.5.1.war

Just tested KB in 5.2 EE SP1, SP2 and SP3, it seems working well. But some features are under implementing like

Import Docbook articles with multiple language support
Import Docbook articles with categories

etc.
Hi Camilio,

Thank you. You can get WAR of KB at

http://liferay.cignex.com/palm_tree/0387/knowledge-base-portlet-5.2.5.1.war
Help me!
I have a problem when building ext asset publisher.when I sign in, I click in one article in ext asset publisher table I receive a message:"You do not have the roles required to access this portlet." but when sign out is looked this article content.
Thanks first!
Hi duy, Thank you. This is expected behavior. Ext asset publisher provided a way to customize Asset Publisher. But the links of assets are not customized in this example. You can go ahead and customize the links of assets in your own Ext Asset Publisher portlet.

In fact, there are several sections of chapters 7 & 8 (of the book Liferay Portal 5.2 Systems Development) which show how to provide links to view assets.
Hello,

When you say "Hi Chew, KB portlets need special support in Liferay CE 5.2.3. And CE 5.2.3 is buggy and unstable. Would you plan to use Liferay 5.2 EE like SP1 or SP2 or SP3? " I am not happy to understand CE is poor and buggy. But it is your right !

So it is really possible to use KM with CE or should we use EE ?

Best regards,
Hi Nicole, thanks. CE *IS NOT* poor, but it is buggy and unstable, actually. Anyway, you can fix a lot of bugs in CE.

KM is implemented in 5.2.5 (5.2 EE SP1) and Liferay 6. Thus it requires EE version for 5.2. That is, KM needs 5.2 EE SP1 or above version. Of course, you can use KM in Liferay portal 6 (both CE and EE), when Liferay 6 CE or EE is available.
Hi, Jonas,
Great Job!
I downloaded the latest Liferay Portal 6 RC2 Bundled with Tomcat and knowledge-base-portlet-6.0.0.1.war and tried to run. However, it gives an error message as below.
Do you have any suggestions what I should do in order to test-run the knowledge base portlet?

Thanks!



SEVERE: Null component Catalina:type=JspMonitor,name=jsp,WebModule=//localhost/k
nowledge-base-portlet,J2EEApplication=none,J2EEServer=none
Jun 10, 2010 7:04:27 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory knowledge-base-portlet
java.lang.UnsupportedClassVersionError: Bad version number in .class file (unabl
e to load class com.liferay.knowledgebase.servlet.KnowledgeBaseServletContextLis
tener)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(Webapp
ClassLoader.java:2531)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoa
der.java:1010)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1483)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1361)
at org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebA
nnotationSet.java:145)
Hi, Jonas,
It seems that the problem is that kb requires JRE 1.6+. After switching to JRE 1.6, kb portlet is loaded successfully but in the control panel->knowledge base, there is a warning message:
"Knowledge Base is temporarily unavailable". Do you have and solutions for this?

Thanks!
Hi Wei Cheng, Thanks. yes, JDK6 12 update or above is required. By the way, the WAR is for 5.2 EE SP1, SP2 and SP3.

Hope that it helps.
Hi,
Thanks for you quick reply!
Do you mean even knowledge-base-portlet-6.0.0.1.war is also for the EE SPx?
Oh, There are two WAR files provided: one for 5.2 EE SPX, one for Liferay 6.0. Sure, knowledge-base-portlet-6.0.0.1.war should be used for Liferay 6. And it will get updated soon for Liferay 6.0.3 (GA).

Thanks, Wei Cheng.
When using the knowlege base aggregator in title or abstact mode, once you click on a link and is opened in the same portlet is there a way to add a back button (i.e. similar to how the Asset Publisher shows articles)?
Hi Rodrick, you would be able to change this behavior by modifying related JSP file.

Good luck!
Hi Thanks a lot for your help and for the very helpful tutorial
Hi Jonas,

I am trying KB 6.0.6.1 and I have an issue with KB search portlet. Somehow it fails to find the articles which is viewable though organization membership. Those are shown up well through KB display and aggregator portlets.

Brian
Hi Brian, which Liferay portal version are you using? Supposed that you are using trunk version (like 6.0.6), right? You mentioned "KB 6.0.6.1", but latest CE version is 6.0.5 GA 3.

Thanks

Jonas
Hi, Jonas,
I tried the knowledge base version 6.0.6.1 with 6.0.5 GA 3. It works. Great Job!
One question I have is that the layout of the knowledge base portlet looks quite different from your blog. Instead of the table-like layout, it's listed one by one. Is there anyway I can switch to the table-like layout you have?
Thanks again!

Wei Cheng
Hi Cheng, Thanks. You can change the view by updating JSP files. Please let me know if you meet any issues.

best,

Jonas
Hi Jonas,
Actually I am working with trial version of 6.0 EE. Here is what I found. When I give the permission to view a KB article to organization member only, the search fails to find it. However, I found it after the posting, that if I give the permission to user, the search finds it properly. Thank you.
Brian.
Above it states: Abstracted from the book: Liferay Portal 6 Enterprise Intranets.

However, this book does not contain information concerning the knowledge base other than some passing mentions. Is there anywhere where configuration and other setup information for the knowledge base is located?
Hi Christopher, Thanks.

Eventually, there are 13 chapters in this book. due to page number, two chapters got removed, knowledge base is one of them.

Jonas
Hi Jonas, will this chapter about KB be posted elsewhere? Documentation is heavily needed. It is currently unclear how far the current version of the KB portlets are developed and what is still work to be done. For instance: in this blog you talk about docbook import: is this a hidden feature or not implemented yet? Also: you can use hierarchies to create books/manuals but it is currently not possible to rearrange the order of the subarticles which is of course a requirement in real practice. Another example is the integration with the asset publisher or any other tool to show a) an index of the chapters in a manual in one portlet and b) to show the content of the chapters in another portlet. This can be done when the KB Aggregator can send a message to the Asset Publisher to show the content of the selected item (as can be done with many other LR portlets).
Any updates on this.
@RoK, @Scott, thanks. sorry to come back late.

yes, I am planning to provide detailed documentation for these features in new book: Liferay Portal 6.2 Systems Development.

Hopefully I could make it.
Hey jonas, http://liferay.cignex.com/palm_tree/book/0387/chapter11/knowledge-base-portlet-6­.0.0.1.war file is not working
Hey Jonas, we have been trying to get the knowledge base plugin deployed, but cannot figure out what we are doing wrong. We are running Liferay 6.0.6 CE on Windows 32 bit with JDK 6 18. Liferay may be using the JRE that comes bundled with 6.0.6. I am trying to figure that out. When I try to look at KB in the Control Panel I get the below error in the console and I get a message "KB Admin is temporarily unavailable.

21:56:57,575 ERROR [PortletRequestDispatcherImpl:108] org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 85 in the generated java file
Only a type can be imported. com.liferay.portlet.portletconfiguration.util.PortletConfigurationUtil resolves to a package

Stacktrace:
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 85 in the generated java file
Only a type can be imported. com.liferay.portlet.portletconfiguration.util.PortletConfigurationUtil resolves to a package

I also get errors deploying the WAR file. Is there a way to make sure I am using my JDK instead of provided JRE, or is that not the issue.

21:56:13,965 ERROR [PortletApplicationContext:80] org.springframework.beans.factory.parsing.BeanDefinitionParsingException: C
onfiguration problem: Bean class [com.liferay.portal.spring.context.PortletBeanFactoryCleaner] not found
Offending resource: ServletContext resource [/WEB-INF/classes/META-INF/base-spring.xml]
Bean ''; nested exception is java.lang.ClassNotFoundException: com.liferay.portal.spring.context.PortletBeanFactoryCleaner
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean class [com.liferay.port
al.spring.context.PortletBeanFactoryCleaner] not found
Offending resource: ServletContext resource [/WEB-INF/classes/META-INF/base-spring.xml]
Bean ''; nested exception is java.lang.ClassNotFoundException: com.liferay.portal.spring.context.PortletBeanFactoryCleaner
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
@Mani @Jason

Thanks, the WAR was built for 5.2 (CE and EE). I am planning to provide new WAR file for 6.0.6 CE.
@jeeamra

Thanks, you should be able to receive updates once subscribed.

Jonas
Hi jonas,
Did you update the WAR file? of,
http://liferay.cignex.com/palm_tree/book/0387/chapter11/knowledge-base-portlet-6­­.0.0.1.war
Thanks, Mani,

It is in the to-do list.

Jonas
I think I almost have this 100% figured out. But I'm still having a few issues.

I have my organizations set up similar to this:
Org
|
| |
DeptA DeptB

These organizations have the roles "DeptA User", "DeptB User", and "Org User" defined, which are applied to users depending on what organization they belong to.

When a user logs in, they are sent to the Org site which contains the Knowledge Base portlet. In the Knowledge Base portlet I've created 3 article:

HR Article
HR DeptA Article
HR DeptB Article

I'd like to have the knowledge base portlet display _only_ the articles that a user has access to. Right now, if a user in DeptB logs in, they see a list of all three articles, even though they should only see "HR Article" and "HR DeptB Article".

I've successfully set the permissions on "HR DeptA Article" to prevent users from DeptB from opening it, but I'd like DeptB users to only see the documents they can open.