The cfw_kix.pm configuration module


Below is shown a copy of the cfw_kix.pm module, which is used by KIX to configure many of the CGI scripts and the command line scripts. The cfw_kix.pm module should be installed in the KIX lib directory.

The cfw_kix.pm module is distributed as a template with the KixFw download. The module needs adaptation for each KIX installation. Each place, where adaptation may be required is marked by a hypertext link, which if followed explains the configured item.

 #=======================================================================
 #	$Id: cfw_kix.pm,v 1.11 2009/01/05 18:22:30 metaagility Exp $
 #	Example cfw configuration for kix
 #=======================================================================
 package cfw_kix;
 use strict;
 use PythonTech::Cfw;
 
 my $HOME = '/home/metaagility';
 my $KIXDIR = "$HOME/kix";
 my $CGIBASE = 'http://www.metaagility.com/cgi-bin';
 my $X3P_LOGFILE = "$HOME/x3plogs/x3pkix.log";
 
 #-----------------------------------------------------------------------
 #	Example configuration in cfw for kixfw application
 #-----------------------------------------------------------------------
 my $rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
 cfwset(
 
        # cfw imports: loginurl, logouturl, cgi/kixAccessControl
 
        sysadmin_users => [ 'superuser1','superuser2'],
 
        # demo KIX instance
        kix => {
 	       basequalifier  => 'kixfw',
 	       imageurl       => '/img',
 	       baseuri        => "$CGIBASE/kixfw",
 	       showuri        => "$CGIBASE/kixshow",
 	       x3pservice_uri => "$CGIBASE/x3pkix",
 	       cronmail      => 'no.reply@dkix.metaagility.com',
 	       file_kixdb    => "$KIXDIR/kix.db", # main triple database
 	       file_dyndb    => "$KIXDIR/aux.db", # auxillary triple database
 	       file_x3pkixdb => "$KIXDIR/x3pkix.db", # X3P sessions and cache database
 	       dir_templates => "$KIXDIR/templates", # configured and installed HTML templates
               repository => "$KIXDIR/repository", # optional directory for document content files
               extensions2mime => { # HASH table for mime types of known extensions
                                   tex => 'text/plain',
                                   txt => 'text/plain',
                                   log => 'text/plain',
                                   lst => 'text/plain',
                                   c => 'text/plain',
                                   cpp => 'text/plain',
                                   pl => 'text/plain',
                                   pm => 'text/plain',
                                   py => 'text/plain',
                                   jar => 'text/plain',
                                   tcl => 'text/plain',
                                   ccl => 'text/plain',
                                   nt => 'text/plain',
                                   xml => 'text/plain',
                                   rdf => 'text/plain',
                                  },
 
 
 	       #####  X3P federation stuff  #####
 
 
 	       # DEMO (1st federate): demo_qualifier = demo
 
 	       demo_nick => 'KixDemo',
 	       demo_uri => 'http://www.kixfw.org/cgi-bin/kixdemo',
 	       demo_x3p => 'http://www.kixfw.org/cgi-bin/x3pkix',
 
 
 	       # TEST (2nd federate): test_qualifier = test
 
 	       test_nick => 'KixTest',
 	       test_uri => 'http://www.metaagility.com/cgi-bin/kixtest',
 	       testx3p => 'http://www.metaagility.com/cgi-bin/x3pkixtest',
 
 	       # XXXX (3rd federate): to be inserted below in
 	       #                      1. federation,
 	       #                      2. fedqmap,
 	       #                      3. fullqmap
 
 	       federation => { demo => {
 				       fed_nickname => cfwref('kix/demo_nick'),
 				       fed_x3p => cfwref('kix/demo_x3p'),
 				      },
 			       test => {
 					 fed_nickname => cfwref('kix/test_nick'),
 					 fed_x3p => cfwref('kix/testx3p'),
 					},
 			     },
 	       fedqmap => cfwobj('PythonTech::QMap',
 				 qmap => {
 					  rdf => "$rdf",
 					  demo => cfwref('kix/demo_uri'),
 					  test => cfwref('kix/test_uri'),
 					 },
 				),
 	       fullqmap => cfwobj('PythonTech::QMap',
 				  qmap => {rdf => "$rdf",
 		# Note. The tag identifier kixfw below needs to be
 		# the same as the basequalifier value (see above).
 					   kixfw => cfwref('kix/baseuri'),
 					   demo => cfwref('kix/demo_uri'),
 					   test =>cfwref('kix/test_uri'),
 					  },
 				 ),
 
 
 
 	       #### The rest is KIX standard configuration, ####
 	       #### which normally isn't changed.           ####
 
 
 	       kixdb => cfwobj('PythonTech::Triples::DBHash',
 			       {
 				filename => cfwref('kix/file_kixdb'),
 				index_s2p => 1,
 				index_o2p => 1,
 				access => 'wl',
 			       }),
 	       kixqdb => cfwobj('PythonTech::Triples::QMapped',
 				qtriples => cfwref('kix/kixdb'),
 				qmap => cfwref('kix/fullqmap'),
 			       ),
 	       initstorage => cfwobj('Kix::InitStorage',
 				     db => cfwref('kix/kixqdb'),
 				     baseuri => cfwref('kix/baseuri')),
 	       extradb => cfwobj('PythonTech::Triples::DBHash',
 				 {
 				  filename => cfwref('kix/file_dyndb'),
 				  index_s2p => 1,
 				  index_o2p => 1,
 				  access => 'wl',
 				 }),
 	       kixqstore => cfwobj('PythonTech::Triples::QMapped',
 				   qtriples => cfwref('kix/kixstore'),
 				   qmap => cfwref('kix/fullqmap'),
 				  ),
 	       kixstore => cfwobj('PythonTech::Triples::Multi',
 				  {
 				   dbs => [
 					   cfwref('kix/kixdb'),
 					   cfwref('kix/extradb'),
 					  ]
 				  }),
 	       kixclassmap => {
 			       'kix:User' => 'Kix::User',
 			       'kix:AdminUser' => 'Kix::User',
 			       'kix:Document' => 'Kix::Document',
 			       'kix:Version' => 'Kix::Version',
 			       'kix:Folder' => 'Kix::Folder',
 			       'kix:Event' => 'Kix::Event',
 			       'kix:Observation' => 'Kix::Observation',
 			       'kix:Alarm' => 'Kix::Alarm',
 			       'kix:Comment' => 'Kix::Comment',
 			       '' => 'Kix::Obj', # Default
 			      },
 #	       kixfwqstore => cfwref('kix/kixqstore'),     # non federate config
 	       kixfwqstore => cfwref('kix/x3pqstore'),     # federate config
 	       kixfwmodel => cfwobj('Kix::X3pModel',
 				    {
 				     triples => cfwref('kix/kixfwqstore'),
 				     classmap => cfwref('kix/kixclassmap'),
 				    }),
 	       x3pclassmap => {
 			       'x3p:OtherHandler' => 'X3P::Other',
 			       'x3p:TestHandler' => 'X3P::Test',
 			       'kix:X3pExtender' => 'Kix::X3pExtender',
 			       'kix:X3pHandler' => 'Kix::X3pHandler',
 			       'x3p:Session' => 'X3P::Session',
 			       'x3p:ClosedSession' => 'X3P::Session',
 			       '' => 'PythonTech::Obj',
 			      },
 	       x3pcache => cfwobj('PythonTech::Triples::DBHash', {
 								  filename => cfwref('kix/file_x3pkixdb'),
 								  index_s2p => 1,
 								  index_o2p => 1,
 								  access => 'wl',
 								 }),
 	       x3pqcache => cfwobj('PythonTech::Triples::QMapped',
 				   qtriples => cfwref('kix/x3pcache'),
 				   qmap => cfwref('kix/fullqmap'),
 				  ),
 	       x3pmodel => cfwobj('PythonTech::Model',
 				  {
 				   triples => cfwref('kix/x3pqcache'),
 				   classmap => cfwref('kix/x3pclassmap'),
 				  }),
               kixcache => cfwobj('PythonTech::Model',
                                  {
                                   triples => cfwref('kix/x3pqcache'),
                                   classmap => cfwref('kix/kixclassmap'),
                                  }),
 	       x3pstore => cfwobj('PythonTech::Triples::Multi',
 				  {
 				   dbs => [
 					   cfwref('kix/kixdb'), # main must be first
 					   cfwref('kix/x3pcache'),
 					   cfwref('kix/extradb'),
 					  ],
 				  }),
 	       x3pqstore => cfwobj('PythonTech::Triples::QMapped',
 				   qtriples => cfwref('kix/x3pstore'),
 				   qmap => cfwref('kix/fullqmap'),
 				  ),
 
 	       # configuration for an instance of the KixPlugin::DocReview plugin
 
 	       DocReview => {'kix:pluginInterfaces' => [
 							'kix:IHtmlFragments',
 							'kix:IUriMapper',
 						       ],
 			     'kix:pluginPerlModule' => 'KixPlugin::DocReview',
 			    },
 	       documentreview => {
 				  'kix:pluginType' => cfwref('kix/DocReview'),
 				  docReviewModel => cfwref('kix/kixfwmodel'),
 				  docReviewNormalLineClass => 'reviewlinenormal',
 				  docReviewCommentedLineClass => 'reviewlinecommented',
 				  docReviewUrgentLineClass => 'reviewlineurgent',
 				  docReviewContentLineClass => 'reviewlinecontent',
 				  docReviewMainTemplate => 'DocReview/doc_review_main.ptt',
 				  docReviewMetaTemplate => 'DocReview/doc_review_meta.ptt',
 				  docReviewTemplateDir => cfwref('kix/dir_templates'),
 				  docReviewMakeCommentTemplate => 'DocReview/doc_review_make_comment.ptt',
 				  docReviewWithdrawCommentTemplate =>
 				      'DocReview/doc_review_withdraw_comment.ptt',
 				 },
 	       kixplugins => cfwobj('Kix::Plugin',
 				    pluginLocations => 
 				    {
 				     # Document review folder for KIX user 'example_kix_user'
 				     '/home/example_kix_user/docreview' => cfwref('kix/documentreview'),
 				    }
 				   ),
 	       kixclasstemplatemap => {
 				       'Kix::Federation' => 'Kix/federation.ptt',
 				       'Kix::User' => 'Kix/user.ptt',
 				       'Kix::Folder' => 'Kix/folder.ptt',
 				       'Kix::Document' => 'Kix/document.ptt',
 				       'Kix::Version' => 'Kix/version.ptt',
 				       'Kix::Event' => 'Kix/event.ptt',
 				       'Kix::Observation' => 'Kix/event.ptt',
 				       'Kix::Alarm' => 'Kix/alarm.ptt',
 				       'Kix::Comment' => 'Kix/comment.ptt',
 				       'Kix::Obj' => 'Kix/obj.ptt',
 				       'KixPlugin::DocReview::Version' => 'Kix/version.ptt',
 				       'KixPlugin::DocReview::Fragment' => 'DocReview/doc_review_line.ptt',
 				      },
 	       kixfw => cfwobj('Kix::CGI',
 			       admin_users => cfwref('sysadmin_users'),
                               extensions2mime => cfwref('kix/extensions2mime'),
 			       model => cfwref('kix/kixfwmodel'),
 			       store => cfwref('kix/kixfwqstore'),
                               repository => cfwref('kix/repository'), # optional file based document repository
 			       templater => cfwobj('PythonTech::Template',
 						   {
 						    DIRS => cfwref('kix/dir_templates'),
 						   }),
 			       dbshowUrl => cfwref('kix/showuri'), # passed through as dbshow_url to template
 			       classTemplateMap => cfwref('kix/kixclasstemplatemap'),
 			       loginUrl => cfwref('loginurl'),
 			       logoutUrl => cfwref('logouturl'),
 			       imageUrl => cfwref('kix/imageurl'),
 #			       plugins => cfwref('kix/kixplugins'),
 			       basequalifier => cfwref('kix/basequalifier'),
 			       cgibaseuri => cfwref('kix/baseuri'),
 			       x3p_api => cfwref('kix/x3p_api'),
 			      ),
 	       x3pkix => cfwobj('Kix::X3pExtender',
 				model => cfwref('kix/x3pmodel'),
 				uri => cfwref('kix/x3pservice_uri'),
 				defaultExtender => sub {cfw('kix/x3pservice_uri') . '/kix/X3pExtender'},
 				extenderType => 'kix:X3pExtender',
 #				logfileName => "$X3P_LOGFILE",
 #			        x3pAccessControl => cfwref('cgi/kixAccessControl'),
 				extenderConfig => 'kix/x3p_api',
 				),
 	       x3pclient => cfwobj('Kix::X3pClient',
 				   {
 				    x3pkixmodel => cfwref('kix/x3pmodel'),
 				    x3pservis => cfwref('kix/x3pkix'),
 #				    logfileName => "$X3P_LOGFILE",
 				   }),
 	       serverfedmodel => cfwobj('PythonTech::Model',
 					{
 					 triples => cfwref('kix/kixqdb'),
 					 classmap => cfwref('kix/kixclassmap'),
 					}),
 	       x3p_api => cfwobj('Kix::X3pApi',
 				 {
 				  kixmodel => cfwref('kix/serverfedmodel'),
 				  kixdb => cfwref('kix/kixqdb'),
 				  x3pcache => cfwref('kix/x3pqcache'),
                                  kixcache => cfwref('kix/kixcache'),
 				  x3pclient => cfwref('kix/x3pclient'),
 				  fed_qmap => cfwref('kix/fedqmap'),
 				  fedmap => cfwref('kix/federation'),
 #				  logfileName => "$X3P_LOGFILE",
 				 }),
 	       cronjob => cfwobj('Kix::CronJob',
 				 # debug => 1,
 				 from => cfwref('kix/cronmail'),
 				 model => cfwref('kix/kixfwmodel'),
 				 x3p_api => cfwref('kix/x3p_api'),
 				),
 	       webedit => cfwobj('PythonTech::Triples::WebEdit',
 				 db => cfwref('kix/kixfwqstore'),
 				 viewing_users => cfwref('sysadmin_users'),
 				 editing_users => cfwref('sysadmin_users'),
 				 qmap => cfwref('kix/fullqmap'),
 				),
 	      },
       );
 
 1;
Back to the main installation instruction page.

The KixFw development team would appreciate any comments or questions. Include your details if you wish to be contacted. kix4kixfw
 
 

2009-02-03 20:54


Home of kixfw.sourceforge.net
Contact kixfw project