Sunday, July 18, 2010

My First KnowledgeTree Plugin

I am using KnowledgeTree for more than 3 years, but never do any development for it. This is a first plugin, it take me only about 10 minutes. This plugin is a Dashlet used to display online users. I have read a wiki reference and do some research on 'active_sessions' table. I admit that it is very easy to code this plugin. But I don't know why KT doesnot have a better plugin installer. Like Joomla! we create plugin, make a zip file with codes and XML manifest file. Then we install it just by upload through its installer. This make webmaster can check release information from the installer where information resides in XML manifest file.

You can download the plugin from my personal web site, Joomlant.com - All about Joomla!. It is in Thai however I provide information for this plugin in English. The following picture is what it is function on Dashboard.


Please leave any comment or feedback if you find it useful. If you have any idea to extend KnowledgeTree functionality, please let me know.

Monday, July 12, 2010

Set up KnowledgeTree DropBox

What is KnowledgeTree DropBox? It is just a small Windows program that can make your like easier in uploading documents to KnowledgeTree server. Using this program, you can simply drag and drop file into "Drop Box" of this program. The uploaded documents will be put in "Dropped Document" folder on server. Then you have to move them to required folder and input addtional metadata information.

Where you get it?

When you use KnowledgeTree Community Edition and registered your usage with KnowledgeTree.com you will get it. If you use commercial edition, surely you will get it and more tools. To use this software you have to enable one plugin on the server. It is "My Drop Documents" plugin. Web service will have to be enabled as this program communicate with KT using XML/SOAP web service.

When you got trouble?

Upon installation of program, you have to provide user information for the program used to upload document. If you provide correct information, you will not get message complaining about "connection problem". But you will get error message "cannot mkdir ...." something like this.
mkdir() [function.mkdir]: Permission denied
This is why I share you this information to resolve this problem.

Resolve the problem

To resolve to problem, you have to identified which group you use in running Apache server. For 3.6.1 and earlier it is 'nobody'. For 3.7+ it depends on your distribution and setting. In my case, I use CentOS 5 and it is 'apache'. Once you got this information, change directory to /var/proxies/ and create directory with the name of user running Apache. Change group of folder for it also. Then try connect DropBox to server again. If there no error message, try drag a file to DropBox. It should be success, you file uploaded to server. Login to KT and see if it there.

Sunday, July 11, 2010

Problems on upgrade KT 3.6.1 CE to 3.7.0.2 CE

I have spent a long time for upgrading KnowledgeTree 3.6.1 Community Edition to 3.7.0.2 Community Edition. As you know KT 3.6.1 CE use its own installation stack, while 3.7.0.2 use OS distribution package like YUM and rpm for installation. I installed KT on CentOS 5.2, which now upgraded to 5.5 and use MySQL on port 3307.

For those that do not know how to upgrade, you have to follow this guide. But even if you carefully follow this guide you still have problems when upgrading. These are the problems you will have, and I provided the solutions here.

First Problem

When install KT 3.7.0.2 using stack installer, it works fine. But when starting to upgrade using php script (http://127.0.0.1/knowledgetree/) it completely failed. If you looking at error messages it complained about cannot include file DB/.php. Inspecting the file name, and open the source, it looks like that database type is undefined. This is caused by content of file in /usr/share/knowledgetree-ce/config/config-path which contains information about some configuration file. So to resolve the problem, delete all content in this file except one that specifies /etc/knowledgetree-ce/config.ini.

Second Problem

Ok at this point, you can run http://127.0.0.1/knowledgetree/ which start upgrading wizard. But you will end up with the upgrader cannot connect to the old MySQL server instance in my case MySQL at port 3307. This is also another bug in the package. After spending for some time in Google search I found that we have to replace a file in /usr/share/knowledgetree-ce/setup/migrate/steps/migrateDatabase.php with a patched file. So this resolve all problems encountered during upgrade. This is a link from knowledgeTree to download this file. If you have a problem please let me know.

I don't know why this problem is not resolved by a new released as I start first time upgrade for 2 months ago, upon failure I postponed an upgrade and then I started it again last week. Fortunately this time luck stays with me. Now the upgrade works fine.