Getting the right shopping cart template for you

The right shopping cart for you is the one that can meet your requirements (easy enough)

My requirements:

-  I want my shopping cart simple, clean and tidy

- Search engine optimized

- Can do payment with paypal and credit card

- Able to do restore and backup

- Easy to add configurable option: i.e: cloth size  S, L, M, XL

- Provide updates

- Optional: cool addons and template

After searching a few seconds  i found this list of 15 best free shopping cart link. Long live open source! they are indeed pretty good software with bunch of cool features. My eyes suddenly caught by  magento, prestashop and opencart and finally getting hands on them one by one.

You can read the comments from link to get seconds opinions for you. I finally chose OpenCart, it is very very easy to start with and you can just jump and start defining your categories, products, price, currency, etc.. with it’s admin dashboard easily. It also supports multi language/lingual make it my top No.1 choice of the list.

I already have my web hosting powered by OpenCart see it for yourself www.batikstore.net

Batik Store – Start with why?

Start with why?!. After watching Simon Sinek video on “How great leaders inspire action”  you can find it here link. I also want to start my action with Why?. Why am i doing this?.

Simply put, i want to deliver Indonesia Batik to the world.

Batik is already popular in Indonesia, people commonly wear it every day and it also become essential for ceremonial costumes. Honored guesses like Barack Obama and Bill Gates also wore Batik during their visits to Indonesia. It’s more and more likely Batik has become a unique identity of Indonesia people.

You can find more about batik in wiki link

Well.. will people outside of Indonesia bite this?

I don’t know but worth to try. I myself prefer Batik that i can wear everyday, casual but not formal. Is there any kind of Batik like this? hmm.. must search for suppliers, i will just assume there are suppliers.

Okay what next?

I want the store to be filled with kinds of Batik: Batik tulis, printed batik,  fashion, daily, formal, shirt, skirt, pants whatever the suppliers may have. I want the people feel good when browsing and exploring, within their budget, easy to purchase, can track their purchase and received their ordered within 7 days.

How to do this?

I’ll use web and mobile as store. Especially mobile, i love it! i usually browse using laptop when i’m in office and use mobile phone when i’m on train or somewhere else. I will facilitate this two media so more and more chances the people know about the products, they might purchase from the store.

Who’s the buyer?

Will provide batik for ladies, men, teenager  and kids. I will focus on Asia Pacific market first.

What do you think guys? leave your comments below. Thanks!

AJAX – Getting Started ExtJs with Perl CGI

I usually use ExtJs with Struts, PHP, or Google Web Toolkit (GWT). Here i will create a simple tree panel sample using ExtJS and Perl CGI.

Here is our directory structure:
extjstest
-extjs (directory)
-JSON (directory)
-data.cgi (file)
-index.html (file)
-JSON.pm (file)

requirements:
1. Download the latest Ext Js from here and extract the archive files to extjs folder
2. You have mod Perl cgi enabled with your apache server, you can see my post at Perl for how to set up mod mod Perl CGI in apache
3. JSON module for Perl, you can download it from here

Enough talk, let’s start coding!

Filename: index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	href="extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript">
	Ext.onReady(function() {
		var Tree = Ext.tree;
		var tree = new Tree.TreePanel( {
			el : 'tree-div',
			autoScroll : true,
			border: false,
			title: 'My First Panel',
			animate : true,
			enableDD : true,
			containerScroll : true,
			loader : new Tree.TreeLoader( {
				<strong>dataUrl : 'data.cgi'</strong>
			})
		});
		// set the root node
			var root = new Tree.AsyncTreeNode( {
				text : 'Ext JS',
				draggable : false,
				id : 'source'
			});
			tree.setRootNode(root);

			 // render the tree
		    tree.render();
		    root.expand();
		});
</script>

</head>
<body>
<div id="tree-div" style="overflow:auto; height:300px;width:250px;border:1px solid #c3daf9;"></div>
</body>
</html></a>

As you see above code, the treepanel gets the data url from data.cgi. What is this data.cgi produce? the data.cgi will response JSON type to the html, JSON is optimized version of XML.

2. data.cgi

#!/usr/bin/perl -w
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Storable;
use JSON;
$page = new CGI;


print "Content-type: application/json\n\n";
@mydata0={'text'=>'merci','id'=>'3','leaf'=>true,'cls'=>'file'};
@mydata1={'text'=>'audi','id'=>'2','children'=>\@mydata0};
@mydata2={'text'=>'benz','id'=>'1','children'=>\@mydata1};

@mydata=(@mydata2,@mydata3);

$text = objToJson(\@mydata);

print $text;
exit (0);

Open your browser and point to http://localhost/extjstest/index.html. If everything fine, you should see a treepanel displayed.

JBoss – Create JNDI Datasource with Oracle

Goal: able to create and use jndi datasource with jboss as backend
First, make sure you have JBoss and Oracle installed on your system, then we can start creating our datasource configuration file.
filename: oracle-ds.xml

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
    <local-tx-datasource>
        <jndi-name>oraclexeDS</jndi-name>
        <connection-url>jdbc:oracle:thin:@localhost:1521:your-db-sid</connection-url>
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
        <user-name>your-db-user</user-name>
        <password>your-db-pass</password>
        <valid-connection-checker-classname>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-classname>
        <metadata>
            <type-mapping>Oracle10g</type-mapping>
        </metadata>
    </local-tx-datasource>
</datasources>

copy the file to your deployment directory: ../pathto/Jboss-x.x.x/server/default/deploy
congratulation, you already set up datasource with jndi named: oraclexeDS. Next, create a simple jsp project and named it Datasource, modify index.jsp so it becomes like below.
Filename: index.jsp

<%@page contentType="text/html"
        import="java.util.*,javax.naming.*,javax.sql.DataSource,java.sql.*"
        %>
<%
        DataSource ds = null;
        Connection con = null;
        PreparedStatement pr = null;
        InitialContext ic;
        try {
            ic = new InitialContext();
            ds = (DataSource) ic.lookup("java:/oraclexeDS");
            con = ds.getConnection();
            pr = con.prepareStatement("select sysdate as coldate from dual");
            ResultSet rs = pr.executeQuery();
            while (rs.next()) {
                out.println("<br> today is " + rs.getString("coldate"));
            }
            rs.close();
            pr.close();
        } catch (Exception e) {
            out.println("Exception thrown " + e);
        } finally {
            if (con != null) {
                try {
                    con.close();
                } catch (Exception ex) {
                    out.println(ex.getMessage());
                }
            }
        }%>

The idea of jsp code is to get today’s date from oracle. Build your web and copy the war file to jboss deployment directory.

run it in a browser: http://localhost:8080/Datasource

if everything works fine, it should display today is 2009-12-05 16:42:20.0

JBoss – changing JMX-Console admin password

# cd ../pathto/jboss-x.x.x/server/default/conf/props
# vi jmx-console-users.properties
admin=admin

it is user=password format, change them accordingly. Now you can login with your new username and password

Connect Zend Framework with Oracle XE

Howdy,
As a new player in zend framework, i tried to connect my php with oracle using Zend_Db and tried to get sysdate from oracle. Here how it goes.
First i created a DB.php file and put it in models directory

<?php
require_once 'Zend/Db.php';
class DB{

    protected $db = null;

    function __construct(){
        $params = array('username'=>'user','password'=>'pass','dbname'=>'//localhost/XE');
        $this->db = Zend_Db::factory('oracle',$params);
    }

    function getSysDate(){
        $res = $this->db->fetchRow("select sysdate as coldate from dual");
        return $res['COLDATE'];
    }
    function helloWorld(){
        return 'Hello World';
    }
}
?>

and then i modified the indexController.php as below

<?php
require_once 'models/DBphp';
class IndexController extends Zend_Controller_Action
{
    protected $db;
    public function init()
    {
        $this->_helper->viewRenderer->setNoRender();
        $this->db = new DB();
    }

    public function indexAction()
    {
        echo $this->db->helloWorld();
        echo $this->db->getSysDate();
    }
}

Run and it displayed
Hello World 28-NOV-09

Nice, next i will try to connect php with my java webservice modules. See yaa!

Fix error when creating action in Zend Framework

Fatal error: Call to undefined function token_get_all() in
…/ZendFRamework/library/Zend/ReflectioN/File.php on line 300

The error message happened because we haven’t enabled the tokenizer extention in PHP. To enable that extension simply do this:

- open your php.ini, uncomment this line
before:
#extension=tokenizer.so
after:
extension=tokenizer.so

- save your php.ini and restart apache
- try to create a project and an action
$ zf.sh create project testing
$ cd testing
$ zf.sh create action testaction index

you will have your testaction created. Hope this is helpful

Insert and fetch Binary Data with Oracle and JDBC

First create a dummy table
create table tblBlob(c1 number primary key not null, c2 blob);

please note that blob data type in oracle can handle up to 4Gb size

here is the code for insertion

Connection conn = ... // define your connection here
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO tblBlob VALUES (?,?)");
pstmt.setInt(1, 100);
File fBlob = new File("cable.jpg");  // i'm using an image as the data
is = new FileInputStream(fBlob);
pstmt.setBinaryStream(2, is, (int) fBlob.length());
pstmt.execute();

and here is the code for fetching and convert it back to image

Connection conn = OracleConnection.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM tblBlob");
while (rs.next()) {
      int val1 = rs.getInt(1);
      InputStream val2 = rs.getBinaryStream(2);
      BufferedImage image = ImageIO.read(val2);
      img = image.getScaledInstance(300, 300, 300);
     . . .
}

5 Reasons we chose BIRT instead of Jasper or JFreeReport

A year ago, I was looking for a way to integrate complex/graphical reporting into our software offerings. I was sure that the way is to find an open source project that has the right kind of license and right kind of technology. Regarding licensing, I wanted to make sure that we should be able to use the reporting engine/technology in our commercial software. I evaluated JasperReport, JFree Report (now part of Pentaho) and of course, BIRT. Here is what I liked in BIRT

  1. BIRT is an Eclipse project: This made sure that the project is going to be live and evolving (as an open source project) in the times to come and will become more feature rich as the time passes. We were not afraid that someone is going to close the source directly or indirectly (by selling documentation at high prices) by creating a future version that will require commercial support to do anything but trivial.
  2. BIRT uses standard technologies to the maximum level: It uses HTML for layout related things, JavaScript for scripting and CSS for styling! It naturally means we can leverage the existing knowledge that our developers have in creating the kind of reports our customer want. Faster and at lower costs.
  3. BIRT offers very good GUI Designer: A graphical designer not just makes your life easier while developing the reports but you can also give it to your customers so that they can also do some small changes that they might need here or there in the report. Most important thing is that BIRT designer is group of plugIns for Eclipse IDE and hence quality of the report designer is excellent.
  4. BIRT has a very nice Web Viewer: Yes it comes with nice pre-integrated ajax enabled web viewer that your can run from Tomcat (our favourite) or any other Application Server in less than few minutes.
  5. BIRT has quality documentation, sample database, example reports: All this reduced the learning curve to a very affordable level.

If you are looking for a serious reporting solution (open source), I will recommend that you should consider evaluating BIRT. May be you can find the technology you are looking for.

by http://blogs.zaidsoft.com/sz_quadri

Email Alert Management

Project Name: Email Alert Management
Background: As there are many supporting applications tools running, the number of alert and warning from the applications is getting bigger. It is annoying when receiving hundreds of emails per day triggered by alerts from many applications. Therefore we need a mechanism to manage all the alerts.
Aim: To provide an application that will sit between supporting applications and end users so that we can set parameters to filter the alerts, and trigger the alert when the parameters are satisfied. parameters used are number of alert received, alert priority, alert status, notification list
Technology: Linux, Oracle10g, Java, GWT (Google Web Toolkit), Apache Tomcat, Dovecot, JavaMail API
Estimated time: 1 month

EmailAlertManagement

User Manual:

Alert Management is a tool that help to manage email alert from various applications

The first page you will see is a login screen that require authentication your NT Account with LDAP.

There are two privileges in this web application: Member and Administrator.

Member Privilege
When you login as a member you will be directed to below main page

Getting Started
1. Choosing subscription

At the left panel there is tree node called Available subcription, you can tick one or more available subscriptions.

2. Adding selections
Click Email Alert Setting at the tree node and then click Add Selections. This will add your selected subscription to the grid at the center panel of the page

3. Defining Alert
You can define your alert by clicking alert list at the grid. this will direct you to below alert panel

Click the arrow down button of Add New Alert panel and fill up the form to define a new alert.
Below is an example of an alert that will trigger after receiving 10 emails from QMS UTV email alert.

Note: If you have multiple notification list, please separated emails with comma (,)
Click add to continue
You will get your defined alert in your alert list grid box

Also notice that your inbox tree node also updated with the new created alert.

4. Inbox
Clicking the inbox will show your inbox with emails from the subscription

As we already defined an alert in this example to automatically sends emails alert when receiving 10 emails. You have two more options at the inbox panel: Delete and Send Now
Clicking the delete button will delete your inbox, and clicking send now will send the emails right away to the notification list defined at the alert.

 

 

Follow

Get every new post delivered to your Inbox.