Liferay 6 Development Documentation
Liferay6
Development Documentation
TABLE OF CONTENTS
1. PREFACE ................................................................................................................................. 2 WHAT'S COVERED ......................................................................................................................... 2 PREREQUISITE SOFTWARE ............................................................................................................. 2 ASSUMPTION ................................................................................................................................ 3
2. LIFERAY INSTALLATION AND CONFIGURATION ..................................................... 3 DOWNLOAD .................................................................................................................................. 3 JDK 1.6 INSTALLATION ................................................................................................................ 3 MYSQL INSTALLATION................................................................................................................ 3 TOMCAT 6 INSTALLATION AND CONFIGURATION ....................................................................... 4
3. 4.
LIFERAY 6 DEVELOPMENT ENVIRONMENT SETUP ................................................... 6 DEVELOPING & DEPLOYING CUSTOM PORTLET TO LIFERAY 6 ......................... 10 LIFERAY EXTEND STRUCTURE ....................................................................... 错误!未定义书签。 CREATE A NEW EMPTY LIFERAY PROJECT .................................................................................... 10 CREATE A NEW PORTLET ............................................................................................................. 12 COMPILING & DEPLOYING PORTLET .......................................................................................... 15
5. 6. 7.
TABLE MAINTENANCE PORTLET DEVELOPMENT .................................................. 15 FAQ(FREQUENT ASKED QUESTIONS).......................................................................... 35 APPENDIX ............................................................................................................................ 36
Liferay 6 Development Documentation
1. Preface
This guide was written as a quick reference to getting started developing on the Liferay Portal 6 platform (non-bundled) for Java developer step by step.
What's covered
The following list details all of the various parts of the documentation that are covered over the course of the tutorial.
? Preparation, development environment setup ? The basic portlet development & deployment. ? Logic code with MySql
Prerequisite software
The following prerequisite software and environment setup is assumed. You should also be reasonably comfortable using the following technologies. ? Java SDK 1.5+ ? Liferay Portal 6 ? Eclipse 3.6 ? Ant 1.7
Liferay 6 Development Documentation
? Apache Tomcat 6.0.14 ? MySql
Assumption
? MySQL is installed
2. Liferay installation and configuration
Download
Download Liferay 6 war & sdk file from website War:
http://sourceforge.net/projects/lportal/files/Liferay Portal/6.0.5/liferay-portal-6.0.5.war/download Dependency file:
http://sourceforge.net/projects/lportal/files/Liferay Portal/6.0.5/liferay-portal-dependencies-6.0.5.zip/download
SDK: http://www.liferay.com/downloads/ Tomcat 6: http://tomcat.apache.org/download-60.cgi ()
Now we have 4 files:
apache-tomcat-6.0.20.zip liferay-portal-6.0.5.war, liferay-plugins-sdk-6.0.5.zip liferay-portal-dependencies-6.0.5.zip
JDK 1.6 Installation
Refer to:
http://www.oracle.com/technetwork/java/javase/documentation/install-windows-152927.html
MySQL Installation
Refer to:
Liferay 6 Development Documentation
http://dev.mysql.com/doc/refman/5.1/en/windows-install-wizard.html
Tomcat 6 installation and configuration
1. Unpack apache-tomcat-6.0.20.zip to your prefer directory such as C:\\java\\tomcat60.
From now on, we shall call this path as ${TOMCAT_HOME}. Notice: we are using non-install version.
2. Create and edit ${TOMCAT_HOME}/conf/Catalina/localhost/ROOT.xml to set up the portal web application:
4. Make sure your database server is installed and is working. If it's installed in a different machine, make sure that it's accessible from the one where Liferay is being installed.
5. Make sure the JDBC driver for your database is accessible by Tomcat. We will use MySQL as database, please copy connector-java-{$version}-bin.jar to ${TOMCAT_HOME}/lib/ext Download url:
http://dev.mysql.com/downloads/mirror.php?id=13520#mirrors
6. JNDI configure, edit
${TOMCAT_HOME}/conf/Catalina/localhost/ROOT.xml
appropriate fields above.
Notice:
1) You need to create a file name portal-ext.properties, the following steps will
talk about this.
2) Copy jta.jar/mysql-connector-java-x.x.xx-bin.jar to
${TOMCAT_HOME}/lib/ext
7. Create a mail session bound to mail/MailSession. Edit
${TOMCAT_HOME}/conf/Catalina/localhost/ROOT.xml and configure a mail session
8. Configure JAAS