Pages

Wednesday, April 21

FP going to support MySQL

We have eventually decided to add MySQL support in next releases. MySQL is most popular database for web system and it should encourage web developers to develop web POS.

Porting or adding option for different database systems is easier job in Floreant POS as we used hibernate based abstraction layer( DAL ).The developers who cannot wait to see should go through this hibernate tutorial . You may also try with any other datatabase system as long as it has Java driver available.

Sunday, April 18

Connecting PHP 5.3 and Apache Derby / JavaDB / IBM Cloudscape


[This has been outdated] PHP Developers can connect Derby database of Floreant POS with following steps. It has been tested in PHP 5.3 and should be working in PHP 5.2

Necessary Steps
PHP has different APIs for different databases and PHP can connect to Apache Derby (formerly known as Cloudscape) with DB2 connectivity.  For successful connection we need to go with  the following steps. Examples are from Ubuntu 9.10 but it should be working other linux distributions with respective commands.


Install DB2 Express C
Download it from here . Extract and run ./db2setup


Download & Compile PHP Source code
  1. Download PHP 5.3 or the latest version. If you are using Ubuntu write
    wget http://us3.php.net/get/php-5.3.1.tar.bz2/from/us.php.net/mirror
  2. Untar source code in /usr/src
    tar -xjf php-5.x.x.tar.bz2
  3. Build make file with with desired parameters
    ./configure --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php5/apache2/ --with-mysql --enable-inline-optimization --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-dbase --enable-discard-path --enable-exif --enable-force-cgi-redirect --enable-ftp --enable-gd-native-ttf --with-ttf --enable-shmop --enable-sigchild --enable-sysvsem --enable-sysvshm --enable-wddx --with-zlib=yes --with-openssl --with-xsl  --with-gd --with-gettext --with-mcrypt --with-mhash --enable-sockets --enable-mbstring=all --enable-mbregex --enable-zend-multibyte --enable-exif --enable-soap --enable-pcntl --with-mysqli --with-mime-magic --with-iconv --with-pdo-mysql --with-freetype-dir=/usr/include/freetype2/freetype  --enable-cli -disable-cgi --with-pdo-ibm=/home/db2inst1/sqllib/

    NOTE:  If you find dependent files are missing install them. Following examples are for Ubuntu 9.10 . Other distributions should have similar commands.

    #apxs2 was not installed so updated with
    sudo apt-get install apache2-threaded-dev

    #libxm2-dev not found so installed
    apt-get install libxml2-dev

    #freetype now installed found solution: http://theserverpages.com/php/manual/en/function.imagefttext.php
    apt-get install libfreetype6-dev

    #libmcrypt not found. so installed
    sudo apt-get install libmcrypt-dev

  4. Compiled PHP
    sudo make 




    #Error while doing make install
    # apxs:Error: Activation failed for custom /etc/apache2/httpd.conf file..
    # apxs:Error: At least one `LoadModule' directive already has to exist..


    Noted that: Its a bug in PHP 5.3
    Added this to  /etc/apache2/httpd.conf and the module built correctly.
    # Placeholder for future module installations or else modules will fail to build
    #LoadModule dummy_module /usr/lib/apache2/modules/mod_dummy.so
  5. Stopped any apache2
    sudo /etc/init.d/apache2 stop
    Make install
    sudo /etc/init.d/apache2 start
  6. Write a simple php file index.php with


    and save as  /var/www/index.php
    Now browser should show php info page. If everything is ok, it should show pdo_ibm and ibm_db2 enabled.

DB2 CATALOG Configuration
  1. Login  DB2 primary account (default is db2insta1).
  2. go to /home/db2insta1/sqllib/bin
    and run ./db2
  3. Register Derby Database server as Node
     db2 catalog tcpip node floreantpos remote 192.168.16.105 server 1527
  4. Register Database in that Node.
    catalog db "posdb" at node posdb authentication server

    NOTE: database  name shoud be same as Floreant POS Derby Database. While doing these steps you must run Derby Database.
    DB2 in Linux does not find Database in smaller case. In case of default database (posdb) we
    just created softlink of database folder and found it working smoothly.

    ln -s posdb POSDB
  5. Connect database to test
    connect posdb with user name "app" and using sa

    For more visit the following link:
    http://www.ibm.com/developerworks/data/library/techarticle/dm-0409cline2/readme_win.txt




Test with PHP
      
In /var/www/ write a php file to check if it can connect



 $database = 'posdb';
$user = 'app';     //derby pass
$password = 'sa'; //your pass
$hostname = '192.168.16.2'; //your IP here
$port = 1527;

$conn_string = $database;


$conn = db2_connect($conn_string, $user, $password);


if ($conn) {
    echo "Connection succeeded.";
    db2_close($conn);
}
else {
    echo "Connection failed.";
}

?>

Wednesday, April 14

Coke vs Orange Juice Companies

Src: Food service forum

Why promote Open Source? Do you programmers not want to be paid for your work? What do you only want part-time editors making changes as their hobby? It just doesn't make sense to me. Please explain if I've got it wrong, but that won't change my opinion.

Robert Lehman
www.ViewGistics.com

Dear Robert,

Open source is an established business model. Instead of selling software license, open source model sells service (support, customization, modification of reports etc). There are many successful projects who left their source open and still making enough money to sustain.

Traditional software business rely on hiding source code and they may get surprised how a software company can survive giving away their hard work.

Let me give answer your question with a layman's example. Think

-Source code is like Recipe for Cooking.
-Compiling can be compared to Cooking and
-Binary Executable are final cooked food.

Now Closed source (Traditional) companies are those restaurants who hide their recipe. They hide recipe because no other can produce same taste, so they would make more profit and lock their guests. This model works when cooks get sure their recipes are unique.

But we know there are already lots of Recipe books in the market and one can cook delicious foods without special recipe. Most of the restaurants in the world in fact runs with common recipes and people eats there even though they could cook same thing at home.

Interestingly all those generic recipe restaurants make business. How can they survive? Reason is market is so big that one player cannot capture the whole. Guests can find food in his area and whoever gives better service makes better profit.

I told before that Close source works best when you have a special formula that nobody could repeat (like Coca cola). In software highly researched mathematical program could be similar candidate, But Restaurant business, Accounting or ERP has almost similar business process for many years. Literally there are nothing new and most of the software we program reinvents the same wheel. In contrast to Coke, It could be Orange juice where many companies can produce same orange juice and make business.

In Assembly or machine language days all software companies were locking business like Coke companies! There was a day when writing code required huge time and compilers were expensive. Now paradigm has changed. There are IDE, Wizard and tons of freely available snippets, that reduced cost of software. So its proven that hiding source code now give little advantage. In contrast if a programmer give away the source code in public domain he may invite our competitors to work on same code but market will expand dramatically. Such way it benefits a big community.

Not sure if you could get some idea from that. I would be happy to answer specific questions because we have always faced those questions.

Tuesday, April 6

A new release with better look in Subversion

As promised, a new release has been updated in Subversion. There are many small changes and fixes
  • Printer configuration - Now all the printers will be automatically shown in drop down list.You don't even need JavaPOS for printing. Epson  usually provides advanced printer driver in their installation CD. In other case contact the brand owner.



  • Printer receipt preview, you can also save receipt in PDF, DOC etc format 




  • Eliminated prompting Beverage by guest count. Small restaurants do not need that. 
Developers are requested to try it and send us their comment.

Send your suggestions to this email address. We will build binary end of this week.