Tuesday, May 19, 2009

Hybris: Location of items.xml

Once we create our own extension on hybris.

We can find the items.xml file inside:
HYBRIS_HOME/extensions/CUSTOMEXT/resources/CUSTOMEXT-item.xml

In this file, we need to go and add type and item attribute.

Hybris type are represent as java class. item as attribute.

Tuesday, May 12, 2009

Cake is a PHP web development framework which employs the MVC model. I will describe how to set it up on a win32-based machine.

First install xampp (the lite version is fine) which consists of Apache, PHP, and MySQL. The install process just copies some files to a specified folder.

Next, run “setup_xampp.bat” located on the root xampp folder.

After that open “httpd.conf” located on “apache\conf” folder. Then uncomment the line that contains “mod_rewrite”. This is needed to enable Cake’s pretty URL such as “http://localhost/cake/users/view” instead of “http://localhost/cake/index.php/users/view”.

Afterwards, extract Cake somewhere in the “htdocs” folder. I usually put it in “htdocs\cake”.

The last step is to copy “database.php.default” in “app\config” of Cake’s folder to “database.php”. Then change the “$default” variable to suit your database settings. An example is:

class DATABASE_CONFIG
{
var $default = array('driver' => 'mysql',
'connect' => 'mysql_connect',
'host' => 'localhost',
'login' => 'root',
'password' => '',
'database' => 'test',
'prefix' => '');
}

Which works with the default MySQL in xampp.

To see if things are working properly, run “xampp-control.exe” in xampp’s root folder and then start Apache and MySQL from there:

Starting Apache and MySQL

After that point your browser to “http://localhost/[cake's root folder]” for example “http://localhost/cake”.

Here’s some goodies:

Cake 1.1.5.3148
Cake 1.1.5.3148

Cake 1.1.6.3264
Cake 1.1.6.3264. Cleaner???

To learn how to use it, read “The Cake Blog Tutorial” in CakePHP Manual.

Saturday, May 9, 2009

Installing CakePHP on Ubuntu

  1. Install Apache Server, MySQL, PHP
    sudo apt-get install apache2 mysql-server php5
  2. Download CakePHP 1.2
    Go to http://cakephp.org and download latest cakephp. I downloaded cake_1.2.3.8166.tar.gz
  3. Copy and extract to web root
    Open your terminal where you put cakephp you just downloaded.
    sudo cp cake_1.2.1.8004.tar.bz2 /var/www/
    cd /var/www
    sudo tar -xvf cake_1.2.3.8166.tar.gz
    sudo mv cake_1.2.3.8166 bulksms
  4. Change tmp folder permisssion
    sudo chmod -R 777 bulksms/app/tmp
  5. Enable mod-rewrite
    sudo a2enmod rewrite
  6. Open file /etc/apache2/sites-enabled/000-default and change AllowOverride None to AllowOverride All
    sudo vim /etc/apache2/sites-enabled/000-default

    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

    to


    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
  7. Restart Apache
    sudo /etc/init.d/apache2 restart
  8. Open your browser and type address http://localhost/cakephp/ and you’ll see CakePHP message

apache2 could not determine fully qualified domain name

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName.

Solution: I created a file /etc/apache2/conf.d/fqdn with following line as content: ServerName localhost

And it works!!!