Rabu, 09 Desember 2009

Configure Liferay 5.2.3 bundled with tomcat on Windows 7






According to Jonas. X Yuan on Liferay Portal Intranet Enterprise
Liferay Portal is one of the most mature portal frameworks in the market and offers many benefits. Liferay is backed by a comprehensive professional services network and it offers custom development, training, and support across the world.
As the world's leading open source portal platform, Liferay provides a unified web interface to data and tools scattered across many sources. Within Liferay portal, a portal interface is composed of a number of portlets—self contained interactive elements that are written to a particular standard. Since portlets are developed independently of the portal itself, and loosely coupled with the portal, they are apparently SOA (Service-Oriented Architecture).
In this article, i would try explain how to setup Extension Environtment for liferay development.
I wrote this article not to teach but this is what i’ve done and my personal documentation for my research just incase i forgot or my computer crashes....since i’m lame....:D

Before we start, we need external tools for this article.
1. JDK, since liferay is java base portal. We need to setup JDK in our computer. Download this JDK for free from http://java.sun.com/javase/downloads/jdk6.jsp
2. Ant, ant is free tools for most java development. Download from http://apache.eu.lucid.dk/ant/binaries/apache-ant-1.7.0-bin.zip or from ziddu....(add Link here)
3. Jikes, i use jikes 1.2.2 download from (add Link ziddu)
4. Liferay portal source 5.2.3 download from sourceforge.net
5. liferay-portal-tomcat-6.0-5.2.3 download from http://sourceforge.net/projects/lportal/files/Liferay%20Portal/5.2.3/liferay-portal-tomcat-6.0-5.2.3.zip/download
After we download all file that we need, next step is to set up Environtment Variabel. I assume that you have setup you Environtment Variabel, if not you can follow the instruction from here....(link my blog again here).
Let get it on....
Let’s assume that we will create our project in drive C:>\
Create new folder and name it “Project” (you can name it whatever you like)
Open folder “project” in explorer and create new folder and name it as “liferay”
So we have C:>\project\liferay in our windows.
We need create new folder in liferay directory. Create tomcat and portal folder.
Tomcat folder is folder that we will put all extracted file from liferay-tomcat bundled and your directory will contain extracted file showing here




To test if all configuration is right, open cmd and go to C:\project\liferay\tomcat\tomcat-6.0.18\bin>
Type startup and see what happen in your browser. If everything is set you should see liferay welcome page....



If you want to explore liferay portal, just use test@liferay as username and test as password and have fun with liferay....

Let’s start to build Ext Environtment
What is Extension Environment?
Here is brief introduction that i obtain from Liferay Portal 4 - Development in the
Extension Environment
The extension environment, also known as the ext environment, is a set of tools that allow developers to build portals and portlets on top of Liferay Portal. It can be seen as a Software Development Kit that is independent of any IDE but integrates well with all of them thanks to its usage of ant, the most popular and supported build tool. Another way to think about the extension environment is as a wrapper for Liferay's core source because, in most cases, it mirrors Liferay's core source directories (i.e. ext-impl/ for portal-impl/, ext-web/ for portal-web/). It allows you to develop on top of Liferay portal, like a platform, providing help when an upgrade to a new version of Liferay Portal is needed.

Extract liferay portal 5.2.3-src into portal folder that we create before. For easy way you can extract anywhere you like and copy all the files in the extracted folder into portal folder. Do not delete extracted folder in case we fail to build in first attemp so we can copy again without need to re-extract.
Here is what i got in my computer :


To build Ext Environment we need to create app.server.properties, build.properties and release.properties in portal folder. Keep original file and do not change the content, we can create new file and name it as app.server.{username}.properties, build. {username}.properties and release. {username}.properties. this new file will override original file when we build ext environment.
{username} is computer username, to see what exactly you computer username just open cmd and type set then you will see your username and replace {username} with your username.


e.g : my computer username is yan showing in the picture. So my file properties is app.server.yan.properties, build.yan.properties and release.yan.properties
add this line into your app.server.{username}.properties
app.server.tomcat.version=6.0.18
app.server.tomcat.dir=C:\project\liferay\tomcat\tomcat-6.0.18/tomcat
app.server.tomcat.classes.global.dir=${app.server.tomcat.dir}/lib
app.server.tomcat.lib.endorsed.dir = ${app.server.tomcat.dir}/lib/ext
app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.lib.support.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.support.dir=${app.server.tomcat.dir}/lib/ext

add this line into your build.{username}.properties
ant.build.javac.source=1.6
ant.build.javac.target=1.6

add this line into your release.{username}.properties
lp.ext.dir=C:/project/liferay/ext
note : in app.server.{username}.properties in line app.server.tomcat.dir=C:\project\liferay\tomcat\tomcat-6.0.18/tomcat
change “C:/project/liferay/tomcat/tomcat-6.0.18/tomcat “ into your tomcat installation folder and same as release.{username}.properties.
change lp.ext.dir=C:/project/liferay/ext into you ext directory. Do not create ext directory manualy because liferay won’t be able to copy all the files needed into existing ext directory. By the way, release.{username}.properties is to tell liferay portal which directory that ext environtment is setup.
Next, open cmd and point to your portal directory. Mine is C:>\project\liferay\portal
Type this command :
ant start clean build-ext
on your console windows you should see this


Now check your ext directory in windows explorer, see what you got there....

Ok, your ext directory has created succesfully. Now time to deploy liferay from your ext environtment. To do this, you need to create app.server.{username}.properties and build.{username}.properties. since setup between portal and ext is similar, just copy app.{username}.properties and build.{username}.properties into ext folder.
Point to your ext folder in cmd, mine is C:>\project\liferay\ext
Type ant clean deploy to deploy your liferay. But before you do this, make sure that tomcat not running.


Since liferay-portal-tomcat-6.0-5.2.3 include JRE 1.5 in tomcat directory, we need to change setenv.bat in tomcat/bin and point jre home to our installed jre directory.
For testing if our configuration is correct, point your cmd into tomcat/bin and type startup. If everything ok you will see in your browser liferay welcome page and you ready to develop your portlet project in extension environment

That all my article in Building Ext Environment on Liferay – tomcat bundled 5.2.3 src

Next, i will try to write the article about setup database on mysql and liferay 5.2.3 on external tomcat 6.0

Doc Version here : http://www.ziddu.com/download/7676057/ConfigureLiferay5tomcatbundled.docx.html

Thank you

Yan Sakhrul Hadian

Beyond Compare

Beyond Compare adalah sebuah software untuk membandingkan antara 2 direktori, 2 folder ataupun 2 file. ini sangat berguna untuk mencari jika ada sebuah file namun kita tidak mengetahuinya.

saya menggunakan software ini pada saat membandingkan ext folder yang di generate dari Liferay-tomcat bunled dan Lifery- external tomcat.

selain dari aplikasinya secara langsung, pada windows explorer ketika klik kanan maka akan muncul set as left file atau compare.

untuk lebih jelasnya silahkan download disini

http://www.scootersoftware.com/BCompare-3.1.8.11096.exe

Selasa, 08 Desember 2009

Cara Buat Akun Paypal

PayPal adalah salah satu alat pembayaran online yang berfungsi seperti rekening Bank biasa tetapi khusus dipakai untuk bertransaksi secara internasional.

Kelebihannya adalah bahwa PayPal sudah digunakan oleh program-program online atau website di seluruh dunia, bisa di jadikan sarana untuk menerima pembayaran dari program-program online dan bisa di transfer ke berbagai rekening Bank di Indonesia seperti: BCA, Mandiri, BNI, BII, NISP dll. Mayoritas program online saat ini memakai Paypal sebagai alat pembayarannya sehingga ini merupakan sebuah peluang besar bagi kita warga indonesia untuk bisa memperoleh penghasilan dari internet dengan mengikuti program-program online yang memakai paypal sebagai alat transaksi. Paypal sangat ketat aturannya sehingga program-program internet yang berpotensi SCAM, Penipuan dan program ilegal lainnya tidak bisa memakai paypal karena perlu verifikasi dan setiap program yang melanggar aturan akan di BLOKIR. Karena itu mengikuti program-program online yang memakai paypal akan lebih aman dan lebih terjamin. Sekarang saatnya Anda memperoleh penghasilan dari berbagai macam program online yang memakai paypal.



Buat account PAYPAL atau https://www.paypal.com/

Berikut adalah langkah-langkah buat account di PAYPAL (gratis) :
1. Klik BANNER DIATAS untuk memulai
2. Pilih Sign Up, kemudian pilih Negara (Indonesia)
3. Pilih jenis account, disini disediakan pilihan
- Personal Account: Ada batasan transaksi, transaksi tidak dikenakan biaya hampir sama seperti AlertPay.
- Premier Account : Tidak ada batasan transaksi, setiap transaksi dikenakan biaya.
- Business Account : Jika Anda seorang merchant atau pemilik usaha online pilih Premier.
4. Pilih bahasa: U.S. English, klik Continue kemudian isi data-data tersebut dengan benar
- First Name : Nama pertama kamu
- Last Name : Nama akhir kamu
- Address Line 1 : Alamat kamu
- Address Line 2 : Boleh dikosongkan
- City : Kota tempat tinggalmu
- State/Province/Region : Propinsi
- Postal Code : Kode Pos
- Country : Indonesia (sudah tertulis)
- Country of Citizenship : Indonesia (sudah tertulis)
- Primary Currency : U.S. Dollars
- Home Telephone : Telp rumah, missal 021456789 maka buatlah 6221456789
- Work Telephone : Boleh dikosongkan
- Mobile Telephone : Boleh dikosongkan
- Email Address : Masukkin email kamu
- Re-enter Email Address : Ulangi email kamu seperti di atas tadi
- Password : Password perpaduan huruf dan angka minimal 8 karakter/digit misal akuganteng09
- Retype Password : Ulangi passwordmu seperti diatas
- Security Question 1 : Pilih pertanyaan yg kamu suka
Answer 1 : Jawabannya
- Security Question 2 : Pilihlah pertanyaan yg kamu suka
Answer 2 : Jawabannya

- Pada pernyataan ini : Do you agree to the User Agreement and Privacy Policy, and terms incorporated there in? pilihlah Yes.
- Masukkan kode sesuai yg tertera lalu klik Sign Up. Setelah itu muncul halaman untuk pengisian kartu kredit atau kartu debit. Ini gunanya untuk verified. Verified berguna untuk mencairkan uang. Untuk kartu kredit yg bisa yaitu keluaran Visa, Mastercard, Discover dan American Express.

Building Ext Environtment on Liferay and Apache Tomcat .6.0.18

Building Ext Environment using liferay src and tomcat 6

INITIAL SETUP
Before we starting to build ext environtment for liferay. We need tools for development. The tools we need is :
1. Ant, i’m using ant.1.7.0 for this article
2. Jikes, i use Jikes 1.2.2-windows
3. JDK, i use JDK 1.6
4. Liferay source code, i use liferay 5.2.3
5. Apache tomcat, i use apache tomcat 6.0.18

Ok, let’s get started.
Ok, let say we have install JDK, extract Ant and jikes, extract tomcat and liferay Src.
First thing we need is set environtment variabels on windows, on windows open My Computer and right click open properties. After properties dialog open, choose advance tab and click on Environtment Variabels.
1. Add new variable and name it as JAVA_HOME set value to JDK Instalation Path on your windows.
2. Add new variable and name it as ANT_HOME set value to ANT extracted Path on your windows.
3. Add new variable and name it as JIKES_HOME set value to JIKES extracted Path on your windows.
4. Test your setting by execute command prompt : java –version for JDK, ant –version for Ant and jikes –version for jikes.
Tomcat.
Tomcat is open source server come from apache software foundation. Extract tomcat to our project directory. E.g
E:>\ liferay\tomcatxxx (xxx is version of tomcat)
Liferay
Liferay is largest open source java portal. See liferay wiki site for more info. Extract liferay src to portal directory under workspace directory. E.g
E:>\liferay\workspace\portal

EXT ENVIRONTMENT
Before we create ext environtment, we need to create several properties file. This file will override original properties file in liferay src/portal folder. The properties is app.server.properties and release.properties.
1. Create release.{username}.properties
Username is username on your windows logon, to knows your username at command prompt write “set” and see what is username.
On release.{username}.properties, add this line :

lp.ext.dir E:>/liferay/portal/workspace/ext

this line is show where ext directory which liferay will copy most of file need to development.
Save release.{username}.properties and put into /portal directory

2. Create build.{username}.properties
Build properties is properties for ant to know which version java development we use.
Add this two line into build.{username}.properties

ant.build.javac.source=1.6
ant.build.javac.target=1.6

since we use JDK 1.6 so at the end of line we put 1.6

3. Create app.{username}.properties
This file properties content information about server type we use on development. Add this line into app.{username}.properties

app.server.tomcat.version=6.0
app.server.tomcat.dir=E:/liferay/apache-tomcat-6.0.18
app.server.tomcat.classes.global.dir=${app.server.tomcat.dir}/lib
app.server.tomcat.lib.endorsed.dir = ${app.server.tomcat.dir}/lib/ext
app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.lib.support.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.support.dir=${app.server.tomcat.dir}/lib/ext

ECLIPSE IDE

for this development we will use eclipse as IDE. In eclipse, direct workspace into forlder workspace that we create before.
Create new java project and choose import existing project into workspace, choose portal and click finish.

To build on eclipse we need ant view, choose windows and show view. Click on Ant then drag build properties from portal project.

Before we can build portal project, we need to configure tomcat server. On eclipse create new project let’s name it as server. Create new folder under server and name it as catalina_home. But when we prompt dialog, click on advance and fill link into file system with tomcat path where we extracted before. Press finish.

Configure tomcat, in /catalina/conf/catalina.properties. edit this file in eclipse and add this line ${catalina.home}/lib/ext/*.jar to end of common.loader.
This is the complete common.loader after edit :

common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar, ${catalina.home}/lib/ext/*.jar

lets build ext environment. On command prompt direct into portal path and type this command
ant clean build-ext
or on eclipse>ant view. Double click clean then build-ext.

Now your ext environtment has created. To see point to /liferay/workspace/ directory and you will see ext directory.

This is my conclusion after read Liferay 5.2 System Development from http://www.packtpub.com/liferay-portal-5-2-systems-development/book

you can download liferay portal administartion guide here :

http://www.ziddu.com/download/7650185/liferay-quick-start-guide-4.0.pdf.html
http://www.ziddu.com/download/7650186/liferay_4_extension_environment_guide.pdf.html
http://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.html

Senin, 07 Desember 2009

Social Network Yang Menguntungkan

Ber sosialisasi dan dapatkan kemungkinan mendapatkan apple ipod atau dollar, klik disini

Program Pertama

Langkah pertama adalah instalasi JDK, bisa di download di www.sun.java.com, dalam tulisan ini JDK yang digunakan adalah JDK.1.6.7, untuk mengetahui versi JDK yang dimiliki dapat dilihat pada command prompt dengan mengetikan perintah java –version.


Namun setelah proses instalasi selesai, perlu dilakukan pengaturan JAVA_HOME. Untuk setting JAVA_HOME maka dapat dilakukan dengan memilih My Computer pada windows kemudian klik kanan dan pilih properties. Pada tab advance, pilih Environment Variabels dan buatlah variabel baru dengan nama JAVA_HOME dan isi dengan path direktori tempat instalasi JDK, biasanya secara default instalasi ini ada di direktori C:\program files\java\jdk... seperti pada Gambar berikut


Setelah proses ini selesai maka kita akan memulai membuat aplikasi java pertama.

Langkah pertama buatlah folder baru di direktori C (bisa dimanapun) dengan nama belajarJava.

Langkah berikutnya buatlah file HelloWorld.java dengan menggunakan notepad dan simpan di dalam folder BelajarJava.

Ketikan listing berikut dalam HelloWorld.java

public class HelloWorld{

public static void main(String[] args){

System.out.println("Hello Dunia, ini adalah program Java Pertamaku!!!!");

}

}

Langkah selanjutnya buka command prompt dan arahka pada direktori BelajarJava, bisa dilakukan dengan mengetikan perintah

C:\>cd belajarjava

Untuk mengcompile file HelloWorld.java kita menjadi HelloWorld.class, maka pada command prompt bisa dilakukan dengan mengetikan C:\>javac HelloWorld.java atau dengan perintah C:\>javac *.java

Nb : perintah javac HelloWorld.java memerintahkan java compiler untuk mengkompile file HelloWorld.java saja, dengan kata lain jika dalam folder BelajarJava terdapat beberapa file berekstensi java maka java compiler tidak akan melakukan kompilasi, jika ingin mengompile semua file berekstensi java pada folder BelajarJava maka dapat dilakukan dengan perintah javac *.java


Jika dalam HelloWorld.java tidak terdapat error, maka pada command prompt akan ditampilkan direktori BelajarJava. Jika terdapat error, maka pada command prompt akan ditampilkan pesan error.

Untuk mencoba melihat pesan error, maka edit file HelloWorld.java dan ganti HelloWorld dengan helloWorld. Lakukan kompilasi dan lihat hasilnya pada konsole atau command prompt.


Pada gambar di atas terdapat 1 pesan error, “HelloWorld.java : 1 class helloWorld is public.....”

Error ini adalah adanya kesalahan pada penamaan, java adalah bahasa pemrograman yang case sensitif, sehingga setiap penulisan harus sama persis. Misal HelloWorld.java, maka pada penulisan public class harus sama persis dan hal ini juga berlaku jika kita akan mengimport kelas-kelas java yang lain.

Untuk itu, ubah kembali helloWorld dengan HelloWorld pada HelloWorld.java dan lakukan kompilasi ulang dengan perintah javac HelloWorld.java atau javac *.java.

Jika proses kompilasi berhasil, maka pada ketikan perintah DIR pada Command Prompt, berikut adalah perintahnya. Jangan lupa command prompt harus berada pada folder BelajarJava C:\>BelajarJava\DIR


Sampai dengan tahap ini proses kompilasi sudah selesai, tahapan berikutnya adalah proses run atau menjalankan program java pertama kita yaitu HelloWorld.java

Pada command prompt ketikan perintah : java HelloWorld


Perintah java HelloWorld adalah perintah untuk menjalankan kelas-kelas java.

Pada gambar di atas terlihat pesan yang kita buat pada HelloWorld.java

Penjelasan Kode Program :

public class HelloWorld() à deklarasi kelas java, penamaan kelas harus sama dengan penamaan file.

public static void main (String[] args) à konstuktor utama untuk menjalankan kelas java. Jika dalam kelas tidak ada baris ini maka java compiler tidak bisa menjalankan program yang dimaksud. Untuk mengetahuinya maka ubah file HelloWorld.java dan hilangkan deklarasi main. Simpan dan kompilasi ulang, kemudian run dengan menggunakan perintah java HelloWorld, lihat hasilnya.


Akan muncul eksepsi, dengan kata lain java memerlukan method main untuk dapat menjalankan program java atau mengeksekusi kelas java.

System.out.println(“”); à adalah perintah untuk menampilkan String atau nilai tertentu ke dalam console.

Sampai disini program java pertama kita sudah selesai dan bisa dijalankan dengan benar.

Langkah berikutnya adalah membuat jar file. Jar adalah file kompress untuk kelas-kelas java. Dengan jar kita bisa menjalankan program java atau kita bisa menggunakan kelas-kelas dalam jar untuk membuat program java.

Untuk membuat HelloWorld.jar, pada Command Prompt ketikan perintah jar cvf {nama_jar} {kelas_java}

{nama_jar} adalah nama jar file yang diinginkan.

{kelas_java} adalah kelas java yang akan di simpan ke dalam jar file

Untuk contoh helloworld ini berikut adalah perintah membuat jar.

Berikutnya saya akan mencoba lebih banyak menulis tentang java dan penjelasan yang lebih teoritikal. Terima Kasih dan Selamat Belajar.


untuk versi pdf disertai dengan gambar dapat didownload di

http://www.docstoc.com/docs/18755492/DASAR-JAVA

atau di

http://www.ziddu.com/download/7646694/belajarjava-I.rar.html
dan untuk source code nya
http://www.ziddu.com/download/7646696/BelajarJavaSrc.rar.html

Jumat, 04 Desember 2009

Pengenalan Liferay I

Dalam rangka belajar mengenai portlet, khusunya penggunaan Liferay. perlu di lakukan beberapa tahapan instalasi sebelum menjalankan liferay itu sendiri.

setelah googling, maka di dapatlah informasi tentang bagaimana menjalankan liferay....


menarik juga?

tahapan pertama adalah mengunduh semua file yang dibutuhkan :

1. Ant (http://ant.apache.org/bindownload.cgi)
2. Jikes (
3. JDK (http://java.sun.com/javase/downloads/widget/jdk6.jsp)
4. Liferay

setelah mendowload Ant, jikes dan JDK maka lakukan instalasi

instal JDK terlebih dahulu, kemudian jikes dan ant.

jangan lupa setting EnvirontmentVariabels nya

berikut adalah contohnya, sesuaikan dengan direktori instalasi.

JAVA_HOME = c:/java/jdk6
ANT_HOME = c:/java/ant
JIKES_HOME = c:/java/jikes

kemudian lakukan test untuk mengetahui apakah instalasi sudah benar apa belum?

pada command prompt ketikan perintah : ant - version, java-version dan jikes-version

untuk instalasi liferay will be next entry