instal font arab ubuntu 10.10

” TO THE POINT(ER) = TO THE POINTER = MENJADI PINTER

Q> Nambah keyboar arab dulu

Go To System > Preferences > Keyboard . muncul window “Keyboard Prefereces” pilih tab Layout kemudian klik tombol Add.

Tewww otomatis pada panel akan muncul icon keyboard bertuliskan USA, klik icon tersebut untuk memilih layout, karena kita ingin nulis huruf Arab maka pilih Arabic.

Font-font yang sudah di-download ato membajak dari font2nya MS. window$ ,, ditampung dulu di tempat yang diinginkan misalnya Documents/design/font_arab/ , kemudian langsung masukkan saja ke folder

/usr/share/fonts/

Copy semua font ke /usr/share/fonts , misalnya type fontnya adalah TTF, langsung tembak dengan command

sudo cp Documents/design/font_arab/*.TTF /usr/share/fonts/

Hasilnya :
Q> Font arab di Ink scape

Q> Font arab di GIMP

Q> Font arab di Open Office

Selamat menulis ;D

config hibernate untuk menggenerate tabel

Dalam file config hibernate { hibernate.cfg.xml } terdapat property yang digunakan untuk meng-generate table yang berasal dari object model.
Gunakan property ini untuk meng-generate table.

<property name="hibernate.hbm2ddl.auto">create</property>

Contoh model yang akan di-generate adalah Contact

package com.ipi.myweb.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="CONTACT")
public class Contact implements Serializable{

@Id @GeneratedValue
@Column(name="ID")
private Long id;

@Column(name="NAMA", nullable=false,length=50)
private String nama;

@Column(name="NO_HP", nullable=false, length=15)
private String no_hp;

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getNama() {
return nama;
}

public void setNama(String nama) {
this.nama = nama;
}

public String getNo_hp() {
return no_hp;
}

public void setNo_hp(String no_hp) {
this.no_hp = no_hp;
}

}

file hibernate.cfg.xml

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/web</property>
<property name="connection.username">saifi</property>
<property name="connection.password">ahmada</property>
<property name="hibernate.hbm2ddl.auto">create</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.min_size">1</property>
<property name="c3p0.idle_test_period">30</property>
<property name="cache.provider_class">
org.hibernate.cache.EhCacheProvider
</property>
<property name="cache.use_second_level_cache">true</property>

<property name="show_sql">true</property>

<mapping class="com.ipi.myweb.model.Contact" />

</session-factory>
</hibernate-configuration>

Q:> jalankan aplikasi hibernate, maka pada database “web” akan terbentuk table CONTACT.

Log yang terlihat saat menjalankan server
2576 [main] INFO  org.hibernate.cfg.AnnotationBinder  – Binding entity from annotated class: com.ipi.myweb.model.Contact
2669 [main] INFO  org.hibernate.cfg.annotations.EntityBinder  – Bind entity com.ipi.myweb.model.Contact on table CONTACT

6507 [main] INFO  org.hibernate.tool.hbm2ddl.SchemaExport  – Running hbm2ddl schema export
6508 [main] INFO  org.hibernate.tool.hbm2ddl.SchemaExport  – exporting generated schema to database
8227 [main] INFO  org.hibernate.tool.hbm2ddl.SchemaExport  – schema export complete

Q:> Cek database web

mysql -usaifi -p

masukkan password untuk user saifi , ****** ahmada.

use web;
desc contact;

Selamat ber-Hibernate ;D

multiple annotations found at this line: javax.servlet.jsp.PageContext

Error eclipse:

multiple annotations found at this line:
javax.servlet.jsp.PageContext cannot be resolved to a type
javax.servlet.jsp.JspException cannot be resolved to a type

Eclipse : klik menu Project > Properties > { filter dengan validation } pilih Validation,
pada JSP Syntax Validator , uncheck pada Manual dan juga Build.

Selamat ber-eclipse ;D

Sumber :
http://stackoverflow.com/questions/3789886/mysterious-eclipse-jsp-validation-errors

template page meggunakan sitemesh

Buat project web menggunakan eclipse JEE

File > New > Dynamic Web Project

Buat file index.html pada WebContent

<!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>Just my code</title>
</head>
<body>
<h5>Template page menggunakan sitemesh</h5>
</body>
</html>

Kemudian jalankan Myweb, klik kanan project Myweb pilih Run As > Run On Server, pada tipe server pilih Basic > J2EE Preview > Finish ..

Kemudian akses web menggunakan alamat http://localhost:8080/Myweb

Download Sitemesh dan JSTL library

Q> sitemesh-2.4.1.jar dan jstl-1.2.jar kemudian letakan (copy) di folder lib project.

Q> Buat folder sitemesh pada WebContent
Q> Buat file main.jsp pada folder sitemesh

<%@taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!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>My Web - <decorator:title /></title>
</head>
<body>
<h2>This about my web ;D</h2>
<hr>
<h4><decorator:title /></h4>
<br/>

<decorator:body />
</body>
</html>

Q> Buat file decorators.xml pada folder WEB-INF

<?xml version="1.0" encoding="UTF-8"?>
<decorators defaultdir="/sitemesh">
<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>

Q> Tambahkan config untuk sitemesh di web.xml

<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

Q> Donwload apache-tomcat-6.0.35 > ekstrak di suatu direktory
Q> Masukkan tomcat ke dalam eclipse, menu Window > Show View > Server
Q> Klik kanan > Add server , pilih Apache > Tomcat 6.0 > browse tempat ekstract file apache tomcat tadi.
Q> Start tomcat.
Q> Jalankan lagi Myweb , http://localhost:8080/Myweb

Q> Selesai ;D ,, met ber-sitemesh