login | register
Sun 12 of Oct, 2008 (03:50 UTC)

bitweaver - Web Application Framework and CMS

Web Application Framework and CMS

Refresh cacheHistoryPrint

IntegrationTutorial

Information on integrating existing applications into bitweaver

Created by: spiderr, Last modification: Tue 25 of Apr, 2006 (15:16 UTC) by test
Integrating applications into bitweaver involves two key parts:
  1. Data integration such as single-sign on
  2. Visual integration

This tutorial is focused on "loosely coupled" integrations where minimal modifications of the integrated application source are desired.

Data Integration


(Further information forthingcoming. Feel free to add it...)

Visual Integration


phpinfo()


this example will insert phpinfo() into the center column of bitweaver using the output buffereing method

file: test/index.php
<?php
require_once( '../bit_setup_inc.php' );
 
// start output buffering
ob_start();
phpinfo();
 
// assign the captured content to the template
$gBitSmarty->assign( 'info', ob_get_contents() );
 
// end output buffering
ob_end_clean();
 
// display the template
$gBitSystem->display( 'bitpackage:test/info.tpl' );
?>


file: test/templates/info.tpl
{$info}



phpBB


Integration of non-smarty application such as phpBB or bitcommercePackage (an OSCommerce / Zencart fork) is achieved through the use of PHP's output buffering capabilities.

This "cheap and dirty" trick enables the integrated package to stay virtually untouched, while displaying properly in the bitweaverArchitecture. The technique in psuedo-code looks like:

<?php
// Accessed source file for existing application such as fooforum/index.php
// {{{ BIT_MOD
 
require_once( '../bit_setup_inc.php' );
 
// use php function to initiate output control after bit_setup in case http headers (cookies where sent)
 
ob_start();
// }}} BIT_MOD
 
foo code...
hack, whitle, chop, whir, buzzz...
 
// {{{ BIT_MOD
 
// Get the contents of whatever was output but the app and assign to a smarty variable
$smarty->assign_by_ref( 'fooforumCenter', ob_get_contents() );
ob_end_clean();
$gBitSystem->display( 'bitpackage:fooforum/view_fooforum.tpl' );
 
// }}} BIT_MOD
?>


The display template needs to live in fooforum/templates/view_fooforum.tpl and is a *very* simple template:

<div class="display fooforum">
    {$fooforumCenter}
</div>


You can get much more advanced and capturing modules and other interface elements from the integrated app. The best example is the bitcommercePackage and here is some source code that does module capturing.

Comments

Related Items

Documentation » Tutorials

Tutorials to help you work out how something in bitweaver is done

Archived Picture Upload with Fisheye under Windows  •  Configuring multisites  •  Creating Screencasts  •  DatabaseTestsAndFixes-Firebird  •  GalaxiaTutorial  •  Groups and Permissions  •  Home Page Tutorial  •  Install pspell on Windows  •  IntegrationTutorial  •  JavaScript Module Tutorial  •  Migrating Users Between Bitweaver Sites  •  phpBB to Boards Upgrade  •  phpbbTutorial  •  Schema tutorial  •  SearchPackageDevNotes  •  Speed optimisation  •  Squirrel Mail Integration Tutorial  •  theme compliance with MSIE  •  ThemeTutorial  •  TopBarTutorial  •  TranslationTutorial  •  Tutorial_Custom_Module  •  Tutorial - Liberty Plugins  •  Tutorial - Liberty Plugins II  •  Tutorial - Native Theme  •  Tutorials  •  Use bitweaver to build a web site that is very nice  •  Wiki Plugin Tutorial  •  wiki syntax  •  Screencasts  •  InstallShots  •  Video: Installation of Bitweaver

Documentation » Technical Documentation

Documentation geared towards developers and people who want to learn about the core processes of bitweaver

HEAD ON! Support has been added for Pear::DB!  •  Oracle Reservations for Two  •  ReleaseTwo: Shedding that last bits of our roots, finding the core of our being  •  getContentList  •  How to add a pagination to an object list  •  Moving bw in another directory  •  pma and mysql  •  safe mode on / open_base_dir  •  sequence and auto  •  The package I am currently developping is suddenly desactivated  •  APIDocumentation  •  Archived Picture Upload with Fisheye under Windows  •  Bitweaver and Browser Cookies  •  bitweaverCVS  •  bitweaverFeatures  •  bitweaverPerformance  •  CodingGuidelines  •  CreatingServices  •  CssSchema  •  InstallbitweaverDoc  •  IntegrationTutorial  •  LibertyFormats  •  LibertyMime  •  LibertyServices  •  phpdoc content status  •  PortingTikiWikiPackages  •  PrototypeAjaxObject  •  PrototypeReference  •  SamplePackage  •  SearchPackageDevNotes  •  TUTORIAL - Displaying Icons ONLY to AUTHORS of the page  •  Tutorial - Liberty Plugins  •  Tutorial - Liberty Plugins II  •  UsersDoc