Knowledge management - import and export images and documents across groups

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; search by keyword – look-ahead typing; multiple-language support; import and export as XML file like DocBook; import and export images and documents across groups; etc.

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)

We have discussed main features of Knowledge base articles in both Liferay portal 5.2 EE SP1 (or SP2 or SP3) and 6.0 like

Import and export Knowledge based articles

Multiple-language support for Knowledge Base articles

Taxonomies and Folksonomies - Increasing search and retrieve capabilities in Knowledge Base Articles

Sharing Content - Knowledge base - across Organizations and Communities

Search by keyword - look-ahead typing – based on Knowledge Base articles in Liferay portal 6

This article will share one more feature: import and export images and documents across groups in Liferay portal 6 and 5.2 EE SP1 (or SP2 or SP3).

Introduction

You may have thousands of articles like Questions & Answers, Ideas management in third party systems. Now you are planning to import these articles into Liferay portal Knowledge base portlets. And moreover, you are required to import images and documents in articles into Image Gallery and Document Library, respectively. Thus once articles got imported in Liferay portal, it would have all images and documents stored in Liferay portal, too.

Similarly, you may have thousands of KB articles. You are planning to export these articles with images and documents in Liferay portal into third party systems like DocBook XML files.

This article will share how to import or export KB articles with images and documents across groups in general.

Import images and documents in Image Gallery and Document Library 

The importing process is smart – it can detect whether it is XML or ZIP file; and furthermore, it can support both DocBook XML format and ROW-ITEM XML format.

 

Default settings

## Import docbook
## like /${kb.ig.default.root.folder.name}/${article.id}/en_US for English
kb.ig.default.root.folder.name=KB_IG_Home
kb.ig.default.root.folder.description=Knowledge Based IG Home

kb.ig.default.folder.languague.description=Knowledge Based Language Home

## enable custom group to contain images and documents
kb.default.group.organization.enabled=true

## default documents and images container group (organization)
## This property would be active when kb.default.group.organization.enabled is set to true
kb.default.group.organization.name=Knowledge Based Group

## default documents root folder
## like /${kb.dl.default.root.folder.name}/${article.id}/en_US for English
kb.dl.default.root.folder.name=KB_DL_Home
kb.dl.default.root.folder.description=Knowledge Based DL Home

## default vocabulary name
kb.default.vocabulary.name=Knowledge Based

As you can see, you can import images and documents into a specific group or current group. Set kb.default.group.organization.enabled to true to import images and documents into a specific group; or set kb.default.group.organization.enabled to false to import images and documents into current group. This is configurable in KB portlet.

Export images and documents in KB Articles

You can export all articles or selected articles or a specific article with images and documents.

export all articles or selected articles

export a specfic article

 

An Example

An article in DocBook with multiple language support plus images and documents for importing

<?xml version='1.0' ?>
<book>
  <bookinfo>
    <chapter>
      <title>Answer ID: 17</title>
      <section>
        <title>Summary</title>
        <para>Panagon Password Resets</para>
      </section>
      <section>
        <title>Question</title>
        <para>Panagon Password Resets</para>
      </section>
      <section>
        <title>Answer</title>
        <para>Jill Parsons or John Stirrup can reset Panagon Passwords.
        <br />They recommend emailing both of them to ensure that the request is picked up as quickly as possible. <a href="http://liferay.cignex.com/palm_tree/book/liferay-portal-5-2-systems-development-sample-chapter-5-managing-pages.pdf" title="Sample Chapter">Sample Chapter</a><img alt="figure6" src="http://liferay.cignex.com/palm_tree/book/liferay-dev.book.png" border="0" /> </para>
      </section>
      <section>
        <title>Product</title>
        <para>Unilever Applications</para>
      </section>
      <section>
        <title>Sub-Product</title>
        <para>Other</para>
      </section>
      <section>
        <title>Language-Locale</title>
        <para>en_US</para>
      </section>
    </chapter>
    <chapter>
      <title>Answer ID: 17</title>
      <section>
        <title>Summary</title>
        <para>Panagon Password Resets DE</para>
      </section>
      <section>
        <title>Question</title>
        <para>Panagon Password Resets DE</para>
      </section>
      <section>
        <title>Answer</title>
        <para>Jill Parsons or John Stirrup can reset Panagon Passwords.<img alt="figure6" src="http://liferay.cignex.com/palm_tree/book/liferay-dev.book.png" border="0" /> <br />They recommend emailing both of them to ensure that the request is picked up as quickly as possible. DE</para>
      </section>
      <section>
        <title>Product</title>
        <para>Unilever Applications</para>
      </section>
      <section>
        <title>Sub-Product</title>
        <para>Other</para>
      </section>
      <section>
        <title>Language-Locale</title>
        <para>de_DE</para>
      </section>
    </chapter>
  </bookinfo>
</book>

After importing, the article has following lines in content

In English

<p>Jill Parsons or John Stirrup can reset Panagon Passwords. <br />
They recommend emailing both of them to ensure that the request is picked up as quickly as possible. <a title="Sample Chapter" href="/c/document_library/get_file?uuid=3cc7d6c1-ebe9-496e-b66a-499b1fc6379a&amp;groupId=17802">Sample Chapter</a><img border="0" src="/image/image_gallery?uuid=a5e53991-46a3-44b7-a587-ecd8838bc1ed&amp;groupId=17802" alt="figure6" /></p>

In German

<p>Jill Parsons or John Stirrup can reset Panagon Passwords.<img border="0" src="/image/image_gallery?uuid=b5fefea6-6b89-4353-83a9-d7c10c54cdc5&amp;groupId=17802" alt="figure6" /> <br />
They recommend emailing both of them to ensure that the request is picked up as quickly as possible. DE</p>

Summary

As you can see, importing and exporting images and documents in KB articles are useful. That is, you can import articles with images and documents from third party systems into Liferay portal as Knowledge base articles; or you can export any Knowledge base articles with images and documents in Liferay portal to third party systems.

Last but not least, I'd like to send special thanks to Robert Chen and Frank Yu who did an amazing job to make importing and exporting images and documents in Knowledge base articles a reality.

Blogs
how do I import the docbook xml?? it always asks for a .lar file to be specified ....
Hi,
Has this feature discontinued.
How to import docbook xml, kb always asks for .lar file.As you have mentioned it will also work with zilp file I tried zipping xml genearated earlier still no success.
Appreciate your help.